Skip to content

Commit

Permalink
fix:Failed assertion: line 350 pos 12: 'colorScheme
Browse files Browse the repository at this point in the history
  • Loading branch information
Tecode committed Nov 13, 2023
1 parent f45fcc7 commit 7e403cc
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 22 deletions.
20 changes: 10 additions & 10 deletions lib/helpers/themes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ TextTheme _buildTextTheme(TextTheme base) => base.copyWith(
ThemeData _buildDarkTheme() {
const primaryColor = Color(0xFF0175c2);
const secondaryColor = Color(0xFF13B9FD);
final colorScheme = const ColorScheme.dark().copyWith(
primary: primaryColor,
secondary: secondaryColor,
);
final colorScheme = const ColorScheme.dark().copyWith(primary: primaryColor, secondary: secondaryColor);
final base = ThemeData(
pageTransitionsTheme: const PageTransitionsTheme(builders: {
// TargetPlatform.iOS: NoShadowCupertinoPageTransitionsBuilder(),
Expand All @@ -35,7 +32,10 @@ ThemeData _buildDarkTheme() {
colorScheme: colorScheme,
textTheme: ButtonTextTheme.primary,
),
colorScheme: ColorScheme.fromSwatch().copyWith(secondary: secondaryColor),
colorScheme: ColorScheme.fromSwatch().copyWith(
secondary: secondaryColor,
brightness: Brightness.dark,
),
);
return base.copyWith(
textTheme: _buildTextTheme(base.textTheme),
Expand All @@ -46,10 +46,7 @@ ThemeData _buildDarkTheme() {
ThemeData _buildLightTheme() {
const primaryColor = Color(0xFF0175c2);
const secondaryColor = Color(0xFF13B9FD);
final colorScheme = const ColorScheme.light().copyWith(
primary: primaryColor,
secondary: secondaryColor,
);
final colorScheme = const ColorScheme.light().copyWith(primary: primaryColor, secondary: secondaryColor);
final base = ThemeData(
pageTransitionsTheme: const PageTransitionsTheme(builders: {
// TargetPlatform.iOS: NoShadowCupertinoPageTransitionsBuilder(),
Expand All @@ -68,7 +65,10 @@ ThemeData _buildLightTheme() {
colorScheme: colorScheme,
textTheme: ButtonTextTheme.primary,
),
colorScheme: colorScheme.copyWith(secondary: secondaryColor),
colorScheme: colorScheme.copyWith(
secondary: secondaryColor,
brightness: Brightness.light,
),
);
return base.copyWith(
textTheme: _buildTextTheme(base.textTheme),
Expand Down
31 changes: 19 additions & 12 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ packages:
name: _fe_analyzer_shared
url: "https://pub.flutter-io.cn"
source: hosted
version: "22.0.0"
version: "31.0.0"
analyzer:
dependency: transitive
description:
name: analyzer
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.7.1"
version: "2.8.0"
archive:
dependency: transitive
description:
Expand All @@ -35,7 +35,7 @@ packages:
name: async
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.6.1"
version: "2.8.1"
boolean_selector:
dependency: transitive
description:
Expand Down Expand Up @@ -77,7 +77,7 @@ packages:
name: charcode
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.2.0"
version: "1.3.1"
cli_util:
dependency: transitive
description:
Expand Down Expand Up @@ -147,7 +147,7 @@ packages:
name: file
url: "https://pub.flutter-io.cn"
source: hosted
version: "6.1.0"
version: "6.1.2"
flutter:
dependency: "direct main"
description: flutter
Expand Down Expand Up @@ -201,6 +201,13 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
frontend_server_client:
dependency: transitive
description:
name: frontend_server_client
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.3"
fuchsia_remote_debug_protocol:
dependency: transitive
description: flutter
Expand Down Expand Up @@ -282,7 +289,7 @@ packages:
name: meta
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.3.0"
version: "1.7.0"
mime:
dependency: transitive
description:
Expand Down Expand Up @@ -387,7 +394,7 @@ packages:
name: process
url: "https://pub.flutter-io.cn"
source: hosted
version: "4.2.1"
version: "4.2.3"
pub_semver:
dependency: transitive
description:
Expand Down Expand Up @@ -518,21 +525,21 @@ packages:
name: test
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.16.8"
version: "1.17.10"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.3.0"
version: "0.4.2"
test_core:
dependency: transitive
description:
name: test_core
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.3.19"
version: "0.4.0"
typed_data:
dependency: transitive
description:
Expand Down Expand Up @@ -581,7 +588,7 @@ packages:
name: vm_service
url: "https://pub.flutter-io.cn"
source: hosted
version: "6.2.0"
version: "7.1.1"
watcher:
dependency: transitive
description:
Expand Down Expand Up @@ -632,5 +639,5 @@ packages:
source: hosted
version: "3.1.1"
sdks:
dart: ">=2.13.0 <3.0.0"
dart: ">=2.14.0 <3.0.0"
flutter: ">=2.2.0"

0 comments on commit 7e403cc

Please sign in to comment.