Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

Commit

Permalink
Temporarily remove shared_preferences dependency until it can be used…
Browse files Browse the repository at this point in the history
… with nnbd (#385)
  • Loading branch information
rami-a authored Dec 8, 2020
1 parent 86b2ac2 commit 9dd9e78
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 63 deletions.
3 changes: 1 addition & 2 deletions golden_test/flutter_test_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import 'dart:async';

import 'package:flutter_test/flutter_test.dart';
import 'package:shared_preferences/shared_preferences.dart';

import 'testing/font_loader.dart';

Expand All @@ -23,7 +22,7 @@ Future<void> testExecutable(FutureOr<void> Function() testMain) async {
// Disabling the warning because @visibleForTesting doesn't take the testing
// framework into account.
// ignore: invalid_use_of_visible_for_testing_member
SharedPreferences.setMockInitialValues(<String, String>{});
// TODO(rami-a): Add back shared_preferences mocking once migrated to NNBD.
await loadFonts();
await testMain();
}
8 changes: 1 addition & 7 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,13 @@ PODS:
- Flutter
- path_provider (0.0.1):
- Flutter
- shared_preferences (0.0.1):
- Flutter
- url_launcher (0.0.1):
- Flutter

DEPENDENCIES:
- Flutter (from `Flutter`)
- package_info (from `.symlinks/plugins/package_info/ios`)
- path_provider (from `.symlinks/plugins/path_provider/ios`)
- shared_preferences (from `.symlinks/plugins/shared_preferences/ios`)
- url_launcher (from `.symlinks/plugins/url_launcher/ios`)

EXTERNAL SOURCES:
Expand All @@ -23,16 +20,13 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/package_info/ios"
path_provider:
:path: ".symlinks/plugins/path_provider/ios"
shared_preferences:
:path: ".symlinks/plugins/shared_preferences/ios"
url_launcher:
:path: ".symlinks/plugins/url_launcher/ios"

SPEC CHECKSUMS:
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c
package_info: 873975fc26034f0b863a300ad47e7f1ac6c7ec62
path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c
shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d
url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef

PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c
Expand Down
11 changes: 2 additions & 9 deletions lib/pages/demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,8 @@ import 'package:gallery/layout/adaptive.dart';
import 'package:gallery/pages/splash.dart';
import 'package:gallery/themes/gallery_theme_data.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:url_launcher/url_launcher.dart';

const _demoViewedCountKey = 'demoViewedCountKey';

enum _DemoState {
normal,
options,
Expand Down Expand Up @@ -132,12 +129,8 @@ class _GalleryDemoPageState extends State<GalleryDemoPage>
vsync: this,
duration: const Duration(milliseconds: 300),
);
SharedPreferences.getInstance().then((preferences) {
setState(() {
_demoViewedCount = preferences.getInt(_demoViewedCountKey) ?? 0;
preferences.setInt(_demoViewedCountKey, _demoViewedCount + 1);
});
});
// TODO(rami-a): Add back shared_preferences check once migrated to NNBD.
_demoViewedCount = 10;
}

@override
Expand Down
2 changes: 0 additions & 2 deletions macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ import Foundation

import package_info
import path_provider_macos
import shared_preferences_macos
import url_launcher_macos

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
FLTPackageInfoPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
}
42 changes: 0 additions & 42 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -437,48 +437,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
shared_preferences:
dependency: "direct main"
description:
name: shared_preferences
url: "https://pub.dartlang.org"
source: hosted
version: "0.5.12+4"
shared_preferences_linux:
dependency: transitive
description:
name: shared_preferences_linux
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.2+4"
shared_preferences_macos:
dependency: transitive
description:
name: shared_preferences_macos
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.1+11"
shared_preferences_platform_interface:
dependency: transitive
description:
name: shared_preferences_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.4"
shared_preferences_web:
dependency: transitive
description:
name: shared_preferences_web
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.2+7"
shared_preferences_windows:
dependency: transitive
description:
name: shared_preferences_windows
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.1+3"
shelf:
dependency: transitive
description:
Expand Down
1 change: 0 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ dependencies:
shrine_images: ^1.1.2
url_launcher: ^5.6.0
vector_math: ^2.0.8
shared_preferences: ^0.5.4
collection: ^1.14.0
flutter_gallery_assets: ^0.2.6
package_info: ^0.4.0
Expand Down

0 comments on commit 9dd9e78

Please sign in to comment.