themes
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hirameki_srs/src/models/theme_model.dart';
|
||||
import 'package:hirameki_srs/src/services/vocab_deck_repository.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||
@@ -9,16 +10,15 @@ void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
try {
|
||||
await dotenv.load(fileName: ".env");
|
||||
} catch (e) {
|
||||
// It's okay if the .env file is not found.
|
||||
// This is expected in release builds.
|
||||
}
|
||||
// No need to catch because the file is only needed for dev
|
||||
} catch (_) {}
|
||||
|
||||
runApp(
|
||||
MultiProvider(
|
||||
providers: [
|
||||
Provider<DeckRepository>(create: (_) => DeckRepository()),
|
||||
Provider<VocabDeckRepository>(create: (_) => VocabDeckRepository()),
|
||||
ChangeNotifierProvider<ThemeModel>(create: (_) => ThemeModel()),
|
||||
],
|
||||
child: const WkApp(),
|
||||
),
|
||||
@@ -30,29 +30,15 @@ class WkApp extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
title: 'Hirameki SRS',
|
||||
debugShowCheckedModeBanner: false,
|
||||
theme: ThemeData(
|
||||
colorScheme: const ColorScheme(
|
||||
brightness: Brightness.dark,
|
||||
primary: Color(0xFF90CAF9), // Light blue for primary elements
|
||||
onPrimary: Colors.black,
|
||||
secondary: Color(0xFFBBDEFB), // Slightly lighter blue for secondary elements
|
||||
onSecondary: Colors.black,
|
||||
tertiary: Color(0xFFA5D6A7), // Light green for success/correct states
|
||||
onTertiary: Colors.black,
|
||||
error: Color(0xFFEF9A9A), // Light red for error states
|
||||
onError: Colors.black,
|
||||
surface: Color(0xFF121212), // Very dark gray
|
||||
onSurface: Colors.white,
|
||||
surfaceContainer: Color(0xFF1E1E1E), // Slightly lighter dark gray
|
||||
surfaceContainerHighest: Color(0xFF424242), // A distinct dark gray for surface variants
|
||||
onSurfaceVariant: Colors.white70,
|
||||
),
|
||||
useMaterial3: true,
|
||||
),
|
||||
home: const StartScreen(),
|
||||
return Consumer<ThemeModel>(
|
||||
builder: (context, themeModel, child) {
|
||||
return MaterialApp(
|
||||
title: 'Hirameki SRS',
|
||||
debugShowCheckedModeBanner: false,
|
||||
theme: themeModel.currentTheme,
|
||||
home: const StartScreen(),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user