Skip to content

Commit 1726dca

Browse files
authored
Update main.dart
1 parent 3dbb7db commit 1726dca

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

lib/main.dart

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
import 'package:flutter/material.dart';
2-
import 'package:dynamic_color/dynamic_color.dart'; // Obavezan import
2+
import 'package:dynamic_color/dynamic_color.dart';
3+
import 'package:hive_flutter/hive_flutter.dart';
34
import 'ui/screens/home_screen.dart';
4-
import 'ui/screens/document_viewer_screen.dart';
55

6-
void main() {
6+
void main() async {
7+
WidgetsFlutterBinding.ensureInitialized();
8+
await Hive.initFlutter();
9+
await Hive.openBox('documents_box');
710
runApp(const FSentenceApp());
811
}
912

@@ -12,11 +15,8 @@ class FSentenceApp extends StatelessWidget {
1215

1316
@override
1417
Widget build(BuildContext context) {
15-
// Ovo je "magija" koja izvlači boje iz sistema
1618
return DynamicColorBuilder(
1719
builder: (ColorScheme? lightDynamic, ColorScheme? darkDynamic) {
18-
19-
// Definišemo fallback boje (ako sistem nema dynamic color)
2020
ColorScheme lightColorScheme = lightDynamic ?? ColorScheme.fromSeed(
2121
seedColor: Colors.orange,
2222
);
@@ -29,20 +29,15 @@ class FSentenceApp extends StatelessWidget {
2929
return MaterialApp(
3030
title: 'f.Sentence',
3131
debugShowCheckedModeBanner: false,
32-
33-
// SVETLA TEMA
3432
theme: ThemeData(
3533
useMaterial3: true,
3634
colorScheme: lightColorScheme,
37-
// Ovde smo "ubacili" tvoje tanke headinge
3835
textTheme: const TextTheme(
3936
headlineLarge: TextStyle(fontWeight: FontWeight.w300),
4037
headlineMedium: TextStyle(fontWeight: FontWeight.w300),
4138
titleLarge: TextStyle(fontWeight: FontWeight.w300),
4239
),
4340
),
44-
45-
// TAMNA TEMA
4641
darkTheme: ThemeData(
4742
useMaterial3: true,
4843
colorScheme: darkColorScheme,
@@ -52,10 +47,7 @@ class FSentenceApp extends StatelessWidget {
5247
titleLarge: TextStyle(fontWeight: FontWeight.w300),
5348
),
5449
),
55-
56-
// Automatski prebacuje na dark mode ako je tako na sistemu
5750
themeMode: ThemeMode.system,
58-
5951
home: const HomeScreen(),
6052
);
6153
},

0 commit comments

Comments
 (0)