yak_runner 0.0.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 48

yak_runner #

A Flutter package with goal of making pseudo-TDD and error handling more concise

[0.0.2] - 21st June 2020 #

  • full re-design with mixin based classes
  • async and sync test pass
TO DO LISTSTATUS
implement streemsTO DO
example appTO DO

[0.0.1+1] - 4th June 2020 #

TO DO LISTSTATUS
remove flutter dependencydone
refactor and renamedone
implement streemsTO DO

[0.0.1] - 4th June 2020 #

  • this release is pre-alpha

example/lib/main.dart

import 'dart:async';
import 'dart:convert';
import 'package:http/http.dart' as http;
import 'package:flutter/material.dart';
import 'package:yak/yak.dart';

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


class MyApp extends StatelessWidget {

  static const _title = '[yak_runner] Sample App';
  @override
  Widget build(BuildContext context) => MaterialApp(
    title: _title,
    home: MyHomePage(title: _title),
  );
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key key, this.title}) : super(key: key);
  final String title;

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

class _MyHomePageState extends State<MyHomePage> {

  /// [need to update package first]
  // int _counter = 1;
  // YakAsyncFunctionInterface<String,int> _swapi;
  // YakFunctionInterface<String,String> _decode;
  // YakAsyncFunction<String,int> _yakApi;
  // YakFunction<String,String> _yakDecode;
  // StreamController<String> _controller;

  // @override
  // void initState() {
  //   _controller = StreamController<String>();
  //   _swapi = SWApi();
  //   _decode = DecodeSwapiJson();
  //   _yakApi = Yak.asyncFunction<String,int>(function: _swapi);
  //   _yakDecode = Yak.function(function: _decode);
  //   super.initState();
  // }

  // void _fetch(int data) async {
  //   _yakDecode(await _yakApi(data));
  // }



  @override
  Widget build(BuildContext context) => Scaffold(

  );
}

class SWApi implements YakAsyncFunctionInterface<String,int> {
  static const String _url = 'https://swapi.dev/api/people/';

  @override
  FutureOr<String> call(FutureOr<int> argument) async {
    final int _i = await argument;
    final http.Response _res = await http.get(_url+'$_i');
    if (_res.statusCode != 200) {throw Error;}
    return _res.body;
  } 
}

class DecodeSwapiJson implements YakFunctionInterface<String,String> {
  @override
  String call(String argument) {
    final Map<String,dynamic> _json = jsonDecode( argument);
    return _json['name'] as String;
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  yak_runner: ^0.0.2

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

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

3. Import it

Now in your Dart code, you can use:


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

We analyzed this package on Jul 6, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.13

Analysis suggestions

Package not compatible with SDK dart

because of import path [yak_runner] that is in a package requiring null.

Health suggestions

Format lib/src/nullary/implementation.dart.

Run flutter format to format lib/src/nullary/implementation.dart.

Format lib/src/nullary/interfaces.dart.

Run flutter format to format lib/src/nullary/interfaces.dart.

Format lib/src/nullary/mixin.dart.

Run flutter format to format lib/src/nullary/mixin.dart.

Fix additional 10 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/src/streams/yak_stream_function.dart (Run flutter format to format lib/src/streams/yak_stream_function.dart.)
  • lib/src/streams/yak_stream_generator.dart (Run flutter format to format lib/src/streams/yak_stream_generator.dart.)
  • lib/src/timeout/interface.dart (Run flutter format to format lib/src/timeout/interface.dart.)
  • lib/src/timeout/mixin.dart (Run flutter format to format lib/src/timeout/mixin.dart.)
  • lib/src/unary/implementation.dart (Run flutter format to format lib/src/unary/implementation.dart.)
  • lib/src/unary/mixin.dart (Run flutter format to format lib/src/unary/mixin.dart.)
  • lib/src/utils/failure.dart (Run flutter format to format lib/src/utils/failure.dart.)
  • lib/src/validator/conditions.dart (Run flutter format to format lib/src/validator/conditions.dart.)
  • lib/src/validator/interfaces.dart (Run flutter format to format lib/src/validator/interfaces.dart.)
  • lib/src/validator/mixin.dart (Run flutter format to format lib/src/validator/mixin.dart.)

Maintenance suggestions

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
dartz ^0.9.1 0.9.1
equatable ^1.2.0 1.2.0
meta ^1.1.8 1.2.1
Transitive dependencies
collection 1.14.13
Dev dependencies
flutter_test