Flutter-Neumorphic
Flutter-Neumorphic copied to clipboard
[Flutter][3.22.0] fix accentColor & textTheme
fix two property
-
accentColor
(depracated) =>Theme.of(context).colorScheme.secondary
ref -
textTheme
(depracated)
Fixed to build with Flutter 3.10.0.
Got this error with the fix, even with an "empty" NeumorphicApp() (using Flutter 3.10 and Dart3)
If someone is blocked with this and dont want to downgrade Flutter SDK, just use a MaterialApp for testing
The following assertion was thrown building NeumorphicApp(dirty): Assertion failed: file:///dev/flutter/packages/flutter/lib/src/material/theme_data.dart:459:12 colorScheme?.brightness == null || brightness == null || colorScheme!.brightness == brightness is not true
The relevant error-causing widget was: NeumorphicApp NeumorphicApp:file:///dev/webui/lib/main.dart:20:12
When the exception was thrown, this was the stack:
dart-sdk/lib/internal/js_dev_runtime/private/ddc_runtime/errors.dart 288:49 throw
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 29:3 assertFailed
packages/flutter/src/material/theme_data.dart 459:106 new
packages/flutter_neumorphic/src/widget/app.dart 86:12 [_getMaterialTheme]
packages/flutter_neumorphic/src/widget/app.dart 101:35 build
packages/flutter/src/widgets/framework.dart 5156:22 build
packages/flutter/src/widgets/framework.dart 5086:15 performRebuild
packages/flutter/src/widgets/framework.dart 4805:7 rebuild
packages/flutter/src/widgets/framework.dart 5068:5 [_firstBuild]
packages/flutter/src/widgets/framework.dart 5062:5 mount
packages/flutter/src/widgets/framework.dart 3971:15 inflateWidget
packages/flutter/src/widgets/framework.dart 3708:18 updateChild
packages/flutter/src/widgets/framework.dart 5111:16 performRebuild
packages/flutter/src/widgets/framework.dart 4805:7 rebuild
packages/flutter/src/widgets/framework.dart 5068:5 [_firstBuild]
packages/flutter/src/widgets/framework.dart 5062:5 mount
packages/flutter/src/widgets/framework.dart 3971:15 inflateWidget
packages/flutter/src/widgets/framework.dart 3708:18 updateChild
packages/flutter/src/widgets/framework.dart 5111:16 performRebuild
packages/flutter/src/widgets/framework.dart 4805:7 rebuild
packages/flutter/src/widgets/framework.dart 5068:5 [_firstBuild]
packages/flutter/src/widgets/framework.dart 5062:5 mount
packages/flutter/src/widgets/framework.dart 3971:15 inflateWidget
packages/flutter/src/widgets/framework.dart 3708:18 updateChild
packages/flutter/src/widgets/framework.dart 5111:16 performRebuild
packages/flutter/src/widgets/framework.dart 5251:11 performRebuild
packages/flutter/src/widgets/framework.dart 4805:7 rebuild
packages/flutter/src/widgets/framework.dart 5068:5 [_firstBuild]
packages/flutter/src/widgets/framework.dart 5242:11 [_firstBuild]
packages/flutter/src/widgets/framework.dart 5062:5 mount
packages/flutter/src/widgets/framework.dart 3971:15 inflateWidget
packages/flutter/src/widgets/framework.dart 3708:18 updateChild
packages/flutter/src/widgets/framework.dart 5111:16 performRebuild
packages/flutter/src/widgets/framework.dart 4805:7 rebuild
packages/flutter/src/widgets/framework.dart 5068:5 [_firstBuild]
packages/flutter/src/widgets/framework.dart 5062:5 mount
packages/flutter/src/widgets/framework.dart 3971:15 inflateWidget
packages/flutter/src/widgets/framework.dart 3708:18 updateChild
packages/flutter/src/widgets/framework.dart 5111:16 performRebuild
packages/flutter/src/widgets/framework.dart 4805:7 rebuild
packages/flutter/src/widgets/framework.dart 5068:5 [_firstBuild]
packages/flutter/src/widgets/framework.dart 5062:5 mount
packages/flutter/src/widgets/framework.dart 3971:15 inflateWidget
packages/flutter/src/widgets/framework.dart 3708:18 updateChild
packages/flutter/src/widgets/binding.dart 1240:16 [_rebuild]
packages/flutter/src/widgets/binding.dart 1209:5 mount
packages/flutter/src/widgets/binding.dart 1156:16
@thomasnappee fix it, pls check wrap NeumorphicApp or MaterialApp.
NeumorphicApp
Works perfectly :+1:
@florent37 while the project doesn't seem to be actively maintained, could you please still take a look at this critical compatibility PR?
@florent37 while the project doesn't seem to be actively maintained, could you please still take a look at this critical compatibility PR?
Should this project be forked so that these issues can be fixed, otherwise this package is likely to die?
A fork published on pub.dev means people willing to continue maintaining it.
For my own purposes I forked and then applied "dart fix" which did a fine job as far as I can see with no effort required from me. So now my project refers to my fork, and unless a graver and more difficult update is required, that should do for the foreseeable future.
@scttbloom, you can fork this project into your own repository, make the fix, for example using @den0206 changes then replace the pub.dev version of the package with you github version. An example of how to do this is in this link https://stackoverflow.com/questions/54022704/how-to-add-a-package-from-github-in-flutter.
i need this fix