feat: initial release of Oracle 999 divination app
This commit is contained in:
+138
@@ -0,0 +1,138 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'screens/catalog_screen.dart';
|
||||
import 'screens/history_screen.dart';
|
||||
import 'screens/home_search_screen.dart';
|
||||
import 'screens/oracle_spread_screen.dart';
|
||||
import 'services/words_repository.dart';
|
||||
import 'widgets/gradient_star_badge.dart';
|
||||
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
await WordsRepository().init();
|
||||
runApp(const Words999App());
|
||||
}
|
||||
|
||||
class Words999App extends StatefulWidget {
|
||||
const Words999App({super.key});
|
||||
|
||||
@override
|
||||
State<Words999App> createState() => _Words999AppState();
|
||||
}
|
||||
|
||||
class _Words999AppState extends State<Words999App> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
title: 'Оракул 999 Символов',
|
||||
debugShowCheckedModeBanner: false,
|
||||
themeMode: ThemeMode.dark, // Default to rich mystical dark mode
|
||||
darkTheme: ThemeData(
|
||||
useMaterial3: true,
|
||||
brightness: Brightness.dark,
|
||||
scaffoldBackgroundColor: const Color(0xFF0C0E1A),
|
||||
colorScheme: const ColorScheme.dark(
|
||||
primary: Color(0xFFFFD54F), // Celestial Yellow Gold
|
||||
onPrimary: Color(0xFF1B1D30),
|
||||
primaryContainer: Color(0xFF2A2D4A),
|
||||
onPrimaryContainer: Color(0xFFFFF9C4),
|
||||
secondary: Color(0xFF80DEEA),
|
||||
surface: Color(0xFF151829),
|
||||
onSurface: Color(0xFFE8EAF6),
|
||||
surfaceContainerHigh: Color(0xFF1E2238),
|
||||
surfaceContainerHighest: Color(0xFF262B44),
|
||||
outline: Color(0xFF9FA8DA),
|
||||
outlineVariant: Color(0xFF3949AB),
|
||||
),
|
||||
fontFamily: 'Roboto',
|
||||
appBarTheme: const AppBarTheme(
|
||||
backgroundColor: Color(0xFF0C0E1A),
|
||||
elevation: 0,
|
||||
scrolledUnderElevation: 3,
|
||||
centerTitle: false,
|
||||
titleTextStyle: TextStyle(
|
||||
color: Color(0xFFFFF9C4),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w900,
|
||||
letterSpacing: 0.5,
|
||||
),
|
||||
),
|
||||
navigationBarTheme: NavigationBarThemeData(
|
||||
backgroundColor: const Color(0xFF101322),
|
||||
indicatorColor: const Color(0xFF2A2D4A),
|
||||
labelTextStyle: WidgetStateProperty.resolveWith((states) {
|
||||
if (states.contains(WidgetState.selected)) {
|
||||
return const TextStyle(
|
||||
color: Color(0xFFFFD54F),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 12,
|
||||
);
|
||||
}
|
||||
return const TextStyle(
|
||||
color: Color(0xFF9FA8DA),
|
||||
fontSize: 11,
|
||||
);
|
||||
}),
|
||||
),
|
||||
),
|
||||
home: const MainNavigationContainer(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MainNavigationContainer extends StatefulWidget {
|
||||
const MainNavigationContainer({super.key});
|
||||
|
||||
@override
|
||||
State<MainNavigationContainer> createState() => _MainNavigationContainerState();
|
||||
}
|
||||
|
||||
class _MainNavigationContainerState extends State<MainNavigationContainer> {
|
||||
int _currentIndex = 0;
|
||||
|
||||
final List<Widget> _screens = const [
|
||||
HomeSearchScreen(),
|
||||
OracleSpreadScreen(),
|
||||
CatalogScreen(),
|
||||
HistoryScreen(),
|
||||
];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: IndexedStack(
|
||||
index: _currentIndex,
|
||||
children: _screens,
|
||||
),
|
||||
bottomNavigationBar: NavigationBar(
|
||||
selectedIndex: _currentIndex,
|
||||
onDestinationSelected: (index) {
|
||||
setState(() => _currentIndex = index);
|
||||
HapticFeedback.selectionClick();
|
||||
},
|
||||
destinations: const [
|
||||
NavigationDestination(
|
||||
icon: Icon(Icons.dialpad_outlined),
|
||||
selectedIcon: GradientStar(size: 22),
|
||||
label: 'Поиск 000..999',
|
||||
),
|
||||
NavigationDestination(
|
||||
icon: Icon(Icons.auto_awesome_outlined),
|
||||
selectedIcon: GradientStar(size: 22),
|
||||
label: 'Расклады',
|
||||
),
|
||||
NavigationDestination(
|
||||
icon: Icon(Icons.menu_book_outlined),
|
||||
selectedIcon: GradientStar(size: 22),
|
||||
label: 'Каталог 999',
|
||||
),
|
||||
NavigationDestination(
|
||||
icon: Icon(Icons.history_rounded),
|
||||
selectedIcon: GradientStar(size: 22),
|
||||
label: 'История',
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user