45 lines
1.2 KiB
Dart
45 lines
1.2 KiB
Dart
import 'dart:io';
|
|
import 'package:flutter/cupertino.dart';
|
|
import 'package:flutter/foundation.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
import 'app/router/app_router.dart';
|
|
|
|
void main() async {
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
runApp(const ProviderScope(child: GLP1CompanionApp()));
|
|
}
|
|
|
|
class GLP1CompanionApp extends ConsumerWidget {
|
|
const GLP1CompanionApp({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context, WidgetRef ref) {
|
|
final router = ref.watch(routerProvider);
|
|
final isApple = !kIsWeb && (Platform.isIOS || Platform.isMacOS);
|
|
|
|
if (isApple) {
|
|
return CupertinoApp.router(
|
|
title: 'GLP-1 Companion',
|
|
routerConfig: router,
|
|
theme: const CupertinoThemeData(
|
|
brightness: Brightness.light,
|
|
primaryColor: CupertinoColors.activeGreen,
|
|
),
|
|
debugShowCheckedModeBanner: false,
|
|
);
|
|
}
|
|
|
|
return MaterialApp.router(
|
|
title: 'GLP-1 Companion',
|
|
routerConfig: router,
|
|
theme: ThemeData(
|
|
useMaterial3: true,
|
|
colorSchemeSeed: Colors.teal,
|
|
brightness: Brightness.light,
|
|
),
|
|
debugShowCheckedModeBanner: false,
|
|
);
|
|
}
|
|
}
|