OnPay operations
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gymlink_module_web/components/app_bar.dart';
|
||||
import 'package:gymlink_module_web/components/heading.dart';
|
||||
@@ -44,11 +46,17 @@ class HistoryPage extends StatefulWidget {
|
||||
|
||||
class _HistoryPageState extends State<HistoryPage> {
|
||||
List<Map<String, String>> my_orders = [];
|
||||
late Timer _updateTimer;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
my_orders = orders;
|
||||
ordersRefresh();
|
||||
}
|
||||
|
||||
void ordersRefresh() {
|
||||
_updateTimer = Timer.periodic(const Duration(minutes: 1), _onRefresh);
|
||||
}
|
||||
|
||||
void _onLoad() async {
|
||||
@@ -65,8 +73,15 @@ class _HistoryPageState extends State<HistoryPage> {
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> _onRefresh() async {
|
||||
@override
|
||||
void dispose() {
|
||||
_updateTimer.cancel();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
Future<void> _onRefresh(Timer timer) async {
|
||||
await Future.delayed(const Duration(milliseconds: 1000));
|
||||
debugPrint('refreshed');
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -86,7 +101,7 @@ class _HistoryPageState extends State<HistoryPage> {
|
||||
scrollOffset: 200,
|
||||
child: RefreshIndicator(
|
||||
edgeOffset: 55,
|
||||
onRefresh: _onRefresh,
|
||||
onRefresh: () => _onRefresh(_updateTimer),
|
||||
child: Stack(
|
||||
children: [
|
||||
ListView.builder(
|
||||
|
||||
Reference in New Issue
Block a user