flutter_lifecycle 0.2.0 flutter_lifecycle: ^0.2.0 copied to clipboard
Get access to Flutter's life cycle on StatelessWidgets. It adds the ability to run onInit and onDispose to StatelessWidget
import 'package:flutter/material.dart';
import './home_page.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Lifecycle',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: HomePage(),
);
}
}