Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Add Shared Preferences plugin #16

Merged
merged 2 commits into from
May 5, 2017

Conversation

collinjackson
Copy link
Contributor

@collinjackson collinjackson commented May 3, 2017

@@ -0,0 +1,32 @@
group 'com.yourcompany.shared_preferences'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@@ -0,0 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.yourcompany.shared_preferences"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably io.flutter here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@collinjackson collinjackson changed the title Add Shared Preferences plugin. Fixes flutter/flutter#4757 Add Shared Preferences plugin May 3, 2017
@collinjackson collinjackson requested a review from mit-mit May 3, 2017 23:24
@mit-mit mit-mit requested a review from szakarias May 4, 2017 08:17
Copy link
Contributor

@szakarias szakarias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool stuff!

@@ -0,0 +1,32 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.yourcompany.shared_preferences_example"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably you want "io.flutter.plugins" here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

plugins = [[PluginRegistry alloc] initWithController:flutterController];
return YES;
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider deleting the methods below.

Copy link
Contributor Author

@collinjackson collinjackson May 5, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is the unmodified output of flutter create, I think it's better not to customize it since that isn't part of the plugin installation instructions.

@@ -0,0 +1,65 @@
import 'dart:async';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing copyright

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added

shared_preferences:
path: ../

# For information on the generic Dart part of this file, see the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider removing the generated comments.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -0,0 +1,38 @@
#include "AppDelegate.h"
#include "PluginRegistry.h"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might want a copyright statement here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is the unmodified output of flutter create

child: new FutureBuilder(
future: _prefs,
builder: (BuildContext context, AsyncSnapshot<SharedPreferences> snapshot) {
if (snapshot.connectionState != ConnectionState.done)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could also be ' if (snapshot.connectionState == ConnectionsState.waiting)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

future: _prefs,
builder: (BuildContext context, AsyncSnapshot<SharedPreferences> snapshot) {
if (snapshot.connectionState != ConnectionState.done)
return new Text('Loading...');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps const Text() here and in the title ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@szakarias
Copy link
Contributor

Consider adding a CHANGELOG.md

Copy link
Member

@mit-mit mit-mit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed just the readme.md files, looks good.

Thanks for adding this plugin!

s.name = 'shared_preferences'
s.version = '0.0.1'
s.summary = 'A new flutter plugin project.'
s.description = <<-DESC
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May not matter since you're hosting them separately but might look more complete if you filled these

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we have agreed not to maintain this. We only have it to make CocoaPods happy.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll leave it as-is for now but feel free to change it

@collinjackson
Copy link
Contributor Author

Thanks for the comments

@collinjackson collinjackson merged commit d238a53 into flutter:master May 5, 2017
srburton added a commit to srburton/plugins that referenced this pull request Feb 21, 2020
       FAILURE: Build failed with an exception.

                    * Where:
                    Build file 'C:\Users\srburton\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\shared_preferences_macos-0.0.1+6\android\build.gradle' line: 22

                    * What went wrong:
                    A problem occurred evaluating root project 'shared_preferences_macos'.
                    > Failed to apply plugin [id 'com.android.library']
                       > Minimum supported Gradle version is 5.4.1. Current version is 5.1.1. If using the gradle wrapper, try editing the distributionUrl in
                       C:\Users\srburton\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\shared_preferences_macos-0.0.1+6\android\gradle\wrapper\gradle-wrapper.properties to gradle-5.4.1-all.zip

                    * Try:
                    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

                    * Get more help at https://help.gradle.org

                    BUILD FAILED in 1s
[   +1 ms] Running Gradle task 'assembleAarRelease'... (completed in 2,0s)
[        ] 
           FAILURE: Build failed with an exception.
           
           * Where:
           Build file 'C:\Users\srburton\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\shared_preferences_macos-0.0.1+6\android\build.gradle' line: 22
           
           * What went wrong:
           A problem occurred evaluating root project 'shared_preferences_macos'.
           > Failed to apply plugin [id 'com.android.library']
              > Minimum supported Gradle version is 5.4.1. Current version is 5.1.1. If using the gradle wrapper, try editing the distributionUrl in
C:\Users\srburton\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\shared_preferences_macos-0.0.1+6\android\gradle\wrapper\gradle-wrapper.properties to gradle-5.4.1-all.zip
           
           * Try:
           Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
           
           * Get more help at https://help.gradle.org
           
           BUILD FAILED in 1s
           
[   +5 ms] "flutter apk" took 179.497ms.
The plugin shared_preferences_macos could not be built due to the issue above.

#0      throwToolExit (package:flutter_tools/src/base/common.dart:28:3)
flutter#1      buildPluginsAsAar (package:flutter_tools/src/android/gradle.dart:726:7)
flutter#2      _asyncErrorWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:80:45)
#3      _rootRunBinary (dart:async/zone.dart:1146:38)
flutter#4      _CustomZone.runBinary (dart:async/zone.dart:1039:19)
flutter#5      _FutureListener.handleError (dart:async/future_impl.dart:153:20)
flutter#6      Future._propagateToListeners.handleError (dart:async/future_impl.dart:692:47)
flutter#7      Future._propagateToListeners (dart:async/future_impl.dart:713:24)
flutter#8      Future._completeError (dart:async/future_impl.dart:532:5)
flutter#9      _AsyncAwaitCompleter.completeError (dart:async-patch/async_patch.dart:38:15)
flutter#10     buildGradleAar (package:flutter_tools/src/android/gradle.dart)
flutter#11     _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:73:64)
flutter#12     _rootRunUnary (dart:async/zone.dart:1134:38)
flutter#13     _CustomZone.runUnary (dart:async/zone.dart:1031:19)
flutter#14     _FutureListener.handleValue (dart:async/future_impl.dart:139:18)
flutter#15     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:680:45)
flutter#16     Future._propagateToListeners (dart:async/future_impl.dart:709:32)
#17     Future._completeWithValue (dart:async/future_impl.dart:524:5)
flutter#18     _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:32:15)
flutter#19     _completeOnAsyncReturn (dart:async-patch/async_patch.dart:290:13)
flutter#20     _DefaultProcessUtils.run (package:flutter_tools/src/base/process.dart)
flutter#21     _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:73:64)
flutter#22     _rootRunUnary (dart:async/zone.dart:1134:38)
flutter#23     _CustomZone.runUnary (dart:async/zone.dart:1031:19)
flutter#24     _FutureListener.handleValue (dart:async/future_impl.dart:139:18)
flutter#25     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:680:45)
flutter#26     Future._propagateToListeners (dart:async/future_impl.dart:709:32)
flutter#27     Future._completeWithValue (dart:async/future_impl.dart:524:5)
flutter#28     Future.wait.<anonymous closure> (dart:async/future.dart:400:22)
flutter#29     _rootRunUnary (dart:async/zone.dart:1134:38)
flutter#30     _CustomZone.runUnary (dart:async/zone.dart:1031:19)
flutter#31     _FutureListener.handleValue (dart:async/future_impl.dart:139:18)
flutter#32     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:680:45)
flutter#33     Future._propagateToListeners (dart:async/future_impl.dart:709:32)
flutter#34     Future._completeWithValue (dart:async/future_impl.dart:524:5)
flutter#35     Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:554:7)
flutter#36     _rootRun (dart:async/zone.dart:1126:13)
flutter#37     _CustomZone.run (dart:async/zone.dart:1023:19)
flutter#38     _CustomZone.runGuarded (dart:async/zone.dart:925:7)
flutter#39     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:965:23)
flutter#40     _microtaskLoop (dart:async/schedule_microtask.dart:43:21)
flutter#41     _startMicrotaskLoop (dart:async/schedule_microtask.dart:52:5)
flutter#42     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:118:13)
flutter#43     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:175:5)
@srburton srburton mentioned this pull request Feb 21, 2020
13 tasks
nt4f04uNd pushed a commit to nt4f04uNd/plugins that referenced this pull request Mar 23, 2021
…onboundries-feature

Added test coverage to region boundaries feature
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants