|
|
@ -8,34 +8,35 @@ List<AppImplementation> getAppImplementations( |
|
|
|
[ |
|
|
|
[ |
|
|
|
FilesApp(sharedPreferences, requestManager, platform), |
|
|
|
FilesApp(sharedPreferences, requestManager, platform), |
|
|
|
NewsApp(sharedPreferences, requestManager, platform), |
|
|
|
NewsApp(sharedPreferences, requestManager, platform), |
|
|
|
NotesApp(sharedPreferences, requestManager), |
|
|
|
NotesApp(sharedPreferences, requestManager, platform), |
|
|
|
NotificationsApp(sharedPreferences, requestManager), |
|
|
|
NotificationsApp(sharedPreferences, requestManager, platform), |
|
|
|
]; |
|
|
|
]; |
|
|
|
|
|
|
|
|
|
|
|
abstract class AppImplementation<T extends RxBlocBase, R extends NextcloudAppSpecificOptions> { |
|
|
|
abstract class AppImplementation<T extends RxBlocBase, R extends NextcloudAppSpecificOptions> { |
|
|
|
AppImplementation( |
|
|
|
AppImplementation( |
|
|
|
this.id, |
|
|
|
|
|
|
|
this.nameFromLocalization, |
|
|
|
|
|
|
|
final SharedPreferences sharedPreferences, |
|
|
|
final SharedPreferences sharedPreferences, |
|
|
|
final R Function(Storage) buildOptions, |
|
|
|
final this.requestManager, |
|
|
|
this._buildBloc, |
|
|
|
final this.platform, |
|
|
|
this._buildPage, |
|
|
|
|
|
|
|
) { |
|
|
|
) { |
|
|
|
final storage = Storage('app-$id', sharedPreferences); |
|
|
|
final storage = Storage('app-$id', sharedPreferences); |
|
|
|
options = buildOptions(storage); |
|
|
|
options = buildOptions(storage); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
final String Function(AppLocalizations) nameFromLocalization; |
|
|
|
String get id; |
|
|
|
|
|
|
|
final RequestManager requestManager; |
|
|
|
|
|
|
|
final NeonPlatform platform; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String nameFromLocalization(AppLocalizations localizations); |
|
|
|
String name(BuildContext context) => nameFromLocalization(AppLocalizations.of(context)); |
|
|
|
String name(BuildContext context) => nameFromLocalization(AppLocalizations.of(context)); |
|
|
|
final String id; |
|
|
|
|
|
|
|
late final R options; |
|
|
|
late final R options; |
|
|
|
final T Function(R options, NextcloudClient client) _buildBloc; |
|
|
|
R buildOptions(Storage storage); |
|
|
|
final Widget Function(BuildContext context, T bloc) _buildPage; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
T buildBloc(final NextcloudClient client) => _buildBloc(options, client); |
|
|
|
T buildBloc(final NextcloudClient client); |
|
|
|
|
|
|
|
|
|
|
|
Widget buildPage(final BuildContext context, final AppsBloc appsBloc) => |
|
|
|
Widget buildPage(BuildContext context, T bloc); |
|
|
|
_buildPage(context, appsBloc.getAppBloc(this)); |
|
|
|
Widget buildPageFromAppsBloc(final BuildContext context, final AppsBloc appsBloc) => |
|
|
|
|
|
|
|
buildPage(context, appsBloc.getAppBloc(this)); |
|
|
|
|
|
|
|
|
|
|
|
Widget buildIcon( |
|
|
|
Widget buildIcon( |
|
|
|
final BuildContext context, { |
|
|
|
final BuildContext context, { |
|
|
|