From 98feb2c2b8eb0e70622173f0470a2a4a161363d4 Mon Sep 17 00:00:00 2001 From: Mangirdas Kazlauskas Date: Sun, 17 Sep 2023 15:35:57 +0300 Subject: [PATCH 1/2] fix: override text colors for Material text styles --- lib/src/flutter_deck_slide.dart | 28 ++++++++++++++++++++-------- lib/src/templates/split_slide.dart | 26 ++++++++++++++++++-------- 2 files changed, 38 insertions(+), 16 deletions(-) diff --git a/lib/src/flutter_deck_slide.dart b/lib/src/flutter_deck_slide.dart index 9929319..ac2b0a5 100644 --- a/lib/src/flutter_deck_slide.dart +++ b/lib/src/flutter_deck_slide.dart @@ -252,17 +252,29 @@ class FlutterDeckSlide extends StatelessWidget { @override Widget build(BuildContext context) { + final materialTheme = Theme.of(context); final theme = FlutterDeckTheme.of(context).merge(_theme); + final slideTheme = theme.slideTheme; - final textTheme = theme.textTheme; + final backgroundColor = slideTheme.backgroundColor; + final color = slideTheme.color; - return FlutterDeckTheme( - data: theme.copyWith(textTheme: textTheme.apply(color: slideTheme.color)), - child: Builder( - builder: (context) => Scaffold( - backgroundColor: slideTheme.backgroundColor, - drawer: const FlutterDeckDrawer(), - body: _SlideBody(child: _builder(context)), + return Theme( + data: materialTheme.copyWith( + textTheme: materialTheme.textTheme.apply( + bodyColor: color, + displayColor: color, + decorationColor: color, + ), + ), + child: FlutterDeckTheme( + data: theme.copyWith(textTheme: theme.textTheme.apply(color: color)), + child: Builder( + builder: (context) => Scaffold( + backgroundColor: backgroundColor, + drawer: const FlutterDeckDrawer(), + body: _SlideBody(child: _builder(context)), + ), ), ), ); diff --git a/lib/src/templates/split_slide.dart b/lib/src/templates/split_slide.dart index 3b978e8..aa008af 100644 --- a/lib/src/templates/split_slide.dart +++ b/lib/src/templates/split_slide.dart @@ -172,16 +172,26 @@ class _ContentSection extends StatelessWidget { @override Widget build(BuildContext context) { + final materialTheme = Theme.of(context); final theme = FlutterDeckTheme.of(context); - return FlutterDeckTheme( - data: theme.copyWith(textTheme: theme.textTheme.apply(color: color)), - child: Builder( - builder: (context) => Expanded( - flex: flex, - child: Padding( - padding: FlutterDeckLayout.slidePadding, - child: builder(context), + return Theme( + data: materialTheme.copyWith( + textTheme: materialTheme.textTheme.apply( + bodyColor: color, + displayColor: color, + decorationColor: color, + ), + ), + child: FlutterDeckTheme( + data: theme.copyWith(textTheme: theme.textTheme.apply(color: color)), + child: Builder( + builder: (context) => Expanded( + flex: flex, + child: Padding( + padding: FlutterDeckLayout.slidePadding, + child: builder(context), + ), ), ), ), From eda9d1f2a0883b9179ba0bd2889f3002dfa868ab Mon Sep 17 00:00:00 2001 From: Mangirdas Kazlauskas Date: Sun, 17 Sep 2023 15:37:46 +0300 Subject: [PATCH 2/2] docs: update changelog --- CHANGELOG.md | 4 ++++ pubspec.yaml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b97c311..4937311 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.4.1 + +fix: override text colors for Material text styles + # 0.4.0 - **BREAKING**: refactor: rework the way how a new slide is created diff --git a/pubspec.yaml b/pubspec.yaml index a33f221..6aba8f7 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_deck description: A lightweight, customizable, and easy-to-use framework to create presentations in Flutter. -version: 0.4.0 +version: 0.4.1 homepage: https://github.com/mkobuolys/flutter_deck repository: https://github.com/mkobuolys/flutter_deck issue_tracker: https://github.com/mkobuolys/flutter_deck/issues