Browse Source

refactor(neon): make stuff immutable

pull/499/head
Nikolas Rimikis 1 year ago
parent
commit
b52806371f
No known key found for this signature in database
GPG Key ID: 85ED1DE9786A4FF2
  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';
@internal
@immutable
class AccountSpecificOptions {
AccountSpecificOptions(
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.
///
/// Subclasses must override one of [build] or [redirect].
@immutable
abstract class NeonAppRoute extends GoRouteData {
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';
@internal
@immutable
class GlobalOptions {
GlobalOptions(
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';
@internal
@immutable
class PushUtils {
static Future<RSAKeypair> loadRSAKeypair(final AppStorage storage) async {
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:xml/xml.dart' as xml;
@immutable
class RequestManager {
RequestManager([
const RequestManager([
this.cache,
]);

Loading…
Cancel
Save