Browse Source

refactor(neon): Adjust

Signed-off-by: jld3103 <jld3103yt@gmail.com>
pull/715/head
jld3103 1 year ago
parent
commit
92493b0a4a
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. 2
      packages/neon/neon/lib/src/app.dart
  2. 2
      packages/neon/neon/lib/src/blocs/apps.dart
  3. 10
      packages/neon/neon/lib/src/blocs/capabilities.dart
  4. 2
      packages/neon/neon/lib/src/blocs/user_details.dart
  5. 2
      packages/neon/neon/lib/src/widgets/drawer.dart

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

@ -283,7 +283,7 @@ class _NeonAppState extends State<NeonApp> with WidgetsBindingObserver, tray.Tra
stream: _accountsBloc.activeAccount, stream: _accountsBloc.activeAccount,
builder: (final context, final activeAccountSnapshot) { builder: (final context, final activeAccountSnapshot) {
FlutterNativeSplash.remove(); FlutterNativeSplash.remove();
return ResultBuilder<CoreOcsGetCapabilitiesResponse200ApplicationJson_Ocs_Data?>.behaviorSubject( return ResultBuilder<CoreOcsGetCapabilitiesResponseApplicationJson_Ocs_Data?>.behaviorSubject(
stream: activeAccountSnapshot.hasData stream: activeAccountSnapshot.hasData
? _accountsBloc.getCapabilitiesBlocFor(activeAccountSnapshot.data!).capabilities ? _accountsBloc.getCapabilitiesBlocFor(activeAccountSnapshot.data!).capabilities
: null, : null,

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

@ -190,7 +190,7 @@ class AppsBloc extends InteractiveBloc implements AppsBlocEvents, AppsBlocStates
@override @override
Future refresh() async { Future refresh() async {
await RequestManager.instance await RequestManager.instance
.wrapNextcloud<List<CoreNavigationEntry>, CoreNavigationGetAppsNavigationResponse200ApplicationJson>( .wrapNextcloud<List<CoreNavigationEntry>, CoreNavigationGetAppsNavigationResponseApplicationJson>(
_account.id, _account.id,
'apps-apps', 'apps-apps',
apps, apps,

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

@ -11,7 +11,7 @@ import 'package:rxdart/rxdart.dart';
abstract class CapabilitiesBlocEvents {} abstract class CapabilitiesBlocEvents {}
abstract class CapabilitiesBlocStates { abstract class CapabilitiesBlocStates {
BehaviorSubject<Result<CoreOcsGetCapabilitiesResponse200ApplicationJson_Ocs_Data>> get capabilities; BehaviorSubject<Result<CoreOcsGetCapabilitiesResponseApplicationJson_Ocs_Data>> get capabilities;
} }
@internal @internal
@ -31,13 +31,13 @@ class CapabilitiesBloc extends InteractiveBloc implements CapabilitiesBlocEvents
} }
@override @override
BehaviorSubject<Result<CoreOcsGetCapabilitiesResponse200ApplicationJson_Ocs_Data>> capabilities = BehaviorSubject<Result<CoreOcsGetCapabilitiesResponseApplicationJson_Ocs_Data>> capabilities =
BehaviorSubject<Result<CoreOcsGetCapabilitiesResponse200ApplicationJson_Ocs_Data>>(); BehaviorSubject<Result<CoreOcsGetCapabilitiesResponseApplicationJson_Ocs_Data>>();
@override @override
Future refresh() async { Future refresh() async {
await RequestManager.instance.wrapNextcloud<CoreOcsGetCapabilitiesResponse200ApplicationJson_Ocs_Data, await RequestManager.instance.wrapNextcloud<CoreOcsGetCapabilitiesResponseApplicationJson_Ocs_Data,
CoreOcsGetCapabilitiesResponse200ApplicationJson>( CoreOcsGetCapabilitiesResponseApplicationJson>(
_account.id, _account.id,
'capabilities', 'capabilities',
capabilities, capabilities,

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

@ -37,7 +37,7 @@ class UserDetailsBloc extends InteractiveBloc implements UserDetailsBlocEvents,
@override @override
Future refresh() async { Future refresh() async {
await RequestManager.instance await RequestManager.instance
.wrapNextcloud<ProvisioningApiUserDetails, ProvisioningApiUsersGetCurrentUserResponse200ApplicationJson>( .wrapNextcloud<ProvisioningApiUserDetails, ProvisioningApiUsersGetCurrentUserResponseApplicationJson>(
_account.id, _account.id,
'user-details', 'user-details',
userDetails, userDetails,

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

@ -121,7 +121,7 @@ class NeonDrawerHeader extends StatelessWidget {
final accountsBloc = Provider.of<AccountsBloc>(context, listen: false); final accountsBloc = Provider.of<AccountsBloc>(context, listen: false);
final capabilitiesBloc = accountsBloc.activeCapabilitiesBloc; final capabilitiesBloc = accountsBloc.activeCapabilitiesBloc;
final branding = ResultBuilder<CoreOcsGetCapabilitiesResponse200ApplicationJson_Ocs_Data>.behaviorSubject( final branding = ResultBuilder<CoreOcsGetCapabilitiesResponseApplicationJson_Ocs_Data>.behaviorSubject(
stream: capabilitiesBloc.capabilities, stream: capabilitiesBloc.capabilities,
builder: (final context, final capabilities) { builder: (final context, final capabilities) {
if (!capabilities.hasData) { if (!capabilities.hasData) {

Loading…
Cancel
Save