timer
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import 'dart:async';
|
||||
import 'package:community_material_icon/community_material_icon.dart';
|
||||
import 'package:firebase_auth/firebase_auth.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
@@ -29,12 +30,26 @@ class ProfessionalServiceScreen extends StatefulWidget {
|
||||
class _ProfessionalServiceScreenState extends State<ProfessionalServiceScreen> {
|
||||
final settingRepository = Injector.appInstance.get<SettingRepository>();
|
||||
SettingEntity? settings;
|
||||
Timer? _timer;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
_loadSettings();
|
||||
_startTimer();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_timer?.cancel();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
void _startTimer() {
|
||||
_timer = Timer.periodic(const Duration(minutes: 5), (timer) {
|
||||
setState(() {});
|
||||
});
|
||||
}
|
||||
|
||||
void _loadSettings() {
|
||||
|
||||
Reference in New Issue
Block a user