simple_auth_generator 2.0.2

  • Readme
  • Changelog
  • Installing
  • 67

Simple Auth Generator #

This is the API Generator for Simple Auth

Usage #

Dart #

pub run build_runner build

flutter #

flutter packages pub run build_runner build

Add the following to your pubspec.yaml

dev_dependencies:
  simple_auth_generator: 
  build_runner: ^0.8.0

The Generator is not required, however it will make things magical.

@GoogleApiDeclaration("GoogleTestApi","client_id",clientSecret: "client_secret", scopes: ["TestScope", "Scope2"])
abstract class GoogleTestDefinition {
  @Get(url: "https://www.googleapis.com/oauth2/v1/userinfo?alt=json")
  Future<Response<GoogleUser>> getCurrentUserInfo();
}

will generate a new Api for you that is easy to use!

var api = new GoogleTestApi("google");
var user = await getCurrentUserInfo();

For more examples, check out the example project

Serialization #

Json objects will automatically serialize if you conform to JsonSerializable

If you use the generator and you objects have the factory factory JsonSerializable.fromJson(Map<String, dynamic> json) your api calls will automatically Serialize/Deserialize

Or you can pass your own Converter to the api and handle conversion yourself. \

[2.0.2] - 02-28-2019

  • Added Azure A2D V2

[2.0.1] - 01-28-2019

  • Azure APIs now generate properly

[2.0] - 11-09-2018

  • The rest of the providers now require a redirect
  • Cleaned up dependencies

[1.0.3] - 08-30-2018

  • Updated dependencies

[1.0.2] - 08-30-2018

  • Updated dependencies

[1.0.1] - 07-30-2018

  • OAuth Bug fix

[0.0.1] - 07-05-2018

  • Initial release of Simple Auth

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  simple_auth_generator: ^2.0.2

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:simple_auth_generator/simple_auth_generator.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
66
Health:
Code health derived from static analysis. [more]
65
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
70
Overall:
Weighted score of the above. [more]
67
Learn more about scoring.

We analyzed this package on Dec 5, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.1
  • pana: 0.12.21

Platforms

Detected platforms: other

Primary library: package:simple_auth_generator/simple_auth_generator.dart with components: io, build, mirrors.

Health issues and suggestions

Document public APIs. (-1 points)

2 out of 2 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/src/generator.dart. (-34.03 points)

Analysis of lib/src/generator.dart reported 83 hints, including:

line 25 col 13: Unnecessary new keyword.

line 40 col 30: Unnecessary new keyword.

line 43 col 26: Unnecessary new keyword.

line 46 col 20: Unnecessary new keyword.

line 72 col 18: Unnecessary new keyword.

Maintenance issues and suggestions

Support latest dependencies. (-20 points)

The version constraint in pubspec.yaml does not support the latest published versions for 2 dependencies (analyzer, build_config).

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and simple_auth_generator.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev <3.0.0
analyzer >=0.32.2 <0.34.0 0.33.6+1 0.39.1
build >=0.12.6 <2.0.0 1.1.0 1.2.2
build_config >=0.2.6 <0.4.0 0.3.2 0.4.1+1
code_builder ^3.1.0 3.2.1
dart_style ^1.2.0 1.2.0 1.3.3
logging ^0.11.3 0.11.3+2
meta ^1.1.0 1.1.8
path ^1.3.2 1.6.4
simple_auth ^2.0.2 2.0.5
source_gen ^0.9.0 0.9.4+1 0.9.4+6
Transitive dependencies
args 1.5.2
async 2.4.0
built_collection 4.3.0
built_value 7.0.0
charcode 1.1.2
checked_yaml 1.0.2
collection 1.14.12
convert 2.1.1
crypto 2.1.3
csslib 0.16.1
fixnum 0.10.11
front_end 0.1.6+9 0.1.29
glob 1.2.0
html 0.14.0+3
http 0.12.0+2
http_parser 3.1.3
js 0.6.1+1
json_annotation 2.4.0 3.0.0
kernel 0.3.6+9 0.3.29
matcher 0.12.6
node_interop 1.0.3
node_io 1.0.1+2
package_config 1.1.0
pedantic 1.9.0
plugin 0.2.0+3
pub_semver 1.4.2
pubspec_parse 0.1.5
quiver 2.1.2+1
source_span 1.5.5
stack_trace 1.9.3
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
watcher 0.9.7+13
yaml 2.2.0
Dev dependencies
build_runner ^1.0.0
build_runner_core ^1.0.0
build_test ^0.10.0
build_verify ^1.1.0
test any