Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 10 additions & 17 deletions lib/src/widget/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,27 +73,20 @@ class NeumorphicApp extends StatelessWidget {
}) : super(key: key);

ThemeData _getMaterialTheme(NeumorphicThemeData theme) {
final color = theme.accentColor;
final brightness = ThemeData.estimateBrightnessForColor(theme.baseColor);

if (color is MaterialColor) {
return ThemeData(
primarySwatch: color,
textTheme: theme.textTheme,
iconTheme: theme.iconTheme,
scaffoldBackgroundColor: theme.baseColor,
);
}
final colorScheme = ColorScheme.fromSeed(
seedColor: theme.accentColor,
brightness: brightness,
).copyWith(
secondary: theme.variantColor,
);

return ThemeData(
primaryColor: theme.accentColor,
accentColor: theme.variantColor,
iconTheme: theme.iconTheme,
brightness: ThemeData.estimateBrightnessForColor(theme.baseColor),
primaryColorBrightness:
ThemeData.estimateBrightnessForColor(theme.accentColor),
accentColorBrightness:
ThemeData.estimateBrightnessForColor(theme.variantColor),
useMaterial3: true,
colorScheme: colorScheme,
textTheme: theme.textTheme,
iconTheme: theme.iconTheme,
scaffoldBackgroundColor: theme.baseColor,
);
}
Expand Down
6 changes: 3 additions & 3 deletions lib/src/widget/app_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,10 @@ class NeumorphicAppBarState extends State<NeumorphicAppBar> {

Widget? title = widget.title;
if (title != null) {
final AppBarTheme appBarTheme = AppBarTheme.of(context);
final AppBarThemeData appBarTheme = AppBarTheme.of(context);
title = DefaultTextStyle(
style: (appBarTheme.textTheme?.headline5 ??
Theme.of(context).textTheme.headline5!)
style: (appBarTheme.titleTextStyle ??
Theme.of(context).textTheme.titleLarge!)
.merge(widget.textStyle ?? nTheme?.current?.appBarTheme.textStyle),
softWrap: false,
overflow: TextOverflow.ellipsis,
Expand Down
2 changes: 1 addition & 1 deletion lib/src/widget/container.dart
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class _NeumorphicContainer extends StatelessWidget {
final shape = this.style.boxShape ?? NeumorphicBoxShape.rect();

return DefaultTextStyle(
style: this.textStyle ?? material.Theme.of(context).textTheme.bodyText2!,
style: this.textStyle ?? material.Theme.of(context).textTheme.bodyMedium!,
child: AnimatedContainer(
margin: this.margin,
duration: this.duration,
Expand Down