Skip to content

Commit

Permalink
Merge pull request #5 from infinum/maintenance-fixes
Browse files Browse the repository at this point in the history
Resolved maintenance issues
  • Loading branch information
itsJoKr authored Jul 10, 2020
2 parents 6ede921 + b30c973 commit ad9fa30
Show file tree
Hide file tree
Showing 15 changed files with 237 additions and 122 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.0.0

* Initial release
* Initial release

## 1.0.1

* Resolved maintenance issues.
37 changes: 25 additions & 12 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,35 +21,45 @@ class _MyAppState extends State<MyApp> {

Future<void> _canAuthenticate(BuildContext context) async {
FlutterLocker.canAuthenticate().then((value) {
Scaffold.of(context).showSnackBar(SnackBar(content: Text('Can authenticate: ' + value.toString())));
Scaffold.of(context).showSnackBar(
SnackBar(content: Text('Can authenticate: ' + value.toString())));
}).catchError((err) {
Scaffold.of(context).showSnackBar(SnackBar(content: Text('Error happened: ' + err.toString())));
Scaffold.of(context).showSnackBar(
SnackBar(content: Text('Error happened: ' + err.toString())));
});
}

Future<void> _saveSecret(BuildContext context) async {
FlutterLocker.save(SaveSecretRequest(key, secret, AndroidPrompt('Authenticate', 'Cancel'))).then((value) {
Scaffold.of(context).showSnackBar(SnackBar(content: Text('Successfully Saved Secret: $secret')));
FlutterLocker.save(SaveSecretRequest(
key, secret, AndroidPrompt('Authenticate', 'Cancel')))
.then((value) {
Scaffold.of(context).showSnackBar(
SnackBar(content: Text('Successfully Saved Secret: $secret')));
}).catchError((err) {
Scaffold.of(context).showSnackBar(SnackBar(content: Text('Error happened: ' + err.toString())));
Scaffold.of(context).showSnackBar(
SnackBar(content: Text('Error happened: ' + err.toString())));
});
}

Future<void> _retrieveSecret(BuildContext context) async {
FlutterLocker.retrieve(
RetrieveSecretRequest(key, AndroidPrompt('Authenticate', 'Cancel'), IOsPrompt('Authenticate')))
FlutterLocker.retrieve(RetrieveSecretRequest(key,
AndroidPrompt('Authenticate', 'Cancel'), IOsPrompt('Authenticate')))
.then((value) {
Scaffold.of(context).showSnackBar(SnackBar(content: Text('Retrieved secret: ' + value)));
Scaffold.of(context)
.showSnackBar(SnackBar(content: Text('Retrieved secret: ' + value)));
}).catchError((err) {
Scaffold.of(context).showSnackBar(SnackBar(content: Text('Error happened: ' + err.toString())));
Scaffold.of(context).showSnackBar(
SnackBar(content: Text('Error happened: ' + err.toString())));
});
}

Future<void> _deleteSecret(BuildContext context) async {
FlutterLocker.delete(key).then((value) {
Scaffold.of(context).showSnackBar(SnackBar(content: Text('Secret deleted.')));
Scaffold.of(context)
.showSnackBar(SnackBar(content: Text('Secret deleted.')));
}).catchError((err) {
Scaffold.of(context).showSnackBar(SnackBar(content: Text('Error happened: ' + err.toString())));
Scaffold.of(context).showSnackBar(
SnackBar(content: Text('Error happened: ' + err.toString())));
});
}

Expand All @@ -60,7 +70,10 @@ class _MyAppState extends State<MyApp> {
children: <Widget>[
SizedBox(height: 100),
Center(
child: Text('Locker example', style: TextStyle(fontSize: 24),),
child: Text(
'Locker example',
style: TextStyle(fontSize: 24),
),
),
SizedBox(height: 40),
CupertinoButton.filled(
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ packages:
path: ".."
relative: true
source: path
version: "0.0.1"
version: "1.0.1"
flutter_test:
dependency: "direct dev"
description: flutter
Expand Down
4 changes: 2 additions & 2 deletions example/test/widget_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ void main() {
// Verify that platform version is retrieved.
expect(
find.byWidgetPredicate(
(Widget widget) => widget is Text &&
widget.data.startsWith('Running on:'),
(Widget widget) =>
widget is Text && widget.data.startsWith('Running on:'),
),
findsOneWidget,
);
Expand Down
1 change: 0 additions & 1 deletion lib/flutter_locker.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

library flutter_locker;

import 'dart:async';
Expand Down
Loading

0 comments on commit ad9fa30

Please sign in to comment.