lite_state 3.2.1 copy "lite_state: ^3.2.1" to clipboard
lite_state: ^3.2.1 copied to clipboard

A simple state management machine for Flutter.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:lite_state/lite_state.dart';

import 'lite_state_controllers/auth_controller.dart';
import 'lite_state_controllers/auth_data.dart';
import 'lite_state_controllers/loader_controller.dart';
import 'test_page.dart';

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

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

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    initJsonDecoders({
      AuthData: AuthData.decode,
    });

    initControllersLazy({
      AuthController: () => AuthController(),
      LoaderController: () => LoaderController(),
    });

    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.red,
      ),
      home: const TestPage(),
    );
  }
}
8
likes
150
points
371
downloads

Publisher

verified publishersoftmaestri.com

Weekly Downloads

A simple state management machine for Flutter.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

collection, crypto, flutter, hive, path_provider

More

Packages that depend on lite_state