Browse Source

Merge pull request #499 from provokateurin/cleanup/mutability

refactor(neon): make stuff immutable
pull/506/head
Nikolas Rimikis 1 year ago committed by GitHub
parent
commit
f1e62dd195
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      packages/neon/neon/lib/src/utils/account_options.dart
  2. 1
      packages/neon/neon/lib/src/utils/app_route.dart
  3. 1
      packages/neon/neon/lib/src/utils/global_options.dart
  4. 1
      packages/neon/neon/lib/src/utils/push_utils.dart
  5. 3
      packages/neon/neon/lib/src/utils/request_manager.dart

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

@ -6,6 +6,7 @@ import 'package:neon/src/settings/models/select_option.dart';
import 'package:neon/src/settings/models/storage.dart'; import 'package:neon/src/settings/models/storage.dart';
@internal @internal
@immutable
class AccountSpecificOptions { class AccountSpecificOptions {
AccountSpecificOptions( AccountSpecificOptions(
this._storage, this._storage,

1
packages/neon/neon/lib/src/utils/app_route.dart

@ -4,6 +4,7 @@ import 'package:go_router/go_router.dart';
/// [RouteData] for the initial page of an app. /// [RouteData] for the initial page of an app.
/// ///
/// Subclasses must override one of [build] or [redirect]. /// Subclasses must override one of [build] or [redirect].
@immutable
abstract class NeonAppRoute extends GoRouteData { abstract class NeonAppRoute extends GoRouteData {
const NeonAppRoute(); const NeonAppRoute();

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

@ -16,6 +16,7 @@ import 'package:shared_preferences/shared_preferences.dart';
const unifiedPushNextPushID = 'org.unifiedpush.distributor.nextpush'; const unifiedPushNextPushID = 'org.unifiedpush.distributor.nextpush';
@internal @internal
@immutable
class GlobalOptions { class GlobalOptions {
GlobalOptions( GlobalOptions(
this._sharedPreferences, this._sharedPreferences,

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

@ -22,6 +22,7 @@ import 'package:nextcloud/nextcloud.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
@internal @internal
@immutable
class PushUtils { class PushUtils {
static Future<RSAKeypair> loadRSAKeypair(final AppStorage storage) async { static Future<RSAKeypair> loadRSAKeypair(final AppStorage storage) async {
const keyDevicePrivateKey = 'device-private-key'; const keyDevicePrivateKey = 'device-private-key';

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

@ -9,8 +9,9 @@ import 'package:rxdart/rxdart.dart';
import 'package:sqflite/sqflite.dart'; import 'package:sqflite/sqflite.dart';
import 'package:xml/xml.dart' as xml; import 'package:xml/xml.dart' as xml;
@immutable
class RequestManager { class RequestManager {
RequestManager([ const RequestManager([
this.cache, this.cache,
]); ]);

Loading…
Cancel
Save