Skip to content

Commit

Permalink
Merge pull request #40 from Flagsmith/feature/update-example-app
Browse files Browse the repository at this point in the history
Updated example app to use new storage plugin
  • Loading branch information
jackforesightmobile authored Jul 14, 2022
2 parents 769cb40 + d0de294 commit 2ea35dc
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 16 deletions.
1 change: 1 addition & 0 deletions example/lib/bloc/flag_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class FlagBloc extends Bloc<FlagEvent, FlagState> {

@override
Stream<FlagState> mapEventToState(FlagEvent event) async* {

switch (event.runtimeType) {
case InitFlagEvent:
yield state.copyWith(loading: LoadingState.isInitial);
Expand Down
3 changes: 2 additions & 1 deletion example/lib/di.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flagsmith/flagsmith.dart';
import 'package:flagsmith_storage/flagsmith_storage_sharedpreferences.dart';
import 'package:get_it/get_it.dart';

import 'bloc/flag_bloc.dart';
Expand All @@ -11,7 +12,7 @@ Future<void> setupPrefs() async {
apiKey: 'CoJErJUXmihfMDVwTzBff4',
config: const FlagsmithConfig(
storageType: StorageType.custom, isDebug: true),
storage: InMemoryStorage());
storage: FlagsmithSharedPreferenceStore());
await client.initialize();
return client;
});
Expand Down
31 changes: 19 additions & 12 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -127,27 +127,20 @@ packages:
relative: true
source: path
version: "3.0.2"
flagsmith_core:
dependency: transitive
description:
name: flagsmith_core
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0+1"
flagsmith_flutter_core:
dependency: transitive
description:
name: flagsmith_flutter_core
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.0"
flagsmith_storage_sharedpreferences:
version: "2.3.0"
flagsmith_storage:
dependency: "direct main"
description:
name: flagsmith_storage_sharedpreferences
name: flagsmith_storage
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0+2"
version: "3.0.0"
flutter:
dependency: "direct main"
description: flutter
Expand Down Expand Up @@ -386,7 +379,21 @@ packages:
name: shared_preferences
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.8"
version: "2.0.15"
shared_preferences_android:
dependency: transitive
description:
name: shared_preferences_android
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.12"
shared_preferences_ios:
dependency: transitive
description:
name: shared_preferences_ios
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
shared_preferences_linux:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dependencies:
sdk: flutter
flagsmith:
path: ../
flagsmith_storage_sharedpreferences: ^2.1.0+2
flagsmith_storage: ^3.0.0

platform: ^3.1.0
collection: ^1.15.0
Expand Down
2 changes: 1 addition & 1 deletion pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ packages:
name: flagsmith_flutter_core
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.0"
version: "2.3.0"
frontend_server_client:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ environment:
sdk: '>=2.13.0 <3.0.0'

dependencies:
flagsmith_flutter_core: ^2.2.0
flagsmith_flutter_core: ^2.3.0
collection: ^1.15.0
dio: ^4.0.0
rxdart: ">=0.26.0 <=0.27.2"
Expand Down

0 comments on commit 2ea35dc

Please sign in to comment.