empire 1.2.0 copy "empire: ^1.2.0" to clipboard
empire: ^1.2.0 copied to clipboard

A simple yet powerful state management library for Flutter. Keeps your widget build methods clean, with ZERO dependencies on other packages.

example/lib/main.dart

import 'package:empire/empire.dart';
import 'package:flutter/material.dart';
import 'package:uuid/uuid.dart';

import 'application_view_model.dart';
import 'counter_page.dart';
import 'counter_view_model.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Empire State Example',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: Empire(
        ApplicationViewModel(EmpireStringProperty('Empire Counter Example')),
        onAppStateChanged: () => const Uuid().v1(),
        child: CounterPage(
          viewModel: CounterViewModel(),
        ),
      ),
    );
  }
}
10
likes
140
pub points
45%
popularity

Publisher

verified publisherstrivebusiness.ca

A simple yet powerful state management library for Flutter. Keeps your widget build methods clean, with ZERO dependencies on other packages.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on empire