factory_castle_flutter 2.1.0
factory_castle_flutter: ^2.1.0 copied to clipboard

A complete MVVM state management solution for Flutter based on factory_castle package.

example/lib/main.dart

import 'package:factory_castle/factory_castle.dart';
import 'package:factory_castle_flutter/factory_castle_flutter.dart';
import 'package:flutter/material.dart';

import 'example_installer.dart';
import 'home_page/home_page.dart';
import 'ui_text_service.dart';

/// IoC container is set up via installer before the app is run.
void main() {
  final container = FactoryContainer()..install(ExampleInstaller());
  runApp(MyApp(container));
}

class MyApp extends StatelessWidget {
  MyApp(this._container);

  final FactoryContainer _container;

  /// App root is [FactoryContainerWidget] which makes [FactoryContainer] accessible down the widget tree
  @override
  Widget build(BuildContext context) => FactoryContainerWidget(
        container: _container,
        child: MaterialApp(
          title: _container.resolve<UiTextService>().appTitle,
          theme: _container.resolve(),
          home: HomePage(),
        ),
      );
}
0
likes
100
pub points
0%
popularity

Publisher

nuc134r.io

A complete MVVM state management solution for Flutter based on factory_castle package.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

factory_castle, flutter

More

Packages that depend on factory_castle_flutter