diff --git a/example/lib/accessibility/neumorphic_accessibility.dart b/example/lib/accessibility/neumorphic_accessibility.dart index 15f6223a..b8cbe581 100644 --- a/example/lib/accessibility/neumorphic_accessibility.dart +++ b/example/lib/accessibility/neumorphic_accessibility.dart @@ -1,5 +1,4 @@ import 'package:example/lib/color_selector.dart'; -import 'package:flutter/material.dart'; import 'package:flutter_neumorphic/flutter_neumorphic.dart'; class NeumorphicAccessibility extends StatefulWidget { @@ -71,7 +70,7 @@ class __PageState extends State<_Page> { child: RaisedButton( shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(12)), - color: Theme.of(context).accentColor, + color: Theme.of(context).colorScheme.secondary, child: Text( "back", style: TextStyle(color: Colors.white), @@ -104,7 +103,7 @@ class __PageState extends State<_Page> { int selectedConfiguratorIndex = 0; Widget _configurators() { - final Color buttonActiveColor = Theme.of(context).accentColor; + final Color buttonActiveColor = Theme.of(context).colorScheme.secondary; final Color buttonInnactiveColor = Colors.white; final Color textActiveColor = Colors.white; @@ -513,7 +512,7 @@ class __PageState extends State<_Page> { } Widget shapeWidget() { - final Color buttonActiveColor = Theme.of(context).accentColor; + final Color buttonActiveColor = Theme.of(context).colorScheme.secondary; final Color buttonInnactiveColor = Colors.white; final Color iconActiveColor = Colors.white; diff --git a/example/lib/playground/neumorphic_playground.dart b/example/lib/playground/neumorphic_playground.dart index eb52041c..94846eba 100644 --- a/example/lib/playground/neumorphic_playground.dart +++ b/example/lib/playground/neumorphic_playground.dart @@ -71,7 +71,7 @@ class __PageState extends State<_Page> { child: RaisedButton( shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(12)), - color: Theme.of(context).accentColor, + color: Theme.of(context).colorScheme.secondary, child: Text( "back", style: TextStyle(color: Colors.white), @@ -102,7 +102,7 @@ class __PageState extends State<_Page> { int selectedConfiguratorIndex = 0; Widget _configurators() { - final Color buttonActiveColor = Theme.of(context).accentColor; + final Color buttonActiveColor = Theme.of(context).colorScheme.secondary; final Color buttonInnactiveColor = Colors.white; final Color textActiveColor = Colors.white; @@ -622,7 +622,7 @@ class __PageState extends State<_Page> { } Widget boxshapeWidget() { - final Color buttonActiveColor = Theme.of(context).accentColor; + final Color buttonActiveColor = Theme.of(context).colorScheme.secondary; final Color buttonInnactiveColor = Colors.white; final Color textActiveColor = Colors.white; @@ -756,7 +756,7 @@ class __PageState extends State<_Page> { } Widget shapeWidget() { - final Color buttonActiveColor = Theme.of(context).accentColor; + final Color buttonActiveColor = Theme.of(context).colorScheme.secondary; final Color buttonInnactiveColor = Colors.white; final Color iconActiveColor = Colors.white; diff --git a/example/lib/playground/text_playground.dart b/example/lib/playground/text_playground.dart index f1a547cd..dda81e4b 100644 --- a/example/lib/playground/text_playground.dart +++ b/example/lib/playground/text_playground.dart @@ -1,5 +1,4 @@ import 'package:example/lib/color_selector.dart'; -import 'package:flutter/material.dart'; import 'package:flutter_neumorphic/flutter_neumorphic.dart'; class NeumorphicTextPlayground extends StatefulWidget { @@ -92,7 +91,7 @@ class __PageState extends State<_Page> { child: RaisedButton( shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(12)), - color: Theme.of(context).accentColor, + color: Theme.of(context).colorScheme.secondary, child: Text( "back", style: TextStyle(color: Colors.white), @@ -125,7 +124,7 @@ class __PageState extends State<_Page> { int selectedConfiguratorIndex = 0; Widget _configurators() { - final Color buttonActiveColor = Theme.of(context).accentColor; + final Color buttonActiveColor = Theme.of(context).colorScheme.secondary; final Color buttonInnactiveColor = Colors.white; final Color textActiveColor = Colors.white; @@ -238,7 +237,7 @@ class __PageState extends State<_Page> { } Widget shapeWidget() { - final Color buttonActiveColor = Theme.of(context).accentColor; + final Color buttonActiveColor = Theme.of(context).colorScheme.secondary; final Color buttonInnactiveColor = Colors.white; final Color iconActiveColor = Colors.white; @@ -444,7 +443,7 @@ class __PageState extends State<_Page> { } FontWeight _fontWeight() { - switch ((this.fontWeight / 100).toInt()) { + switch (this.fontWeight ~/ 100) { case 1: return FontWeight.w100; case 2: diff --git a/example/lib/sample_neumorphic_playground.dart b/example/lib/sample_neumorphic_playground.dart index afb309e7..d5de1e45 100644 --- a/example/lib/sample_neumorphic_playground.dart +++ b/example/lib/sample_neumorphic_playground.dart @@ -1,5 +1,3 @@ -import 'package:example/lib/color_selector.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter_neumorphic/flutter_neumorphic.dart'; void main() => runApp(NeumorphicPlayground()); @@ -85,7 +83,7 @@ class __PageState extends State<_Page> { } Widget _configurators() { - final Color buttonActiveColor = Theme.of(context).accentColor; + final Color buttonActiveColor = Theme.of(context).colorScheme.secondary; final Color buttonInnactiveColor = Colors.white; final Color textActiveColor = Colors.white; @@ -246,7 +244,7 @@ class __PageState extends State<_Page> { } Widget shapeWidget() { - final Color buttonActiveColor = Theme.of(context).accentColor; + final Color buttonActiveColor = Theme.of(context).colorScheme.secondary; final Color buttonInnactiveColor = Colors.white; final Color iconActiveColor = Colors.white; diff --git a/lib/src/widget/app_bar.dart b/lib/src/widget/app_bar.dart index 75768744..2f4268fa 100644 --- a/lib/src/widget/app_bar.dart +++ b/lib/src/widget/app_bar.dart @@ -1,7 +1,4 @@ -import 'package:flutter/material.dart'; -import 'package:flutter/widgets.dart'; import 'package:flutter_neumorphic/flutter_neumorphic.dart'; -import 'package:flutter_neumorphic/src/widget/back_button.dart'; class NeumorphicAppBar extends StatefulWidget implements PreferredSizeWidget { static const toolbarHeight = kToolbarHeight + 16 * 2; @@ -180,8 +177,8 @@ class NeumorphicAppBarState extends State { if (title != null) { final AppBarTheme appBarTheme = AppBarTheme.of(context); title = DefaultTextStyle( - style: (appBarTheme.textTheme?.headline5 ?? - Theme.of(context).textTheme.headline5!) + style: (appBarTheme.titleTextStyle ?? + Theme.of(context).textTheme.titleMedium!) .merge(widget.textStyle ?? nTheme?.current?.appBarTheme.textStyle), softWrap: false, overflow: TextOverflow.ellipsis,