diff --git a/build/app/outputs/flutter-apk/app-arm64-v8a-release.apk b/build/app/outputs/flutter-apk/app-arm64-v8a-release.apk index 8038cb7..c37757e 100644 Binary files a/build/app/outputs/flutter-apk/app-arm64-v8a-release.apk and b/build/app/outputs/flutter-apk/app-arm64-v8a-release.apk differ diff --git a/fonts/Nunito-VariableFont_wght.ttf b/fonts/Nunito-VariableFont_wght.ttf new file mode 100644 index 0000000..0a00f63 Binary files /dev/null and b/fonts/Nunito-VariableFont_wght.ttf differ diff --git a/icons/cards.png b/icons/cards.png index 6d826f1..387b81c 100644 Binary files a/icons/cards.png and b/icons/cards.png differ diff --git a/lib/features/tests/progress_widget.dart b/lib/features/tests/progress_widget.dart index d087d18..e5707d1 100644 --- a/lib/features/tests/progress_widget.dart +++ b/lib/features/tests/progress_widget.dart @@ -72,7 +72,7 @@ class _ProgressWidgetState extends State { children: [ Image.asset( 'icons/back.png', - color: Colors.black, + color: Theme.of(context).colorScheme.primary, width: 17, height: 23.h, ), @@ -100,7 +100,7 @@ class _ProgressWidgetState extends State { borderRadius: BorderRadius.circular(16.h), child: Container( height: 16.h, - color: white, + color: Theme.of(context).scaffoldBackgroundColor, child: Stack( alignment: Alignment.center, children: [ @@ -137,6 +137,7 @@ class _ProgressWidgetState extends State { 'icons/mic_on.png', height: 18.h, width: 13.w, + color: Theme.of(context).colorScheme.primary, ), ), if (widget.showSound) @@ -146,6 +147,7 @@ class _ProgressWidgetState extends State { 'icons/sound_on.png', height: 18.h, width: 24.w, + color: Theme.of(context).colorScheme.primary, ), ), if (widget.timer != null) @@ -198,6 +200,7 @@ class _TimeWidget extends StatelessWidget { 'icons/clock.png', width: 15.w, height: 15.h, + color: Theme.of(context).colorScheme.primary ), SizedBox( width: 4.0.w, diff --git a/lib/features/tests/test_complete_widget.dart b/lib/features/tests/test_complete_widget.dart index 2365a86..c20395a 100644 --- a/lib/features/tests/test_complete_widget.dart +++ b/lib/features/tests/test_complete_widget.dart @@ -52,7 +52,7 @@ class TestCompleteWidget extends StatelessWidget { child: Column( children: [ Expanded( - flex: 3, + flex: 20, child: Padding( padding: const EdgeInsets.only(top: 12.0), child: Column( @@ -87,6 +87,7 @@ class TestCompleteWidget extends StatelessWidget { badgeWidget: Image.asset( 'icons/crown.png', width: 20.w, + color: Theme.of(context).colorScheme.primary ), ), PieChartSectionData( @@ -96,15 +97,17 @@ class TestCompleteWidget extends StatelessWidget { badgeWidget: Image.asset( 'icons/skull.png', width: 20.w, + color: Theme.of(context).colorScheme.primary ), ), PieChartSectionData( - color: Colors.white, + color: Theme.of(context).scaffoldBackgroundColor, showTitle: false, value: skipped.toDouble(), badgeWidget: Image.asset( 'icons/small_circle.png', width: 20.w, + color: Theme.of(context).colorScheme.primary, ), ), ], @@ -116,14 +119,14 @@ class TestCompleteWidget extends StatelessWidget { '$correct/$total', style: TextStyle( fontSize: 36, - fontWeight: FontWeight.w500, + fontWeight: FontWeight.w700, ), ), // Text( // '1:47', // style: TextStyle( // fontSize: 20, - // fontWeight: FontWeight.w500, + // fontWeight: FontWeight.w700, // height: 0.85, // ), // ), @@ -132,7 +135,7 @@ class TestCompleteWidget extends StatelessWidget { ), ), Expanded( - flex: 2, + flex: 20, child: Container( alignment: Alignment.bottomCenter, child: ListView.builder( @@ -152,7 +155,7 @@ class TestCompleteWidget extends StatelessWidget { '${word.word}', style: TextStyle( fontSize: 24, - fontWeight: FontWeight.w500, + fontWeight: FontWeight.w700, ), ), Flexible( diff --git a/lib/features/tests/test_page.dart b/lib/features/tests/test_page.dart index a00dbc2..113f4af 100644 --- a/lib/features/tests/test_page.dart +++ b/lib/features/tests/test_page.dart @@ -86,7 +86,6 @@ class _TestPageState extends State { @override Widget build(BuildContext context) { return Scaffold( - backgroundColor: Colors.white, body: StreamBuilder( stream: locator.testManager.testHolder.asStream.takeWhileInclusive( (state) => state?.questions.isNotEmpty != true, diff --git a/lib/features/tests/test_widgets/common_test_question_widget.dart b/lib/features/tests/test_widgets/common_test_question_widget.dart index 932d727..5357f38 100644 --- a/lib/features/tests/test_widgets/common_test_question_widget.dart +++ b/lib/features/tests/test_widgets/common_test_question_widget.dart @@ -51,6 +51,7 @@ class CommonTestQuestionWidget extends StatelessWidget { icon: Image.asset( 'icons/sound_on.png', width: 26, + color: Theme.of(context).colorScheme.primary, ), onPressed: () => AudioPlayer.playAudio(audio), ), @@ -68,6 +69,7 @@ class CommonTestQuestionWidget extends StatelessWidget { 'icons/sound_on.png', width: 80, height: 80, + color: Theme.of(context).colorScheme.primary, ), onPressed: () => AudioPlayer.playAudio(audio), ), @@ -92,6 +94,7 @@ class CommonTestQuestionWidget extends StatelessWidget { icon: Image.asset( 'icons/sound_on.png', width: 26, + color: Theme.of(context).colorScheme.primary, height: theme.headlineLarge?.fontSize, ), onPressed: () => AudioPlayer.playAudio(audio), diff --git a/lib/features/tests/test_widgets/input_buttons_test.dart b/lib/features/tests/test_widgets/input_buttons_test.dart index dbaa3d2..c33bc6e 100644 --- a/lib/features/tests/test_widgets/input_buttons_test.dart +++ b/lib/features/tests/test_widgets/input_buttons_test.dart @@ -191,9 +191,9 @@ class InputButtonsTestWidget extends StatelessWidget { onTap: () => buttonTapped(index, button), color: state.answer == button ? isCorrect - ? Colors.green[200] - : Colors.red[200] - : Colors.white, + ? Colors.green.withOpacity(0.5) + : Colors.red.withOpacity(0.5) + : Theme.of(context).scaffoldBackgroundColor, ), ), ), @@ -214,7 +214,7 @@ class InputButtonsTestWidget extends StatelessWidget { class _Letter extends StatelessWidget { final String text; final Color? borderColor; - final Color backgroundColor; + final Color? backgroundColor; final double _width; final double _padding; final double _margin; @@ -222,7 +222,7 @@ class _Letter extends StatelessWidget { _Letter({ this.text = '', this.borderColor, - this.backgroundColor = Colors.white, + this.backgroundColor, }) : this._width = 32, this._padding = 5, this._margin = 2.0; @@ -245,12 +245,12 @@ class _Letter extends StatelessWidget { padding: EdgeInsets.all(_padding), clipBehavior: Clip.antiAlias, decoration: BoxDecoration( - color: backgroundColor, + color: backgroundColor ?? Theme.of(context).scaffoldBackgroundColor, borderRadius: BorderRadius.circular(6.0), border: borderColor != null ? Border.all(color: borderColor!) : null, ), child: Material( - color: backgroundColor, + color: backgroundColor ?? Theme.of(context).scaffoldBackgroundColor, child: Text( text, style: Theme.of(context).textTheme.titleLarge, diff --git a/lib/features/tests/test_widgets/simple_test.dart b/lib/features/tests/test_widgets/simple_test.dart index 668d7c6..7391daa 100644 --- a/lib/features/tests/test_widgets/simple_test.dart +++ b/lib/features/tests/test_widgets/simple_test.dart @@ -103,9 +103,9 @@ class SimpleTestWidget extends StatelessWidget { // borderColor: testColor, color: state.answer == e.id ? isCorrect - ? Colors.green[200] - : Colors.red[200] - : Colors.white, + ? Colors.green.withOpacity(0.5) + : Colors.red.withOpacity(0.5) + : Theme.of(context).scaffoldBackgroundColor, ), ) : SizedBox( @@ -119,9 +119,9 @@ class SimpleTestWidget extends StatelessWidget { // borderColor: testColor, color: e.id == state.answer ? isCorrect - ? Colors.green[200] - : Colors.red[200] - : Colors.white, + ? Colors.green.withOpacity(0.5) + : Colors.red.withOpacity(0.5) + : Theme.of(context).scaffoldBackgroundColor, ), ), ) diff --git a/lib/features/tests/test_widgets/test_button.dart b/lib/features/tests/test_widgets/test_button.dart index 319685f..c3cf18a 100644 --- a/lib/features/tests/test_widgets/test_button.dart +++ b/lib/features/tests/test_widgets/test_button.dart @@ -37,8 +37,10 @@ class TestButton extends StatelessWidget { // ), ], ), - child: InkWell( + child: GestureDetector( + // borderRadius: BorderRadius.circular(10.0), onTap: onTap, + behavior: HitTestBehavior.opaque, child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ @@ -54,6 +56,7 @@ class TestButton extends StatelessWidget { if (text != null) Text( text!, + textAlign: TextAlign.center, style: theme.titleLarge, ) ], diff --git a/lib/features/tests/test_widgets/test_image.dart b/lib/features/tests/test_widgets/test_image.dart index 442a147..ff02a5b 100644 --- a/lib/features/tests/test_widgets/test_image.dart +++ b/lib/features/tests/test_widgets/test_image.dart @@ -5,6 +5,7 @@ import 'dart:typed_data'; import 'package:flutter/cupertino.dart'; import 'package:flutter/foundation.dart'; +import 'package:flutter/material.dart'; import 'package:mnemo_cards/features/packs/images_holder.dart'; import 'package:mnemo_cards/theme/themes.dart'; @@ -67,7 +68,7 @@ class _TestImageWidgetState extends State { cached = Container( clipBehavior: Clip.antiAlias, decoration: BoxDecoration( - color: white, + color: Theme.of(context).scaffoldBackgroundColor, borderRadius: BorderRadius.circular(12), ), child: s.data, @@ -114,26 +115,4 @@ class TestImage { TestImage.image(String image) : data = image, key = image.substring(0, m.min(image.length, 50)); -} - -// class _TestImageCache { -// static final _instance = _TestImageCache._(); -// -// _TestImageCache get instance => _instance; -// -// factory _TestImageCache() => _instance; -// -// _TestImageCache._(); -// -// Map _images = {}; -// -// Image? image(TestImage key) { -// return _images[key]; -// } -// -// Image? setImage(TestImage key, ImageProvider provider) { -// return _images[key] = Image(image: provider); -// } -// -// void clear() => _images.clear(); -// } +} \ No newline at end of file diff --git a/lib/main.dart b/lib/main.dart index 011884a..229e3d7 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -147,11 +147,18 @@ class MyApp extends StatelessWidget with WidgetsBindingObserver { designSize: const Size(370, 800), minTextAdapt: true, splitScreenMode: true, - child: MaterialApp.router( - theme: lightTheme, - routerConfig: appRouter.config(), - scaffoldMessengerKey: scaffoldMessengerKey, - debugShowCheckedModeBanner: false, + child: ValueListenableBuilder( + builder: (context, themeMode, child) { + return MaterialApp.router( + theme: theme2, + darkTheme: darkTheme2, + themeMode: themeMode, + routerConfig: appRouter.config(), + scaffoldMessengerKey: scaffoldMessengerKey, + debugShowCheckedModeBanner: false, + ); + }, + valueListenable: themeNotifier, ), ); } diff --git a/lib/managers/user_manager.dart b/lib/managers/user_manager.dart index ec169a8..8aa62c9 100644 --- a/lib/managers/user_manager.dart +++ b/lib/managers/user_manager.dart @@ -115,7 +115,7 @@ class UserManager { } on Object catch (e, s) { log('User manager init error', error: e, stackTrace: s); } - + var firstSkipped = false; _subscription = CompositeSubscription() ..add(_googleSignIn.onCurrentUserChanged .startWith(_googleSignIn.currentUser) @@ -133,9 +133,10 @@ class UserManager { userStateHolder.asNullableStream .distinct((a, b) => a?.id == b?.id) // don't want to clear cache on login - .skip(1) + .skipWhile((user) => user != null && !firstSkipped) .listen( (user) async { + firstSkipped = true; try { if (user == null) { AppRouter.openAuthOrProfile(); diff --git a/lib/pages/auth_page.dart b/lib/pages/auth_page.dart index 21375a5..a30cd7f 100644 --- a/lib/pages/auth_page.dart +++ b/lib/pages/auth_page.dart @@ -27,7 +27,7 @@ class AuthPage extends StatelessWidget { 'Mnemo cards', style: TextStyle( fontSize: 36.sp, - fontWeight: FontWeight.w500, + fontWeight: FontWeight.w700, height: 0.85, ), textAlign: TextAlign.start, @@ -56,7 +56,6 @@ class AuthPage extends StatelessWidget { height: 90.h, alignment: Alignment.center, decoration: BoxDecoration( - color: Colors.white, border: Border.all(color: borderGray), borderRadius: BorderRadius.circular(16.0), ), diff --git a/lib/pages/profile_page.dart b/lib/pages/profile_page.dart index 022f120..e02b0bb 100644 --- a/lib/pages/profile_page.dart +++ b/lib/pages/profile_page.dart @@ -57,6 +57,7 @@ class ProfilePage extends StatelessWidget { Image.asset( 'icons/exit.png', width: 25.w, + color: Theme.of(context).colorScheme.primary, ), ], ), @@ -104,7 +105,6 @@ class ProfilePage extends StatelessWidget { }, child: Container( alignment: Alignment.center, - color: Colors.white, margin: EdgeInsets.all(8.0), child: Text('Clear cache'), height: 40.h, @@ -170,6 +170,7 @@ class ProfilePage extends StatelessWidget { Image.asset( 'icons/settings.png', width: 16.w, + color: Theme.of(context).colorScheme.primary, ), SizedBox(width: 8.w), Expanded(child: Text('Настройки там')), @@ -178,6 +179,7 @@ class ProfilePage extends StatelessWidget { trail: Image.asset( 'icons/next.png', width: 16.w, + color: Theme.of(context).colorScheme.primary, ), ), Divider( diff --git a/lib/pages/settgins_page.dart b/lib/pages/settgins_page.dart index 4f952e4..c9bdf1e 100644 --- a/lib/pages/settgins_page.dart +++ b/lib/pages/settgins_page.dart @@ -49,6 +49,25 @@ class SettingsPage extends StatelessWidget { child: Column( mainAxisAlignment: MainAxisAlignment.end, children: [ + Divider( + height: 1, + color: borderGray.withOpacity(0.2), + ), + SharedPrefButton.builder( + spKey: 'dark_theme', + builder: (enabled, _) => AbsorbPointer( + child: SwitchTile( + text: 'Темная тема', + value: enabled ?? false, + ), + ), + setOnTap: (v) { + final darkTheme = !(v ?? false); + themeNotifier.value = + darkTheme ? ThemeMode.dark : ThemeMode.light; + return darkTheme; + }, + ), Divider( height: 1, color: borderGray.withOpacity(0.2), diff --git a/lib/theme/themes.dart b/lib/theme/themes.dart index 4660414..e25c978 100644 --- a/lib/theme/themes.dart +++ b/lib/theme/themes.dart @@ -1,12 +1,15 @@ import 'package:flutter/material.dart'; -import 'package:google_fonts/google_fonts.dart'; +// import 'package:google_fonts/google_fonts.dart'; + +final ValueNotifier themeNotifier = ValueNotifier(ThemeMode.light); const Color peach = Color(0xffffc994); const Color golden = Color(0xffffea00); const Color green = Color(0xff3d5309); const Color greenAccent = Color(0xff688d11); const Color black = Color(0xff000000); -const Color mainBackground = Color(0xffffffff); +const Color mainBackgroundLight = Color(0xffffffff); +const Color mainBackgroundDark = Color(0xff000000); const Color white = Color(0xffffffff); const Color yellow = Colors.yellowAccent; const Color progressBlue = Color(0xff8CCBFF); @@ -15,28 +18,90 @@ const Color backgroundBlue = Color(0xFFf0f0f0); const Color testBlue = Color(0xffD0EAFF); const Color borderGray = Color(0xffABABAB); -final lightTheme = ThemeData( +final Map color = { + 50: const Color.fromRGBO(0, 0, 0, .1), + 100: const Color.fromRGBO(0, 0, 0, .2), + 200: const Color.fromRGBO(0, 0, 0, .3), + 300: const Color.fromRGBO(0, 0, 0, .4), + 400: const Color.fromRGBO(0, 0, 0, .5), + 500: const Color.fromRGBO(0, 0, 0, .6), + 600: const Color.fromRGBO(0, 0, 0, .7), + 700: const Color.fromRGBO(0, 0, 0, .8), + 800: const Color.fromRGBO(0, 0, 0, .9), + 900: const Color.fromRGBO(0, 0, 0, 1), +}; + +final Map colorWhite = { + 50: const Color.fromRGBO(255, 255, 255, .1), + 100: const Color.fromRGBO(255, 255, 255, .2), + 200: const Color.fromRGBO(255, 255, 255, .3), + 300: const Color.fromRGBO(255, 255, 255, .4), + 400: const Color.fromRGBO(255, 255, 255, .5), + 500: const Color.fromRGBO(255, 255, 255, .6), + 600: const Color.fromRGBO(255, 255, 255, .7), + 700: const Color.fromRGBO(255, 255, 255, .8), + 800: const Color.fromRGBO(255, 255, 255, .9), + 900: const Color.fromRGBO(255, 255, 255, 1), +}; + +final theme2 = ThemeData( + useMaterial3: true, brightness: Brightness.light, - useMaterial3: true, - primaryColor: menuBlue, - scaffoldBackgroundColor: mainBackground, + fontFamily: 'Nunito', + // textTheme: GoogleFonts.exo2TextTheme(), + colorScheme: ColorScheme.light( + secondaryContainer: Colors.grey, + primary: MaterialColor(0xFF000000, color), + surface: MaterialColor(0xFFFFFFFF, colorWhite), + surfaceVariant: MaterialColor(0xFFFFFFFF, colorWhite), + onSurface: Colors.black, + ), + + tabBarTheme: TabBarTheme( + labelColor: MaterialColor(0xFF000000, color), + ), appBarTheme: AppBarTheme( - backgroundColor: mainBackground, + iconTheme: IconThemeData( + color: MaterialColor(0xFF000000, color), + ), ), - colorScheme: ColorScheme.fromSeed( - seedColor: menuBlue, - brightness: Brightness.light, + textTheme: TextTheme( + titleLarge: TextStyle(fontWeight: FontWeight.w700), + titleMedium: TextStyle(fontWeight: FontWeight.w700), + titleSmall: TextStyle(fontWeight: FontWeight.w700), + bodyLarge: TextStyle(fontWeight: FontWeight.w700), + bodyMedium: TextStyle(fontWeight: FontWeight.w700), + bodySmall: TextStyle(fontWeight: FontWeight.w700), + labelLarge: TextStyle(fontWeight: FontWeight.w700), + labelMedium: TextStyle(fontWeight: FontWeight.w700), + labelSmall: TextStyle(fontWeight: FontWeight.w700), + displayLarge: TextStyle(fontWeight: FontWeight.w700), + displayMedium: TextStyle(fontWeight: FontWeight.w700), + displaySmall: TextStyle(fontWeight: FontWeight.w700), + headlineLarge: TextStyle(fontWeight: FontWeight.w700), + headlineMedium: TextStyle(fontWeight: FontWeight.w700), + headlineSmall: TextStyle(fontWeight: FontWeight.w700), ), - fontFamily: GoogleFonts.inter().fontFamily, + primarySwatch: MaterialColor(0xFF000000, color), + visualDensity: VisualDensity.adaptivePlatformDensity, ); -final darkTheme = ThemeData( - brightness: Brightness.dark, +final darkTheme2 = ThemeData( useMaterial3: true, - primaryColor: green, - scaffoldBackgroundColor: black, - colorScheme: ColorScheme.fromSeed( - seedColor: greenAccent, - brightness: Brightness.dark, + brightness: Brightness.dark, + fontFamily: 'Nunito', + // textTheme: GoogleFonts.exo2TextTheme(), + colorScheme: ColorScheme.dark( + primary: MaterialColor(0xFFFFFFFF, colorWhite), + secondary: Colors.lightBlue, + tertiary: Colors.lightBlue, ), - fontFamily: GoogleFonts.istokWeb().fontFamily, + tabBarTheme: TabBarTheme( + labelColor: MaterialColor(0xFFFFFFFF, colorWhite), + ), + appBarTheme: AppBarTheme( + iconTheme: IconThemeData( + color: MaterialColor(0xFFFFFFFF, colorWhite), + )), + primarySwatch: MaterialColor(0xFFFFFFFF, colorWhite), + visualDensity: VisualDensity.adaptivePlatformDensity, ); diff --git a/lib/widgets/big_back_button.dart b/lib/widgets/big_back_button.dart index 1b8fa28..4dd23ee 100644 --- a/lib/widgets/big_back_button.dart +++ b/lib/widgets/big_back_button.dart @@ -16,7 +16,7 @@ class BigBackButton extends StatelessWidget { height: 90.h, alignment: Alignment.center, decoration: BoxDecoration( - color: Colors.white, + color: Theme.of(context).scaffoldBackgroundColor, border: Border.all(color: borderGray), borderRadius: BorderRadius.circular(16.0), ), @@ -25,7 +25,7 @@ class BigBackButton extends StatelessWidget { 'Назад', style: TextStyle( fontSize: 25.sp, - fontWeight: FontWeight.w500, + fontWeight: FontWeight.w700, height: 0.85, ), ), diff --git a/lib/widgets/card_game/card_game_page.dart b/lib/widgets/card_game/card_game_page.dart index fd60c82..f594074 100644 --- a/lib/widgets/card_game/card_game_page.dart +++ b/lib/widgets/card_game/card_game_page.dart @@ -7,6 +7,7 @@ import 'package:mnemo_cards/features/tests/progress_widget.dart'; import 'package:mnemo_cards/main.dart'; import 'package:mnemo_cards/managers/audio_player.dart'; import 'package:mnemo_cards/theme/themes.dart'; +import 'package:mnemo_cards/utils/color_helper.dart'; import 'package:mnemo_cards_common/mnemo_cards_common.dart'; import 'package:rxdart/rxdart.dart'; import '../../di/locator.dart'; @@ -141,7 +142,7 @@ class _CardGamePageState extends State { AutoRouter.of(context).maybePop, icon: Icon( Icons.arrow_back_ios, - color: Colors.black26, + color: Colors.grey[400], ), ), ) @@ -190,7 +191,9 @@ class _CardGamePageState extends State { return Container( alignment: Alignment.center, decoration: BoxDecoration( - color: Colors.white, + color: Theme.of(context) + .scaffoldBackgroundColor + .lighten(0.05), border: Border.all( color: borderGray), borderRadius: @@ -232,7 +235,9 @@ class _CardGamePageState extends State { child: Container( alignment: Alignment.center, decoration: BoxDecoration( - color: Colors.white, + color: Theme.of(context) + .scaffoldBackgroundColor + .lighten(0.05), border: Border.all(color: borderGray), borderRadius: BorderRadius.circular(16.0), @@ -242,7 +247,7 @@ class _CardGamePageState extends State { 'Дальше', style: TextStyle( fontSize: 25.sp, - fontWeight: FontWeight.w500, + fontWeight: FontWeight.w700, height: 0.85, ), ), diff --git a/lib/widgets/card_pack/available_pack.dart b/lib/widgets/card_pack/available_pack.dart index a3f0586..cb1741f 100644 --- a/lib/widgets/card_pack/available_pack.dart +++ b/lib/widgets/card_pack/available_pack.dart @@ -134,20 +134,6 @@ class AvailablePack extends StatelessWidget { }), _AdTile(), _TestsSection(cardPack.id.toString()), - // _TestButton( - // title: 'Быстрый тест', - // subtitle: 'Лучший результат: 99 / 100', - // time: '3', - // timeSubtitle: 'мин', - // onTap: () {}, - // ), - // _TestButton( - // title: 'Полный тест', - // subtitle: 'Лучший результат: 99 / 100', - // time: '10', - // timeSubtitle: 'мин', - // onTap: () {}, - // ), ], ), ), @@ -285,7 +271,7 @@ class _AdTile extends StatelessWidget { margin: const EdgeInsets.symmetric(vertical: 4.0, horizontal: 8.0), decoration: BoxDecoration( border: Border.all( - color: Colors.white, + color: Theme.of(context).scaffoldBackgroundColor, width: 4.0, ), borderRadius: BorderRadius.circular(12.0), @@ -313,7 +299,7 @@ class _Button extends StatelessWidget { width: 110.w, height: 60.h, decoration: BoxDecoration( - color: Colors.white, + color: Theme.of(context).scaffoldBackgroundColor, border: Border.all(color: borderGray), borderRadius: BorderRadius.circular(16.0), ), @@ -321,6 +307,7 @@ class _Button extends StatelessWidget { child: Image.asset( 'icons/$asset', width: 29.w, + color: Theme.of(context).colorScheme.primary, // height: 29.h, fit: BoxFit.scaleDown, ), @@ -343,7 +330,7 @@ class _DownButton extends StatelessWidget { width: 110.w, height: 60.h, decoration: BoxDecoration( - color: Colors.white, + color: Theme.of(context).scaffoldBackgroundColor, border: Border.all(color: borderGray), borderRadius: BorderRadius.circular(16.0), ), @@ -354,6 +341,7 @@ class _DownButton extends StatelessWidget { child: Image.asset( 'icons/down.png', width: 29.w, + color: Theme.of(context).colorScheme.primary, // height: 29.h, fit: BoxFit.scaleDown, ), @@ -391,7 +379,7 @@ class _TestButton extends StatelessWidget { height: 130.h, alignment: Alignment.center, decoration: BoxDecoration( - color: Colors.white, + color: Theme.of(context).scaffoldBackgroundColor, border: Border.all(color: borderGray), borderRadius: BorderRadius.circular(16.0), ), @@ -412,7 +400,7 @@ class _TestButton extends StatelessWidget { title, style: TextStyle( fontSize: 25.sp, - fontWeight: FontWeight.w500, + fontWeight: FontWeight.w700, height: 0.85, ), ), @@ -423,7 +411,7 @@ class _TestButton extends StatelessWidget { subtitle!, style: TextStyle( fontSize: 16.sp, - fontWeight: FontWeight.w300, + fontWeight: FontWeight.w500, height: 0.85, ), ), @@ -458,7 +446,7 @@ class _TestButton extends StatelessWidget { time!, style: TextStyle( fontSize: 40.sp, - fontWeight: FontWeight.w400, + fontWeight: FontWeight.w700, height: 0.85), ), if (timeSubtitle != null) @@ -466,7 +454,7 @@ class _TestButton extends StatelessWidget { timeSubtitle!, style: TextStyle( fontSize: 24.sp, - fontWeight: FontWeight.w400, + fontWeight: FontWeight.w700, height: 0.85), ), ], diff --git a/lib/widgets/card_pack/buy_pack_page.dart b/lib/widgets/card_pack/buy_pack_page.dart index 52cde04..98298f9 100644 --- a/lib/widgets/card_pack/buy_pack_page.dart +++ b/lib/widgets/card_pack/buy_pack_page.dart @@ -194,7 +194,7 @@ class _BuyButton extends StatelessWidget { 'Купить', style: TextStyle( fontSize: 25.sp, - fontWeight: FontWeight.w500, + fontWeight: FontWeight.w700, height: 0.85, ), ), diff --git a/lib/widgets/card_pack/cards_view.dart b/lib/widgets/card_pack/cards_view.dart index 10c185c..7d9e4ab 100644 --- a/lib/widgets/card_pack/cards_view.dart +++ b/lib/widgets/card_pack/cards_view.dart @@ -267,7 +267,7 @@ class _NoCards extends StatelessWidget { favorite ? 'Нет любимых карточек' : 'Пока нет карточек', style: TextStyle( fontSize: 16.sp, - fontWeight: FontWeight.w500, + fontWeight: FontWeight.w700, ), textAlign: TextAlign.center, ), diff --git a/lib/widgets/enter_promo_code_widget.dart b/lib/widgets/enter_promo_code_widget.dart index 847aea1..4ea80eb 100644 --- a/lib/widgets/enter_promo_code_widget.dart +++ b/lib/widgets/enter_promo_code_widget.dart @@ -72,6 +72,7 @@ class _EnterPromoCodeState extends State { child: Image.asset( 'icons/gift.png', width: 17.w, + color: Theme.of(context).colorScheme.primary, ), ), ), diff --git a/lib/widgets/game_card_widget.dart b/lib/widgets/game_card_widget.dart index d8cd502..87346e0 100644 --- a/lib/widgets/game_card_widget.dart +++ b/lib/widgets/game_card_widget.dart @@ -65,18 +65,28 @@ class GameCardDecoration extends StatelessWidget { top: 0.0 * alpha, ), decoration: BoxDecoration( - color: Colors.white, + // color: Theme.of(context).scaffoldBackgroundColor, + color: Theme.of(context) + .scaffoldBackgroundColor + .lighten(0.05), + // .withOpacity(alpha), boxShadow: [ - if (alpha > 0) - BoxShadow( - color: Colors.black.withOpacity(0.25 * alpha), - blurRadius: 4.0 * alpha, - ), + BoxShadow( + color: Theme.of(context) + .colorScheme + .primary + .withOpacity(0.25 * alpha), + blurRadius: 4.0 * alpha, + ), ], borderRadius: BorderRadius.circular( 12 + (GameCardWidget.borderRadius - 12) * alpha), border: Border.all( - color: (borderColor ?? borderGray).withOpacity(1.0 - alpha * alpha), + color: (borderColor ?? borderGray).withOpacity( + Theme.of(context).brightness == Brightness.dark + ? 1.0 + : 1.0 - alpha * alpha, + ), ), ), child: ClipRRect( @@ -252,7 +262,7 @@ class FrontCard extends StatelessWidget { card.translation?.toLowerCase(), textStyle: TextStyle( fontSize: 12 * textScale * alpha + 8, - fontWeight: FontWeight.w400, + fontWeight: FontWeight.w700, color: theme.headlineSmall!.color! .withOpacity(0.5), ), @@ -267,7 +277,8 @@ class FrontCard extends StatelessWidget { padding: EdgeInsets.only(top: 4.0.h * alpha), child: GestureDetector( onTap: () async { - if (card.transcription != null && card.transcriptionMnemo != null) { + if (card.transcription != null && + card.transcriptionMnemo != null) { AudioPlayer.playAudio( '${card.transcription} - ${card.transcriptionMnemo}', lang: 'ru', @@ -278,7 +289,7 @@ class FrontCard extends StatelessWidget { "[${card.transcription}] - ${card.transcriptionMnemo}", textStyle: TextStyle( fontSize: 20 * textScale * alpha, - fontWeight: FontWeight.w400, + fontWeight: FontWeight.w700, ), textAlign: TextAlign.center, maxLines: 2, @@ -293,9 +304,13 @@ class FrontCard extends StatelessWidget { height: constrains.maxHeight / ar * imageScale, clipBehavior: Clip.antiAlias, decoration: BoxDecoration( - borderRadius: BorderRadius.circular( - GameCardWidget.borderRadius * imageScale, - )), + borderRadius: BorderRadius.circular( + GameCardWidget.borderRadius * + imageScale * + imageScale * + imageScale, + ), + ), child: ImageFade( key: ValueKey(card.id), image: image, @@ -317,7 +332,7 @@ class FrontCard extends StatelessWidget { card.mnemo?.isNotEmpty == true ? card.mnemo : ' ', textStyle: TextStyle( fontSize: 20 * textScale, - fontWeight: FontWeight.w400, + fontWeight: FontWeight.w700, ), ), ), @@ -332,7 +347,9 @@ class FrontCard extends StatelessWidget { child: Text( "mnemo cards", style: TextStyle( - fontSize: 10 * textScale, color: Colors.black26), + fontSize: 10 * textScale, + color: Colors.grey[400], + ), maxLines: 1, // group: smallSize, ), @@ -362,6 +379,7 @@ class FrontCard extends StatelessWidget { icon: Image.asset( 'icons/sound_on.png', width: 24 * textScale, + color: Theme.of(context).colorScheme.primary, ), onPressed: () async { AudioPlayer.playAudio(card.original, lang: 'es-ES'); diff --git a/lib/widgets/header.dart b/lib/widgets/header.dart index a1d6060..f264a7a 100644 --- a/lib/widgets/header.dart +++ b/lib/widgets/header.dart @@ -53,7 +53,8 @@ class Header extends StatelessWidget { children: [ Image.asset( 'icons/back.png', - color: Colors.black, + color: + Theme.of(context).buttonTheme.colorScheme!.primary, width: 17, height: 23.h, ), @@ -64,7 +65,7 @@ class Header extends StatelessWidget { popText!, style: TextStyle( fontSize: 16, - fontWeight: FontWeight.w400, + fontWeight: FontWeight.w700, ), ), ), @@ -89,7 +90,7 @@ class Header extends StatelessWidget { title!, style: TextStyle( fontSize: 36.sp, - fontWeight: FontWeight.w500, + fontWeight: FontWeight.w700, height: 0.85, ), textAlign: TextAlign.start, diff --git a/lib/widgets/items/builder.dart b/lib/widgets/items/builder.dart index 30d1966..8238364 100644 --- a/lib/widgets/items/builder.dart +++ b/lib/widgets/items/builder.dart @@ -47,7 +47,7 @@ class TextItemBuilder extends StatelessWidget { Text( item.title!, style: TextStyle( - fontWeight: FontWeight.w500, + fontWeight: FontWeight.w700, fontSize: 24, color: Colors.black, ), @@ -57,7 +57,7 @@ class TextItemBuilder extends StatelessWidget { Text( item.subtitle!, style: TextStyle( - fontWeight: FontWeight.w500, + fontWeight: FontWeight.w700, fontSize: 16, color: Colors.black, ), diff --git a/lib/widgets/packs_menu_widget.dart b/lib/widgets/packs_menu_widget.dart index f50785a..7882476 100644 --- a/lib/widgets/packs_menu_widget.dart +++ b/lib/widgets/packs_menu_widget.dart @@ -67,6 +67,7 @@ class _PacksMenuWidgetState extends State { 'icons/profile.png', width: 27.w, height: 27.h, + color: Theme.of(context).colorScheme.primary, ), ), ), @@ -160,7 +161,7 @@ class _PackButton4 extends StatelessWidget { alignment: Alignment.center, height: cardHeight, decoration: BoxDecoration( - color: Colors.white, + // color: main, border: Border.all( color: pack.color?.asColor?.withOpacity(0.9) ?? Colors.grey.withOpacity(0.5), @@ -195,7 +196,7 @@ class _PackButton4 extends StatelessWidget { child: Text( pack.title, style: TextStyle( - fontWeight: FontWeight.w500, + fontWeight: FontWeight.w700, fontSize: 24.sp, height: 0.9, ), @@ -230,6 +231,7 @@ class _PackButton4 extends StatelessWidget { 'icons/cards.png', width: 18.w, height: 16.h, + color: Theme.of(context).colorScheme.primary, ) ], ), diff --git a/lib/widgets/slider.dart b/lib/widgets/slider.dart index cbeaffa..0ed3d20 100644 --- a/lib/widgets/slider.dart +++ b/lib/widgets/slider.dart @@ -30,8 +30,8 @@ class MnemoSlider extends StatelessWidget { padding: EdgeInsets.symmetric(vertical: 3, horizontal: 2.0), child: SliderTheme( data: SliderTheme.of(context).copyWith( - activeTrackColor: Colors.white, - inactiveTrackColor: Colors.white, + activeTrackColor: Theme.of(context).scaffoldBackgroundColor, + inactiveTrackColor: Theme.of(context).scaffoldBackgroundColor, thumbColor: progressBlue, thumbShape: _RectSliderThumbShape( enabledThumbRadius: 19.0, diff --git a/lib/widgets/switch_button.dart b/lib/widgets/switch_button.dart index a1de011..764e413 100644 --- a/lib/widgets/switch_button.dart +++ b/lib/widgets/switch_button.dart @@ -17,8 +17,8 @@ class SwitchButton extends StatelessWidget { value: value, onChanged: onChanged, activeColor: progressBlue, - activeTrackColor: white, - inactiveTrackColor: white, + activeTrackColor: Theme.of(context).scaffoldBackgroundColor, + inactiveTrackColor: Theme.of(context).scaffoldBackgroundColor, trackOutlineColor: WidgetStatePropertyAll(borderGray), inactiveThumbColor: borderGray, ); diff --git a/lib/widgets/text_button.dart b/lib/widgets/text_button.dart index fcb3a9a..b10cade 100644 --- a/lib/widgets/text_button.dart +++ b/lib/widgets/text_button.dart @@ -17,9 +17,8 @@ class LinkButton extends StatelessWidget { child: Text( text, style: TextStyle( - fontWeight: FontWeight.w500, + fontWeight: FontWeight.w700, fontSize: 16, - color: Colors.black, decoration: TextDecoration.underline, ), ), diff --git a/lib/widgets/user_statistics.dart b/lib/widgets/user_statistics.dart index 1a68202..65e855d 100644 --- a/lib/widgets/user_statistics.dart +++ b/lib/widgets/user_statistics.dart @@ -75,7 +75,7 @@ class UserStatistics extends StatelessWidget { '${word.word}', style: TextStyle( fontSize: 18, - fontWeight: FontWeight.w500, + fontWeight: FontWeight.w700, ), ), Flexible( diff --git a/pubspec.lock b/pubspec.lock index cc8ab5a..c3d0112 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -600,14 +600,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.2" - google_fonts: - dependency: "direct main" - description: - name: google_fonts - sha256: b1ac0fe2832c9cc95e5e88b57d627c5e68c223b9657f4b96e1487aa9098c7b82 - url: "https://pub.dev" - source: hosted - version: "6.2.1" google_identity_services_web: dependency: transitive description: @@ -1454,4 +1446,4 @@ packages: version: "1.0.2" sdks: dart: ">=3.3.0 <4.0.0" - flutter: ">=3.19.2" + flutter: ">=3.19.0" diff --git a/pubspec.yaml b/pubspec.yaml index e51bb72..4162895 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -27,7 +27,7 @@ dependencies: json_annotation: ^4.7.0 auto_size_text: ^3.0.0 path_provider: - google_fonts: +# google_fonts: auto_route: flutter_tts: ^4.0.2 dio: ^5.3.3 @@ -83,6 +83,11 @@ flutter: - assets/ - icons/ + fonts: + - family: Nunito + fonts: + - asset: fonts/Nunito-VariableFont_wght.ttf + flutter_launcher_icons: android: "launcher_icon" ios: true