bolter_flutter 5.0.2 copy "bolter_flutter: ^5.0.2" to clipboard
bolter_flutter: ^5.0.2 copied to clipboard

discontinuedreplaced by: bolter
outdated

based on bolter library extensions for manage widgets and state

example/lib/main.dart

import 'package:bolter_flutter/bolter_flutter.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(BolterProvider(
    child: PresenterProvider(
      presenter: NavPresenter(Navigation([F()])),
      child: PresenterProvider(
        presenter: NavTabPresenter(TabNavigation("1")),
        child: CupertinoApp(
          color: Colors.white,
          home: Builder(builder: (context) {
            return BolterNavigator<NavPresenter>(
              // navigationPresenter: context.presenter<NavPresenter>(),
              routes: {
                F: (c) {
                  // return Root(
                  //   key: ValueKey('1234'),
                  // );
                  return BolterTabNavigator<NavTabPresenter>(
                    key: ValueKey('1231232131'),
                    pages: {"1": (ctx) => Root()},
                    tabs: {"1": (ctx) => Icon(Icons.add)},
                    selectedTabs: {"1": (ctx) => Icon(Icons.add)},
                  );
                },
                S: (c) => Center(
                      child: RaisedButton(
                        onPressed: () {
                          Navigator.of(c).pop();
                        },
                      ),
                    )
              },
            );
          }),
        ),
      ),
    ),
  ));
}

class NavPresenter extends Presenter with NavigationPresenter {
  final Navigation navState;

  NavPresenter(this.navState);

  @override
  Navigation get navigation => navState;
}

class NavTabPresenter extends Presenter with TabNavigationPresenter {
  final TabNavigation navState;

  NavTabPresenter(this.navState);

  @override
  TabNavigation get tabNavigation => navState;
}

class Root extends StatefulWidget {
  const Root({Key key}) : super(key: key);

  @override
  _RootState createState() => _RootState();
}

class _RootState extends State<Root> {
  @override
  Widget build(BuildContext context) {
    print('root');
    return Center(
      child: Column(
        mainAxisSize: MainAxisSize.min,
        children: [
          FutureBuilder<String>(
            builder: (c, v) {
              print('FURTURE');
              return Material(child: Text(v?.data ?? "01"));
            },
            future: Future.value("123"),
          ),
          RaisedButton(
            onPressed: () {
              context.presenter<NavPresenter>().push(S());
            },
          ),
        ],
      ),
    );
  }
}

class F extends BolterRoute {}

class S extends BolterRoute {}
4
likes
0
pub points
0%
popularity

Publisher

verified publisherrenesanse.net

based on bolter library extensions for manage widgets and state

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

after_layout, animations, bolter, flutter, hive, hive_flutter, provider

More

Packages that depend on bolter_flutter