Skip to content

Improve material theme #258

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
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
9 changes: 8 additions & 1 deletion app/lib/core/theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ class TraleTheme {

/// get elevated shade of clr
Color colorOfElevation(double elevation, Color clr) => Color.alphaBlend(
getFontColor(clr).withOpacity(overlayOpacity(elevation)), clr,
getFontColor(clr).withValues(
alpha: overlayOpacity(elevation)
), clr,
);
/// 24 elevation shade of bg
Color get bgShade1 => bgElevated(24);
Expand Down Expand Up @@ -196,6 +198,10 @@ class TraleTheme {
year2023: false,
);

const CardThemeData cardTheme = CardThemeData(
shadowColor: Colors.transparent,
);

const ProgressIndicatorThemeData progressIndicatorTheme =
ProgressIndicatorThemeData(year2023: false);

Expand All @@ -207,6 +213,7 @@ class TraleTheme {
).copyWith(
listTileTheme: listTileThemeData,
sliderTheme: sliderTheme,
cardTheme: cardTheme,
progressIndicatorTheme: progressIndicatorTheme,
pageTransitionsTheme: const PageTransitionsTheme(
builders: <TargetPlatform, PageTransitionsBuilder>{
Expand Down
17 changes: 6 additions & 11 deletions app/lib/pages/about.dart
Original file line number Diff line number Diff line change
Expand Up @@ -366,17 +366,12 @@ class _About extends State<About> {
);
}

return Container(
color: Theme.of(context).colorScheme.surface,
child: SafeArea(
child: Scaffold(
body: NestedScrollView(
headerSliverBuilder: (BuildContext context, bool _) {
return <Widget>[appBar()];
},
body: aboutList(),
),
),
return Scaffold(
body: NestedScrollView(
headerSliverBuilder: (BuildContext context, bool _) {
return <Widget>[appBar()];
},
body: aboutList(),
),
);
}
Expand Down
17 changes: 6 additions & 11 deletions app/lib/pages/faq.dart
Original file line number Diff line number Diff line change
Expand Up @@ -188,17 +188,12 @@ class _FAQ extends State<FAQ> {
);
}

return Container(
color: Theme.of(context).colorScheme.surface,
child: SafeArea(
child: Scaffold(
body: NestedScrollView(
headerSliverBuilder: (BuildContext context, bool _) {
return <Widget>[appBar()];
},
body: faqList(),
),
),
return Scaffold(
body: NestedScrollView(
headerSliverBuilder: (BuildContext context, bool _) {
return <Widget>[appBar()];
},
body: faqList(),
),
);
}
Expand Down
9 changes: 4 additions & 5 deletions app/lib/pages/measurementScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,10 @@ class _MeasurementScreen extends State<MeasurementScreen> {
}

return StreamBuilder<List<Measurement>>(
stream: database.streamController.stream,
builder: (
BuildContext context, AsyncSnapshot<List<Measurement>> snapshot,
) => measurementScreenWrapper(context, snapshot)
stream: database.streamController.stream,
builder: (
BuildContext context, AsyncSnapshot<List<Measurement>> snapshot,
) => measurementScreenWrapper(context, snapshot),
);

}
}
2 changes: 1 addition & 1 deletion app/lib/pages/onBoarding.dart
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class _OnBoardingPageState extends State<OnBoardingPage> {
image: SizedBox(
width: MediaQuery.of(context).size.width,
height: 0.5 * MediaQuery.of(context).size.width,
child: const ThemeSelection(),
child: ThemeSelection(controller: CarouselController()),
),
decoration: pageDecoration.copyWith(
imagePadding: EdgeInsets.symmetric(
Expand Down
6 changes: 3 additions & 3 deletions app/lib/pages/overview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,10 @@ class _OverviewScreen extends State<OverviewScreen> {
stream: database.streamController.stream,
builder: (
BuildContext context, AsyncSnapshot<List<Measurement>> snapshot,
) => SafeArea(
) => SafeArea(
key: key,
child: overviewScreenWrapper(context, snapshot)
)
child: overviewScreenWrapper(context, snapshot),
)
);
}
}
Loading