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

outdated

flutter 息屏显示执行事件

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_lifecycle_by_resume/minix.dart';

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

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> with ResumeMixin<MyApp>{

  @override
  void initState() {
    super.initState();
  }


  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('用户息屏后,重新亮屏执行插件'),
        ),
        body: Container(),
      ),
    );
  }

  @override
  void onResume(BuildContext context) {
    // TODO: implement onResume
    /// 此处写亮屏后的逻辑代码
    print("todo in this");
  }
}