lifecycle_provider 0.0.2 copy "lifecycle_provider: ^0.0.2" to clipboard
lifecycle_provider: ^0.0.2 copied to clipboard

Based on the provider and combined with GetX, a state management tool is developed, which enables the widget to have an Android-like life cycle.

example/lib/main.dart

import 'package:example/pages/page_one.dart';
import 'package:flutter/material.dart';
import 'package:lifecycle_provider/lifecycle_provider.dart';

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

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

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const PageOne(),
      navigatorObservers: [LifecycleRouteObserver()],
    );
  }
}
copied to clipboard
1
likes
0
points
191
downloads

Publisher

unverified uploader

Weekly Downloads

2024.07.08 - 2025.01.20

Based on the provider and combined with GetX, a state management tool is developed, which enables the widget to have an Android-like life cycle.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, meta, provider

More

Packages that depend on lifecycle_provider