diff --git a/assets/fonts/OFL - RobotoCondensed.txt b/assets/fonts/OFL - RobotoCondensed.txt new file mode 100644 index 000000000..565ded1ca --- /dev/null +++ b/assets/fonts/OFL - RobotoCondensed.txt @@ -0,0 +1,93 @@ +Copyright 2011 The Roboto Project Authors (https://github.com/googlefonts/roboto-classic) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/assets/fonts/OpenSans-Bold.ttf b/assets/fonts/OpenSans-Bold.ttf deleted file mode 100644 index 1811cd634..000000000 Binary files a/assets/fonts/OpenSans-Bold.ttf and /dev/null differ diff --git a/assets/fonts/OpenSans-Light.ttf b/assets/fonts/OpenSans-Light.ttf deleted file mode 100644 index bf6b36931..000000000 Binary files a/assets/fonts/OpenSans-Light.ttf and /dev/null differ diff --git a/assets/fonts/RobotoCondensed-VariableFont_wght.ttf b/assets/fonts/RobotoCondensed-VariableFont_wght.ttf new file mode 100644 index 000000000..a5f645b6e Binary files /dev/null and b/assets/fonts/RobotoCondensed-VariableFont_wght.ttf differ diff --git a/lib/screens/auth_screen.dart b/lib/screens/auth_screen.dart index f9b99c897..06ed58feb 100644 --- a/lib/screens/auth_screen.dart +++ b/lib/screens/auth_screen.dart @@ -70,11 +70,10 @@ class AuthScreen extends StatelessWidget { margin: const EdgeInsets.only(bottom: 20.0), padding: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 94.0), child: const Text( - 'WGER', + 'wger', style: TextStyle( color: Colors.white70, fontSize: 30, - fontFamily: 'OpenSansBold', fontWeight: FontWeight.bold, ), ), diff --git a/lib/screens/dashboard.dart b/lib/screens/dashboard.dart index 2b324c389..da4761240 100644 --- a/lib/screens/dashboard.dart +++ b/lib/screens/dashboard.dart @@ -35,6 +35,7 @@ class _DashboardScreenState extends State { return Scaffold( appBar: MainAppBar(AppLocalizations.of(context).labelDashboard), body: SingleChildScrollView( + padding: const EdgeInsets.all(10), child: Column( children: [ DashboardWorkoutWidget(), diff --git a/lib/screens/home_tabs_screen.dart b/lib/screens/home_tabs_screen.dart index d4fa82c84..f74bc54ea 100644 --- a/lib/screens/home_tabs_screen.dart +++ b/lib/screens/home_tabs_screen.dart @@ -157,36 +157,35 @@ class _HomeTabsScreenState extends State with SingleTickerProvid } else { return Scaffold( body: _screenList.elementAt(_selectedIndex), - bottomNavigationBar: BottomNavigationBar( - items: [ - BottomNavigationBarItem( - icon: const Icon(Icons.dashboard), + bottomNavigationBar: NavigationBar( + destinations: [ + NavigationDestination( + icon: const Icon(Icons.home), label: AppLocalizations.of(context).labelDashboard, ), - BottomNavigationBarItem( + NavigationDestination( icon: const Icon(Icons.fitness_center), label: AppLocalizations.of(context).labelBottomNavWorkout, ), - BottomNavigationBarItem( + NavigationDestination( icon: const Icon(Icons.restaurant), label: AppLocalizations.of(context).labelBottomNavNutrition, ), - BottomNavigationBarItem( + NavigationDestination( icon: const FaIcon( FontAwesomeIcons.weightScale, size: 20, ), label: AppLocalizations.of(context).weight, ), - BottomNavigationBarItem( + NavigationDestination( icon: const Icon(Icons.photo_library), label: AppLocalizations.of(context).gallery, ), ], - type: BottomNavigationBarType.fixed, - currentIndex: _selectedIndex, - onTap: _onItemTapped, - showUnselectedLabels: false, + onDestinationSelected: _onItemTapped, + selectedIndex: _selectedIndex, + labelBehavior: NavigationDestinationLabelBehavior.alwaysHide, ), ); } diff --git a/lib/screens/nutritional_plan_screen.dart b/lib/screens/nutritional_plan_screen.dart index e3a3db782..c590464e5 100644 --- a/lib/screens/nutritional_plan_screen.dart +++ b/lib/screens/nutritional_plan_screen.dart @@ -40,6 +40,7 @@ class NutritionalPlanScreen extends StatelessWidget { @override Widget build(BuildContext context) { + const appBarForeground = Colors.white; final nutritionalPlan = ModalRoute.of(context)!.settings.arguments as NutritionalPlan; return Scaffold( @@ -64,11 +65,13 @@ class NutritionalPlanScreen extends StatelessWidget { body: CustomScrollView( slivers: [ SliverAppBar( + foregroundColor: appBarForeground, expandedHeight: 250, pinned: true, + iconTheme: const IconThemeData(color: appBarForeground), actions: [ PopupMenuButton( - icon: const Icon(Icons.more_vert), + icon: const Icon(Icons.more_vert, color: appBarForeground), onSelected: (value) { // Edit if (value == NutritionalPlanOptions.edit) { @@ -106,9 +109,7 @@ class NutritionalPlanScreen extends StatelessWidget { flexibleSpace: FlexibleSpaceBar( title: Text( nutritionalPlan.getLabel(context), - style: const TextStyle( - color: Colors.white, - ), + style: Theme.of(context).textTheme.titleLarge?.copyWith(color: appBarForeground), ), background: const Image( image: AssetImage('assets/images/backgrounds/nutritional_plans.jpg'), diff --git a/lib/screens/workout_plan_screen.dart b/lib/screens/workout_plan_screen.dart index 30b3f3f48..0fb013431 100644 --- a/lib/screens/workout_plan_screen.dart +++ b/lib/screens/workout_plan_screen.dart @@ -22,6 +22,7 @@ import 'package:provider/provider.dart'; import 'package:wger/models/workouts/workout_plan.dart'; import 'package:wger/providers/workout_plans.dart'; import 'package:wger/screens/form_screen.dart'; +import 'package:wger/theme/theme.dart'; import 'package:wger/widgets/workouts/forms.dart'; import 'package:wger/widgets/workouts/workout_logs.dart'; import 'package:wger/widgets/workouts/workout_plan_detail.dart'; @@ -69,6 +70,7 @@ class _WorkoutPlanScreenState extends State { @override Widget build(BuildContext context) { + const appBarForeground = Colors.white; final workoutPlan = ModalRoute.of(context)!.settings.arguments as WorkoutPlan; return Scaffold( @@ -77,10 +79,12 @@ class _WorkoutPlanScreenState extends State { SliverAppBar( expandedHeight: 250, pinned: true, + iconTheme: const IconThemeData(color: appBarForeground), + backgroundColor: wgerPrimaryColor, flexibleSpace: FlexibleSpaceBar( title: Text( workoutPlan.name, - style: const TextStyle(color: Colors.white), + style: Theme.of(context).textTheme.titleLarge?.copyWith(color: appBarForeground), ), background: const Image( image: AssetImage('assets/images/backgrounds/workout_plans.jpg'), @@ -89,7 +93,7 @@ class _WorkoutPlanScreenState extends State { ), actions: [ PopupMenuButton( - icon: const Icon(Icons.more_vert), + icon: const Icon(Icons.more_vert, color: appBarForeground), onSelected: (value) { // Edit if (value == WorkoutOptions.edit) { diff --git a/lib/theme/theme.dart b/lib/theme/theme.dart index 72b6c8919..3589f6b31 100644 --- a/lib/theme/theme.dart +++ b/lib/theme/theme.dart @@ -16,6 +16,8 @@ * along with this program. If not, see . */ +import 'dart:ui'; + import 'package:flex_color_scheme/flex_color_scheme.dart'; import 'package:flutter/material.dart'; import 'package:table_calendar/table_calendar.dart'; @@ -32,11 +34,22 @@ const Color wgerSecondaryColorLight = Color(0xffF6B4BA); const Color wgerTertiaryColor = Color(0xFF6CA450); const FlexSubThemesData wgerSubThemeData = FlexSubThemesData( - fabSchemeColor: SchemeColor.secondary, - inputDecoratorBorderType: FlexInputBorderType.underline, - inputDecoratorIsFilled: false, - useTextTheme: true, -); + fabSchemeColor: SchemeColor.secondary, + inputDecoratorBorderType: FlexInputBorderType.underline, + inputDecoratorIsFilled: false, + useTextTheme: true, + appBarBackgroundSchemeColor: SchemeColor.background, + appBarScrolledUnderElevation: 4, + navigationBarBackgroundSchemeColor: SchemeColor.primary, + navigationBarSelectedIconSchemeColor: SchemeColor.onPrimary, + navigationBarUnselectedIconSchemeColor: SchemeColor.onPrimary, + navigationBarIndicatorSchemeColor: SchemeColor.onPrimary, + navigationBarIndicatorOpacity: 0.24, + navigationBarHeight: 56); + +const String wgerDisplayFont = 'RobotoCondensed'; +const List displayFontBoldWeight = [FontVariation('wght', 600)]; +const List displayFontHeavyWeight = [FontVariation('wght', 800)]; // Make a light ColorScheme from the seeds. final ColorScheme schemeLight = SeedColorScheme.fromSeeds( @@ -75,31 +88,66 @@ final ColorScheme schemeDarkHc = SeedColorScheme.fromSeeds( tones: FlexTones.ultraContrast(Brightness.dark), ); -final wgerLightTheme = FlexThemeData.light( - colorScheme: schemeLight, - useMaterial3: true, - appBarStyle: FlexAppBarStyle.primary, - subThemesData: wgerSubThemeData, +const wgerTextTheme = TextTheme( + displayLarge: TextStyle( + fontFamily: wgerDisplayFont, + fontVariations: displayFontHeavyWeight, + ), + displayMedium: TextStyle( + fontFamily: wgerDisplayFont, + fontVariations: displayFontHeavyWeight, + ), + displaySmall: TextStyle( + fontFamily: wgerDisplayFont, + fontVariations: displayFontHeavyWeight, + ), + headlineLarge: TextStyle( + fontFamily: wgerDisplayFont, + fontVariations: displayFontBoldWeight, + ), + headlineMedium: TextStyle( + fontFamily: wgerDisplayFont, + fontVariations: displayFontBoldWeight, + ), + headlineSmall: TextStyle( + fontFamily: wgerDisplayFont, + fontVariations: displayFontBoldWeight, + ), + titleLarge: TextStyle( + fontFamily: wgerDisplayFont, + fontVariations: displayFontBoldWeight, + ), + titleMedium: TextStyle(fontFamily: wgerDisplayFont, fontVariations: displayFontBoldWeight), + titleSmall: TextStyle(fontFamily: wgerDisplayFont, fontVariations: displayFontBoldWeight), ); +final wgerLightTheme = FlexThemeData.light( + colorScheme: schemeLight, + useMaterial3: true, + appBarStyle: FlexAppBarStyle.surface, + subThemesData: wgerSubThemeData, + textTheme: wgerTextTheme); + final wgerDarkTheme = FlexThemeData.dark( - colorScheme: schemeDark, - useMaterial3: true, - subThemesData: wgerSubThemeData, -); + colorScheme: schemeDark, + useMaterial3: true, + appBarStyle: FlexAppBarStyle.surface, + subThemesData: wgerSubThemeData, + textTheme: wgerTextTheme); final wgerLightThemeHc = FlexThemeData.light( - colorScheme: schemeLightHc, - useMaterial3: true, - appBarStyle: FlexAppBarStyle.primary, - subThemesData: wgerSubThemeData, -); + colorScheme: schemeLightHc, + useMaterial3: true, + appBarStyle: FlexAppBarStyle.surface, + subThemesData: wgerSubThemeData, + textTheme: wgerTextTheme); final wgerDarkThemeHc = FlexThemeData.dark( - colorScheme: schemeDarkHc, - useMaterial3: true, - subThemesData: wgerSubThemeData, -); + colorScheme: schemeDarkHc, + useMaterial3: true, + appBarStyle: FlexAppBarStyle.surface, + subThemesData: wgerSubThemeData, + textTheme: wgerTextTheme); CalendarStyle getWgerCalendarStyle(ThemeData theme) { return CalendarStyle( diff --git a/lib/widgets/dashboard/calendar.dart b/lib/widgets/dashboard/calendar.dart index f2b5c8b5b..979477048 100644 --- a/lib/widgets/dashboard/calendar.dart +++ b/lib/widgets/dashboard/calendar.dart @@ -217,7 +217,7 @@ class _DashboardCalendarWidgetState extends State style: Theme.of(context).textTheme.headlineMedium, ), leading: Icon( - Icons.calendar_today_outlined, + Icons.calendar_today, color: Theme.of(context).textTheme.headlineMedium!.color, ), ), diff --git a/lib/widgets/dashboard/widgets.dart b/lib/widgets/dashboard/widgets.dart index 690b9712b..9310cd5a4 100644 --- a/lib/widgets/dashboard/widgets.dart +++ b/lib/widgets/dashboard/widgets.dart @@ -537,7 +537,7 @@ class _DashboardWorkoutWidgetState extends State { : '', ), leading: Icon( - Icons.fitness_center_outlined, + Icons.fitness_center, color: Theme.of(context).textTheme.headlineSmall!.color, ), trailing: getTrailing(), diff --git a/lib/widgets/gallery/forms.dart b/lib/widgets/gallery/forms.dart index c9cdf8643..b5443f4ea 100644 --- a/lib/widgets/gallery/forms.dart +++ b/lib/widgets/gallery/forms.dart @@ -135,7 +135,7 @@ class _ImageFormState extends State { key: const Key('field-date'), decoration: InputDecoration( labelText: AppLocalizations.of(context).date, - suffixIcon: const Icon(Icons.calendar_today_outlined), + suffixIcon: const Icon(Icons.calendar_today), ), readOnly: true, // Stop keyboard from appearing controller: dateController, diff --git a/lib/widgets/nutrition/forms.dart b/lib/widgets/nutrition/forms.dart index b0b002253..42129ea27 100644 --- a/lib/widgets/nutrition/forms.dart +++ b/lib/widgets/nutrition/forms.dart @@ -277,7 +277,7 @@ class IngredientLogForm extends StatelessWidget { // Stop keyboard from appearing decoration: InputDecoration( labelText: AppLocalizations.of(context).date, - suffixIcon: const Icon(Icons.calendar_today_outlined), + suffixIcon: const Icon(Icons.calendar_today), ), enableInteractiveSelection: false, controller: _dateController, diff --git a/lib/widgets/weight/forms.dart b/lib/widgets/weight/forms.dart index c4b6f6760..1f414b235 100644 --- a/lib/widgets/weight/forms.dart +++ b/lib/widgets/weight/forms.dart @@ -49,7 +49,7 @@ class WeightForm extends StatelessWidget { readOnly: true, // Stop keyboard from appearing decoration: InputDecoration( labelText: AppLocalizations.of(context).date, - suffixIcon: const Icon(Icons.calendar_today_outlined), + suffixIcon: const Icon(Icons.calendar_today), ), enableInteractiveSelection: false, controller: dateController, diff --git a/lib/widgets/workouts/gym_mode.dart b/lib/widgets/workouts/gym_mode.dart index 69e710554..3b1c3d847 100644 --- a/lib/widgets/workouts/gym_mode.dart +++ b/lib/widgets/workouts/gym_mode.dart @@ -631,7 +631,7 @@ class _LogPageState extends State { Center( child: Text( widget._setting.singleSettingRepText, - style: Theme.of(context).textTheme.displaySmall, + style: Theme.of(context).textTheme.headlineMedium, textAlign: TextAlign.center, ), ), diff --git a/lib/widgets/workouts/workout_logs.dart b/lib/widgets/workouts/workout_logs.dart index effbc6697..0c6f4da92 100644 --- a/lib/widgets/workouts/workout_logs.dart +++ b/lib/widgets/workouts/workout_logs.dart @@ -55,7 +55,7 @@ class _WorkoutLogsState extends State { isSelected: const [false, true], children: const [ Icon( - Icons.table_chart_outlined, + Icons.table_chart, ), Icon( Icons.show_chart, diff --git a/lib/widgets/workouts/workout_plan_detail.dart b/lib/widgets/workouts/workout_plan_detail.dart index 159ea9756..4ed3f7349 100644 --- a/lib/widgets/workouts/workout_plan_detail.dart +++ b/lib/widgets/workouts/workout_plan_detail.dart @@ -40,19 +40,21 @@ class _WorkoutPlanDetailState extends State { return Column( children: [ if (widget._workoutPlan.days.isNotEmpty) - ToggleButtons( - renderBorder: false, - onPressed: (int index) { - if (index == 1) { - widget._changeMode(WorkoutScreenMode.log); - } - }, - isSelected: const [true, false], - children: const [ - Icon(Icons.table_chart_outlined), - Icon(Icons.show_chart), - ], - ), + Padding( + padding: const EdgeInsets.all(10), + child: ToggleButtons( + renderBorder: false, + onPressed: (int index) { + if (index == 1) { + widget._changeMode(WorkoutScreenMode.log); + } + }, + isSelected: const [true, false], + children: const [ + Icon(Icons.table_chart), + Icon(Icons.show_chart), + ], + )), if (widget._workoutPlan.description != '') Padding( padding: const EdgeInsets.all(15), diff --git a/pubspec.lock b/pubspec.lock index da8407d59..6cbde2f7f 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -201,14 +201,6 @@ packages: url: "https://pub.dev" source: hosted version: "0.2.4" - cli_util: - dependency: transitive - description: - name: cli_util - sha256: b8db3080e59b2503ca9e7922c3df2072cf13992354d5e944074ffa836fba43b7 - url: "https://pub.dev" - source: hosted - version: "0.4.0" clock: dependency: transitive description: @@ -459,14 +451,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.0" - flutter_launcher_icons: - dependency: "direct dev" - description: - name: flutter_launcher_icons - sha256: "526faf84284b86a4cb36d20a5e45147747b7563d921373d4ee0559c54fcdbcea" - url: "https://pub.dev" - source: hosted - version: "0.13.1" flutter_lints: dependency: "direct dev" description: diff --git a/pubspec.yaml b/pubspec.yaml index 64d0e126b..7d8a1f654 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -105,13 +105,9 @@ flutter: # list giving the asset and other descriptors for the font. For # example: fonts: - - family: OpenSansLight + - family: RobotoCondensed fonts: - - asset: assets/fonts/OpenSans-Light.ttf - - family: OpenSansBold - fonts: - - asset: assets/fonts/OpenSans-Bold.ttf - weight: 700 + - asset: assets/fonts/RobotoCondensed-VariableFont_wght.ttf # # For details regarding fonts from package dependencies, # see https://flutter.dev/custom-fonts/#from-packages