2024-04-12 16:38:20 +00:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
2024-04-13 16:03:50 +00:00
|
|
|
import 'package:solian/providers/auth.dart';
|
2024-04-18 14:33:55 +00:00
|
|
|
import 'package:solian/providers/chat.dart';
|
2024-04-26 12:49:21 +00:00
|
|
|
import 'package:solian/providers/friend.dart';
|
2024-04-13 16:10:22 +00:00
|
|
|
import 'package:solian/providers/navigation.dart';
|
2024-04-24 15:19:26 +00:00
|
|
|
import 'package:solian/providers/notify.dart';
|
2024-04-12 16:38:20 +00:00
|
|
|
import 'package:solian/router.dart';
|
2024-04-13 11:47:31 +00:00
|
|
|
import 'package:solian/utils/timeago.dart';
|
2024-04-12 16:38:20 +00:00
|
|
|
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
2024-04-17 12:57:25 +00:00
|
|
|
import 'package:solian/utils/video_player.dart';
|
2024-04-30 12:31:54 +00:00
|
|
|
import 'package:solian/widgets/chat/call/call_overlay.dart';
|
2024-04-24 15:19:26 +00:00
|
|
|
import 'package:solian/widgets/notification_notifier.dart';
|
2024-04-12 16:38:20 +00:00
|
|
|
|
|
|
|
void main() {
|
2024-04-27 12:10:15 +00:00
|
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
|
|
|
2024-04-17 12:57:25 +00:00
|
|
|
initVideo();
|
2024-04-13 11:47:31 +00:00
|
|
|
initTimeAgo();
|
|
|
|
|
2024-04-12 16:38:20 +00:00
|
|
|
runApp(const SolianApp());
|
|
|
|
}
|
|
|
|
|
|
|
|
class SolianApp extends StatelessWidget {
|
|
|
|
const SolianApp({super.key});
|
|
|
|
|
|
|
|
// This widget is the root of your application.
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return MaterialApp.router(
|
|
|
|
title: 'Solian',
|
|
|
|
theme: ThemeData(
|
|
|
|
colorScheme: ColorScheme.fromSeed(seedColor: Colors.indigo),
|
|
|
|
useMaterial3: true,
|
|
|
|
),
|
|
|
|
localizationsDelegates: AppLocalizations.localizationsDelegates,
|
|
|
|
supportedLocales: AppLocalizations.supportedLocales,
|
|
|
|
routerConfig: router,
|
|
|
|
builder: (context, child) {
|
2024-04-30 12:31:54 +00:00
|
|
|
return MultiProvider(
|
|
|
|
providers: [
|
|
|
|
Provider(create: (_) => NavigationProvider()),
|
|
|
|
ChangeNotifierProvider(create: (_) => AuthProvider()),
|
|
|
|
ChangeNotifierProvider(create: (_) => ChatProvider()),
|
|
|
|
ChangeNotifierProvider(create: (_) => NotifyProvider()),
|
|
|
|
ChangeNotifierProvider(create: (_) => FriendProvider()),
|
2024-04-12 16:38:20 +00:00
|
|
|
],
|
2024-04-30 12:31:54 +00:00
|
|
|
child: Overlay(
|
|
|
|
initialEntries: [
|
|
|
|
OverlayEntry(builder: (context) {
|
|
|
|
return NotificationNotifier(child: child ?? Container());
|
|
|
|
}),
|
|
|
|
OverlayEntry(builder: (context) => const CallOverlay()),
|
|
|
|
],
|
|
|
|
),
|
2024-04-12 16:38:20 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|