Example.dart 991 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import 'package:flutter/material.dart';
  2. import '../styles/colors.dart';
  3. import 'dart:ui';
  4. import '../styles/totast.dart';
  5. class Rechrage extends StatefulWidget {
  6. @override
  7. RechrageState createState() => RechrageState();
  8. }
  9. class RechrageState extends State<Rechrage> {
  10. @override
  11. Widget build(BuildContext context) {
  12. return new WillPopScope(
  13. child: Scaffold(
  14. appBar: AppBar(
  15. backgroundColor: PRIMARY_COLOR,
  16. title: Text('充值'),
  17. centerTitle: true,
  18. elevation:0,
  19. ),
  20. body: RefreshIndicator(
  21. color: PRIMARY_COLOR,
  22. backgroundColor: BG_COLOR,
  23. onRefresh: () async {
  24. await new Future.delayed(const Duration(seconds: 1));
  25. },
  26. child: Container(
  27. color: BG_COLOR,
  28. ),
  29. )),
  30. onWillPop: () {
  31. Toast.hide();
  32. print("返回键点击了");
  33. Navigator.pop(context);
  34. });
  35. }
  36. }