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