Skip to content

Commit

Permalink
Adjust colors due to Flutter/Material update
Browse files Browse the repository at this point in the history
  • Loading branch information
Xennis committed Jul 18, 2024
1 parent 79d083a commit 8ab7b11
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 21 deletions.
12 changes: 8 additions & 4 deletions green_walking/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,16 @@ class GreenWalkingApp extends StatelessWidget {
return MaterialApp(
onGenerateTitle: (BuildContext context) => AppLocalizations.of(context)!.appTitle,
theme: ThemeData(
brightness: Brightness.light,
primaryColor: Colors.blue,
colorScheme: ColorScheme.fromSeed(
brightness: Brightness.light,
seedColor: Colors.blue,
),
),
darkTheme: ThemeData(
brightness: Brightness.dark,
primaryColor: Colors.blue,
colorScheme: ColorScheme.fromSeed(
brightness: Brightness.dark,
seedColor: Colors.blue,
),
),
themeMode: prefsProvider.themeMode,
initialRoute: Routes.map,
Expand Down
2 changes: 1 addition & 1 deletion green_walking/lib/pages/feedback.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class FeedbackPage extends StatelessWidget {
children: <Widget>[
RichText(
text: TextSpan(
style: TextStyle(color: theme.unselectedWidgetColor),
style: TextStyle(color: theme.colorScheme.secondary),
children: <InlineSpan>[
TextSpan(
text: '${locale.feedbackPageText}\n',
Expand Down
4 changes: 2 additions & 2 deletions green_walking/lib/pages/legal_notice.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class LegalNoticePage extends StatelessWidget {
children: <Widget>[
RichText(
text: TextSpan(
style: TextStyle(color: theme.unselectedWidgetColor),
style: TextStyle(color: theme.colorScheme.secondary),
children: <InlineSpan>[
TextSpan(
text: '${locale.imprintTmgText('5')}:\n\n',
Expand All @@ -41,7 +41,7 @@ class LegalNoticePage extends StatelessWidget {
TextSpan(text: '${locale.imprintGdprApplyText} '),
TextSpan(
text: locale.gdprPrivacyPolicy,
style: TextStyle(color: theme.primaryColor),
style: TextStyle(color: theme.colorScheme.primary, fontWeight: FontWeight.bold),
recognizer: TapGestureRecognizer()..onTap = () => launchUrl(privacyPolicyUrl),
),
const TextSpan(text: '.')
Expand Down
4 changes: 1 addition & 3 deletions green_walking/lib/pages/search.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ class _SearchPageState extends State<SearchPage> {
@override
Widget build(BuildContext context) {
final AppLocalizations locale = AppLocalizations.of(context)!;
final ThemeData theme = Theme.of(context);

return Scaffold(
// If the search in the search bar is clicked the keyboard appears. The keyboard
Expand All @@ -59,7 +58,6 @@ class _SearchPageState extends State<SearchPage> {
title: TextField(
controller: _queryFieldController,
autofocus: true,
cursorColor: theme.hintColor,
keyboardType: TextInputType.text,
textInputAction: TextInputAction.go,
decoration: InputDecoration(
Expand Down Expand Up @@ -131,7 +129,7 @@ class _SearchPageState extends State<SearchPage> {
children: [
Flexible(
child: Text(locale.geocodingResultLegalNotice(data.attribution),
style: TextStyle(color: theme.hintColor, fontSize: 12.0)))
style: TextStyle(color: theme.colorScheme.secondary, fontSize: 12.0)))
],
),
],
Expand Down
4 changes: 2 additions & 2 deletions green_walking/lib/widgets/location_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class _LocationButtonState extends State<LocationButton> {
child: Padding(
padding: const EdgeInsets.only(bottom: 18.0, right: 18.0),
child: FloatingActionButton(
backgroundColor: theme.primaryColor,
backgroundColor: theme.colorScheme.primary,
onPressed: _onPressed,
child: ValueListenableBuilder<UserLocationTracking>(
valueListenable: widget.trackUserLocation,
Expand All @@ -63,7 +63,7 @@ class _LocationButtonState extends State<LocationButton> {
return Icon(
icon,
size: 27,
color: Colors.white,
color: theme.colorScheme.onPrimary,
);
})),
),
Expand Down
10 changes: 5 additions & 5 deletions green_walking/lib/widgets/navigation_drawer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,23 @@ class AppNavigationDrawer extends StatelessWidget {
children: <Widget>[
DrawerHeader(
decoration: BoxDecoration(
color: theme.primaryColor,
color: theme.colorScheme.primary,
),
child: Column(children: <Widget>[
Row(children: <Widget>[
Text(
locale.appTitle,
style: const TextStyle(
color: Colors.white,
style: TextStyle(
color: theme.colorScheme.onPrimary,
fontSize: 22,
),
),
]),
Row(
children: <Widget>[
Text(locale.appSlogan,
style: const TextStyle(
color: Colors.white70,
style: TextStyle(
color: theme.colorScheme.onPrimary,
)),
],
)
Expand Down
2 changes: 1 addition & 1 deletion green_walking/lib/widgets/search_result_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class _TrailingWidget extends StatelessWidget {

final List<Widget> children = [
IconButton(
color: theme.primaryColor,
color: theme.colorScheme.primary,
tooltip: locale.openLocationInDefaultAppSemanticLabel,
icon: Icon(Icons.open_in_new, semanticLabel: locale.openLocationInDefaultAppSemanticLabel),
onPressed: () => launchUrlString(
Expand Down
6 changes: 3 additions & 3 deletions green_walking/lib/widgets/user_consent_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,21 @@ class UserConsentDialog extends StatelessWidget {
child: ListBody(
children: <Widget>[
RichText(
text: TextSpan(style: TextStyle(color: theme.hintColor), children: <InlineSpan>[
text: TextSpan(style: TextStyle(color: theme.colorScheme.secondary), children: <InlineSpan>[
TextSpan(
text: '${locale.gdprDialogText} ',
),
TextSpan(
text: locale.gdprPrivacyPolicy,
style: TextStyle(color: theme.primaryColor),
style: TextStyle(color: theme.colorScheme.primary, fontWeight: FontWeight.bold),
recognizer: TapGestureRecognizer()
..onTap = () {
launchUrl(privacyPolicyUrl);
},
),
TextSpan(
text: '.',
style: TextStyle(color: theme.hintColor),
style: TextStyle(color: theme.colorScheme.secondary),
),
]),
),
Expand Down

0 comments on commit 8ab7b11

Please sign in to comment.