easy_mvvm 0.0.9 copy "easy_mvvm: ^0.0.9" to clipboard
easy_mvvm: ^0.0.9 copied to clipboard

An easy mvvm solution that includes ways to manage routes, views, viewmodels, and the mvvm architecture

example/lib/main.dart

import 'package:easy_mvvm/easy_mvvm.dart';
import 'package:example/app/locator.dart';
import 'package:example/app/routes.dart';
import 'package:example/ui/views/splash_view/splash_view.dart';
import 'package:flutter/material.dart';

void main() {
  // if any of the code calls native code
  // (ios/js/android/etc) then you need to call this
  WidgetsFlutterBinding.ensureInitialized();

  // Setup the locator
  setupLocator();

  // Setup the routes
  setupRoutes();

  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),

      // add the initial route (it can also be the `RouteService().homeView`)
      initialRoute: RouteService.path<SplashView>(),
      // this allows the [RouteService] to generate the necessary routes
      onGenerateRoute: RouteService().onGenerateRoute,
    );
  }
}
5
likes
120
pub points
38%
popularity

Publisher

verified publisherrutvik.dev

An easy mvvm solution that includes ways to manage routes, views, viewmodels, and the mvvm architecture

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

animations, args, code_builder, colorize, dart_style, flutter, get_it, meta, pubspec_yaml, recase, universal_platform

More

Packages that depend on easy_mvvm