flutter_view_widgets 1.0.6

  • Readme
  • Changelog
  • Example
  • Installing
  • 80

Flutter-view Widgets #

Notice: flutter_view_widgets replaces the flutter_view_tools library, which can no longer maintained due to a loss of Dart pub credentials.

Flutter-view is a tool that lets you easily create layouts for Flutter, using Pug and Sass.

http://flutter-view.io

This package adds some widgets that allow some extra functionality for flutter-view, and are highly recommended for your flutter-view projects.

Check out the documentation on how to get started with this library in your own flutter-view project. Check out the example project for a simple project that uses all supported widgets.

The library adds the following widgets:

Assign #

A builder widget used in combination with the flutter-view assign tag shortcut, used to assign a value to a new variable in your widget build tree.

Documentation

Lifecycle #

A stateful widget that lets you hook into different lifecycle events of its state, such as initState, render and dispose. You can use these hooks for updating and cleaning up in your view-model.

Documentation

ReactiveWidget #

A wrapper of a Flutter StreamWidget, that monitors a Listenable such as a Model, and triggers an update when that Listenable updates. This allows for your tree of widgets to respond to model updates.

Documentation | Usage guide

Changelog #

1.0.6 #

- Renamed from flutter_view_tools to flutter_view_widgets to be able to publish again to pub
- Use latest Flutter release
- Formatted sources with flutter format

1.0.5 #

- Formatted sources with flutter format

1.0.4 #

- Using scoped_model: ^1.0.1
- Updated example readme
- Fixed example bug

1.0.3 #

- Added example, better description, changelog.md and more documentation.

1.0.2 #

- Improved exports

1.0.1 #

- Updated readme and added scoped_model in the exports

1.0.0 #

- First public release with the tools in a new seperated tools package

example/README.md

Flutter-View Tools Example #

Screenshot

This app shows you by example how you may use the Assign, Lifecycle, and ReactiveWidget classes.

It is a simple screen that lets you enter a text, and as you type, updates the same text on the screen.

  • It demonstrates the reactive tag and ReactiveWidget by using it to update the text on the screen by monitoring the model
  • It demonstrates the assign tag and widget by assigning the text controller to the ctl parameter
  • It demonstrates the lifecycle tag and widget by using it to call methods to init and dispose of a listener for the text controller

The most important files to check are:

  • example-model.dart: This contains the state of the app. Since it extends the Model class, it can call notifyListeners() to inform any listeners that it has changed. This allows the ReactiveWidget in the ExamplePage to watch it, and rerender whenever the example model has changed.
  • main.dart: The startpoint of the app. It creates the ExampleApp and its _ExampleAppState. The _ExampleAppState creates and holds the ExampleModel, and for the home it uses the ExamplePage, passing the model for rendering.
  • example-page.pug: The template for the home page of the example app. In this file you see each flutter-view tag being used, with some explanation in the comments.
  • example-page.dart: This is the generated Dart code from example-page.pug, after having been processed by the flutter-view console tool.

See the project page for more information on this project and flutter-view.

Use this package as a library

1. Depend on it

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


dependencies:
  flutter_view_widgets: ^1.0.6

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:flutter_view_widgets/flutter_view_widgets.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
60
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]
80
Learn more about scoring.

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

  • Dart: 2.6.1
  • pana: 0.13.1+4
  • Flutter: 1.12.13+hotfix.2

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.23.0 <3.0.0
flutter 0.0.0
scoped_model ^1.0.1 1.0.1
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
flutter_test