flutter_view_tools 1.0.5

Flutter-View Tools #

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


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.


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.


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.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


Flutter-View Tools Example #


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:

  flutter_view_tools: ^1.0.5

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_tools/flutter_view_tools.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 25, 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 suggestions

Format lib/src/lifecycle.dart.

Run flutter format to format lib/src/lifecycle.dart.

Format lib/src/reactive-widget.dart.

Run flutter format to format lib/src/reactive-widget.dart.

Maintenance suggestions

Package is getting outdated. (-10.68 points)

The package was last published 57 weeks ago.


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