easy_mvvm 0.1.1 copy "easy_mvvm: ^0.1.1" to clipboard
easy_mvvm: ^0.1.1 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({super.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
140
points
109
downloads

Documentation

API reference

Publisher

verified publisherrutvik.dev

Weekly Downloads

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

Repository (GitHub)
View/report issues

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