Skip to content

Commit b8e7229

Browse files
committed
Release 1.1.0
1 parent dd089ef commit b8e7229

22 files changed

+961
-530
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## 1.1.0
2+
3+
* BREAKING: now you need to provide SharedPreferences instance to create feature manager
4+
* Added sync calls for FeatureManager
5+
* Added additional getters for FeatureManger
6+
* Added json type for Feature
7+
18
## 1.0.0
29

310
* Initial release of Feature Manager

README.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,17 +87,15 @@ Preferable way to create FeatureManager instance is to use DI (Provider, GetIt e
8787

8888
```dart
8989
...
90-
FutureBuilder<bool>(
91-
initialData: Features.booleanFeature.defaultValue as bool,
92-
future: featureManager.isEnabled(Features.booleanFeature),
93-
builder: (BuildContext context, snapshot) {
94-
final bool isEnabled = snapshot.data ?? false;
90+
final bool isEnabled =
91+
context.read<FeatureManager>().isEnabled(Features.booleanFeature);
9592
...
9693
```
9794

9895
#### Modify feature values in DEBUG (develop) mode
9996
To do it, you can simply open DeveloperPreferences screen in any part of your app.
10097
You should pass list of your features as parameter for this screen.
98+
10199
P.S. You should hide this button for production builds.
102100

103101
```dart
@@ -127,7 +125,7 @@ Navigator.of(context).push(
127125
enum FeatureType { feature, experiment }
128126
```
129127
```dart
130-
enum FeatureValueType { text, toggle, doubleNumber, integerNumber }
128+
enum FeatureValueType { text, toggle, doubleNumber, integerNumber, json }
131129
```
132130

133131
## Todo
@@ -141,7 +139,7 @@ enum FeatureValueType { text, toggle, doubleNumber, integerNumber }
141139

142140
- [ ] Use permanent notification to access dev settings
143141

144-
- [ ] Add sync calls of `isEnabled` and `getValue` for `FeatureManager`
142+
- [x] Add sync calls of `isEnabled` and `getValue` for `FeatureManager`
145143

146144
## Contributions
147145
Feel free to contact me (a.e.getman@gmail.com) or create Merge Requests for this repository :)

example/ios/Flutter/AppFrameworkInfo.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
<key>CFBundleVersion</key>
2222
<string>1.0</string>
2323
<key>MinimumOSVersion</key>
24-
<string>8.0</string>
24+
<string>11.0</string>
2525
</dict>
2626
</plist>

example/ios/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Uncomment this line to define a global platform for your project
2-
# platform :ios, '9.0'
2+
# platform :ios, '11.0'
33

44
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
55
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

example/ios/Podfile.lock

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
PODS:
2+
- Flutter (1.0.0)
3+
- shared_preferences_foundation (0.0.1):
4+
- Flutter
5+
- FlutterMacOS
6+
7+
DEPENDENCIES:
8+
- Flutter (from `Flutter`)
9+
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/ios`)
10+
11+
EXTERNAL SOURCES:
12+
Flutter:
13+
:path: Flutter
14+
shared_preferences_foundation:
15+
:path: ".symlinks/plugins/shared_preferences_foundation/ios"
16+
17+
SPEC CHECKSUMS:
18+
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
19+
shared_preferences_foundation: 297b3ebca31b34ec92be11acd7fb0ba932c822ca
20+
21+
PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3
22+
23+
COCOAPODS: 1.11.3

example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 75 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 46;
6+
objectVersion = 54;
77
objects = {
88

99
/* Begin PBXBuildFile section */
1010
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
1111
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
12+
7439274CB4C6FF15335C461A /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 81B674EDC3CEE702AF053F7D /* Pods_Runner.framework */; };
1213
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
1314
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
1415
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
@@ -29,12 +30,16 @@
2930
/* End PBXCopyFilesBuildPhase section */
3031

3132
/* Begin PBXFileReference section */
33+
0FAF7C0517B7BA318C2B8EA7 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
3234
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
3335
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
3436
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
37+
3E82F08BDDB71249ED65DDA2 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
38+
5764D1618B6D5B1D1456846F /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
3539
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
3640
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
3741
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
42+
81B674EDC3CEE702AF053F7D /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
3843
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
3944
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
4045
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -49,12 +54,21 @@
4954
isa = PBXFrameworksBuildPhase;
5055
buildActionMask = 2147483647;
5156
files = (
57+
7439274CB4C6FF15335C461A /* Pods_Runner.framework in Frameworks */,
5258
);
5359
runOnlyForDeploymentPostprocessing = 0;
5460
};
5561
/* End PBXFrameworksBuildPhase section */
5662

5763
/* Begin PBXGroup section */
64+
125B2189BEEDE0E4BB2F35BE /* Frameworks */ = {
65+
isa = PBXGroup;
66+
children = (
67+
81B674EDC3CEE702AF053F7D /* Pods_Runner.framework */,
68+
);
69+
name = Frameworks;
70+
sourceTree = "<group>";
71+
};
5872
9740EEB11CF90186004384FC /* Flutter */ = {
5973
isa = PBXGroup;
6074
children = (
@@ -72,6 +86,8 @@
7286
9740EEB11CF90186004384FC /* Flutter */,
7387
97C146F01CF9000F007C117D /* Runner */,
7488
97C146EF1CF9000F007C117D /* Products */,
89+
F1988A1615F1DD66E6C69F67 /* Pods */,
90+
125B2189BEEDE0E4BB2F35BE /* Frameworks */,
7591
);
7692
sourceTree = "<group>";
7793
};
@@ -98,19 +114,32 @@
98114
path = Runner;
99115
sourceTree = "<group>";
100116
};
117+
F1988A1615F1DD66E6C69F67 /* Pods */ = {
118+
isa = PBXGroup;
119+
children = (
120+
3E82F08BDDB71249ED65DDA2 /* Pods-Runner.debug.xcconfig */,
121+
5764D1618B6D5B1D1456846F /* Pods-Runner.release.xcconfig */,
122+
0FAF7C0517B7BA318C2B8EA7 /* Pods-Runner.profile.xcconfig */,
123+
);
124+
name = Pods;
125+
path = Pods;
126+
sourceTree = "<group>";
127+
};
101128
/* End PBXGroup section */
102129

103130
/* Begin PBXNativeTarget section */
104131
97C146ED1CF9000F007C117D /* Runner */ = {
105132
isa = PBXNativeTarget;
106133
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
107134
buildPhases = (
135+
C16EA757FF8406EB30C7B4B4 /* [CP] Check Pods Manifest.lock */,
108136
9740EEB61CF901F6004384FC /* Run Script */,
109137
97C146EA1CF9000F007C117D /* Sources */,
110138
97C146EB1CF9000F007C117D /* Frameworks */,
111139
97C146EC1CF9000F007C117D /* Resources */,
112140
9705A1C41CF9048500538489 /* Embed Frameworks */,
113141
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
142+
63D0F0D392F3B2598C89FA0C /* [CP] Embed Pods Frameworks */,
114143
);
115144
buildRules = (
116145
);
@@ -127,7 +156,7 @@
127156
97C146E61CF9000F007C117D /* Project object */ = {
128157
isa = PBXProject;
129158
attributes = {
130-
LastUpgradeCheck = 1020;
159+
LastUpgradeCheck = 1300;
131160
ORGANIZATIONNAME = "";
132161
TargetAttributes = {
133162
97C146ED1CF9000F007C117D = {
@@ -171,6 +200,7 @@
171200
/* Begin PBXShellScriptBuildPhase section */
172201
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
173202
isa = PBXShellScriptBuildPhase;
203+
alwaysOutOfDate = 1;
174204
buildActionMask = 2147483647;
175205
files = (
176206
);
@@ -183,8 +213,26 @@
183213
shellPath = /bin/sh;
184214
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
185215
};
216+
63D0F0D392F3B2598C89FA0C /* [CP] Embed Pods Frameworks */ = {
217+
isa = PBXShellScriptBuildPhase;
218+
buildActionMask = 2147483647;
219+
files = (
220+
);
221+
inputFileListPaths = (
222+
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
223+
);
224+
name = "[CP] Embed Pods Frameworks";
225+
outputFileListPaths = (
226+
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
227+
);
228+
runOnlyForDeploymentPostprocessing = 0;
229+
shellPath = /bin/sh;
230+
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
231+
showEnvVarsInLog = 0;
232+
};
186233
9740EEB61CF901F6004384FC /* Run Script */ = {
187234
isa = PBXShellScriptBuildPhase;
235+
alwaysOutOfDate = 1;
188236
buildActionMask = 2147483647;
189237
files = (
190238
);
@@ -197,6 +245,28 @@
197245
shellPath = /bin/sh;
198246
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
199247
};
248+
C16EA757FF8406EB30C7B4B4 /* [CP] Check Pods Manifest.lock */ = {
249+
isa = PBXShellScriptBuildPhase;
250+
buildActionMask = 2147483647;
251+
files = (
252+
);
253+
inputFileListPaths = (
254+
);
255+
inputPaths = (
256+
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
257+
"${PODS_ROOT}/Manifest.lock",
258+
);
259+
name = "[CP] Check Pods Manifest.lock";
260+
outputFileListPaths = (
261+
);
262+
outputPaths = (
263+
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
264+
);
265+
runOnlyForDeploymentPostprocessing = 0;
266+
shellPath = /bin/sh;
267+
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
268+
showEnvVarsInLog = 0;
269+
};
200270
/* End PBXShellScriptBuildPhase section */
201271

202272
/* Begin PBXSourcesBuildPhase section */
@@ -272,7 +342,7 @@
272342
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
273343
GCC_WARN_UNUSED_FUNCTION = YES;
274344
GCC_WARN_UNUSED_VARIABLE = YES;
275-
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
345+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
276346
MTL_ENABLE_DEBUG_INFO = NO;
277347
SDKROOT = iphoneos;
278348
SUPPORTED_PLATFORMS = iphoneos;
@@ -346,7 +416,7 @@
346416
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
347417
GCC_WARN_UNUSED_FUNCTION = YES;
348418
GCC_WARN_UNUSED_VARIABLE = YES;
349-
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
419+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
350420
MTL_ENABLE_DEBUG_INFO = YES;
351421
ONLY_ACTIVE_ARCH = YES;
352422
SDKROOT = iphoneos;
@@ -395,7 +465,7 @@
395465
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
396466
GCC_WARN_UNUSED_FUNCTION = YES;
397467
GCC_WARN_UNUSED_VARIABLE = YES;
398-
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
468+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
399469
MTL_ENABLE_DEBUG_INFO = NO;
400470
SDKROOT = iphoneos;
401471
SUPPORTED_PLATFORMS = iphoneos;

example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1020"
3+
LastUpgradeVersion = "1300"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

example/ios/Runner.xcworkspace/contents.xcworkspacedata

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/ios/Runner/Info.plist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,9 @@
4141
</array>
4242
<key>UIViewControllerBasedStatusBarAppearance</key>
4343
<false/>
44+
<key>CADisableMinimumFrameDurationOnPhone</key>
45+
<true/>
46+
<key>UIApplicationSupportsIndirectInputEvents</key>
47+
<true/>
4448
</dict>
4549
</plist>

example/lib/features.dart

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,19 @@ class Features {
3333
valueType: FeatureValueType.integerNumber,
3434
);
3535

36+
static const Feature jsonFeature = Feature(
37+
key: 'dev-prefs-json-pref',
38+
title: 'Json pref',
39+
description: 'This is json preference',
40+
defaultValue: "{value: 'Json default value'}",
41+
valueType: FeatureValueType.json,
42+
);
43+
3644
static const List<Feature> values = <Feature>[
3745
Features.textFeature,
3846
Features.booleanFeature,
3947
Features.doubleFeature,
4048
Features.integerFeature,
49+
Features.jsonFeature,
4150
];
4251
}

0 commit comments

Comments
 (0)