data_binding 0.2.1

data_binding #

This is a library of Flutter for data binding works as similar as what Android does.


How to use #

  1. Create sub class of BaseViewModel with Observables.

​ 创建BaseViewModel的子类,在其中添加多个Observable

  1. Create sub class of BindingWidgetBuilder, which builds Widget with the data from a Observable.

​ 创建BindingWidgetBuilder的子类,其用某个Observable的数据来生成Widget。

  1. binding() the Observable and the BindingWidgetBuilder.

​ 用binding()绑定ObservableBindingWidgetBuilder

  1. When the property of the Observable in the ViewModel was changed, the Widget would be updated.

​ 当ViewModel中的Observableproperty被改变时,Widget也会更新。

[0.2.0] - 28/03/2019.

  • An Observable can be bound by multi widgets.

[0.1.0] - 21/03/2019.

  • With example app.


Example app for data_binding

Use this package as a library

1. Depend on it

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

  data_binding: ^0.2.1

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:data_binding/data_binding.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

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

  • Dart: 2.7.1
  • pana: 0.13.5
  • Flutter: 1.12.13+hotfix.7

Health issues and suggestions

Document public APIs. (-1 points)

36 out of 36 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/data_binding.dart. (-0.50 points)

Analysis of lib/data_binding.dart reported 1 hint:

line 54 col 16: 'ancestorWidgetOfExactType' is deprecated and shouldn't be used. Use findAncestorWidgetOfExactType instead. This feature was deprecated after v1.12.1..

Maintenance suggestions

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies