Browse Source

Merge pull request #925 from nextcloud/style/neon/remove-inferred-generic-arguments

style(neon): Remove automatically inferred generic type arguments
pull/927/head
Kate 1 year ago committed by GitHub
parent
commit
64c5649d8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      packages/neon/neon/lib/src/blocs/accounts.dart
  2. 12
      packages/neon/neon/lib/src/blocs/apps.dart
  3. 6
      packages/neon/neon/lib/src/blocs/capabilities.dart
  4. 2
      packages/neon/neon/lib/src/blocs/login_flow.dart
  5. 6
      packages/neon/neon/lib/src/blocs/user_details.dart
  6. 3
      packages/neon/neon/lib/src/blocs/user_statuses.dart
  7. 4
      packages/neon/neon/lib/src/pages/home.dart
  8. 5
      packages/neon/neon/lib/src/pages/settings.dart
  9. 4
      packages/neon/neon/lib/src/utils/global_options.dart
  10. 4
      packages/neon/neon/lib/src/widgets/app_bar.dart
  11. 2
      packages/neon/neon/lib/src/widgets/image.dart
  12. 2
      packages/neon/neon/lib/src/widgets/user_avatar.dart

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

@ -140,7 +140,7 @@ class AccountsBloc extends Bloc implements AccountsBlocEvents, AccountsBlocState
BehaviorSubject<List<Account>> accounts = BehaviorSubject<List<Account>>.seeded([]);
@override
BehaviorSubject<Account?> activeAccount = BehaviorSubject<Account?>();
BehaviorSubject<Account?> activeAccount = BehaviorSubject();
@override
void addAccount(final Account account) {

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

@ -175,18 +175,17 @@ class AppsBloc extends InteractiveBloc implements AppsBlocEvents, AppsBlocStates
}
@override
BehaviorSubject<AppImplementation> activeApp = BehaviorSubject<AppImplementation>();
BehaviorSubject<AppImplementation> activeApp = BehaviorSubject();
@override
BehaviorSubject<Result<Iterable<AppImplementation<Bloc, NextcloudAppOptions>>>> appImplementations =
BehaviorSubject<Result<Iterable<AppImplementation>>>();
BehaviorSubject();
@override
BehaviorSubject<Result<List<CoreNavigationEntry>>> apps = BehaviorSubject<Result<List<CoreNavigationEntry>>>();
BehaviorSubject<Result<List<CoreNavigationEntry>>> apps = BehaviorSubject();
@override
BehaviorSubject<Result<NotificationsAppInterface?>> notificationsAppImplementation =
BehaviorSubject<Result<NotificationsAppInterface?>>();
BehaviorSubject<Result<NotificationsAppInterface?>> notificationsAppImplementation = BehaviorSubject();
@override
BehaviorSubject<void> openNotifications = BehaviorSubject();
@ -196,8 +195,7 @@ class AppsBloc extends InteractiveBloc implements AppsBlocEvents, AppsBlocStates
@override
Future<void> refresh() async {
await RequestManager.instance
.wrapNextcloud<List<CoreNavigationEntry>, CoreNavigationGetAppsNavigationResponseApplicationJson, void>(
await RequestManager.instance.wrapNextcloud(
_account.id,
'apps-apps',
apps,

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

@ -33,13 +33,11 @@ class CapabilitiesBloc extends InteractiveBloc implements CapabilitiesBlocEvents
}
@override
BehaviorSubject<Result<CoreOcsGetCapabilitiesResponseApplicationJson_Ocs_Data>> capabilities =
BehaviorSubject<Result<CoreOcsGetCapabilitiesResponseApplicationJson_Ocs_Data>>();
BehaviorSubject<Result<CoreOcsGetCapabilitiesResponseApplicationJson_Ocs_Data>> capabilities = BehaviorSubject();
@override
Future<void> refresh() async {
await RequestManager.instance.wrapNextcloud<CoreOcsGetCapabilitiesResponseApplicationJson_Ocs_Data,
CoreOcsGetCapabilitiesResponseApplicationJson, void>(
await RequestManager.instance.wrapNextcloud(
_account.id,
'capabilities',
capabilities,

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

@ -43,7 +43,7 @@ class LoginFlowBloc extends InteractiveBloc implements LoginFlowBlocEvents, Logi
}
@override
BehaviorSubject<Result<CoreLoginFlowV2>> init = BehaviorSubject<Result<CoreLoginFlowV2>>();
BehaviorSubject<Result<CoreLoginFlowV2>> init = BehaviorSubject();
@override
late Stream<CoreLoginFlowV2Credentials> result = _resultController.stream.asBroadcastStream();

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

@ -33,13 +33,11 @@ class UserDetailsBloc extends InteractiveBloc implements UserDetailsBlocEvents,
}
@override
BehaviorSubject<Result<ProvisioningApiUserDetails>> userDetails =
BehaviorSubject<Result<ProvisioningApiUserDetails>>();
BehaviorSubject<Result<ProvisioningApiUserDetails>> userDetails = BehaviorSubject();
@override
Future<void> refresh() async {
await RequestManager.instance
.wrapNextcloud<ProvisioningApiUserDetails, ProvisioningApiUsersGetCurrentUserResponseApplicationJson, void>(
await RequestManager.instance.wrapNextcloud(
_account.id,
'user-details',
userDetails,

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

@ -41,8 +41,7 @@ class UserStatusesBloc extends InteractiveBloc implements UserStatusesBlocEvents
}
@override
BehaviorSubject<Map<String, Result<UserStatusPublicInterface?>>> statuses =
BehaviorSubject<Map<String, Result<UserStatusPublicInterface?>>>();
BehaviorSubject<Map<String, Result<UserStatusPublicInterface?>>> statuses = BehaviorSubject();
@override
Future<void> refresh() async {

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

@ -148,7 +148,7 @@ class _HomePageState extends State<HomePage> {
);
}
return StreamBuilder<AppImplementation>(
return StreamBuilder(
stream: _appsBloc.activeApp,
builder: (final context, final activeAppIDSnapshot) {
if (!activeAppIDSnapshot.hasData) {
@ -163,7 +163,7 @@ class _HomePageState extends State<HomePage> {
},
);
final body = ValueListenableBuilder<global_options.NavigationMode>(
final body = ValueListenableBuilder(
valueListenable: _globalOptions.navigationMode,
builder: (final context, final navigationMode, final _) {
final drawerAlwaysVisible = navigationMode == global_options.NavigationMode.drawerAlwaysVisible;

5
packages/neon/neon/lib/src/pages/settings.dart

@ -4,7 +4,6 @@ import 'package:flutter_material_design_icons/flutter_material_design_icons.dart
import 'package:meta/meta.dart';
import 'package:neon/l10n/localizations.dart';
import 'package:neon/src/blocs/accounts.dart';
import 'package:neon/src/models/account.dart';
import 'package:neon/src/models/app_implementation.dart';
import 'package:neon/src/platform/platform.dart';
import 'package:neon/src/router.dart';
@ -82,14 +81,14 @@ class _SettingsPageState extends State<SettingsPage> {
),
],
);
final body = StreamBuilder<List<Account>>(
final body = StreamBuilder(
stream: accountsBloc.accounts,
initialData: accountsBloc.accounts.valueOrNull,
builder: (
final context,
final accountsSnapshot,
) =>
ValueListenableBuilder<bool>(
ValueListenableBuilder(
valueListenable: globalOptions.pushNotificationsEnabled,
builder: (
final context,

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

@ -114,7 +114,7 @@ class GlobalOptions extends OptionsCollection {
}
}
late final themeMode = SelectOption<ThemeMode>(
late final themeMode = SelectOption(
storage: storage,
key: GlobalOptionKeys.themeMode,
label: (final context) => AppLocalizations.of(context).globalOptionsThemeMode,
@ -202,7 +202,7 @@ class GlobalOptions extends OptionsCollection {
values: {},
);
late final navigationMode = SelectOption<NavigationMode>(
late final navigationMode = SelectOption(
storage: storage,
key: GlobalOptionKeys.navigationMode,
label: (final context) => AppLocalizations.of(context).globalOptionsNavigationMode,

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

@ -64,9 +64,9 @@ class _NeonAppBarState extends State<NeonAppBar> {
@override
Widget build(final BuildContext context) => ResultBuilder<Iterable<AppImplementation>>.behaviorSubject(
stream: appsBloc.appImplementations,
builder: (final context, final appImplementations) => StreamBuilder<AppImplementation>(
builder: (final context, final appImplementations) => StreamBuilder(
stream: appsBloc.activeApp,
builder: (final context, final activeAppSnapshot) => StreamBuilder<bool>(
builder: (final context, final activeAppSnapshot) => StreamBuilder(
stream: unifiedSearchBloc.enabled,
builder: (final context, final unifiedSearchEnabledSnapshot) {
final unifiedSearchEnabled = unifiedSearchEnabledSnapshot.data ?? false;

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

@ -177,7 +177,7 @@ class NeonCachedImage extends StatefulWidget {
class _NeonCachedImageState extends State<NeonCachedImage> {
@override
Widget build(final BuildContext context) => Center(
child: FutureBuilder<Uint8List>(
child: FutureBuilder(
future: widget.image,
builder: (final context, final fileSnapshot) {
if (fileSnapshot.hasError) {

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

@ -82,7 +82,7 @@ class _UserAvatarState extends State<NeonUserAvatar> {
alignment: Alignment.center,
children: [
avatar,
ResultBuilder<UserStatusPublicInterface?>(
ResultBuilder(
stream: _userStatusBloc.statuses.mapNotNull((final statuses) => statuses[widget.username]),
builder: _userStatusIconBuilder,
),

Loading…
Cancel
Save