Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: NesWindow uses theming from nes container instead of material #119

Merged
merged 1 commit into from
Jan 23, 2024
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- feat: add `NesIcons.hamburgerMenu`.
- feat: adding `NesButton` helper constructors.
- feat: add `NesIcons.arrowCursor`.
- feat: `NesWindow` uses `NesContainerTheme` instead of Material's card.

# 0.12.1
- fix: theme lerp causing error on null access.
Expand Down
7 changes: 4 additions & 3 deletions lib/src/widgets/nes_window.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ class NesWindow extends StatelessWidget {
final textStyle =
Theme.of(context).textTheme.labelMedium ?? const TextStyle();

final containerColor = Theme.of(context).cardColor;
final nesContainerTheme = context.nesThemeExtension<NesContainerTheme>();
final containerColor = nesContainerTheme.backgroundColor;
final nesTheme = context.nesThemeExtension<NesTheme>();

final titleBarHeight = (textStyle.fontSize ?? 8) + nesTheme.pixelSize * 4;
Expand All @@ -75,7 +76,7 @@ class NesWindow extends StatelessWidget {
height: titleBarHeight,
child: DecoratedBox(
decoration: BoxDecoration(
color: textStyle.color ?? Colors.black,
color: nesContainerTheme.borderColor,
),
child: Row(
children: [
Expand Down Expand Up @@ -117,7 +118,7 @@ class NesWindow extends StatelessWidget {
color: containerColor,
border: Border.all(
width: nesTheme.pixelSize.toDouble(),
color: textStyle.color ?? Colors.black,
color: nesContainerTheme.borderColor,
),
),
child: Column(
Expand Down
Loading