-
Notifications
You must be signed in to change notification settings - Fork 0
/
application_configuration.dart
54 lines (43 loc) · 1.62 KB
/
application_configuration.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import 'package:fappconfiguration/src/dynamic_widget_provider.dart';
import 'package:flutter/material.dart';
import 'package:provider/single_child_widget.dart';
/// An Flutter application configuration.
///
/// Define required information for a flutter application.
abstract class ApplicationConfiguration {
/// Unique id of the application.
///
/// Refer to applicationId on android.
///
/// Refer to bundle id on iOS.
String id();
/// Application name.
String name();
/// Application's theme.
ThemeData theme();
/// Application's them when dark mode is enabled on both iOS and Android.
ThemeData darkTheme();
/// Application's theme mode, by default's system.
ThemeMode themeMode() => ThemeMode.system;
/// Application's supported languages.
List<Locale> supportedLanguages();
/// Application's localization delegate.
List<LocalizationsDelegate> localizationsDelegates();
/// Application's route factory.
///
/// Create application pages based on [RouteSettings]
Route<dynamic> routeFactory(RouteSettings settings);
/// Application's unknown route factory.
///
/// Create pages that handle unknown pages based on [RouteSettings].
Route<dynamic> unknownRouteFactory(RouteSettings settings);
/// Application's widget provider.
///
/// Create widget dynamically between a page based on [DynamicWidgetRequest].
Widget widgetProvider(DynamicWidgetRequest request);
/// The dependency that the application may use when it's launched.
///
/// This would contains a lit of [SingleChildWidget]
/// of different type that provide dependencies.
List<SingleChildWidget> dependencies();
}