|
|
@ -14,6 +14,7 @@ import 'package:neon/l10n/localizations.dart'; |
|
|
|
import 'package:neon/src/apps/news/blocs/articles.dart'; |
|
|
|
import 'package:neon/src/apps/news/blocs/articles.dart'; |
|
|
|
import 'package:neon/src/apps/news/blocs/news.dart'; |
|
|
|
import 'package:neon/src/apps/news/blocs/news.dart'; |
|
|
|
import 'package:neon/src/blocs/accounts.dart'; |
|
|
|
import 'package:neon/src/blocs/accounts.dart'; |
|
|
|
|
|
|
|
import 'package:neon/src/blocs/apps.dart'; |
|
|
|
import 'package:neon/src/models/account.dart'; |
|
|
|
import 'package:neon/src/models/account.dart'; |
|
|
|
import 'package:neon/src/neon.dart'; |
|
|
|
import 'package:neon/src/neon.dart'; |
|
|
|
import 'package:nextcloud/nextcloud.dart'; |
|
|
|
import 'package:nextcloud/nextcloud.dart'; |
|
|
@ -21,7 +22,6 @@ import 'package:provider/provider.dart'; |
|
|
|
import 'package:rxdart/rxdart.dart'; |
|
|
|
import 'package:rxdart/rxdart.dart'; |
|
|
|
import 'package:settings/settings.dart'; |
|
|
|
import 'package:settings/settings.dart'; |
|
|
|
import 'package:share_plus/share_plus.dart'; |
|
|
|
import 'package:share_plus/share_plus.dart'; |
|
|
|
import 'package:shared_preferences/shared_preferences.dart'; |
|
|
|
|
|
|
|
import 'package:sort_box/sort_box.dart'; |
|
|
|
import 'package:sort_box/sort_box.dart'; |
|
|
|
import 'package:url_launcher/url_launcher_string.dart'; |
|
|
|
import 'package:url_launcher/url_launcher_string.dart'; |
|
|
|
import 'package:wakelock/wakelock.dart'; |
|
|
|
import 'package:wakelock/wakelock.dart'; |
|
|
@ -48,22 +48,29 @@ part 'widgets/folder_view.dart'; |
|
|
|
part 'widgets/folders_view.dart'; |
|
|
|
part 'widgets/folders_view.dart'; |
|
|
|
|
|
|
|
|
|
|
|
class NewsApp extends AppImplementation<NewsBloc, NewsAppSpecificOptions> { |
|
|
|
class NewsApp extends AppImplementation<NewsBloc, NewsAppSpecificOptions> { |
|
|
|
NewsApp( |
|
|
|
NewsApp(super.sharedPreferences, super.requestManager, super.platform); |
|
|
|
final SharedPreferences sharedPreferences, |
|
|
|
|
|
|
|
final RequestManager requestManager, |
|
|
|
@override |
|
|
|
final NeonPlatform platform, |
|
|
|
String id = 'news'; |
|
|
|
) : super( |
|
|
|
|
|
|
|
'news', |
|
|
|
@override |
|
|
|
(final localizations) => localizations.newsName, |
|
|
|
String nameFromLocalization(AppLocalizations localizations) => localizations.newsName; |
|
|
|
sharedPreferences, |
|
|
|
|
|
|
|
(final storage) => NewsAppSpecificOptions(storage, platform), |
|
|
|
@override |
|
|
|
(final options, final client) => NewsBloc( |
|
|
|
NewsAppSpecificOptions buildOptions(Storage storage) => NewsAppSpecificOptions(storage, platform); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
|
|
|
NewsBloc buildBloc(NextcloudClient client) => NewsBloc( |
|
|
|
options, |
|
|
|
options, |
|
|
|
requestManager, |
|
|
|
requestManager, |
|
|
|
client, |
|
|
|
client, |
|
|
|
), |
|
|
|
|
|
|
|
(final context, final bloc) => NewsMainPage( |
|
|
|
|
|
|
|
bloc: bloc, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
|
|
|
Widget buildPage(BuildContext context, AppsBloc appsBloc) => NewsMainPage( |
|
|
|
|
|
|
|
bloc: appsBloc.getAppBloc(this), |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
|
|
|
BehaviorSubject<int>? getUnreadCounter(AppsBloc appsBloc) => appsBloc.getAppBloc<NewsBloc>(this).unreadCounter; |
|
|
|
} |
|
|
|
} |
|
|
|