Commit code. Update time: 2023-06-25

This commit is contained in:
TK
2023-06-25 11:50:55 +08:00
parent 2d74227878
commit 39a5f2fa92
244 changed files with 26147 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
//ignore_for_file: file_names
import 'dart:async';
import 'package:flutter/cupertino.dart';
class UserPreference extends ChangeNotifier {
// Initally Location index is 0
int locationIndex = 0;
// Change current location by call setlocationIndex method(function)
void setlocationIndex(int index) {
locationIndex = index;
notifyListeners();
}
// Setup for coundown service
Duration duration = Duration.zero;
bool isCountDownStart = false;
final Stream _stream = Stream.periodic(const Duration(seconds: 1));
UserPreference() {
_stream.listen((event) {
if (isCountDownStart) {
duration += const Duration(seconds: 1);
notifyListeners();
}
});
}
void get countDownSwitch {
isCountDownStart = !isCountDownStart;
notifyListeners();
}
}