states_rebuilder 1.3.2 copy "states_rebuilder: ^1.3.2" to clipboard
states_rebuilder: ^1.3.2 copied to clipboard

outdated

a simple yet powerful state management technique for Flutter

example/lib/main.dart

import 'package:flutter/material.dart';

import './tutorial_1/main.dart' as tutorial1;
import './tutorial_2/main.dart' as tutorial2;
import './state_with_mixin_builder.dart/main.dart' as stateWithMixin;

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'States Rebuilder ',
      home: Scaffold(
        appBar: AppBar(
          title: Text("States Rebuilder demo"),
        ),
        body: MyHomePage(),
      ),
    );
  }
}

class MyHomePage extends StatelessWidget {
  goto(Widget page, BuildContext context) {
    Navigator.push(
      context,
      MaterialPageRoute(
        builder: (context) => page,
      ),
    );
  }

  @override
  Widget build(BuildContext context) {
    return Center(
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.center,
        children: <Widget>[
          RaisedButton(
            child: Text("Tutorial 1: Basic use of StateBuilder and Injector"),
            onPressed: () => goto(tutorial1.App(), context),
          ),
          RaisedButton(
            child: Text("Tutorial 2: Basic Use of Streaming"),
            onPressed: () => goto(tutorial2.App(), context),
          ),
          RaisedButton(
            child: Text("StateWithMixinBuilder examples"),
            onPressed: () => goto(stateWithMixin.MyApp(), context),
          ),
        ],
      ),
    );
  }
}
394
likes
0
pub points
94%
popularity

Publisher

unverified uploader

a simple yet powerful state management technique for Flutter

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on states_rebuilder