Skip to content

Commit

Permalink
Merge pull request #67 from Earlybyte/pubDev
Browse files Browse the repository at this point in the history
Comply Pub Dev Requirements
  • Loading branch information
loetsphi authored Oct 12, 2020
2 parents 4472009 + f7d6991 commit 179573c
Show file tree
Hide file tree
Showing 138 changed files with 379 additions and 505 deletions.
1 change: 0 additions & 1 deletion .flutter-plugins

This file was deleted.

7 changes: 4 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
## [0.2.0] - 20201007

- Add additional config options https://github.com/Earlybyte/aad_oauth/pull/66
- Throw Exception on return https://github.com/Earlybyte/aad_oauth/pull/55
- Fix Example App https://github.com/Earlybyte/aad_oauth/pull/65
- Add additional config options #66
- Throw Exception on return #55
- Fix Example App #65
- Comply Pub Dev Requirements #67

## [0.1.9] - 20200529

Expand Down
54 changes: 54 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
#
# Google internally enforced rules. See README.md for more information,
# including a list of lints that are intentionally _not_ enforced.

linter:
rules:
- always_declare_return_types
- always_require_non_null_named_parameters
- annotate_overrides
- avoid_empty_else
- avoid_init_to_null
- avoid_null_checks_in_equality_operators
- avoid_relative_lib_imports
- avoid_return_types_on_setters
- avoid_shadowing_type_parameters
- avoid_types_as_parameter_names
- camel_case_extensions
- curly_braces_in_flow_control_structures
- empty_catches
- empty_constructor_bodies
- library_names
- library_prefixes
- no_duplicate_case_values
- null_closures
- omit_local_variable_types
- prefer_adjacent_string_concatenation
- prefer_collection_literals
- prefer_conditional_assignment
- prefer_contains
- prefer_equal_for_default_values
- prefer_final_fields
- prefer_for_elements_to_map_fromIterable
- prefer_generic_function_type_aliases
- prefer_if_null_operators
- prefer_is_empty
- prefer_is_not_empty
- prefer_iterable_whereType
- prefer_single_quotes
- prefer_spread_collections
- recursive_getters
- slash_for_doc_comments
- type_init_formals
- unawaited_futures
- unnecessary_const
- unnecessary_new
- unnecessary_null_in_if_null_operators
- unnecessary_this
- unrelated_type_equality_checks
- use_function_type_syntax_for_parameters
- use_rethrow_when_possible
- valid_regexps
4 changes: 2 additions & 2 deletions android/local.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
sdk.dir=C:\\Users\\tobias.meier.eb\\AppData\\Local\\Android\\sdk
flutter.sdk=C:\\flutter
sdk.dir=/Users/philipp/Library/Android/sdk
flutter.sdk=/Users/philipp/development/flutter
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,6 @@
/* Begin XCBuildConfiguration section */
249021D3217E4FDB00AE95B9 /* Profile */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
Expand Down Expand Up @@ -393,7 +392,6 @@
};
97C147031CF9000F007C117D /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
Expand Down Expand Up @@ -449,7 +447,6 @@
};
97C147041CF9000F007C117D /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
Expand Down
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
55 changes: 23 additions & 32 deletions examples/example/lib/main.dart → example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,17 @@ import 'package:aad_oauth/aad_oauth.dart';
import 'package:aad_oauth/model/config.dart';
import 'package:flutter/material.dart';

void main() => runApp(new MyApp());

class MyApp extends StatefulWidget {
@override
_MyAppState createState() => new _MyAppState();
}

class _MyAppState extends State<MyApp> {
@override
initState() {
super.initState();
}
void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
return MaterialApp(
title: 'AAD OAuth Demo',
theme: new ThemeData(
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: new MyHomePage(title: 'AAD OAuth Home'),
home: MyHomePage(title: 'AAD OAuth Home'),
);
}
}
Expand All @@ -32,35 +22,36 @@ class MyHomePage extends StatefulWidget {
final String title;

@override
_MyHomePageState createState() => new _MyHomePageState();
_MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
static final Config config = new Config(
tenant: "YOUR_TENANT_ID",
clientId: "YOUR_CLIENT_ID",
scope: "openid profile offline_access",
redirectUri: "https://login.live.com/oauth20_desktop.srf",
static final Config config = Config(
tenant: 'YOUR_TENANT_ID',
clientId: 'YOUR_CLIENT_ID',
scope: 'openid profile offline_access',
redirectUri: 'https://login.live.com/oauth20_desktop.srf',
);
final AadOAuth oauth = AadOAuth(config);

@override
Widget build(BuildContext context) {
// adjust window size for browser login
var screenSize = MediaQuery.of(context).size;
var rectSize =
Rect.fromLTWH(0.0, 25.0, screenSize.width, screenSize.height - 25);
oauth.setWebViewScreenSize(rectSize);

return new Scaffold(
appBar: new AppBar(
title: new Text(widget.title),
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: ListView(
children: <Widget>[
ListTile(
title: Text(
"AzureAD OAuth",
style: Theme.of(context).textTheme.headline,
'AzureAD OAuth',
style: Theme.of(context).textTheme.headline5,
),
),
ListTile(
Expand All @@ -87,9 +78,9 @@ class _MyHomePageState extends State<MyHomePage> {
}

void showMessage(String text) {
var alert = new AlertDialog(content: new Text(text), actions: <Widget>[
new FlatButton(
child: const Text("Ok"),
var alert = AlertDialog(content: Text(text), actions: <Widget>[
FlatButton(
child: const Text('Ok'),
onPressed: () {
Navigator.pop(context);
})
Expand All @@ -100,15 +91,15 @@ class _MyHomePageState extends State<MyHomePage> {
void login() async {
try {
await oauth.login();
String accessToken = await oauth.getAccessToken();
showMessage("Logged in successfully, your access token: $accessToken");
var accessToken = await oauth.getAccessToken();
showMessage('Logged in successfully, your access token: $accessToken');
} catch (e) {
showError(e);
}
}

void logout() async {
await oauth.logout();
showMessage("Logged out");
showMessage('Logged out');
}
}
Loading

0 comments on commit 179573c

Please sign in to comment.