Skip to content

Commit

Permalink
Use flex_color_scheme for themes
Browse files Browse the repository at this point in the history
  • Loading branch information
Merrit committed Jul 7, 2022
1 parent d73b382 commit 7f88332
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 19 deletions.
30 changes: 28 additions & 2 deletions lib/src/app.dart
@@ -1,7 +1,9 @@
import 'package:flex_color_scheme/flex_color_scheme.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:google_fonts/google_fonts.dart';

import 'authentication/authentication.dart';
import 'authentication/login_page.dart';
Expand Down Expand Up @@ -35,8 +37,32 @@ class App extends StatelessWidget {
],
onGenerateTitle: (BuildContext context) =>
AppLocalizations.of(context)!.appTitle,
theme: ThemeData(),
darkTheme: ThemeData.dark(),
theme: FlexThemeData.light(
scheme: FlexScheme.blue,
surfaceMode: FlexSurfaceMode.highScaffoldLowSurface,
blendLevel: 20,
appBarOpacity: 0.95,
subThemesData: const FlexSubThemesData(
blendOnLevel: 20,
blendOnColors: false,
),
visualDensity: FlexColorScheme.comfortablePlatformDensity,
useMaterial3: true,
fontFamily: GoogleFonts.notoSans().fontFamily,
),
darkTheme: FlexThemeData.dark(
scheme: FlexScheme.blue,
surfaceMode: FlexSurfaceMode.highSurfaceLowScaffold,
blendLevel: 40,
appBarStyle: FlexAppBarStyle.background,
appBarOpacity: 0.90,
subThemesData: const FlexSubThemesData(
blendOnLevel: 30,
),
visualDensity: FlexColorScheme.comfortablePlatformDensity,
useMaterial3: true,
fontFamily: GoogleFonts.notoSans().fontFamily,
),
themeMode: ThemeMode.system,
onGenerateRoute: (RouteSettings routeSettings) {
return MaterialPageRoute<void>(
Expand Down
4 changes: 0 additions & 4 deletions linux/flutter/generated_plugin_registrant.cc
Expand Up @@ -7,13 +7,9 @@
#include "generated_plugin_registrant.h"

#include <url_launcher_linux/url_launcher_plugin.h>
#include <window_to_front/window_to_front_plugin.h>

void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");
url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);
g_autoptr(FlPluginRegistrar) window_to_front_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "WindowToFrontPlugin");
window_to_front_plugin_register_with_registrar(window_to_front_registrar);
}
1 change: 0 additions & 1 deletion linux/flutter/generated_plugins.cmake
Expand Up @@ -4,7 +4,6 @@

list(APPEND FLUTTER_PLUGIN_LIST
url_launcher_linux
window_to_front
)

list(APPEND FLUTTER_FFI_PLUGIN_LIST
Expand Down
21 changes: 14 additions & 7 deletions pubspec.lock
Expand Up @@ -148,6 +148,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.6.5"
flex_color_scheme:
dependency: "direct main"
description:
name: flex_color_scheme
url: "https://pub.dartlang.org"
source: hosted
version: "5.0.1"
flutter:
dependency: "direct main"
description: flutter
Expand Down Expand Up @@ -203,6 +210,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "9.2.0"
google_fonts:
dependency: "direct main"
description:
name: google_fonts
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.1"
google_sign_in:
dependency: "direct main"
description:
Expand Down Expand Up @@ -567,13 +581,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.7.0"
window_to_front:
dependency: "direct main"
description:
name: window_to_front
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.3"
xdg_directories:
dependency: transitive
description:
Expand Down
4 changes: 3 additions & 1 deletion pubspec.yaml
Expand Up @@ -14,13 +14,15 @@ dependencies:
equatable: ^2.0.3
extension_google_sign_in_as_googleapis_auth: ^2.0.5
firebase_auth: ^3.3.20
flex_color_scheme: ^5.0.1
flutter:
sdk: flutter
flutter_bloc: ^8.0.1
flutter_localizations:
sdk: flutter
flutter_signin_button: ^2.0.0
flutter_slidable: ^1.3.0
google_fonts: ^3.0.1
google_sign_in: ^5.3.3
googleapis: ^9.1.0
googleapis_auth: ^1.3.1
Expand All @@ -33,7 +35,7 @@ dependencies:
logging: ^1.0.2
path_provider: ^2.0.11
url_launcher: ^6.1.4
window_to_front: ^0.0.3
# window_to_front: ^0.0.3

dev_dependencies:
flutter_test:
Expand Down
3 changes: 0 additions & 3 deletions windows/flutter/generated_plugin_registrant.cc
Expand Up @@ -7,11 +7,8 @@
#include "generated_plugin_registrant.h"

#include <url_launcher_windows/url_launcher_windows.h>
#include <window_to_front/window_to_front_plugin.h>

void RegisterPlugins(flutter::PluginRegistry* registry) {
UrlLauncherWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("UrlLauncherWindows"));
WindowToFrontPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("WindowToFrontPlugin"));
}
1 change: 0 additions & 1 deletion windows/flutter/generated_plugins.cmake
Expand Up @@ -4,7 +4,6 @@

list(APPEND FLUTTER_PLUGIN_LIST
url_launcher_windows
window_to_front
)

list(APPEND FLUTTER_FFI_PLUGIN_LIST
Expand Down

0 comments on commit 7f88332

Please sign in to comment.