thoaded 0.1.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 55

Thoaded #

Library for simple and fast design pattern that extends model, view and controller for asynchronous events in supported modern programming languages.

Installation #

You should ensure that you add the router as a dependency in your project:

dependencies:
 thoaded: ^0.1.0

Documentation #

Thoaded applications are created by composing a series of simple inheritances. By convention, this components extends Modify-based Asynchronous Pattern.

import 'dart:async';
import 'package:thoaded/thoaded.dart';

class SampleMoldeled extends Modeled<String> {
  @override
  Future<String> added(String text) {
    return Future.value(text);
  }

  @override
  Future<String> updated(String text) {
    return Future.value(text);
  }

  @override
  Future<String> deleted(String text) {
    return Future.value(text);
  }

  @override
  Future<String> readed(String text) {
    return Future.value(text);
  }

  @override
  Future<Iterable<String>> queried([String texts]) {
    return Future.value([texts]);
  }

  @override
  Future<void> listened([String texts]) {
    return Future.value();
  }

  @override
  Future<String> unlistened([String texts]) {
    return Future.value();
  }
}

class SampleViewed extends Viewed<String> {
  @override
  Future<String> added(String text) {
    return Future.value(text);
  }

  @override
  Future<String> updated(String text) {
    return Future.value(text);
  }

  @override
  Future<String> deleted(String text) {
    return Future.value(text);
  }

  @override
  Future<String> readed(String text) {
    return Future.value(text);
  }

  @override
  Future<Iterable<String>> queried([String texts]) {
    return Future.value([texts]);
  }

  @override
  Future<void> listened([String texts]) {
    return Future.value();
  }

  @override
  Future<String> unlistened([String texts]) {
    return Future.value();
  }
}

class SampleControlled extends Controlled<String> {
  // run constructor in parent class
  SampleControlled() : super(new SampleMoldeled(), new SampleViewed()) {
    // dispatch read event in modeled listener
    this.modeled.readed("Hello, World!").then((text) {
      // dispatch read event to viewed listener
      this.viewed.readed(text).then((text) {
        // print successfully
        print("Print " + text + " successfully.");
      });
    });
  }
}

void main() {
  SampleControlled();
}

Compatibility #

Thoaded supports all environments that are Flutter.

0.1.0 #

  • Fix description in documentation files

0.0.9 #

  • Rename project for name exclusivity in social networks and create site and update documents with new informations

0.0.8 #

  • Rename project for name exclusivity in dependency management and organize files by language type

0.0.7 #

  • Make a similar code for other modern languages ‚Äč‚Äčlike CSharp, Python, Java, Swift and Dart

0.0.6 #

  • Bug in sync events when load notes of IndexedDB sample

0.0.5 #

  • Fix the bug in grid of IndexedDB sample

0.0.4 #

  • Fix readme file to Installation

0.0.3 #

  • Update IndexedDB sample with view source

0.0.2 #

  • Version publish in npm

0.0.1 #

  • Initial version

example/main.dart

import 'dart:async';
import 'package:thoaded/thoaded.dart';

class SampleMoldeled extends Modeled<String> {
  @override
  Future<String> added(String text) {
    return Future.value(text);
  }

  @override
  Future<String> updated(String text) {
    return Future.value(text);
  }

  @override
  Future<String> deleted(String text) {
    return Future.value(text);
  }

  @override
  Future<String> readed(String text) {
    return Future.value(text);
  }

  @override
  Future<Iterable<String>> queried([String texts]) {
    return Future.value([texts]);
  }

  @override
  Future<void> listened([String texts]) {
    return Future.value();
  }

  @override
  Future<String> unlistened([String texts]) {
    return Future.value();
  }
}

class SampleViewed extends Viewed<String> {
  @override
  Future<String> added(String text) {
    return Future.value(text);
  }

  @override
  Future<String> updated(String text) {
    return Future.value(text);
  }

  @override
  Future<String> deleted(String text) {
    return Future.value(text);
  }

  @override
  Future<String> readed(String text) {
    return Future.value(text);
  }

  @override
  Future<Iterable<String>> queried([String texts]) {
    return Future.value([texts]);
  }

  @override
  Future<void> listened([String texts]) {
    return Future.value();
  }

  @override
  Future<String> unlistened([String texts]) {
    return Future.value();
  }
}

class SampleControlled extends Controlled<String> {
  // run constructor in parent class
  SampleControlled() : super(new SampleMoldeled(), new SampleViewed()) {
    // dispatch read event in modeled listener
    this.modeled.readed("Hello, World!").then((text) {
      // dispatch read event to viewed listener
      this.viewed.readed(text).then((text) {
        // print successfully
        print("Print " + text + " successfully.");
      });
    });
  }
}

void main() {
  SampleControlled();
}

Use this package as a library

1. Depend on it

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


dependencies:
  thoaded: ^0.1.0

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support 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:thoaded/thoaded.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
10
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
55
Learn more about scoring.

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

  • Dart: 2.7.1
  • pana: 0.13.6
  • Flutter: 1.12.13+hotfix.8

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
async ^2.2.0 2.4.1
flutter 0.0.0
meta ^1.1.6 1.1.8
Transitive dependencies
collection 1.14.11 1.14.12
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test
test ^1.6.3