2025-05-12 09:21:29 +02:00
|
|
|
import 'package:appflowy_editor/appflowy_editor.dart';
|
2026-01-28 14:16:38 +08:00
|
|
|
import 'package:appflowy_editor_sync_plugin/appflowy_editor_sync_utility_functions.dart'
|
|
|
|
|
if (dart.library.html) 'package:example/sync_plugin_stub.dart';
|
2025-05-12 09:21:29 +02:00
|
|
|
import 'package:example/home_page.dart';
|
2024-06-11 10:15:15 +08:00
|
|
|
import 'package:flutter/foundation.dart';
|
2022-08-17 17:23:20 +08:00
|
|
|
import 'package:flutter/material.dart';
|
2024-06-11 10:15:15 +08:00
|
|
|
import 'package:flutter/services.dart';
|
2022-09-16 14:06:46 +08:00
|
|
|
import 'package:flutter_localizations/flutter_localizations.dart';
|
2022-08-17 17:23:20 +08:00
|
|
|
|
2025-05-12 09:21:29 +02:00
|
|
|
void main() async {
|
2024-06-11 10:15:15 +08:00
|
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
|
|
|
|
|
|
|
|
if (defaultTargetPlatform == TargetPlatform.android) {
|
|
|
|
|
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge, overlays: []);
|
|
|
|
|
SystemChrome.setSystemUIOverlayStyle(
|
|
|
|
|
const SystemUiOverlayStyle(systemNavigationBarColor: Colors.transparent),
|
|
|
|
|
);
|
|
|
|
|
}
|
2025-05-12 09:21:29 +02:00
|
|
|
// Important for Offline Collaboration
|
|
|
|
|
await AppflowyEditorSyncUtilityFunctions.initAppFlowyEditorSync();
|
2024-06-11 10:15:15 +08:00
|
|
|
|
2022-08-17 17:23:20 +08:00
|
|
|
runApp(const MyApp());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class MyApp extends StatelessWidget {
|
2023-09-15 00:02:05 +02:00
|
|
|
const MyApp({super.key});
|
2022-08-17 17:23:20 +08:00
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
2023-06-20 10:26:22 +08:00
|
|
|
return MaterialApp(
|
2023-06-23 18:36:33 +08:00
|
|
|
localizationsDelegates: const [
|
2022-09-16 14:06:46 +08:00
|
|
|
GlobalMaterialLocalizations.delegate,
|
|
|
|
|
GlobalCupertinoLocalizations.delegate,
|
|
|
|
|
GlobalWidgetsLocalizations.delegate,
|
2022-09-15 21:27:49 +08:00
|
|
|
AppFlowyEditorLocalizations.delegate,
|
|
|
|
|
],
|
2024-01-25 12:43:02 -03:00
|
|
|
supportedLocales: AppFlowyEditorLocalizations.delegate.supportedLocales,
|
2022-08-26 10:53:20 +08:00
|
|
|
debugShowCheckedModeBanner: false,
|
2023-07-03 15:03:19 +02:00
|
|
|
home: const HomePage(),
|
2023-07-02 23:51:18 -05:00
|
|
|
theme: ThemeData.light(useMaterial3: true),
|
2022-08-17 17:23:20 +08:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|