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: [
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<ProgressWidget> {
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<ProgressWidget> {
'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<ProgressWidget> {
'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,

View file

@ -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(

View file

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

View file

@ -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),

View file

@ -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,

View file

@ -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,
),
),
)

View file

@ -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,
)
],

View file

@ -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<TestImageWidget> {
cached = Container(
clipBehavior: Clip.antiAlias,
decoration: BoxDecoration(
color: white,
color: Theme.of(context).scaffoldBackgroundColor,
borderRadius: BorderRadius.circular(12),
),
child: s.data,
@ -115,25 +116,3 @@ class TestImage {
: 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<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),
minTextAdapt: true,
splitScreenMode: true,
child: MaterialApp.router(
theme: lightTheme,
child: ValueListenableBuilder(
builder: (context, themeMode, child) {
return MaterialApp.router(
theme: theme2,
darkTheme: darkTheme2,
themeMode: themeMode,
routerConfig: appRouter.config(),
scaffoldMessengerKey: scaffoldMessengerKey,
debugShowCheckedModeBanner: false,
);
},
valueListenable: themeNotifier,
),
);
}

View file

@ -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();

View file

@ -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),
),

View file

@ -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(

View file

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

View file

@ -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<ThemeMode> 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(
brightness: Brightness.light,
final Map<int, Color> 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<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,
primaryColor: menuBlue,
scaffoldBackgroundColor: mainBackground,
brightness: Brightness.light,
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,
),
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(
brightness: Brightness.dark,
final darkTheme2 = ThemeData(
useMaterial3: true,
primaryColor: green,
scaffoldBackgroundColor: black,
colorScheme: ColorScheme.fromSeed(
seedColor: greenAccent,
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,
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,
),
),

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/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<CardGamePage> {
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<CardGamePage> {
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<CardGamePage> {
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<CardGamePage> {
'Дальше',
style: TextStyle(
fontSize: 25.sp,
fontWeight: FontWeight.w500,
fontWeight: FontWeight.w700,
height: 0.85,
),
),

View file

@ -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),
),
],

View file

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

View file

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

View file

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

View file

@ -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),
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,
@ -294,8 +305,12 @@ class FrontCard extends StatelessWidget {
clipBehavior: Clip.antiAlias,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(
GameCardWidget.borderRadius * imageScale,
)),
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');

View file

@ -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,

View file

@ -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,
),

View file

@ -67,6 +67,7 @@ class _PacksMenuWidgetState extends State<PacksMenuWidget> {
'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,
)
],
),

View file

@ -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,

View file

@ -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,
);

View file

@ -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,
),
),

View file

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

View file

@ -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"

View file

@ -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