Skip to content

Commit

Permalink
set window size on desktop
Browse files Browse the repository at this point in the history
  • Loading branch information
NtsFranz committed Apr 24, 2021
1 parent f69e731 commit 5d4b3c0
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 6 deletions.
1 change: 0 additions & 1 deletion lib/DashboardWidget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,6 @@ class DashboardWidget extends StatelessWidget {
}
}()),
),
textColor: Colors.blue,
children: [
DataTable(
columns: const <DataColumn>[
Expand Down
8 changes: 8 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,18 @@ import 'SettingsWidget.dart';
import 'ColorPage.dart';
import 'package:http/http.dart' as http;
import 'dart:async';
import 'dart:io';
import 'package:window_size/window_size.dart';
import 'dart:convert';
import 'package:shared_preferences/shared_preferences.dart';

void main() {
WidgetsFlutterBinding.ensureInitialized();
if (Platform.isWindows || Platform.isLinux || Platform.isMacOS) {
setWindowTitle("Spark Mini");
setWindowMinSize(Size(375, 750));
setWindowMaxSize(Size(600, 1000));
}
runApp(
ChangeNotifierProvider(create: (context) => Settings(), child: MyApp()));
}
Expand Down
11 changes: 10 additions & 1 deletion pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.1"
version: "1.8.0"
stack_trace:
dependency: transitive
description:
Expand Down Expand Up @@ -483,6 +483,15 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.4"
window_size:
dependency: "direct main"
description:
path: "plugins/window_size"
ref: "927f8cbc09b35d85245c095f2db8df9b186f6618"
resolved-ref: "927f8cbc09b35d85245c095f2db8df9b186f6618"
url: "git://github.com/google/flutter-desktop-embedding.git"
source: git
version: "0.1.0"
wkt_parser:
dependency: transitive
description:
Expand Down
5 changes: 5 additions & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ dependencies:
share: ^2.0.1
provider: ^5.0.0
flutter_map: any
window_size:
git:
url: git://github.com/google/flutter-desktop-embedding.git
path: plugins/window_size
ref: 927f8cbc09b35d85245c095f2db8df9b186f6618

# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
Expand Down
5 changes: 3 additions & 2 deletions windows/flutter/generated_plugin_registrant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
// Generated file. Do not edit.
//

// clang-format off

#include "generated_plugin_registrant.h"

#include <desktop_window/desktop_window_plugin.h>
#include <window_size/window_size_plugin.h>

void RegisterPlugins(flutter::PluginRegistry* registry) {
DesktopWindowPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("DesktopWindowPlugin"));
WindowSizePluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("WindowSizePlugin"));
}
2 changes: 0 additions & 2 deletions windows/flutter/generated_plugin_registrant.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// Generated file. Do not edit.
//

// clang-format off

#ifndef GENERATED_PLUGIN_REGISTRANT_
#define GENERATED_PLUGIN_REGISTRANT_

Expand Down
1 change: 1 addition & 0 deletions windows/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

list(APPEND FLUTTER_PLUGIN_LIST
desktop_window
window_size
)

set(PLUGIN_BUNDLED_LIBRARIES)
Expand Down

0 comments on commit 5d4b3c0

Please sign in to comment.