From 55559e3804c75a148ce43646bc57e80f482fabac Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 16 Nov 2023 12:11:33 +0000 Subject: [PATCH 1/3] feat(flutter): update dependency flutter to v3.16.0 --- .fvm/fvm_config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.fvm/fvm_config.json b/.fvm/fvm_config.json index d8abe1b9..f1f9ceed 100644 --- a/.fvm/fvm_config.json +++ b/.fvm/fvm_config.json @@ -1,4 +1,4 @@ { - "flutterSdkVersion": "3.13.9", + "flutterSdkVersion": "3.16.0", "flavors": {} } \ No newline at end of file From 4b71f97ccdb7ed2c68a8734d051aa0287075d642 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Thu, 16 Nov 2023 12:13:32 +0000 Subject: [PATCH 2/3] chore(deps): dependencies maintenance --- example/pubspec.lock | 34 +++++++++++++++++----------------- pubspec.lock | 34 +++++++++++++++++----------------- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/example/pubspec.lock b/example/pubspec.lock index f9fee796..421e46c1 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -37,10 +37,10 @@ packages: dependency: transitive description: name: collection - sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.17.2" + version: "1.18.0" cupertino_icons: dependency: "direct main" description: @@ -190,10 +190,10 @@ packages: dependency: transitive description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" path: dependency: transitive description: @@ -206,10 +206,10 @@ packages: dependency: transitive description: name: platform - sha256: "4a451831508d7d6ca779f7ac6e212b4023dd5a7d08a27a63da33756410e32b76" + sha256: ae68c7bfcd7383af3629daafb32fb4e8681c7154428da4febcff06200585f102 url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "3.1.2" process: dependency: transitive description: @@ -251,18 +251,18 @@ packages: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" string_scanner: dependency: transitive description: @@ -291,10 +291,10 @@ packages: dependency: transitive description: name: test_api - sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" url: "https://pub.dev" source: hosted - version: "0.6.0" + version: "0.6.1" typed_data: dependency: transitive description: @@ -323,18 +323,18 @@ packages: dependency: transitive description: name: vm_service - sha256: c620a6f783fa22436da68e42db7ebbf18b8c44b9a46ab911f666ff09ffd9153f + sha256: c538be99af830f478718b51630ec1b6bee5e74e52c8a802d328d9e71d35d2583 url: "https://pub.dev" source: hosted - version: "11.7.1" + version: "11.10.0" web: dependency: transitive description: name: web - sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 url: "https://pub.dev" source: hosted - version: "0.1.4-beta" + version: "0.3.0" webdriver: dependency: transitive description: @@ -344,4 +344,4 @@ packages: source: hosted version: "3.0.2" sdks: - dart: ">=3.1.0-185.0.dev <4.0.0" + dart: ">=3.2.0-194.0.dev <4.0.0" diff --git a/pubspec.lock b/pubspec.lock index a10ecc0c..413ced7a 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -211,10 +211,10 @@ packages: dependency: "direct main" description: name: collection - sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.17.2" + version: "1.18.0" convert: dependency: transitive description: @@ -743,10 +743,10 @@ packages: dependency: transitive description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" mime: dependency: transitive description: @@ -1132,18 +1132,18 @@ packages: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" stream_transform: dependency: transitive description: @@ -1180,26 +1180,26 @@ packages: dependency: transitive description: name: test - sha256: "13b41f318e2a5751c3169137103b60c584297353d4b1761b66029bae6411fe46" + sha256: a1f7595805820fcc05e5c52e3a231aedd0b72972cb333e8c738a8b1239448b6f url: "https://pub.dev" source: hosted - version: "1.24.3" + version: "1.24.9" test_api: dependency: transitive description: name: test_api - sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" url: "https://pub.dev" source: hosted - version: "0.6.0" + version: "0.6.1" test_core: dependency: transitive description: name: test_core - sha256: "99806e9e6d95c7b059b7a0fc08f07fc53fabe54a829497f0d9676299f1e8637e" + sha256: a757b14fc47507060a162cc2530d9a4a2f92f5100a952c7443b5cad5ef5b106a url: "https://pub.dev" source: hosted - version: "0.5.3" + version: "0.5.9" textwrap: dependency: transitive description: @@ -1356,10 +1356,10 @@ packages: dependency: transitive description: name: web - sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 url: "https://pub.dev" source: hosted - version: "0.1.4-beta" + version: "0.3.0" web_socket_channel: dependency: transitive description: @@ -1409,5 +1409,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.1.0 <4.0.0" + dart: ">=3.2.0-194.0.dev <4.0.0" flutter: ">=3.13.9" From cfd129845119d4df33d2153e6f01369aa9a0654f Mon Sep 17 00:00:00 2001 From: Joshua Tang Date: Sun, 19 Nov 2023 20:36:07 +1100 Subject: [PATCH 3/3] feat: use material 3 by default and fix deprecated errors --- .../cubit/advanced_theme_state.dart | 5 ++++- lib/app.dart | 15 +++++++++++++-- lib/basic_theme/cubit/basic_theme_state.dart | 9 ++++++--- lib/home/views/home_page.dart | 2 +- lib/home/widgets/material3_switch.dart | 2 +- lib/theme_preview/views/theme_preview.dart | 1 + test/color_theme/color_theme_editor_test.dart | 3 +-- 7 files changed, 27 insertions(+), 10 deletions(-) diff --git a/lib/advanced_theme/cubit/advanced_theme_state.dart b/lib/advanced_theme/cubit/advanced_theme_state.dart index 0be37bfc..18cbdaf8 100644 --- a/lib/advanced_theme/cubit/advanced_theme_state.dart +++ b/lib/advanced_theme/cubit/advanced_theme_state.dart @@ -5,7 +5,10 @@ class AdvancedThemeState extends Equatable { final bool isDark; final bool useMaterial3; - const AdvancedThemeState({this.isDark = false, this.useMaterial3 = false}); + const AdvancedThemeState({ + this.isDark = false, + this.useMaterial3 = true, + }); @override List get props => [isDark, useMaterial3]; diff --git a/lib/app.dart b/lib/app.dart index 58928343..6463317e 100644 --- a/lib/app.dart +++ b/lib/app.dart @@ -213,6 +213,8 @@ class _MaterialApp extends StatefulWidget { } class _MaterialAppState extends State<_MaterialApp> { + final _seedColor = Colors.blue; + @override void initState() { super.initState(); @@ -225,8 +227,17 @@ class _MaterialAppState extends State<_MaterialApp> { builder: (context, state) { return MaterialApp( title: 'Appainter', - theme: ThemeData(), - darkTheme: ThemeData.dark(), + theme: ThemeData.from( + colorScheme: ColorScheme.fromSeed( + seedColor: _seedColor, + ), + ), + darkTheme: ThemeData.from( + colorScheme: ColorScheme.fromSeed( + seedColor: _seedColor, + brightness: Brightness.dark, + ), + ), themeMode: state.themeMode, home: state.status == HomeStatus.success ? const HomePage() diff --git a/lib/basic_theme/cubit/basic_theme_state.dart b/lib/basic_theme/cubit/basic_theme_state.dart index a457a133..f44eb120 100644 --- a/lib/basic_theme/cubit/basic_theme_state.dart +++ b/lib/basic_theme/cubit/basic_theme_state.dart @@ -16,7 +16,7 @@ class BasicThemeState extends Equatable { Color? seedColor, ColorScheme? colorScheme, this.isDark = false, - this.useMaterial3 = false, + this.useMaterial3 = true, }) : seedColor = seedColor ?? defaultSeedColor, colorScheme = colorScheme ?? _colorSchemeLight; @@ -96,9 +96,12 @@ class BasicThemeState extends Equatable { ThemeData get theme { return ThemeData.localize( - ThemeData.from(colorScheme: colorScheme), + ThemeData.from( + colorScheme: colorScheme, + useMaterial3: useMaterial3, + ), Typography.englishLike2018, - ).copyWith(useMaterial3: useMaterial3); + ); } Brightness get brightness => isDark ? Brightness.dark : Brightness.light; diff --git a/lib/home/views/home_page.dart b/lib/home/views/home_page.dart index 405f3b80..88c075ad 100644 --- a/lib/home/views/home_page.dart +++ b/lib/home/views/home_page.dart @@ -16,7 +16,7 @@ class HomePage extends StatefulWidget { } class HomePageState extends State { - static const _sdkVersion = '3.13.0+'; + static const _sdkVersion = '3.16.0+'; static final _backgroundColorDark = Colors.grey[900]!; static final _backgroundColorLight = Colors.grey[200]!; diff --git a/lib/home/widgets/material3_switch.dart b/lib/home/widgets/material3_switch.dart index c4bb8ac7..63222ab9 100644 --- a/lib/home/widgets/material3_switch.dart +++ b/lib/home/widgets/material3_switch.dart @@ -12,7 +12,7 @@ class Material3Switch extends StatelessWidget { return Row( children: [ Text( - 'Material 3 (beta)', + 'Material 3', style: Theme.of(context).textTheme.titleMedium, ), const _Switch(), diff --git a/lib/theme_preview/views/theme_preview.dart b/lib/theme_preview/views/theme_preview.dart index d76e3d12..014f036f 100644 --- a/lib/theme_preview/views/theme_preview.dart +++ b/lib/theme_preview/views/theme_preview.dart @@ -192,6 +192,7 @@ class ThemePreview extends StatelessWidget { ), ), drawer: _Drawer(), + // ignore: prefer_const_constructors body: TabBarView( children: _pages, ), diff --git a/test/color_theme/color_theme_editor_test.dart b/test/color_theme/color_theme_editor_test.dart index ef62409e..0f6d003a 100644 --- a/test/color_theme/color_theme_editor_test.dart +++ b/test/color_theme/color_theme_editor_test.dart @@ -285,11 +285,10 @@ void main() { }); testWidgets('change color', (tester) async { - final opaqueColor = color.withOpacity(0.12); await pumpApp(tester); await tester.verifyColorPicker( key, - opaqueColor, + color, colorThemeCubit.dividerColorChanged, ); });