2025-08-27 09:10:22 +00:00
|
|
|
import 'package:flutter/material.dart';
|
2026-02-07 16:01:37 +00:00
|
|
|
import 'database/database_service.dart';
|
2025-09-08 18:27:42 +00:00
|
|
|
|
2025-09-21 19:35:20 +00:00
|
|
|
import 'ai/formula_list.dart';
|
2025-09-10 15:17:28 +00:00
|
|
|
import 'corpus.dart';
|
2025-09-20 14:46:21 +00:00
|
|
|
import 'defaults/default_corpus.dart';
|
2025-09-10 15:17:28 +00:00
|
|
|
|
2026-02-07 16:01:37 +00:00
|
|
|
void main() async {
|
2026-01-21 07:49:56 +00:00
|
|
|
WidgetsFlutterBinding.ensureInitialized();
|
2026-02-07 16:01:37 +00:00
|
|
|
|
|
|
|
|
// Setup service locator and initialize the database
|
|
|
|
|
setupLocator();
|
|
|
|
|
|
|
|
|
|
runApp(const MyApp());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class MyApp extends StatelessWidget {
|
|
|
|
|
const MyApp({Key? key}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return MaterialApp(
|
|
|
|
|
home: FutureBuilder<Corpus>(
|
|
|
|
|
future: createDefaultCorpus(),
|
|
|
|
|
builder: (context, snapshot) {
|
|
|
|
|
if (snapshot.connectionState == ConnectionState.done) {
|
|
|
|
|
if (snapshot.hasError) {
|
|
|
|
|
return Center(child: Text('Error loading units: ${snapshot.error}'));
|
|
|
|
|
}
|
|
|
|
|
return Scaffold(
|
|
|
|
|
appBar: AppBar(title: const Text('Formulas')),
|
|
|
|
|
body: FormulaList(
|
|
|
|
|
corpus: snapshot.data!,
|
|
|
|
|
formulas: snapshot.data!.getFormulas(),
|
|
|
|
|
),
|
|
|
|
|
);
|
2025-09-08 18:27:42 +00:00
|
|
|
}
|
2026-02-07 16:01:37 +00:00
|
|
|
return const Center(child: CircularProgressIndicator());
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
2025-09-05 16:53:06 +00:00
|
|
|
}
|
|
|
|
|
|
2025-08-27 09:10:22 +00:00
|
|
|
|