better_effect_flutter 0.4.0 copy "better_effect_flutter: ^0.4.0" to clipboard
better_effect_flutter: ^0.4.0 copied to clipboard

Flutter MVVM integration for better_effect with typed EffectCommand state, scoped Runtime bootstrap, and one-shot UI listeners.

example/lib/main.dart

import 'package:better_effect_flutter/better_effect_flutter.dart';
import 'package:better_effect_flutter_example/ui/splash_screen.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';

import 'config/app_module.dart';
import 'ui/tasks_screen.dart';

void main() {
  runApp(
    BetterEffectBootstrap(
      module: appModule,
      observer: (transition) {
        if (kDebugMode) {
          debugPrint('$transition');
        }
      },
      loadingBuilder: (_) => const SplashScreen(),
      minimumLoadingDuration: const Duration(seconds: 2),
      errorBuilder: (context, error, stackTrace, retry) {
        return MaterialApp(
          home: Scaffold(
            body: Center(
              child: Padding(
                padding: const EdgeInsets.all(24),
                child: Text('Could not start the app: $error'),
              ),
            ),
          ),
        );
      },
      builder: (_) => const TasksApp(),
    ),
  );
  // Or Use Application root method
  // return runBetterEffectApp(
  //   module: appModule,
  //   observer: (transition) {
  //     if (kDebugMode) {
  //       debugPrint('$transition');
  //     }
  //   },
  //   startupErrorBuilder: (error, stackTrace) {
  //     return MaterialApp(
  //       home: Scaffold(
  //         body: Center(
  //           child: Padding(
  //             padding: const EdgeInsets.all(24),
  //             child: Text('Could not start the app: $error'),
  //           ),
  //         ),
  //       ),
  //     );
  //   },
  //   app: const TasksApp(),
  // );
}
0
likes
160
points
254
downloads

Documentation

Documentation
API reference

Publisher

unverified uploader

Weekly Downloads

Flutter MVVM integration for better_effect with typed EffectCommand state, scoped Runtime bootstrap, and one-shot UI listeners.

Repository (GitHub)
View/report issues

Topics

#flutter #mvvm #dependency-injection #state-management #effects

License

MIT (license)

Dependencies

better_effect, flutter

More

Packages that depend on better_effect_flutter