Browse Source

feat(app,dynamite,neon,neon_files,neon_news,neon_notes,neon_notifications,neon_lints,nextcloud): enable strict-raw-types

Signed-off-by: Nikolas Rimikis <leptopoda@users.noreply.github.com>
pull/742/head
Nikolas Rimikis 1 year ago
parent
commit
5056f43f1d
No known key found for this signature in database
GPG Key ID: 85ED1DE9786A4FF2
  1. 10
      packages/app/integration_test/screenshot_test.dart
  2. 2
      packages/app/lib/main.dart
  3. 2
      packages/dynamite/dynamite/lib/src/builder/client.dart
  4. 2
      packages/neon/neon/lib/neon.dart
  5. 12
      packages/neon/neon/lib/src/app.dart
  6. 6
      packages/neon/neon/lib/src/bloc/bloc.dart
  7. 10
      packages/neon/neon/lib/src/blocs/apps.dart
  8. 2
      packages/neon/neon/lib/src/blocs/capabilities.dart
  9. 4
      packages/neon/neon/lib/src/blocs/first_launch.dart
  10. 2
      packages/neon/neon/lib/src/blocs/login_check_account.dart
  11. 2
      packages/neon/neon/lib/src/blocs/login_check_server_status.dart
  12. 2
      packages/neon/neon/lib/src/blocs/login_flow.dart
  13. 4
      packages/neon/neon/lib/src/blocs/next_push.dart
  14. 8
      packages/neon/neon/lib/src/blocs/push_notifications.dart
  15. 8
      packages/neon/neon/lib/src/blocs/unified_search.dart
  16. 2
      packages/neon/neon/lib/src/blocs/user_details.dart
  17. 4
      packages/neon/neon/lib/src/blocs/user_statuses.dart
  18. 2
      packages/neon/neon/lib/src/models/app_implementation.dart
  19. 6
      packages/neon/neon/lib/src/pages/home.dart
  20. 2
      packages/neon/neon/lib/src/pages/route_not_found.dart
  21. 4
      packages/neon/neon/lib/src/platform/platform.dart
  22. 2
      packages/neon/neon/lib/src/router.dart
  23. 4
      packages/neon/neon/lib/src/settings/models/options_collection.dart
  24. 18
      packages/neon/neon/lib/src/settings/models/storage.dart
  25. 2
      packages/neon/neon/lib/src/settings/widgets/settings_tile.dart
  26. 2
      packages/neon/neon/lib/src/utils/account_options.dart
  27. 4
      packages/neon/neon/lib/src/utils/global_options.dart
  28. 2
      packages/neon/neon/lib/src/utils/global_popups.dart
  29. 2
      packages/neon/neon/lib/src/utils/push_utils.dart
  30. 12
      packages/neon/neon/lib/src/utils/request_manager.dart
  31. 4
      packages/neon/neon/lib/src/widgets/app_bar.dart
  32. 2
      packages/neon/neon/lib/src/widgets/list_view.dart
  33. 4
      packages/neon/neon/test/option_test.dart
  34. 4
      packages/neon/neon/test/options_collection_test.dart
  35. 2
      packages/neon/neon_files/lib/blocs/browser.dart
  36. 4
      packages/neon/neon_files/lib/blocs/files.dart
  37. 4
      packages/neon/neon_files/lib/dialogs/choose_create.dart
  38. 2
      packages/neon/neon_files/lib/neon_files.dart
  39. 4
      packages/neon/neon_files/lib/utils/task.dart
  40. 4
      packages/neon/neon_news/lib/blocs/article.dart
  41. 4
      packages/neon/neon_news/lib/blocs/articles.dart
  42. 4
      packages/neon/neon_news/lib/blocs/news.dart
  43. 2
      packages/neon/neon_news/lib/neon_news.dart
  44. 2
      packages/neon/neon_news/lib/pages/article.dart
  45. 2
      packages/neon/neon_notes/lib/blocs/note.dart
  46. 4
      packages/neon/neon_notes/lib/blocs/notes.dart
  47. 2
      packages/neon/neon_notes/lib/neon_notes.dart
  48. 2
      packages/neon/neon_notifications/lib/blocs/notifications.dart
  49. 2
      packages/neon/neon_notifications/lib/neon_notifications.dart
  50. 1
      packages/neon_lints/lib/src/base.yaml
  51. 1
      packages/neon_lints/lint_maker.yaml
  52. 22
      packages/nextcloud/lib/src/api/news.openapi.dart
  53. 2
      packages/nextcloud/lib/src/webdav/client.dart
  54. 2
      packages/nextcloud/test/helper.dart
  55. 2
      packages/nextcloud/test/notifications_test.dart
  56. 4
      packages/nextcloud/test/settings_test.dart
  57. 2
      packages/sort_box/lib/sort_box.dart

10
packages/app/integration_test/screenshot_test.dart

@ -14,7 +14,7 @@ import 'package:neon/settings.dart';
import 'package:neon_files/widgets/actions.dart'; import 'package:neon_files/widgets/actions.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
Future runTestApp( Future<void> runTestApp(
final WidgetTester tester, final WidgetTester tester,
final IntegrationTestWidgetsFlutterBinding binding, { final IntegrationTestWidgetsFlutterBinding binding, {
final Account? account, final Account? account,
@ -30,18 +30,18 @@ Future runTestApp(
await tester.pumpAndSettle(); await tester.pumpAndSettle();
} }
Future openDrawer(final WidgetTester tester) async { Future<void> openDrawer(final WidgetTester tester) async {
await tester.tap(find.byTooltip('Open navigation menu')); await tester.tap(find.byTooltip('Open navigation menu'));
await tester.pumpAndSettle(); await tester.pumpAndSettle();
} }
Future switchPage(final WidgetTester tester, final String name) async { Future<void> switchPage(final WidgetTester tester, final String name) async {
await openDrawer(tester); await openDrawer(tester);
await tester.tap(find.text(name).last); await tester.tap(find.text(name).last);
await tester.pumpAndSettle(); await tester.pumpAndSettle();
} }
Future prepareScreenshot(final WidgetTester tester, final IntegrationTestWidgetsFlutterBinding binding) async { Future<void> prepareScreenshot(final WidgetTester tester, final IntegrationTestWidgetsFlutterBinding binding) async {
await binding.convertFlutterSurfaceToImage(); await binding.convertFlutterSurfaceToImage();
await tester.pumpAndSettle(); await tester.pumpAndSettle();
} }
@ -63,7 +63,7 @@ Future<Account> getAccount(final String username) async {
); );
} }
Future main() async { Future<void> main() async {
// The screenshots are pretty annoying on Android. See https://github.com/flutter/flutter/issues/92381 // The screenshots are pretty annoying on Android. See https://github.com/flutter/flutter/issues/92381
assert(Platform.isAndroid, 'Screenshots need to be taken on Android'); assert(Platform.isAndroid, 'Screenshots need to be taken on Android');

2
packages/app/lib/main.dart

@ -2,7 +2,7 @@ import 'package:app/apps.dart';
import 'package:app/branding.dart'; import 'package:app/branding.dart';
import 'package:neon/neon.dart'; import 'package:neon/neon.dart';
Future main() async { Future<void> main() async {
await runNeon( await runNeon(
appImplementations: appImplementations, appImplementations: appImplementations,
theme: neonTheme, theme: neonTheme,

2
packages/dynamite/dynamite/lib/src/builder/client.dart

@ -604,7 +604,7 @@ final _response = await ${isRootClient ? 'this' : '_rootClient'}.doRequest(
b.returns = refer('Future<$dataType>'); b.returns = refer('Future<$dataType>');
code.write('return $dataValue;'); code.write('return $dataValue;');
} else { } else {
b.returns = refer('Future'); b.returns = refer('Future<void>');
code.write('return;'); code.write('return;');
} }

2
packages/neon/neon/lib/neon.dart

@ -18,7 +18,7 @@ import 'package:neon/src/utils/user_agent.dart';
import 'package:package_info_plus/package_info_plus.dart'; import 'package:package_info_plus/package_info_plus.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
Future runNeon({ Future<void> runNeon({
required final Iterable<AppImplementation> appImplementations, required final Iterable<AppImplementation> appImplementations,
required final NeonTheme theme, required final NeonTheme theme,
@visibleForTesting final WidgetsBinding? bindingOverride, @visibleForTesting final WidgetsBinding? bindingOverride,

12
packages/neon/neon/lib/src/app.dart

@ -196,7 +196,7 @@ class _NeonAppState extends State<NeonApp> with WidgetsBindingObserver, tray.Tra
} }
@override @override
Future onWindowClose() async { Future<void> onWindowClose() async {
if (_globalOptions.startupMinimizeInsteadOfExit.value) { if (_globalOptions.startupMinimizeInsteadOfExit.value) {
await _saveAndMinimizeWindow(); await _saveAndMinimizeWindow();
} else { } else {
@ -205,11 +205,11 @@ class _NeonAppState extends State<NeonApp> with WidgetsBindingObserver, tray.Tra
} }
@override @override
Future onWindowMinimize() async { Future<void> onWindowMinimize() async {
await _saveAndMinimizeWindow(); await _saveAndMinimizeWindow();
} }
Future _handleShortcut(final String shortcutType) async { Future<void> _handleShortcut(final String shortcutType) async {
if (shortcutType == 'show_hide') { if (shortcutType == 'show_hide') {
if (NeonPlatform.instance.canUseWindowManager) { if (NeonPlatform.instance.canUseWindowManager) {
if (await windowManager.isVisible()) { if (await windowManager.isVisible()) {
@ -231,13 +231,13 @@ class _NeonAppState extends State<NeonApp> with WidgetsBindingObserver, tray.Tra
} }
} }
Future _openAppFromExternal(final Account account, final String id) async { Future<void> _openAppFromExternal(final Account account, final String id) async {
await _accountsBloc.getAppsBlocFor(account).setActiveApp(id); await _accountsBloc.getAppsBlocFor(account).setActiveApp(id);
_navigatorKey.currentState!.popUntil((final route) => route.settings.name == 'home'); _navigatorKey.currentState!.popUntil((final route) => route.settings.name == 'home');
await _showAndRestoreWindow(); await _showAndRestoreWindow();
} }
Future _saveAndMinimizeWindow() async { Future<void> _saveAndMinimizeWindow() async {
_lastBounds = await windowManager.getBounds(); _lastBounds = await windowManager.getBounds();
if (_globalOptions.systemTrayEnabled.value && _globalOptions.systemTrayHideToTrayWhenMinimized.value) { if (_globalOptions.systemTrayEnabled.value && _globalOptions.systemTrayHideToTrayWhenMinimized.value) {
await windowManager.hide(); await windowManager.hide();
@ -246,7 +246,7 @@ class _NeonAppState extends State<NeonApp> with WidgetsBindingObserver, tray.Tra
} }
} }
Future _showAndRestoreWindow() async { Future<void> _showAndRestoreWindow() async {
if (!NeonPlatform.instance.canUseWindowManager) { if (!NeonPlatform.instance.canUseWindowManager) {
return; return;
} }

6
packages/neon/neon/lib/src/bloc/bloc.dart

@ -17,7 +17,7 @@ abstract class InteractiveBloc extends Bloc {
final _errorsStreamController = StreamController<Object>(); final _errorsStreamController = StreamController<Object>();
late Stream<Object> errors = _errorsStreamController.stream.asBroadcastStream(); late Stream<Object> errors = _errorsStreamController.stream.asBroadcastStream();
Future refresh(); Future<void> refresh();
void addError(final Object error) { void addError(final Object error) {
_errorsStreamController.add(error); _errorsStreamController.add(error);
@ -25,9 +25,9 @@ abstract class InteractiveBloc extends Bloc {
// ignore: avoid_void_async // ignore: avoid_void_async
void wrapAction( void wrapAction(
final Future Function() call, { final Future<void> Function() call, {
final bool disableTimeout = false, final bool disableTimeout = false,
final Future Function()? refresh, final Future<void> Function()? refresh,
}) async { }) async {
try { try {
if (disableTimeout) { if (disableTimeout) {

10
packages/neon/neon/lib/src/blocs/apps.dart

@ -33,7 +33,7 @@ abstract class AppsBlocStates {
BehaviorSubject<AppImplementation> get activeApp; BehaviorSubject<AppImplementation> get activeApp;
BehaviorSubject get openNotifications; BehaviorSubject<void> get openNotifications;
BehaviorSubject<Iterable<(String, Object?)>?> get appVersions; BehaviorSubject<Iterable<(String, Object?)>?> get appVersions;
} }
@ -182,13 +182,13 @@ class AppsBloc extends InteractiveBloc implements AppsBlocEvents, AppsBlocStates
BehaviorSubject<Result<NotificationsAppInterface?>>(); BehaviorSubject<Result<NotificationsAppInterface?>>();
@override @override
BehaviorSubject openNotifications = BehaviorSubject(); BehaviorSubject<void> openNotifications = BehaviorSubject();
@override @override
BehaviorSubject<List<(String, Object?)>?> appVersions = BehaviorSubject(); BehaviorSubject<List<(String, Object?)>?> appVersions = BehaviorSubject();
@override @override
Future refresh() async { Future<void> refresh() async {
await RequestManager.instance await RequestManager.instance
.wrapNextcloud<List<CoreNavigationEntry>, CoreNavigationGetAppsNavigationResponseApplicationJson>( .wrapNextcloud<List<CoreNavigationEntry>, CoreNavigationGetAppsNavigationResponseApplicationJson>(
_account.id, _account.id,
@ -200,7 +200,7 @@ class AppsBloc extends InteractiveBloc implements AppsBlocEvents, AppsBlocStates
} }
@override @override
Future setActiveApp(final String appID, {final bool skipAlreadySet = false}) async { Future<void> setActiveApp(final String appID, {final bool skipAlreadySet = false}) async {
if (appID == AppIDs.notifications) { if (appID == AppIDs.notifications) {
openNotifications.add(null); openNotifications.add(null);
return; return;
@ -220,6 +220,6 @@ class AppsBloc extends InteractiveBloc implements AppsBlocEvents, AppsBlocStates
T getAppBloc<T extends Bloc>(final AppImplementation<T, dynamic> appImplementation) => T getAppBloc<T extends Bloc>(final AppImplementation<T, dynamic> appImplementation) =>
appImplementation.getBloc(_account); appImplementation.getBloc(_account);
List<Provider> get appBlocProviders => List<Provider<Bloc>> get appBlocProviders =>
_allAppImplementations.map((final appImplementation) => appImplementation.blocProvider).toList(); _allAppImplementations.map((final appImplementation) => appImplementation.blocProvider).toList();
} }

2
packages/neon/neon/lib/src/blocs/capabilities.dart

@ -35,7 +35,7 @@ class CapabilitiesBloc extends InteractiveBloc implements CapabilitiesBlocEvents
BehaviorSubject<Result<CoreOcsGetCapabilitiesResponseApplicationJson_Ocs_Data>>(); BehaviorSubject<Result<CoreOcsGetCapabilitiesResponseApplicationJson_Ocs_Data>>();
@override @override
Future refresh() async { Future<void> refresh() async {
await RequestManager.instance.wrapNextcloud<CoreOcsGetCapabilitiesResponseApplicationJson_Ocs_Data, await RequestManager.instance.wrapNextcloud<CoreOcsGetCapabilitiesResponseApplicationJson_Ocs_Data,
CoreOcsGetCapabilitiesResponseApplicationJson>( CoreOcsGetCapabilitiesResponseApplicationJson>(
_account.id, _account.id,

4
packages/neon/neon/lib/src/blocs/first_launch.dart

@ -8,7 +8,7 @@ import 'package:rxdart/rxdart.dart';
abstract class FirstLaunchBlocEvents {} abstract class FirstLaunchBlocEvents {}
abstract class FirstLaunchBlocStates { abstract class FirstLaunchBlocStates {
BehaviorSubject get onFirstLaunch; BehaviorSubject<void> get onFirstLaunch;
} }
@immutable @immutable
@ -31,5 +31,5 @@ class FirstLaunchBloc extends Bloc implements FirstLaunchBlocEvents, FirstLaunch
} }
@override @override
final BehaviorSubject onFirstLaunch = BehaviorSubject(); final BehaviorSubject<void> onFirstLaunch = BehaviorSubject();
} }

2
packages/neon/neon/lib/src/blocs/login_check_account.dart

@ -40,7 +40,7 @@ class LoginCheckAccountBloc extends InteractiveBloc
BehaviorSubject<Result<Account>> state = BehaviorSubject(); BehaviorSubject<Result<Account>> state = BehaviorSubject();
@override @override
Future refresh() async { Future<void> refresh() async {
state.add(Result.loading()); state.add(Result.loading());
try { try {

2
packages/neon/neon/lib/src/blocs/login_check_server_status.dart

@ -33,7 +33,7 @@ class LoginCheckServerStatusBloc extends InteractiveBloc
BehaviorSubject<Result<CoreStatus>> state = BehaviorSubject(); BehaviorSubject<Result<CoreStatus>> state = BehaviorSubject();
@override @override
Future refresh() async { Future<void> refresh() async {
state.add(Result.loading()); state.add(Result.loading());
try { try {

2
packages/neon/neon/lib/src/blocs/login_flow.dart

@ -45,7 +45,7 @@ class LoginFlowBloc extends InteractiveBloc implements LoginFlowBlocEvents, Logi
late Stream<CoreLoginFlowV2Credentials> result = _resultController.stream.asBroadcastStream(); late Stream<CoreLoginFlowV2Credentials> result = _resultController.stream.asBroadcastStream();
@override @override
Future refresh() async { Future<void> refresh() async {
try { try {
init.add(Result.loading()); init.add(Result.loading());

4
packages/neon/neon/lib/src/blocs/next_push.dart

@ -11,7 +11,7 @@ import 'package:rxdart/rxdart.dart';
abstract class NextPushBlocEvents {} abstract class NextPushBlocEvents {}
abstract class NextPushBlocStates { abstract class NextPushBlocStates {
BehaviorSubject get onNextPushSupported; BehaviorSubject<void> get onNextPushSupported;
} }
@internal @internal
@ -78,5 +78,5 @@ class NextPushBloc extends Bloc implements NextPushBlocEvents, NextPushBlocState
} }
@override @override
BehaviorSubject onNextPushSupported = BehaviorSubject(); BehaviorSubject<void> onNextPushSupported = BehaviorSubject();
} }

8
packages/neon/neon/lib/src/blocs/push_notifications.dart

@ -40,7 +40,7 @@ class PushNotificationsBloc extends Bloc implements PushNotificationsBlocEvents,
final GlobalOptions _globalOptions; final GlobalOptions _globalOptions;
final _notificationsController = StreamController<PushNotification>(); final _notificationsController = StreamController<PushNotification>();
StreamSubscription? _accountsListener; StreamSubscription<List<Account>>? _accountsListener;
@override @override
void dispose() { void dispose() {
@ -66,7 +66,7 @@ class PushNotificationsBloc extends Bloc implements PushNotificationsBlocEvents,
} }
} }
Future _setupUnifiedPush() async { Future<void> _setupUnifiedPush() async {
// We just use a single RSA keypair for all accounts // We just use a single RSA keypair for all accounts
final keypair = await PushUtils.loadRSAKeypair(); final keypair = await PushUtils.loadRSAKeypair();
@ -118,7 +118,7 @@ class PushNotificationsBloc extends Bloc implements PushNotificationsBlocEvents,
} }
} }
Future _unregisterUnifiedPushInstances(final List<Account> accounts) async { Future<void> _unregisterUnifiedPushInstances(final List<Account> accounts) async {
for (final account in accounts) { for (final account in accounts) {
try { try {
await account.client.notifications.push.removeDevice(); await account.client.notifications.push.removeDevice();
@ -130,7 +130,7 @@ class PushNotificationsBloc extends Bloc implements PushNotificationsBlocEvents,
} }
} }
Future _registerUnifiedPushInstances(final List<Account> accounts) async { Future<void> _registerUnifiedPushInstances(final List<Account> accounts) async {
// Notifications will only work on accounts with app password // Notifications will only work on accounts with app password
for (final account in accounts.where((final a) => a.password != null)) { for (final account in accounts.where((final a) => a.password != null)) {
await UnifiedPush.registerApp(account.id); await UnifiedPush.registerApp(account.id);

8
packages/neon/neon/lib/src/blocs/unified_search.dart

@ -56,12 +56,12 @@ class UnifiedSearchBloc extends InteractiveBloc implements UnifiedSearchBlocEven
} }
@override @override
Future refresh() async { Future<void> refresh() async {
await _search(); await _search();
} }
@override @override
Future search(final String term) async { Future<void> search(final String term) async {
_term = term.trim(); _term = term.trim();
await _search(); await _search();
} }
@ -78,7 +78,7 @@ class UnifiedSearchBloc extends InteractiveBloc implements UnifiedSearchBlocEven
_term = ''; _term = '';
} }
Future _search() async { Future<void> _search() async {
if (_term.isEmpty) { if (_term.isEmpty) {
results.add(Result.success(null)); results.add(Result.success(null));
return; return;
@ -108,7 +108,7 @@ class UnifiedSearchBloc extends InteractiveBloc implements UnifiedSearchBlocEven
} }
} }
Future _searchProvider(final CoreUnifiedSearchProvider provider) async { Future<void> _searchProvider(final CoreUnifiedSearchProvider provider) async {
_updateResults(provider, Result.loading()); _updateResults(provider, Result.loading());
try { try {
final response = await _account.client.core.unifiedSearch.search( final response = await _account.client.core.unifiedSearch.search(

2
packages/neon/neon/lib/src/blocs/user_details.dart

@ -35,7 +35,7 @@ class UserDetailsBloc extends InteractiveBloc implements UserDetailsBlocEvents,
BehaviorSubject<Result<ProvisioningApiUserDetails>>(); BehaviorSubject<Result<ProvisioningApiUserDetails>>();
@override @override
Future refresh() async { Future<void> refresh() async {
await RequestManager.instance await RequestManager.instance
.wrapNextcloud<ProvisioningApiUserDetails, ProvisioningApiUsersGetCurrentUserResponseApplicationJson>( .wrapNextcloud<ProvisioningApiUserDetails, ProvisioningApiUsersGetCurrentUserResponseApplicationJson>(
_account.id, _account.id,

4
packages/neon/neon/lib/src/blocs/user_statuses.dart

@ -43,14 +43,14 @@ class UserStatusesBloc extends InteractiveBloc implements UserStatusesBlocEvents
BehaviorSubject<Map<String, Result<UserStatusPublicInterface?>>>(); BehaviorSubject<Map<String, Result<UserStatusPublicInterface?>>>();
@override @override
Future refresh() async { Future<void> refresh() async {
for (final username in _statuses.keys) { for (final username in _statuses.keys) {
await load(username, force: true); await load(username, force: true);
} }
} }
@override @override
Future load(final String username, {final bool force = false}) async { Future<void> load(final String username, {final bool force = false}) async {
if (!force && _statuses.containsKey(username)) { if (!force && _statuses.containsKey(username)) {
return; return;
} }

2
packages/neon/neon/lib/src/models/app_implementation.dart

@ -18,7 +18,7 @@ abstract class AppImplementation<T extends Bloc, R extends NextcloudAppOptions>
AppImplementation(); AppImplementation();
String get id; String get id;
LocalizationsDelegate get localizationsDelegate; LocalizationsDelegate<Object> get localizationsDelegate;
List<Locale> get supportedLocales; List<Locale> get supportedLocales;
String nameFromLocalization(final AppLocalizations localizations) => localizations.appImplementationName(id); String nameFromLocalization(final AppLocalizations localizations) => localizations.appImplementationName(id);

6
packages/neon/neon/lib/src/pages/home.dart

@ -32,7 +32,7 @@ class _HomePageState extends State<HomePage> {
late GlobalOptions _globalOptions; late GlobalOptions _globalOptions;
late AccountsBloc _accountsBloc; late AccountsBloc _accountsBloc;
late AppsBloc _appsBloc; late AppsBloc _appsBloc;
late StreamSubscription _versionCheckSubscription; late StreamSubscription<List<(String, Object?)>?> _versionCheckSubscription;
@override @override
void initState() { void initState() {
@ -76,7 +76,7 @@ class _HomePageState extends State<HomePage> {
super.dispose(); super.dispose();
} }
Future _checkMaintenanceMode() async { Future<void> _checkMaintenanceMode() async {
try { try {
final status = await _account.client.core.getStatus(); final status = await _account.client.core.getStatus();
if (status.maintenance && mounted) { if (status.maintenance && mounted) {
@ -93,7 +93,7 @@ class _HomePageState extends State<HomePage> {
} }
} }
Future _showProblem(final String title) async { Future<void> _showProblem(final String title) async {
final colorScheme = Theme.of(context).colorScheme; final colorScheme = Theme.of(context).colorScheme;
await showDialog( await showDialog(

2
packages/neon/neon/lib/src/pages/route_not_found.dart

@ -27,7 +27,7 @@ class _RouteNotFoundPageState extends State<RouteNotFoundPage> {
unawaited(_checkLaunchable()); unawaited(_checkLaunchable());
} }
Future _checkLaunchable() async { Future<void> _checkLaunchable() async {
final accountsBloc = Provider.of<AccountsBloc>(context, listen: false); final accountsBloc = Provider.of<AccountsBloc>(context, listen: false);
if (!accountsBloc.hasAccounts) { if (!accountsBloc.hasAccounts) {
return; return;

4
packages/neon/neon/lib/src/platform/platform.dart

@ -16,7 +16,7 @@ abstract interface class NeonPlatform {
/// Infers and configures the platform automatically. /// Infers and configures the platform automatically.
/// ///
/// Required to be called before accessing [NeonPlatform.instance]. /// Required to be called before accessing [NeonPlatform.instance].
static Future setup() async { static Future<void> setup() async {
if (Platform.isAndroid) { if (Platform.isAndroid) {
_platform = const AndroidNeonPlatform(); _platform = const AndroidNeonPlatform();
} else if (Platform.isLinux) { } else if (Platform.isLinux) {
@ -55,5 +55,5 @@ abstract interface class NeonPlatform {
FutureOr<String> get userAccessibleAppDataPath; FutureOr<String> get userAccessibleAppDataPath;
FutureOr init(); FutureOr<void> init();
} }

2
packages/neon/neon/lib/src/router.dart

@ -62,7 +62,7 @@ class AppRouter extends GoRouter {
routes: $appRoutes, routes: $appRoutes,
); );
static Page _buildErrorPage(final BuildContext context, final GoRouterState state) => MaterialPage( static Page<void> _buildErrorPage(final BuildContext context, final GoRouterState state) => MaterialPage(
child: RouteNotFoundPage( child: RouteNotFoundPage(
uri: state.uri, uri: state.uri,
), ),

4
packages/neon/neon/lib/src/settings/models/options_collection.dart

@ -14,7 +14,7 @@ abstract class OptionsCollection implements Exportable {
/// Collection of options. /// Collection of options.
@protected @protected
Iterable<Option> get options; Iterable<Option<dynamic>> get options;
/// Resets all [options]. /// Resets all [options].
/// ///
@ -61,5 +61,5 @@ abstract class NextcloudAppOptions extends OptionsCollection {
late final Iterable<OptionsCategory> categories; late final Iterable<OptionsCategory> categories;
@override @override
late final Iterable<Option> options; late final Iterable<Option<dynamic>> options;
} }

18
packages/neon/neon/lib/src/settings/models/storage.dart

@ -6,12 +6,12 @@ import 'package:shared_preferences/shared_preferences.dart';
abstract interface class SettingsStorage { abstract interface class SettingsStorage {
String? getString(final String key); String? getString(final String key);
Future setString(final String key, final String value); Future<bool> setString(final String key, final String value);
bool? getBool(final String key); bool? getBool(final String key);
// ignore: avoid_positional_boolean_parameters // ignore: avoid_positional_boolean_parameters
Future setBool(final String key, final bool value); Future<bool> setBool(final String key, final bool value);
Future<bool> remove(final String key); Future<bool> remove(final String key);
} }
@ -53,7 +53,7 @@ final class NeonStorage {
/// Sets up the [SharedPreferences] instance. /// Sets up the [SharedPreferences] instance.
/// ///
/// Required to be called before accessing [database]. /// Required to be called before accessing [database].
static Future init() async { static Future<void> init() async {
if (_sharedPreferences != null) { if (_sharedPreferences != null) {
return; return;
} }
@ -86,16 +86,16 @@ final class SingleValueStorage {
String? getString() => NeonStorage.database.getString(key.value); String? getString() => NeonStorage.database.getString(key.value);
Future setString(final String value) => NeonStorage.database.setString(key.value, value); Future<bool> setString(final String value) => NeonStorage.database.setString(key.value, value);
bool? getBool() => NeonStorage.database.getBool(key.value); bool? getBool() => NeonStorage.database.getBool(key.value);
// ignore: avoid_positional_boolean_parameters // ignore: avoid_positional_boolean_parameters
Future setBool(final bool value) => NeonStorage.database.setBool(key.value, value); Future<bool> setBool(final bool value) => NeonStorage.database.setBool(key.value, value);
List<String>? getStringList() => NeonStorage.database.getStringList(key.value); List<String>? getStringList() => NeonStorage.database.getStringList(key.value);
Future setStringList(final List<String> value) => NeonStorage.database.setStringList(key.value, value); Future<bool> setStringList(final List<String> value) => NeonStorage.database.setStringList(key.value, value);
} }
@immutable @immutable
@ -130,16 +130,16 @@ final class AppStorage implements SettingsStorage {
String? getString(final String key) => NeonStorage.database.getString(formatKey(key)); String? getString(final String key) => NeonStorage.database.getString(formatKey(key));
@override @override
Future setString(final String key, final String value) => NeonStorage.database.setString(formatKey(key), value); Future<bool> setString(final String key, final String value) => NeonStorage.database.setString(formatKey(key), value);
@override @override
bool? getBool(final String key) => NeonStorage.database.getBool(formatKey(key)); bool? getBool(final String key) => NeonStorage.database.getBool(formatKey(key));
@override @override
Future setBool(final String key, final bool value) => NeonStorage.database.setBool(formatKey(key), value); Future<bool> setBool(final String key, final bool value) => NeonStorage.database.setBool(formatKey(key), value);
List<String>? getStringList(final String key) => NeonStorage.database.getStringList(formatKey(key)); List<String>? getStringList(final String key) => NeonStorage.database.getStringList(formatKey(key));
Future setStringList(final String key, final List<String> value) => Future<bool> setStringList(final String key, final List<String> value) =>
NeonStorage.database.setStringList(formatKey(key), value); NeonStorage.database.setStringList(formatKey(key), value);
} }

2
packages/neon/neon/lib/src/settings/widgets/settings_tile.dart

@ -10,7 +10,7 @@ abstract class SettingsTile extends StatelessWidget {
} }
@internal @internal
abstract class InputSettingsTile<T extends Option> extends SettingsTile { abstract class InputSettingsTile<T extends Option<dynamic>> extends SettingsTile {
const InputSettingsTile({ const InputSettingsTile({
required this.option, required this.option,
super.key, super.key,

2
packages/neon/neon/lib/src/utils/account_options.dart

@ -30,7 +30,7 @@ class AccountSpecificOptions extends OptionsCollection {
final AppsBloc _appsBloc; final AppsBloc _appsBloc;
@override @override
late final List<Option> options = [ late final List<Option<dynamic>> options = [
initialApp, initialApp,
]; ];

4
packages/neon/neon/lib/src/utils/global_options.dart

@ -68,7 +68,7 @@ class GlobalOptions extends OptionsCollection {
}; };
@override @override
late final List<Option> options = [ late final List<Option<dynamic>> options = [
themeMode, themeMode,
themeOLEDAsDark, themeOLEDAsDark,
themeKeepOriginalAccentColor, themeKeepOriginalAccentColor,
@ -101,7 +101,7 @@ class GlobalOptions extends OptionsCollection {
} }
} }
Future updateDistributors(final List<String> distributors) async { Future<void> updateDistributors(final List<String> distributors) async {
pushNotificationsDistributor.values = { pushNotificationsDistributor.values = {
for (final distributor in distributors) ...{ for (final distributor in distributors) ...{
distributor: _distributorsMap[distributor] ?? (final _) => distributor, distributor: _distributorsMap[distributor] ?? (final _) => distributor,

2
packages/neon/neon/lib/src/utils/global_popups.dart

@ -26,7 +26,7 @@ class GlobalPopups {
bool _registered = false; bool _registered = false;
late BuildContext _context; late BuildContext _context;
final _subscriptions = <StreamSubscription>[]; final _subscriptions = <StreamSubscription<dynamic>>[];
void dispose() { void dispose() {
for (final subscription in _subscriptions) { for (final subscription in _subscriptions) {

2
packages/neon/neon/lib/src/utils/push_utils.dart

@ -58,7 +58,7 @@ class PushUtils {
return localNotificationsPlugin; return localNotificationsPlugin;
} }
static Future onMessage(final Uint8List messages, final String instance) async { static Future<void> onMessage(final Uint8List messages, final String instance) async {
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();
final localNotificationsPlugin = await initLocalNotifications( final localNotificationsPlugin = await initLocalNotifications(

12
packages/neon/neon/lib/src/utils/request_manager.dart

@ -22,14 +22,14 @@ class RequestManager {
// ignore: prefer_constructors_over_static_methods // ignore: prefer_constructors_over_static_methods
static RequestManager get instance => _requestManager ??= RequestManager(); static RequestManager get instance => _requestManager ??= RequestManager();
Future initCache() async { Future<void> initCache() async {
_cache = Cache(); _cache = Cache();
await _cache!.init(); await _cache!.init();
} }
Cache? _cache; Cache? _cache;
Future wrapNextcloud<T, R>( Future<void> wrapNextcloud<T, R>(
final String clientID, final String clientID,
final String k, final String k,
final BehaviorSubject<Result<T>> subject, final BehaviorSubject<Result<T>> subject,
@ -51,7 +51,7 @@ class RequestManager {
0, 0,
); );
Future wrapWebDav<T>( Future<void> wrapWebDav<T>(
final String clientID, final String clientID,
final String k, final String k,
final BehaviorSubject<Result<T>> subject, final BehaviorSubject<Result<T>> subject,
@ -73,7 +73,7 @@ class RequestManager {
0, 0,
); );
Future _wrap<T, R>( Future<void> _wrap<T, R>(
final String clientID, final String clientID,
final String k, final String k,
final BehaviorSubject<Result<T>> subject, final BehaviorSubject<Result<T>> subject,
@ -189,7 +189,7 @@ class RequestManager {
class Cache { class Cache {
Database? _database; Database? _database;
Future init() async { Future<void> init() async {
if (_database != null) { if (_database != null) {
return; return;
} }
@ -210,7 +210,7 @@ class Cache {
Future<String?> get(final String key) async => Future<String?> get(final String key) async =>
(await _database!.rawQuery('SELECT value FROM cache WHERE key = ?', [key]))[0]['value'] as String?; (await _database!.rawQuery('SELECT value FROM cache WHERE key = ?', [key]))[0]['value'] as String?;
Future set(final String key, final String value) async => _database!.rawQuery( Future<void> set(final String key, final String value) async => _database!.rawQuery(
'INSERT INTO cache (key, value) VALUES (?, ?) ON CONFLICT(key) DO UPDATE SET value = excluded.value', 'INSERT INTO cache (key, value) VALUES (?, ?) ON CONFLICT(key) DO UPDATE SET value = excluded.value',
[key, value], [key, value],
); );

4
packages/neon/neon/lib/src/widgets/app_bar.dart

@ -36,7 +36,7 @@ class _NeonAppBarState extends State<NeonAppBar> {
final _searchBarFocusNode = FocusNode(); final _searchBarFocusNode = FocusNode();
final _searchTermController = StreamController<String>(); final _searchTermController = StreamController<String>();
late final StreamSubscription _searchTermSubscription; late final StreamSubscription<String> _searchTermSubscription;
@override @override
void initState() { void initState() {
@ -181,7 +181,7 @@ class _NotificationIconButtonState extends State<NotificationIconButton> {
late AppsBloc _appsBloc; late AppsBloc _appsBloc;
late List<Account> _accounts; late List<Account> _accounts;
late Account _account; late Account _account;
late StreamSubscription notificationSubscription; late StreamSubscription<void> notificationSubscription;
@override @override
void initState() { void initState() {

2
packages/neon/neon/lib/src/widgets/list_view.dart

@ -19,7 +19,7 @@ class NeonListView<T> extends StatelessWidget {
final Iterable<T>? items; final Iterable<T>? items;
final bool isLoading; final bool isLoading;
final dynamic error; final dynamic error;
final Future Function() onRefresh; final Future<void> Function() onRefresh;
final Widget Function(BuildContext, T data) builder; final Widget Function(BuildContext, T data) builder;
final String? scrollKey; final String? scrollKey;
final bool withFloatingActionButton; final bool withFloatingActionButton;

4
packages/neon/neon/test/option_test.dart

@ -45,7 +45,7 @@ void main() {
late SelectOption<SelectValues> option; late SelectOption<SelectValues> option;
setUp(() { setUp(() {
when(() => storage.setString(key.value, any())).thenAnswer((final _) async {}); when(() => storage.setString(key.value, any())).thenAnswer((final _) async => true);
when(() => storage.remove(key.value)).thenAnswer((final _) async => true); when(() => storage.remove(key.value)).thenAnswer((final _) async => true);
option = SelectOption<SelectValues>( option = SelectOption<SelectValues>(
@ -209,7 +209,7 @@ void main() {
late ToggleOption option; late ToggleOption option;
setUp(() { setUp(() {
when(() => storage.setBool(key.value, any())).thenAnswer((final _) async {}); when(() => storage.setBool(key.value, any())).thenAnswer((final _) async => true);
when(() => storage.remove(key.value)).thenAnswer((final _) async => true); when(() => storage.remove(key.value)).thenAnswer((final _) async => true);
option = ToggleOption( option = ToggleOption(

4
packages/neon/neon/test/options_collection_test.dart

@ -5,10 +5,10 @@ import 'package:neon/src/settings/models/storage.dart';
import 'package:test/test.dart'; import 'package:test/test.dart';
// ignore: missing_override_of_must_be_overridden // ignore: missing_override_of_must_be_overridden
class OptionMock extends Mock implements Option {} class OptionMock extends Mock implements Option<Object> {}
class Collection extends NextcloudAppOptions { class Collection extends NextcloudAppOptions {
Collection(final List<Option> options) : super(const AppStorage(StorageKeys.apps)) { Collection(final List<Option<Object>> options) : super(const AppStorage(StorageKeys.apps)) {
super.options = options; super.options = options;
} }
} }

2
packages/neon/neon_files/lib/blocs/browser.dart

@ -37,7 +37,7 @@ class FilesBrowserBloc extends InteractiveBloc implements FilesBrowserBlocEvents
BehaviorSubject<List<String>> path = BehaviorSubject<List<String>>.seeded([]); BehaviorSubject<List<String>> path = BehaviorSubject<List<String>>.seeded([]);
@override @override
Future refresh() async { Future<void> refresh() async {
await RequestManager.instance.wrapWebDav<List<WebDavFile>>( await RequestManager.instance.wrapWebDav<List<WebDavFile>>(
account.id, account.id,
'files-${path.value.join('/')}', 'files-${path.value.join('/')}',

4
packages/neon/neon_files/lib/blocs/files.dart

@ -103,7 +103,7 @@ class FilesBloc extends InteractiveBloc implements FilesBlocEvents, FilesBlocSta
} }
@override @override
Future refresh() async { Future<void> refresh() async {
await browser.refresh(); await browser.refresh();
} }
@ -164,7 +164,7 @@ class FilesBloc extends InteractiveBloc implements FilesBlocEvents, FilesBlocSta
); );
} }
Future _downloadFile( Future<void> _downloadFile(
final List<String> path, final List<String> path,
final File file, final File file,
) async { ) async {

4
packages/neon/neon_files/lib/dialogs/choose_create.dart

@ -15,7 +15,7 @@ class FilesChooseCreateDialog extends StatefulWidget {
} }
class _FilesChooseCreateDialogState extends State<FilesChooseCreateDialog> { class _FilesChooseCreateDialogState extends State<FilesChooseCreateDialog> {
Future uploadFromPick(final FileType type) async { Future<void> uploadFromPick(final FileType type) async {
final result = await FilePicker.platform.pickFiles( final result = await FilePicker.platform.pickFiles(
allowMultiple: true, allowMultiple: true,
type: type, type: type,
@ -27,7 +27,7 @@ class _FilesChooseCreateDialogState extends State<FilesChooseCreateDialog> {
} }
} }
Future upload(final File file) async { Future<void> upload(final File file) async {
final sizeWarning = widget.bloc.options.uploadSizeWarning.value; final sizeWarning = widget.bloc.options.uploadSizeWarning.value;
if (sizeWarning != null) { if (sizeWarning != null) {
final stat = file.statSync(); final stat = file.statSync();

2
packages/neon/neon_files/lib/neon_files.dart

@ -52,7 +52,7 @@ class FilesApp extends AppImplementation<FilesBloc, FilesAppSpecificOptions> {
final String id = AppIDs.files; final String id = AppIDs.files;
@override @override
final LocalizationsDelegate localizationsDelegate = AppLocalizations.delegate; final LocalizationsDelegate<AppLocalizations> localizationsDelegate = AppLocalizations.delegate;
@override @override
final List<Locale> supportedLocales = AppLocalizations.supportedLocales; final List<Locale> supportedLocales = AppLocalizations.supportedLocales;

4
packages/neon/neon_files/lib/utils/task.dart

@ -23,7 +23,7 @@ class FilesDownloadTask extends FilesTask {
required super.file, required super.file,
}); });
Future execute(final NextcloudClient client) async { Future<void> execute(final NextcloudClient client) async {
await client.webdav.getFile( await client.webdav.getFile(
Uri(pathSegments: path), Uri(pathSegments: path),
file, file,
@ -43,7 +43,7 @@ class FilesUploadTask extends FilesTask {
FileStat? _stat; FileStat? _stat;
FileStat get stat => _stat ??= file.statSync(); FileStat get stat => _stat ??= file.statSync();
Future execute(final NextcloudClient client) async { Future<void> execute(final NextcloudClient client) async {
await client.webdav.putFile( await client.webdav.putFile(
file, file,
stat, stat,

4
packages/neon/neon_news/lib/blocs/article.dart

@ -44,7 +44,7 @@ class NewsArticleBloc extends InteractiveBloc implements NewsArticleBlocEvents,
BehaviorSubject<bool> unread = BehaviorSubject<bool>(); BehaviorSubject<bool> unread = BehaviorSubject<bool>();
@override @override
Future refresh() async {} Future<void> refresh() async {}
@override @override
void markArticleAsRead() { void markArticleAsRead() {
@ -78,7 +78,7 @@ class NewsArticleBloc extends InteractiveBloc implements NewsArticleBlocEvents,
}); });
} }
void _wrapArticleAction(final Future Function() call) => wrapAction( void _wrapArticleAction(final Future<void> Function() call) => wrapAction(
call, call,
refresh: () async { refresh: () async {
await _newsArticlesBloc.refresh(); await _newsArticlesBloc.refresh();

4
packages/neon/neon_news/lib/blocs/articles.dart

@ -75,14 +75,14 @@ class NewsArticlesBloc extends InteractiveBloc implements NewsArticlesBlocEvents
BehaviorSubject<FilterType> filterType = BehaviorSubject<FilterType>(); BehaviorSubject<FilterType> filterType = BehaviorSubject<FilterType>();
@override @override
Future refresh() async { Future<void> refresh() async {
if (this is! NewsMainArticlesBloc) { if (this is! NewsMainArticlesBloc) {
await reload(); await reload();
} }
await _newsBloc.refresh(); await _newsBloc.refresh();
} }
Future reload() async { Future<void> reload() async {
// The API for pagination is pretty useless in this case sadly. So no pagination for us :( // The API for pagination is pretty useless in this case sadly. So no pagination for us :(
// https://github.com/nextcloud/news/blob/master/docs/api/api-v1-2.md#get-items // https://github.com/nextcloud/news/blob/master/docs/api/api-v1-2.md#get-items

4
packages/neon/neon_news/lib/blocs/news.dart

@ -90,7 +90,7 @@ class NewsBloc extends InteractiveBloc implements NewsBlocEvents, NewsBlocStates
late BehaviorSubject<FilterType> filterType = mainArticlesBloc.filterType; late BehaviorSubject<FilterType> filterType = mainArticlesBloc.filterType;
@override @override
Future refresh() async { Future<void> refresh() async {
await Future.wait([ await Future.wait([
RequestManager.instance.wrapNextcloud<List<NewsFolder>, NewsListFolders>( RequestManager.instance.wrapNextcloud<List<NewsFolder>, NewsListFolders>(
account.id, account.id,
@ -187,7 +187,7 @@ class NewsBloc extends InteractiveBloc implements NewsBlocEvents, NewsBlocStates
} }
@override @override
Future reload() async { Future<void> reload() async {
await mainArticlesBloc.reload(); await mainArticlesBloc.reload();
} }
} }

2
packages/neon/neon_news/lib/neon_news.dart

@ -59,7 +59,7 @@ class NewsApp extends AppImplementation<NewsBloc, NewsAppSpecificOptions> {
final String id = AppIDs.news; final String id = AppIDs.news;
@override @override
final LocalizationsDelegate localizationsDelegate = AppLocalizations.delegate; final LocalizationsDelegate<AppLocalizations> localizationsDelegate = AppLocalizations.delegate;
@override @override
final List<Locale> supportedLocales = AppLocalizations.supportedLocales; final List<Locale> supportedLocales = AppLocalizations.supportedLocales;

2
packages/neon/neon_news/lib/pages/article.dart

@ -63,7 +63,7 @@ class _NewsArticlePageState extends State<NewsArticlePage> {
super.dispose(); super.dispose();
} }
Future _startMarkAsReadTimer() async { Future<void> _startMarkAsReadTimer() async {
if (await widget.bloc.unread.first) { if (await widget.bloc.unread.first) {
if (widget.articlesBloc.options.articleDisableMarkAsReadTimeoutOption.value) { if (widget.articlesBloc.options.articleDisableMarkAsReadTimeoutOption.value) {
widget.bloc.markArticleAsRead(); widget.bloc.markArticleAsRead();

2
packages/neon/neon_notes/lib/blocs/note.dart

@ -62,7 +62,7 @@ class NotesNoteBloc extends InteractiveBloc implements NotesNoteBlocEvents, Note
BehaviorSubject<String> category = BehaviorSubject<String>(); BehaviorSubject<String> category = BehaviorSubject<String>();
@override @override
Future refresh() async {} Future<void> refresh() async {}
@override @override
void updateCategory(final String category) { void updateCategory(final String category) {

4
packages/neon/neon_notes/lib/blocs/notes.dart

@ -43,8 +43,8 @@ class NotesBloc extends InteractiveBloc implements NotesBlocEvents, NotesBlocSta
BehaviorSubject<Result<List<NotesNote>>> notes = BehaviorSubject<Result<List<NotesNote>>>(); BehaviorSubject<Result<List<NotesNote>>> notes = BehaviorSubject<Result<List<NotesNote>>>();
@override @override
Future refresh() async { Future<void> refresh() async {
await RequestManager.instance.wrapNextcloud<List<NotesNote>, BuiltList>( await RequestManager.instance.wrapNextcloud<List<NotesNote>, BuiltList<NotesNote>>(
account.id, account.id,
'notes-notes', 'notes-notes',
notes, notes,

2
packages/neon/neon_notes/lib/neon_notes.dart

@ -52,7 +52,7 @@ class NotesApp extends AppImplementation<NotesBloc, NotesAppSpecificOptions> {
final List<Locale> supportedLocales = AppLocalizations.supportedLocales; final List<Locale> supportedLocales = AppLocalizations.supportedLocales;
@override @override
final LocalizationsDelegate localizationsDelegate = AppLocalizations.delegate; final LocalizationsDelegate<AppLocalizations> localizationsDelegate = AppLocalizations.delegate;
@override @override
late final NotesAppSpecificOptions options = NotesAppSpecificOptions(storage); late final NotesAppSpecificOptions options = NotesAppSpecificOptions(storage);

2
packages/neon/neon_notifications/lib/blocs/notifications.dart

@ -49,7 +49,7 @@ class NotificationsBloc extends InteractiveBloc
BehaviorSubject<int> unreadCounter = BehaviorSubject<int>(); BehaviorSubject<int> unreadCounter = BehaviorSubject<int>();
@override @override
Future refresh() async { Future<void> refresh() async {
await RequestManager.instance await RequestManager.instance
.wrapNextcloud<List<NotificationsNotification>, NotificationsEndpointListNotificationsResponseApplicationJson>( .wrapNextcloud<List<NotificationsNotification>, NotificationsEndpointListNotificationsResponseApplicationJson>(
_account.id, _account.id,

2
packages/neon/neon_notifications/lib/neon_notifications.dart

@ -29,7 +29,7 @@ class NotificationsApp extends AppImplementation<NotificationsBloc, Notification
final String id = AppIDs.notifications; final String id = AppIDs.notifications;
@override @override
final LocalizationsDelegate localizationsDelegate = AppLocalizations.delegate; final LocalizationsDelegate<AppLocalizations> localizationsDelegate = AppLocalizations.delegate;
@override @override
final List<Locale> supportedLocales = AppLocalizations.supportedLocales; final List<Locale> supportedLocales = AppLocalizations.supportedLocales;

1
packages/neon_lints/lib/src/base.yaml

@ -1,6 +1,7 @@
analyzer: analyzer:
language: language:
strict-casts: true strict-casts: true
strict-raw-types: true
errors: errors:
flutter_style_todos: ignore flutter_style_todos: ignore
todo: ignore todo: ignore

1
packages/neon_lints/lint_maker.yaml

@ -19,6 +19,7 @@ dart:
analyzer: analyzer:
language: language:
strict-casts: true strict-casts: true
strict-raw-types: true
errors: errors:
flutter_style_todos: ignore flutter_style_todos: ignore
todo: ignore todo: ignore

22
packages/nextcloud/lib/src/api/news.openapi.dart

@ -154,7 +154,7 @@ class NewsClient extends DynamiteClient {
throw await NewsApiException.fromResponse(response); // coverage:ignore-line throw await NewsApiException.fromResponse(response); // coverage:ignore-line
} }
Future renameFolder({ Future<void> renameFolder({
required final int folderId, required final int folderId,
required final String name, required final String name,
}) async { }) async {
@ -183,7 +183,7 @@ class NewsClient extends DynamiteClient {
throw await NewsApiException.fromResponse(response); // coverage:ignore-line throw await NewsApiException.fromResponse(response); // coverage:ignore-line
} }
Future deleteFolder({required final int folderId}) async { Future<void> deleteFolder({required final int folderId}) async {
var path = '/index.php/apps/news/api/v1-3/folders/{folderId}'; var path = '/index.php/apps/news/api/v1-3/folders/{folderId}';
final queryParameters = <String, dynamic>{}; final queryParameters = <String, dynamic>{};
final headers = <String, String>{}; final headers = <String, String>{};
@ -208,7 +208,7 @@ class NewsClient extends DynamiteClient {
throw await NewsApiException.fromResponse(response); // coverage:ignore-line throw await NewsApiException.fromResponse(response); // coverage:ignore-line
} }
Future markFolderAsRead({ Future<void> markFolderAsRead({
required final int folderId, required final int folderId,
required final int newestItemId, required final int newestItemId,
}) async { }) async {
@ -298,7 +298,7 @@ class NewsClient extends DynamiteClient {
throw await NewsApiException.fromResponse(response); // coverage:ignore-line throw await NewsApiException.fromResponse(response); // coverage:ignore-line
} }
Future deleteFeed({required final int feedId}) async { Future<void> deleteFeed({required final int feedId}) async {
var path = '/index.php/apps/news/api/v1-3/feeds/{feedId}'; var path = '/index.php/apps/news/api/v1-3/feeds/{feedId}';
final queryParameters = <String, dynamic>{}; final queryParameters = <String, dynamic>{};
final headers = <String, String>{}; final headers = <String, String>{};
@ -323,7 +323,7 @@ class NewsClient extends DynamiteClient {
throw await NewsApiException.fromResponse(response); // coverage:ignore-line throw await NewsApiException.fromResponse(response); // coverage:ignore-line
} }
Future moveFeed({ Future<void> moveFeed({
required final int feedId, required final int feedId,
final int? folderId, final int? folderId,
}) async { }) async {
@ -354,7 +354,7 @@ class NewsClient extends DynamiteClient {
throw await NewsApiException.fromResponse(response); // coverage:ignore-line throw await NewsApiException.fromResponse(response); // coverage:ignore-line
} }
Future renameFeed({ Future<void> renameFeed({
required final int feedId, required final int feedId,
required final String feedTitle, required final String feedTitle,
}) async { }) async {
@ -383,7 +383,7 @@ class NewsClient extends DynamiteClient {
throw await NewsApiException.fromResponse(response); // coverage:ignore-line throw await NewsApiException.fromResponse(response); // coverage:ignore-line
} }
Future markFeedAsRead({ Future<void> markFeedAsRead({
required final int feedId, required final int feedId,
required final int newestItemId, required final int newestItemId,
}) async { }) async {
@ -504,7 +504,7 @@ class NewsClient extends DynamiteClient {
throw await NewsApiException.fromResponse(response); // coverage:ignore-line throw await NewsApiException.fromResponse(response); // coverage:ignore-line
} }
Future markArticleAsRead({required final int itemId}) async { Future<void> markArticleAsRead({required final int itemId}) async {
var path = '/index.php/apps/news/api/v1-3/items/{itemId}/read'; var path = '/index.php/apps/news/api/v1-3/items/{itemId}/read';
final queryParameters = <String, dynamic>{}; final queryParameters = <String, dynamic>{};
final headers = <String, String>{}; final headers = <String, String>{};
@ -529,7 +529,7 @@ class NewsClient extends DynamiteClient {
throw await NewsApiException.fromResponse(response); // coverage:ignore-line throw await NewsApiException.fromResponse(response); // coverage:ignore-line
} }
Future markArticleAsUnread({required final int itemId}) async { Future<void> markArticleAsUnread({required final int itemId}) async {
var path = '/index.php/apps/news/api/v1-3/items/{itemId}/unread'; var path = '/index.php/apps/news/api/v1-3/items/{itemId}/unread';
final queryParameters = <String, dynamic>{}; final queryParameters = <String, dynamic>{};
final headers = <String, String>{}; final headers = <String, String>{};
@ -554,7 +554,7 @@ class NewsClient extends DynamiteClient {
throw await NewsApiException.fromResponse(response); // coverage:ignore-line throw await NewsApiException.fromResponse(response); // coverage:ignore-line
} }
Future starArticle({required final int itemId}) async { Future<void> starArticle({required final int itemId}) async {
var path = '/index.php/apps/news/api/v1-3/items/{itemId}/star'; var path = '/index.php/apps/news/api/v1-3/items/{itemId}/star';
final queryParameters = <String, dynamic>{}; final queryParameters = <String, dynamic>{};
final headers = <String, String>{}; final headers = <String, String>{};
@ -579,7 +579,7 @@ class NewsClient extends DynamiteClient {
throw await NewsApiException.fromResponse(response); // coverage:ignore-line throw await NewsApiException.fromResponse(response); // coverage:ignore-line
} }
Future unstarArticle({required final int itemId}) async { Future<void> unstarArticle({required final int itemId}) async {
var path = '/index.php/apps/news/api/v1-3/items/{itemId}/unstar'; var path = '/index.php/apps/news/api/v1-3/items/{itemId}/unstar';
final queryParameters = <String, dynamic>{}; final queryParameters = <String, dynamic>{};
final headers = <String, String>{}; final headers = <String, String>{};

2
packages/nextcloud/lib/src/webdav/client.dart

@ -214,7 +214,7 @@ class WebDavClient {
); );
/// Gets the content of the file at [path]. /// Gets the content of the file at [path].
Future getFile( Future<void> getFile(
final Uri path, final Uri path,
final File file, { final File file, {
final Function(double progress)? onProgress, final Function(double progress)? onProgress,

2
packages/nextcloud/test/helper.dart

@ -20,7 +20,7 @@ class DockerContainer {
final int port; final int port;
Future runOccCommand(final List<String> args) async { Future<void> runOccCommand(final List<String> args) async {
final result = await runExecutableArguments( final result = await runExecutableArguments(
'docker', 'docker',
[ [

2
packages/nextcloud/test/notifications_test.dart

@ -21,7 +21,7 @@ void main() {
}); });
tearDown(() => container.destroy()); tearDown(() => container.destroy());
Future sendTestNotification() async { Future<void> sendTestNotification() async {
await client.notifications.api.generateNotification( await client.notifications.api.generateNotification(
userId: 'admin', userId: 'admin',
shortMessage: '123', shortMessage: '123',

4
packages/nextcloud/test/settings_test.dart

@ -4,11 +4,11 @@ import 'package:test/test.dart';
import 'helper.dart'; import 'helper.dart';
Future main() async { Future<void> main() async {
await run(await getDockerImage()); await run(await getDockerImage());
} }
Future run(final DockerImage image) async { Future<void> run(final DockerImage image) async {
group('settings', () { group('settings', () {
late DockerContainer container; late DockerContainer container;
late TestNextcloudClient client; late TestNextcloudClient client;

2
packages/sort_box/lib/sort_box.dart

@ -1,5 +1,5 @@
/// Signature of a function returning a [Comparable]. /// Signature of a function returning a [Comparable].
typedef ComparableGetter<T> = Comparable Function(T); typedef ComparableGetter<T> = Comparable<Object> Function(T);
/// Sorting Box to sort [List]s on multiple properties. /// Sorting Box to sort [List]s on multiple properties.
class SortBox<T extends Enum, R> { class SortBox<T extends Enum, R> {

Loading…
Cancel
Save