musk 0.0.1 copy "musk: ^0.0.1" to clipboard
musk: ^0.0.1 copied to clipboard

Musk gives you utils widgets and interfaces to apply separation of concerns

example/lib/main.dart

import 'package:example/home_view_model.dart';
import 'package:musk/musk.dart' show Musk, Screen;
import 'package:flutter/material.dart';
import 'package:get_it/get_it.dart';

void main() {
  Musk.instance.initDependencies();
  GetIt.instance.registerSingleton<HomeViewModel>(HomeViewModel());
  runApp(const App());
}

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: HomeView(),
    );
  }
}

class HomeView extends Screen<HomeViewModel> {
  HomeView({Key? key}) : super(key: key);

  @override
  Widget? builder() {
    return Scaffold(
      appBar: AppBar(
        title: Text(viewModel.title),
      ),
      body: Center(
        child: ElevatedButton(
          onPressed: viewModel.navToNext, // Your custom method.
          child: const Text('Go Next'),
        ),
      ),
    );
  }
}
2
likes
110
points
33
downloads

Publisher

unverified uploader

Weekly Downloads

Musk gives you utils widgets and interfaces to apply separation of concerns

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

analyzer, build, connectivity_plus, flutter, get, meta, shared_preferences, source_gen

More

Packages that depend on musk