font and black theme

This commit is contained in:
Dmitry 2024-06-22 15:29:18 +03:00
parent 367eab45e9
commit 6e635400cd
33 changed files with 239 additions and 145 deletions

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 741 B

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

@ -72,7 +72,7 @@ class _ProgressWidgetState extends State<ProgressWidget> {
children: [ children: [
Image.asset( Image.asset(
'icons/back.png', 'icons/back.png',
color: Colors.black, color: Theme.of(context).colorScheme.primary,
width: 17, width: 17,
height: 23.h, height: 23.h,
), ),
@ -100,7 +100,7 @@ class _ProgressWidgetState extends State<ProgressWidget> {
borderRadius: BorderRadius.circular(16.h), borderRadius: BorderRadius.circular(16.h),
child: Container( child: Container(
height: 16.h, height: 16.h,
color: white, color: Theme.of(context).scaffoldBackgroundColor,
child: Stack( child: Stack(
alignment: Alignment.center, alignment: Alignment.center,
children: [ children: [
@ -137,6 +137,7 @@ class _ProgressWidgetState extends State<ProgressWidget> {
'icons/mic_on.png', 'icons/mic_on.png',
height: 18.h, height: 18.h,
width: 13.w, width: 13.w,
color: Theme.of(context).colorScheme.primary,
), ),
), ),
if (widget.showSound) if (widget.showSound)
@ -146,6 +147,7 @@ class _ProgressWidgetState extends State<ProgressWidget> {
'icons/sound_on.png', 'icons/sound_on.png',
height: 18.h, height: 18.h,
width: 24.w, width: 24.w,
color: Theme.of(context).colorScheme.primary,
), ),
), ),
if (widget.timer != null) if (widget.timer != null)
@ -198,6 +200,7 @@ class _TimeWidget extends StatelessWidget {
'icons/clock.png', 'icons/clock.png',
width: 15.w, width: 15.w,
height: 15.h, height: 15.h,
color: Theme.of(context).colorScheme.primary
), ),
SizedBox( SizedBox(
width: 4.0.w, width: 4.0.w,

View file

@ -52,7 +52,7 @@ class TestCompleteWidget extends StatelessWidget {
child: Column( child: Column(
children: [ children: [
Expanded( Expanded(
flex: 3, flex: 20,
child: Padding( child: Padding(
padding: const EdgeInsets.only(top: 12.0), padding: const EdgeInsets.only(top: 12.0),
child: Column( child: Column(
@ -87,6 +87,7 @@ class TestCompleteWidget extends StatelessWidget {
badgeWidget: Image.asset( badgeWidget: Image.asset(
'icons/crown.png', 'icons/crown.png',
width: 20.w, width: 20.w,
color: Theme.of(context).colorScheme.primary
), ),
), ),
PieChartSectionData( PieChartSectionData(
@ -96,15 +97,17 @@ class TestCompleteWidget extends StatelessWidget {
badgeWidget: Image.asset( badgeWidget: Image.asset(
'icons/skull.png', 'icons/skull.png',
width: 20.w, width: 20.w,
color: Theme.of(context).colorScheme.primary
), ),
), ),
PieChartSectionData( PieChartSectionData(
color: Colors.white, color: Theme.of(context).scaffoldBackgroundColor,
showTitle: false, showTitle: false,
value: skipped.toDouble(), value: skipped.toDouble(),
badgeWidget: Image.asset( badgeWidget: Image.asset(
'icons/small_circle.png', 'icons/small_circle.png',
width: 20.w, width: 20.w,
color: Theme.of(context).colorScheme.primary,
), ),
), ),
], ],
@ -116,14 +119,14 @@ class TestCompleteWidget extends StatelessWidget {
'$correct/$total', '$correct/$total',
style: TextStyle( style: TextStyle(
fontSize: 36, fontSize: 36,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w700,
), ),
), ),
// Text( // Text(
// '1:47', // '1:47',
// style: TextStyle( // style: TextStyle(
// fontSize: 20, // fontSize: 20,
// fontWeight: FontWeight.w500, // fontWeight: FontWeight.w700,
// height: 0.85, // height: 0.85,
// ), // ),
// ), // ),
@ -132,7 +135,7 @@ class TestCompleteWidget extends StatelessWidget {
), ),
), ),
Expanded( Expanded(
flex: 2, flex: 20,
child: Container( child: Container(
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
child: ListView.builder( child: ListView.builder(
@ -152,7 +155,7 @@ class TestCompleteWidget extends StatelessWidget {
'${word.word}', '${word.word}',
style: TextStyle( style: TextStyle(
fontSize: 24, fontSize: 24,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w700,
), ),
), ),
Flexible( Flexible(

View file

@ -86,7 +86,6 @@ class _TestPageState extends State<TestPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
backgroundColor: Colors.white,
body: StreamBuilder( body: StreamBuilder(
stream: locator.testManager.testHolder.asStream.takeWhileInclusive( stream: locator.testManager.testHolder.asStream.takeWhileInclusive(
(state) => state?.questions.isNotEmpty != true, (state) => state?.questions.isNotEmpty != true,

View file

@ -51,6 +51,7 @@ class CommonTestQuestionWidget extends StatelessWidget {
icon: Image.asset( icon: Image.asset(
'icons/sound_on.png', 'icons/sound_on.png',
width: 26, width: 26,
color: Theme.of(context).colorScheme.primary,
), ),
onPressed: () => AudioPlayer.playAudio(audio), onPressed: () => AudioPlayer.playAudio(audio),
), ),
@ -68,6 +69,7 @@ class CommonTestQuestionWidget extends StatelessWidget {
'icons/sound_on.png', 'icons/sound_on.png',
width: 80, width: 80,
height: 80, height: 80,
color: Theme.of(context).colorScheme.primary,
), ),
onPressed: () => AudioPlayer.playAudio(audio), onPressed: () => AudioPlayer.playAudio(audio),
), ),
@ -92,6 +94,7 @@ class CommonTestQuestionWidget extends StatelessWidget {
icon: Image.asset( icon: Image.asset(
'icons/sound_on.png', 'icons/sound_on.png',
width: 26, width: 26,
color: Theme.of(context).colorScheme.primary,
height: theme.headlineLarge?.fontSize, height: theme.headlineLarge?.fontSize,
), ),
onPressed: () => AudioPlayer.playAudio(audio), onPressed: () => AudioPlayer.playAudio(audio),

View file

@ -191,9 +191,9 @@ class InputButtonsTestWidget extends StatelessWidget {
onTap: () => buttonTapped(index, button), onTap: () => buttonTapped(index, button),
color: state.answer == button color: state.answer == button
? isCorrect ? isCorrect
? Colors.green[200] ? Colors.green.withOpacity(0.5)
: Colors.red[200] : Colors.red.withOpacity(0.5)
: Colors.white, : Theme.of(context).scaffoldBackgroundColor,
), ),
), ),
), ),
@ -214,7 +214,7 @@ class InputButtonsTestWidget extends StatelessWidget {
class _Letter extends StatelessWidget { class _Letter extends StatelessWidget {
final String text; final String text;
final Color? borderColor; final Color? borderColor;
final Color backgroundColor; final Color? backgroundColor;
final double _width; final double _width;
final double _padding; final double _padding;
final double _margin; final double _margin;
@ -222,7 +222,7 @@ class _Letter extends StatelessWidget {
_Letter({ _Letter({
this.text = '', this.text = '',
this.borderColor, this.borderColor,
this.backgroundColor = Colors.white, this.backgroundColor,
}) : this._width = 32, }) : this._width = 32,
this._padding = 5, this._padding = 5,
this._margin = 2.0; this._margin = 2.0;
@ -245,12 +245,12 @@ class _Letter extends StatelessWidget {
padding: EdgeInsets.all(_padding), padding: EdgeInsets.all(_padding),
clipBehavior: Clip.antiAlias, clipBehavior: Clip.antiAlias,
decoration: BoxDecoration( decoration: BoxDecoration(
color: backgroundColor, color: backgroundColor ?? Theme.of(context).scaffoldBackgroundColor,
borderRadius: BorderRadius.circular(6.0), borderRadius: BorderRadius.circular(6.0),
border: borderColor != null ? Border.all(color: borderColor!) : null, border: borderColor != null ? Border.all(color: borderColor!) : null,
), ),
child: Material( child: Material(
color: backgroundColor, color: backgroundColor ?? Theme.of(context).scaffoldBackgroundColor,
child: Text( child: Text(
text, text,
style: Theme.of(context).textTheme.titleLarge, style: Theme.of(context).textTheme.titleLarge,

View file

@ -103,9 +103,9 @@ class SimpleTestWidget extends StatelessWidget {
// borderColor: testColor, // borderColor: testColor,
color: state.answer == e.id color: state.answer == e.id
? isCorrect ? isCorrect
? Colors.green[200] ? Colors.green.withOpacity(0.5)
: Colors.red[200] : Colors.red.withOpacity(0.5)
: Colors.white, : Theme.of(context).scaffoldBackgroundColor,
), ),
) )
: SizedBox( : SizedBox(
@ -119,9 +119,9 @@ class SimpleTestWidget extends StatelessWidget {
// borderColor: testColor, // borderColor: testColor,
color: e.id == state.answer color: e.id == state.answer
? isCorrect ? isCorrect
? Colors.green[200] ? Colors.green.withOpacity(0.5)
: Colors.red[200] : Colors.red.withOpacity(0.5)
: Colors.white, : Theme.of(context).scaffoldBackgroundColor,
), ),
), ),
) )

View file

@ -37,8 +37,10 @@ class TestButton extends StatelessWidget {
// ), // ),
], ],
), ),
child: InkWell( child: GestureDetector(
// borderRadius: BorderRadius.circular(10.0),
onTap: onTap, onTap: onTap,
behavior: HitTestBehavior.opaque,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
@ -54,6 +56,7 @@ class TestButton extends StatelessWidget {
if (text != null) if (text != null)
Text( Text(
text!, text!,
textAlign: TextAlign.center,
style: theme.titleLarge, style: theme.titleLarge,
) )
], ],

View file

@ -5,6 +5,7 @@ import 'dart:typed_data';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:mnemo_cards/features/packs/images_holder.dart'; import 'package:mnemo_cards/features/packs/images_holder.dart';
import 'package:mnemo_cards/theme/themes.dart'; import 'package:mnemo_cards/theme/themes.dart';
@ -67,7 +68,7 @@ class _TestImageWidgetState extends State<TestImageWidget> {
cached = Container( cached = Container(
clipBehavior: Clip.antiAlias, clipBehavior: Clip.antiAlias,
decoration: BoxDecoration( decoration: BoxDecoration(
color: white, color: Theme.of(context).scaffoldBackgroundColor,
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
), ),
child: s.data, child: s.data,
@ -115,25 +116,3 @@ class TestImage {
: data = image, : data = image,
key = image.substring(0, m.min(image.length, 50)); key = image.substring(0, m.min(image.length, 50));
} }
// class _TestImageCache {
// static final _instance = _TestImageCache._();
//
// _TestImageCache get instance => _instance;
//
// factory _TestImageCache() => _instance;
//
// _TestImageCache._();
//
// Map<TestImage, Image> _images = {};
//
// Image? image(TestImage key) {
// return _images[key];
// }
//
// Image? setImage(TestImage key, ImageProvider provider) {
// return _images[key] = Image(image: provider);
// }
//
// void clear() => _images.clear();
// }

View file

@ -147,11 +147,18 @@ class MyApp extends StatelessWidget with WidgetsBindingObserver {
designSize: const Size(370, 800), designSize: const Size(370, 800),
minTextAdapt: true, minTextAdapt: true,
splitScreenMode: true, splitScreenMode: true,
child: MaterialApp.router( child: ValueListenableBuilder(
theme: lightTheme, builder: (context, themeMode, child) {
return MaterialApp.router(
theme: theme2,
darkTheme: darkTheme2,
themeMode: themeMode,
routerConfig: appRouter.config(), routerConfig: appRouter.config(),
scaffoldMessengerKey: scaffoldMessengerKey, scaffoldMessengerKey: scaffoldMessengerKey,
debugShowCheckedModeBanner: false, debugShowCheckedModeBanner: false,
);
},
valueListenable: themeNotifier,
), ),
); );
} }

View file

@ -115,7 +115,7 @@ class UserManager {
} on Object catch (e, s) { } on Object catch (e, s) {
log('User manager init error', error: e, stackTrace: s); log('User manager init error', error: e, stackTrace: s);
} }
var firstSkipped = false;
_subscription = CompositeSubscription() _subscription = CompositeSubscription()
..add(_googleSignIn.onCurrentUserChanged ..add(_googleSignIn.onCurrentUserChanged
.startWith(_googleSignIn.currentUser) .startWith(_googleSignIn.currentUser)
@ -133,9 +133,10 @@ class UserManager {
userStateHolder.asNullableStream userStateHolder.asNullableStream
.distinct((a, b) => a?.id == b?.id) .distinct((a, b) => a?.id == b?.id)
// don't want to clear cache on login // don't want to clear cache on login
.skip(1) .skipWhile((user) => user != null && !firstSkipped)
.listen( .listen(
(user) async { (user) async {
firstSkipped = true;
try { try {
if (user == null) { if (user == null) {
AppRouter.openAuthOrProfile(); AppRouter.openAuthOrProfile();

View file

@ -27,7 +27,7 @@ class AuthPage extends StatelessWidget {
'Mnemo cards', 'Mnemo cards',
style: TextStyle( style: TextStyle(
fontSize: 36.sp, fontSize: 36.sp,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w700,
height: 0.85, height: 0.85,
), ),
textAlign: TextAlign.start, textAlign: TextAlign.start,
@ -56,7 +56,6 @@ class AuthPage extends StatelessWidget {
height: 90.h, height: 90.h,
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white,
border: Border.all(color: borderGray), border: Border.all(color: borderGray),
borderRadius: BorderRadius.circular(16.0), borderRadius: BorderRadius.circular(16.0),
), ),

View file

@ -57,6 +57,7 @@ class ProfilePage extends StatelessWidget {
Image.asset( Image.asset(
'icons/exit.png', 'icons/exit.png',
width: 25.w, width: 25.w,
color: Theme.of(context).colorScheme.primary,
), ),
], ],
), ),
@ -104,7 +105,6 @@ class ProfilePage extends StatelessWidget {
}, },
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
color: Colors.white,
margin: EdgeInsets.all(8.0), margin: EdgeInsets.all(8.0),
child: Text('Clear cache'), child: Text('Clear cache'),
height: 40.h, height: 40.h,
@ -170,6 +170,7 @@ class ProfilePage extends StatelessWidget {
Image.asset( Image.asset(
'icons/settings.png', 'icons/settings.png',
width: 16.w, width: 16.w,
color: Theme.of(context).colorScheme.primary,
), ),
SizedBox(width: 8.w), SizedBox(width: 8.w),
Expanded(child: Text('Настройки там')), Expanded(child: Text('Настройки там')),
@ -178,6 +179,7 @@ class ProfilePage extends StatelessWidget {
trail: Image.asset( trail: Image.asset(
'icons/next.png', 'icons/next.png',
width: 16.w, width: 16.w,
color: Theme.of(context).colorScheme.primary,
), ),
), ),
Divider( Divider(

View file

@ -49,6 +49,25 @@ class SettingsPage extends StatelessWidget {
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [
Divider(
height: 1,
color: borderGray.withOpacity(0.2),
),
SharedPrefButton<bool>.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( Divider(
height: 1, height: 1,
color: borderGray.withOpacity(0.2), color: borderGray.withOpacity(0.2),

View file

@ -1,12 +1,15 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart'; // import 'package:google_fonts/google_fonts.dart';
final ValueNotifier<ThemeMode> themeNotifier = ValueNotifier(ThemeMode.light);
const Color peach = Color(0xffffc994); const Color peach = Color(0xffffc994);
const Color golden = Color(0xffffea00); const Color golden = Color(0xffffea00);
const Color green = Color(0xff3d5309); const Color green = Color(0xff3d5309);
const Color greenAccent = Color(0xff688d11); const Color greenAccent = Color(0xff688d11);
const Color black = Color(0xff000000); 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 white = Color(0xffffffff);
const Color yellow = Colors.yellowAccent; const Color yellow = Colors.yellowAccent;
const Color progressBlue = Color(0xff8CCBFF); const Color progressBlue = Color(0xff8CCBFF);
@ -15,28 +18,90 @@ const Color backgroundBlue = Color(0xFFf0f0f0);
const Color testBlue = Color(0xffD0EAFF); const Color testBlue = Color(0xffD0EAFF);
const Color borderGray = Color(0xffABABAB); const Color borderGray = Color(0xffABABAB);
final lightTheme = ThemeData( final Map<int, Color> color = {
brightness: Brightness.light, 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<int, Color> 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, useMaterial3: true,
primaryColor: menuBlue, brightness: Brightness.light,
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( appBarTheme: AppBarTheme(
backgroundColor: mainBackground, iconTheme: IconThemeData(
color: MaterialColor(0xFF000000, color),
), ),
colorScheme: ColorScheme.fromSeed(
seedColor: menuBlue,
brightness: Brightness.light,
), ),
fontFamily: GoogleFonts.inter().fontFamily, 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),
),
primarySwatch: MaterialColor(0xFF000000, color),
visualDensity: VisualDensity.adaptivePlatformDensity,
); );
final darkTheme = ThemeData( final darkTheme2 = ThemeData(
brightness: Brightness.dark,
useMaterial3: true, 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,
); );

View file

@ -16,7 +16,7 @@ class BigBackButton extends StatelessWidget {
height: 90.h, height: 90.h,
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Theme.of(context).scaffoldBackgroundColor,
border: Border.all(color: borderGray), border: Border.all(color: borderGray),
borderRadius: BorderRadius.circular(16.0), borderRadius: BorderRadius.circular(16.0),
), ),
@ -25,7 +25,7 @@ class BigBackButton extends StatelessWidget {
'Назад', 'Назад',
style: TextStyle( style: TextStyle(
fontSize: 25.sp, fontSize: 25.sp,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w700,
height: 0.85, height: 0.85,
), ),
), ),

View file

@ -7,6 +7,7 @@ import 'package:mnemo_cards/features/tests/progress_widget.dart';
import 'package:mnemo_cards/main.dart'; import 'package:mnemo_cards/main.dart';
import 'package:mnemo_cards/managers/audio_player.dart'; import 'package:mnemo_cards/managers/audio_player.dart';
import 'package:mnemo_cards/theme/themes.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:mnemo_cards_common/mnemo_cards_common.dart';
import 'package:rxdart/rxdart.dart'; import 'package:rxdart/rxdart.dart';
import '../../di/locator.dart'; import '../../di/locator.dart';
@ -141,7 +142,7 @@ class _CardGamePageState extends State<CardGamePage> {
AutoRouter.of(context).maybePop, AutoRouter.of(context).maybePop,
icon: Icon( icon: Icon(
Icons.arrow_back_ios, Icons.arrow_back_ios,
color: Colors.black26, color: Colors.grey[400],
), ),
), ),
) )
@ -190,7 +191,9 @@ class _CardGamePageState extends State<CardGamePage> {
return Container( return Container(
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Theme.of(context)
.scaffoldBackgroundColor
.lighten(0.05),
border: Border.all( border: Border.all(
color: borderGray), color: borderGray),
borderRadius: borderRadius:
@ -232,7 +235,9 @@ class _CardGamePageState extends State<CardGamePage> {
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Theme.of(context)
.scaffoldBackgroundColor
.lighten(0.05),
border: Border.all(color: borderGray), border: Border.all(color: borderGray),
borderRadius: borderRadius:
BorderRadius.circular(16.0), BorderRadius.circular(16.0),
@ -242,7 +247,7 @@ class _CardGamePageState extends State<CardGamePage> {
'Дальше', 'Дальше',
style: TextStyle( style: TextStyle(
fontSize: 25.sp, fontSize: 25.sp,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w700,
height: 0.85, height: 0.85,
), ),
), ),

View file

@ -134,20 +134,6 @@ class AvailablePack extends StatelessWidget {
}), }),
_AdTile(), _AdTile(),
_TestsSection(cardPack.id.toString()), _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), margin: const EdgeInsets.symmetric(vertical: 4.0, horizontal: 8.0),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all( border: Border.all(
color: Colors.white, color: Theme.of(context).scaffoldBackgroundColor,
width: 4.0, width: 4.0,
), ),
borderRadius: BorderRadius.circular(12.0), borderRadius: BorderRadius.circular(12.0),
@ -313,7 +299,7 @@ class _Button extends StatelessWidget {
width: 110.w, width: 110.w,
height: 60.h, height: 60.h,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Theme.of(context).scaffoldBackgroundColor,
border: Border.all(color: borderGray), border: Border.all(color: borderGray),
borderRadius: BorderRadius.circular(16.0), borderRadius: BorderRadius.circular(16.0),
), ),
@ -321,6 +307,7 @@ class _Button extends StatelessWidget {
child: Image.asset( child: Image.asset(
'icons/$asset', 'icons/$asset',
width: 29.w, width: 29.w,
color: Theme.of(context).colorScheme.primary,
// height: 29.h, // height: 29.h,
fit: BoxFit.scaleDown, fit: BoxFit.scaleDown,
), ),
@ -343,7 +330,7 @@ class _DownButton extends StatelessWidget {
width: 110.w, width: 110.w,
height: 60.h, height: 60.h,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Theme.of(context).scaffoldBackgroundColor,
border: Border.all(color: borderGray), border: Border.all(color: borderGray),
borderRadius: BorderRadius.circular(16.0), borderRadius: BorderRadius.circular(16.0),
), ),
@ -354,6 +341,7 @@ class _DownButton extends StatelessWidget {
child: Image.asset( child: Image.asset(
'icons/down.png', 'icons/down.png',
width: 29.w, width: 29.w,
color: Theme.of(context).colorScheme.primary,
// height: 29.h, // height: 29.h,
fit: BoxFit.scaleDown, fit: BoxFit.scaleDown,
), ),
@ -391,7 +379,7 @@ class _TestButton extends StatelessWidget {
height: 130.h, height: 130.h,
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Theme.of(context).scaffoldBackgroundColor,
border: Border.all(color: borderGray), border: Border.all(color: borderGray),
borderRadius: BorderRadius.circular(16.0), borderRadius: BorderRadius.circular(16.0),
), ),
@ -412,7 +400,7 @@ class _TestButton extends StatelessWidget {
title, title,
style: TextStyle( style: TextStyle(
fontSize: 25.sp, fontSize: 25.sp,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w700,
height: 0.85, height: 0.85,
), ),
), ),
@ -423,7 +411,7 @@ class _TestButton extends StatelessWidget {
subtitle!, subtitle!,
style: TextStyle( style: TextStyle(
fontSize: 16.sp, fontSize: 16.sp,
fontWeight: FontWeight.w300, fontWeight: FontWeight.w500,
height: 0.85, height: 0.85,
), ),
), ),
@ -458,7 +446,7 @@ class _TestButton extends StatelessWidget {
time!, time!,
style: TextStyle( style: TextStyle(
fontSize: 40.sp, fontSize: 40.sp,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w700,
height: 0.85), height: 0.85),
), ),
if (timeSubtitle != null) if (timeSubtitle != null)
@ -466,7 +454,7 @@ class _TestButton extends StatelessWidget {
timeSubtitle!, timeSubtitle!,
style: TextStyle( style: TextStyle(
fontSize: 24.sp, fontSize: 24.sp,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w700,
height: 0.85), height: 0.85),
), ),
], ],

View file

@ -194,7 +194,7 @@ class _BuyButton extends StatelessWidget {
'Купить', 'Купить',
style: TextStyle( style: TextStyle(
fontSize: 25.sp, fontSize: 25.sp,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w700,
height: 0.85, height: 0.85,
), ),
), ),

View file

@ -267,7 +267,7 @@ class _NoCards extends StatelessWidget {
favorite ? 'Нет любимых карточек' : 'Пока нет карточек', favorite ? 'Нет любимых карточек' : 'Пока нет карточек',
style: TextStyle( style: TextStyle(
fontSize: 16.sp, fontSize: 16.sp,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w700,
), ),
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),

View file

@ -72,6 +72,7 @@ class _EnterPromoCodeState extends State<EnterPromoCodeWidget> {
child: Image.asset( child: Image.asset(
'icons/gift.png', 'icons/gift.png',
width: 17.w, width: 17.w,
color: Theme.of(context).colorScheme.primary,
), ),
), ),
), ),

View file

@ -65,18 +65,28 @@ class GameCardDecoration extends StatelessWidget {
top: 0.0 * alpha, top: 0.0 * alpha,
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, // color: Theme.of(context).scaffoldBackgroundColor,
color: Theme.of(context)
.scaffoldBackgroundColor
.lighten(0.05),
// .withOpacity(alpha),
boxShadow: [ boxShadow: [
if (alpha > 0)
BoxShadow( BoxShadow(
color: Colors.black.withOpacity(0.25 * alpha), color: Theme.of(context)
.colorScheme
.primary
.withOpacity(0.25 * alpha),
blurRadius: 4.0 * alpha, blurRadius: 4.0 * alpha,
), ),
], ],
borderRadius: BorderRadius.circular( borderRadius: BorderRadius.circular(
12 + (GameCardWidget.borderRadius - 12) * alpha), 12 + (GameCardWidget.borderRadius - 12) * alpha),
border: Border.all( 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( child: ClipRRect(
@ -252,7 +262,7 @@ class FrontCard extends StatelessWidget {
card.translation?.toLowerCase(), card.translation?.toLowerCase(),
textStyle: TextStyle( textStyle: TextStyle(
fontSize: 12 * textScale * alpha + 8, fontSize: 12 * textScale * alpha + 8,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w700,
color: theme.headlineSmall!.color! color: theme.headlineSmall!.color!
.withOpacity(0.5), .withOpacity(0.5),
), ),
@ -267,7 +277,8 @@ class FrontCard extends StatelessWidget {
padding: EdgeInsets.only(top: 4.0.h * alpha), padding: EdgeInsets.only(top: 4.0.h * alpha),
child: GestureDetector( child: GestureDetector(
onTap: () async { onTap: () async {
if (card.transcription != null && card.transcriptionMnemo != null) { if (card.transcription != null &&
card.transcriptionMnemo != null) {
AudioPlayer.playAudio( AudioPlayer.playAudio(
'${card.transcription} - ${card.transcriptionMnemo}', '${card.transcription} - ${card.transcriptionMnemo}',
lang: 'ru', lang: 'ru',
@ -278,7 +289,7 @@ class FrontCard extends StatelessWidget {
"[${card.transcription}] - ${card.transcriptionMnemo}", "[${card.transcription}] - ${card.transcriptionMnemo}",
textStyle: TextStyle( textStyle: TextStyle(
fontSize: 20 * textScale * alpha, fontSize: 20 * textScale * alpha,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w700,
), ),
textAlign: TextAlign.center, textAlign: TextAlign.center,
maxLines: 2, maxLines: 2,
@ -294,8 +305,12 @@ class FrontCard extends StatelessWidget {
clipBehavior: Clip.antiAlias, clipBehavior: Clip.antiAlias,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular( borderRadius: BorderRadius.circular(
GameCardWidget.borderRadius * imageScale, GameCardWidget.borderRadius *
)), imageScale *
imageScale *
imageScale,
),
),
child: ImageFade( child: ImageFade(
key: ValueKey(card.id), key: ValueKey(card.id),
image: image, image: image,
@ -317,7 +332,7 @@ class FrontCard extends StatelessWidget {
card.mnemo?.isNotEmpty == true ? card.mnemo : ' ', card.mnemo?.isNotEmpty == true ? card.mnemo : ' ',
textStyle: TextStyle( textStyle: TextStyle(
fontSize: 20 * textScale, fontSize: 20 * textScale,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w700,
), ),
), ),
), ),
@ -332,7 +347,9 @@ class FrontCard extends StatelessWidget {
child: Text( child: Text(
"mnemo cards", "mnemo cards",
style: TextStyle( style: TextStyle(
fontSize: 10 * textScale, color: Colors.black26), fontSize: 10 * textScale,
color: Colors.grey[400],
),
maxLines: 1, maxLines: 1,
// group: smallSize, // group: smallSize,
), ),
@ -362,6 +379,7 @@ class FrontCard extends StatelessWidget {
icon: Image.asset( icon: Image.asset(
'icons/sound_on.png', 'icons/sound_on.png',
width: 24 * textScale, width: 24 * textScale,
color: Theme.of(context).colorScheme.primary,
), ),
onPressed: () async { onPressed: () async {
AudioPlayer.playAudio(card.original, lang: 'es-ES'); AudioPlayer.playAudio(card.original, lang: 'es-ES');

View file

@ -53,7 +53,8 @@ class Header extends StatelessWidget {
children: [ children: [
Image.asset( Image.asset(
'icons/back.png', 'icons/back.png',
color: Colors.black, color:
Theme.of(context).buttonTheme.colorScheme!.primary,
width: 17, width: 17,
height: 23.h, height: 23.h,
), ),
@ -64,7 +65,7 @@ class Header extends StatelessWidget {
popText!, popText!,
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w700,
), ),
), ),
), ),
@ -89,7 +90,7 @@ class Header extends StatelessWidget {
title!, title!,
style: TextStyle( style: TextStyle(
fontSize: 36.sp, fontSize: 36.sp,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w700,
height: 0.85, height: 0.85,
), ),
textAlign: TextAlign.start, textAlign: TextAlign.start,

View file

@ -47,7 +47,7 @@ class TextItemBuilder extends StatelessWidget {
Text( Text(
item.title!, item.title!,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w500, fontWeight: FontWeight.w700,
fontSize: 24, fontSize: 24,
color: Colors.black, color: Colors.black,
), ),
@ -57,7 +57,7 @@ class TextItemBuilder extends StatelessWidget {
Text( Text(
item.subtitle!, item.subtitle!,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w500, fontWeight: FontWeight.w700,
fontSize: 16, fontSize: 16,
color: Colors.black, color: Colors.black,
), ),

View file

@ -67,6 +67,7 @@ class _PacksMenuWidgetState extends State<PacksMenuWidget> {
'icons/profile.png', 'icons/profile.png',
width: 27.w, width: 27.w,
height: 27.h, height: 27.h,
color: Theme.of(context).colorScheme.primary,
), ),
), ),
), ),
@ -160,7 +161,7 @@ class _PackButton4 extends StatelessWidget {
alignment: Alignment.center, alignment: Alignment.center,
height: cardHeight, height: cardHeight,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, // color: main,
border: Border.all( border: Border.all(
color: pack.color?.asColor?.withOpacity(0.9) ?? color: pack.color?.asColor?.withOpacity(0.9) ??
Colors.grey.withOpacity(0.5), Colors.grey.withOpacity(0.5),
@ -195,7 +196,7 @@ class _PackButton4 extends StatelessWidget {
child: Text( child: Text(
pack.title, pack.title,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w500, fontWeight: FontWeight.w700,
fontSize: 24.sp, fontSize: 24.sp,
height: 0.9, height: 0.9,
), ),
@ -230,6 +231,7 @@ class _PackButton4 extends StatelessWidget {
'icons/cards.png', 'icons/cards.png',
width: 18.w, width: 18.w,
height: 16.h, height: 16.h,
color: Theme.of(context).colorScheme.primary,
) )
], ],
), ),

View file

@ -30,8 +30,8 @@ class MnemoSlider extends StatelessWidget {
padding: EdgeInsets.symmetric(vertical: 3, horizontal: 2.0), padding: EdgeInsets.symmetric(vertical: 3, horizontal: 2.0),
child: SliderTheme( child: SliderTheme(
data: SliderTheme.of(context).copyWith( data: SliderTheme.of(context).copyWith(
activeTrackColor: Colors.white, activeTrackColor: Theme.of(context).scaffoldBackgroundColor,
inactiveTrackColor: Colors.white, inactiveTrackColor: Theme.of(context).scaffoldBackgroundColor,
thumbColor: progressBlue, thumbColor: progressBlue,
thumbShape: _RectSliderThumbShape( thumbShape: _RectSliderThumbShape(
enabledThumbRadius: 19.0, enabledThumbRadius: 19.0,

View file

@ -17,8 +17,8 @@ class SwitchButton extends StatelessWidget {
value: value, value: value,
onChanged: onChanged, onChanged: onChanged,
activeColor: progressBlue, activeColor: progressBlue,
activeTrackColor: white, activeTrackColor: Theme.of(context).scaffoldBackgroundColor,
inactiveTrackColor: white, inactiveTrackColor: Theme.of(context).scaffoldBackgroundColor,
trackOutlineColor: WidgetStatePropertyAll(borderGray), trackOutlineColor: WidgetStatePropertyAll(borderGray),
inactiveThumbColor: borderGray, inactiveThumbColor: borderGray,
); );

View file

@ -17,9 +17,8 @@ class LinkButton extends StatelessWidget {
child: Text( child: Text(
text, text,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w500, fontWeight: FontWeight.w700,
fontSize: 16, fontSize: 16,
color: Colors.black,
decoration: TextDecoration.underline, decoration: TextDecoration.underline,
), ),
), ),

View file

@ -75,7 +75,7 @@ class UserStatistics extends StatelessWidget {
'${word.word}', '${word.word}',
style: TextStyle( style: TextStyle(
fontSize: 18, fontSize: 18,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w700,
), ),
), ),
Flexible( Flexible(

View file

@ -600,14 +600,6 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.1.2" 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: google_identity_services_web:
dependency: transitive dependency: transitive
description: description:
@ -1454,4 +1446,4 @@ packages:
version: "1.0.2" version: "1.0.2"
sdks: sdks:
dart: ">=3.3.0 <4.0.0" dart: ">=3.3.0 <4.0.0"
flutter: ">=3.19.2" flutter: ">=3.19.0"

View file

@ -27,7 +27,7 @@ dependencies:
json_annotation: ^4.7.0 json_annotation: ^4.7.0
auto_size_text: ^3.0.0 auto_size_text: ^3.0.0
path_provider: path_provider:
google_fonts: # google_fonts:
auto_route: auto_route:
flutter_tts: ^4.0.2 flutter_tts: ^4.0.2
dio: ^5.3.3 dio: ^5.3.3
@ -83,6 +83,11 @@ flutter:
- assets/ - assets/
- icons/ - icons/
fonts:
- family: Nunito
fonts:
- asset: fonts/Nunito-VariableFont_wght.ttf
flutter_launcher_icons: flutter_launcher_icons:
android: "launcher_icon" android: "launcher_icon"
ios: true ios: true