Flutter For Mobile

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

Getting started


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

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

  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(
              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);

  void initState() {}

  void onBuildLayout() {}

  void onLayoutLoaded() {}

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


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.