ffm 1.0.22 copy "ffm: ^1.0.22" to clipboard
ffm: ^1.0.22 copied to clipboard

Flutter For Mobile, all in one solution to build your flutter app from scratch.

FFM #

Flutter For Mobile

  • Split UI and logic, and provide connection to each other.
  • Easy state management with auto disposal.

Getting started #

Example:

import 'package:ffm/ffm.dart';
import 'home-page-logic.dart';

class HomePage extends FPage<HomePageLogic> {
  HomePage({Key? key}) : super(key: key) {
    setLogic(HomePageLogic());
  }

  @override
  Widget buildLayout(BuildContext context) {
    return Scaffold(
      key: logic.scaffoldKey,
      appBar: AppBar(
        title: Text('Home'),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            const Text('You have pushed the button this many times:'),
            logic.countPipe.onUpdate((val) => Text(
              '$val',
              style: Theme.of(context).textTheme.headline4,
            )),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: logic.onClickAdd,
        tooltip: 'Increment',
        child: const Icon(Icons.add),
      ),
    );
  }
}
import 'package:ffm/ffm.dart';
import 'home-page.dart';
import 'info-page.dart';

class HomePageLogic extends FPageLogic<HomePage> {
  late FPipe<int> countPipe;

  HomePageLogic() {
    countPipe = FPipe(initValue: 0, disposer: disposer);
  }

  @override
  void initState() {}

  @override
  void onBuildLayout() {}

  @override
  void onLayoutLoaded() {}

  void onClickAdd() async {
    countPipe.update(countPipe.value + 1);
    if (countPipe.value == 3) {
      countPipe.update(0);
      var value = await pageOpen<int>(InfoPage());
    }
  }
}

Contributions #

Feel free to contribute to this project.

If you find a bug or want a feature, but don't know how to fix/implement it, please fill an issue.
If you fixed a bug or implemented a feature, please send a pull request.

2
likes
130
points
62
downloads

Publisher

unverified uploader

Weekly Downloads

Flutter For Mobile, all in one solution to build your flutter app from scratch.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

clock, flutter, intl, pointycastle, rxdart

More

Packages that depend on ffm