Skip to content
This repository was archived by the owner on Sep 9, 2023. It is now read-only.

Commit cc57a4b

Browse files
committed
Applied Idean#276
1 parent 57f2b1f commit cc57a4b

File tree

6 files changed

+15
-28
lines changed

6 files changed

+15
-28
lines changed

example/lib/accessibility/neumorphic_accessibility.dart

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import 'package:example/lib/color_selector.dart';
2-
import 'package:flutter/material.dart';
32
import 'package:flutter_neumorphic/flutter_neumorphic.dart';
43

54
class NeumorphicAccessibility extends StatefulWidget {
@@ -71,7 +70,7 @@ class __PageState extends State<_Page> {
7170
child: RaisedButton(
7271
shape: RoundedRectangleBorder(
7372
borderRadius: BorderRadius.circular(12)),
74-
color: Theme.of(context).accentColor,
73+
color: Theme.of(context).colorScheme.secondary,
7574
child: Text(
7675
"back",
7776
style: TextStyle(color: Colors.white),
@@ -104,7 +103,7 @@ class __PageState extends State<_Page> {
104103
int selectedConfiguratorIndex = 0;
105104

106105
Widget _configurators() {
107-
final Color buttonActiveColor = Theme.of(context).accentColor;
106+
final Color buttonActiveColor = Theme.of(context).colorScheme.secondary;
108107
final Color buttonInnactiveColor = Colors.white;
109108

110109
final Color textActiveColor = Colors.white;
@@ -513,7 +512,7 @@ class __PageState extends State<_Page> {
513512
}
514513

515514
Widget shapeWidget() {
516-
final Color buttonActiveColor = Theme.of(context).accentColor;
515+
final Color buttonActiveColor = Theme.of(context).colorScheme.secondary;
517516
final Color buttonInnactiveColor = Colors.white;
518517

519518
final Color iconActiveColor = Colors.white;

example/lib/playground/neumorphic_playground.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class __PageState extends State<_Page> {
7171
child: RaisedButton(
7272
shape: RoundedRectangleBorder(
7373
borderRadius: BorderRadius.circular(12)),
74-
color: Theme.of(context).accentColor,
74+
color: Theme.of(context).colorScheme.secondary,
7575
child: Text(
7676
"back",
7777
style: TextStyle(color: Colors.white),
@@ -102,7 +102,7 @@ class __PageState extends State<_Page> {
102102
int selectedConfiguratorIndex = 0;
103103

104104
Widget _configurators() {
105-
final Color buttonActiveColor = Theme.of(context).accentColor;
105+
final Color buttonActiveColor = Theme.of(context).colorScheme.secondary;
106106
final Color buttonInnactiveColor = Colors.white;
107107

108108
final Color textActiveColor = Colors.white;
@@ -622,7 +622,7 @@ class __PageState extends State<_Page> {
622622
}
623623

624624
Widget boxshapeWidget() {
625-
final Color buttonActiveColor = Theme.of(context).accentColor;
625+
final Color buttonActiveColor = Theme.of(context).colorScheme.secondary;
626626
final Color buttonInnactiveColor = Colors.white;
627627

628628
final Color textActiveColor = Colors.white;
@@ -756,7 +756,7 @@ class __PageState extends State<_Page> {
756756
}
757757

758758
Widget shapeWidget() {
759-
final Color buttonActiveColor = Theme.of(context).accentColor;
759+
final Color buttonActiveColor = Theme.of(context).colorScheme.secondary;
760760
final Color buttonInnactiveColor = Colors.white;
761761

762762
final Color iconActiveColor = Colors.white;

example/lib/playground/text_playground.dart

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import 'package:example/lib/color_selector.dart';
2-
import 'package:flutter/material.dart';
32
import 'package:flutter_neumorphic/flutter_neumorphic.dart';
43

54
class NeumorphicTextPlayground extends StatefulWidget {
@@ -92,7 +91,7 @@ class __PageState extends State<_Page> {
9291
child: RaisedButton(
9392
shape: RoundedRectangleBorder(
9493
borderRadius: BorderRadius.circular(12)),
95-
color: Theme.of(context).accentColor,
94+
color: Theme.of(context).colorScheme.secondary,
9695
child: Text(
9796
"back",
9897
style: TextStyle(color: Colors.white),
@@ -125,7 +124,7 @@ class __PageState extends State<_Page> {
125124
int selectedConfiguratorIndex = 0;
126125

127126
Widget _configurators() {
128-
final Color buttonActiveColor = Theme.of(context).accentColor;
127+
final Color buttonActiveColor = Theme.of(context).colorScheme.secondary;
129128
final Color buttonInnactiveColor = Colors.white;
130129

131130
final Color textActiveColor = Colors.white;
@@ -238,7 +237,7 @@ class __PageState extends State<_Page> {
238237
}
239238

240239
Widget shapeWidget() {
241-
final Color buttonActiveColor = Theme.of(context).accentColor;
240+
final Color buttonActiveColor = Theme.of(context).colorScheme.secondary;
242241
final Color buttonInnactiveColor = Colors.white;
243242

244243
final Color iconActiveColor = Colors.white;
@@ -444,7 +443,7 @@ class __PageState extends State<_Page> {
444443
}
445444

446445
FontWeight _fontWeight() {
447-
switch ((this.fontWeight / 100).toInt()) {
446+
switch (this.fontWeight ~/ 100) {
448447
case 1:
449448
return FontWeight.w100;
450449
case 2:

example/lib/sample_neumorphic_playground.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import 'package:example/lib/color_selector.dart';
2-
import 'package:flutter/cupertino.dart';
31
import 'package:flutter_neumorphic/flutter_neumorphic.dart';
42

53
void main() => runApp(NeumorphicPlayground());
@@ -85,7 +83,7 @@ class __PageState extends State<_Page> {
8583
}
8684

8785
Widget _configurators() {
88-
final Color buttonActiveColor = Theme.of(context).accentColor;
86+
final Color buttonActiveColor = Theme.of(context).colorScheme.secondary;
8987
final Color buttonInnactiveColor = Colors.white;
9088

9189
final Color textActiveColor = Colors.white;
@@ -246,7 +244,7 @@ class __PageState extends State<_Page> {
246244
}
247245

248246
Widget shapeWidget() {
249-
final Color buttonActiveColor = Theme.of(context).accentColor;
247+
final Color buttonActiveColor = Theme.of(context).colorScheme.secondary;
250248
final Color buttonInnactiveColor = Colors.white;
251249

252250
final Color iconActiveColor = Colors.white;

lib/src/widget/app.dart

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import 'package:flutter/material.dart';
21
import 'package:flutter_neumorphic/flutter_neumorphic.dart';
32

43
class NeumorphicApp extends StatelessWidget {
@@ -86,13 +85,8 @@ class NeumorphicApp extends StatelessWidget {
8685

8786
return ThemeData(
8887
primaryColor: theme.accentColor,
89-
accentColor: theme.variantColor,
9088
iconTheme: theme.iconTheme,
9189
brightness: ThemeData.estimateBrightnessForColor(theme.baseColor),
92-
primaryColorBrightness:
93-
ThemeData.estimateBrightnessForColor(theme.accentColor),
94-
accentColorBrightness:
95-
ThemeData.estimateBrightnessForColor(theme.variantColor),
9690
textTheme: theme.textTheme,
9791
scaffoldBackgroundColor: theme.baseColor,
9892
);

lib/src/widget/app_bar.dart

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
import 'package:flutter/material.dart';
2-
import 'package:flutter/widgets.dart';
31
import 'package:flutter_neumorphic/flutter_neumorphic.dart';
4-
import 'package:flutter_neumorphic/src/widget/back_button.dart';
52

63
class NeumorphicAppBar extends StatefulWidget implements PreferredSizeWidget {
74
static const toolbarHeight = kToolbarHeight + 16 * 2;
@@ -180,8 +177,8 @@ class NeumorphicAppBarState extends State<NeumorphicAppBar> {
180177
if (title != null) {
181178
final AppBarTheme appBarTheme = AppBarTheme.of(context);
182179
title = DefaultTextStyle(
183-
style: (appBarTheme.textTheme?.headline5 ??
184-
Theme.of(context).textTheme.headline5!)
180+
style: (appBarTheme.titleTextStyle ??
181+
Theme.of(context).textTheme.titleMedium!)
185182
.merge(widget.textStyle ?? nTheme?.current?.appBarTheme.textStyle),
186183
softWrap: false,
187184
overflow: TextOverflow.ellipsis,

0 commit comments

Comments
 (0)