Settings page added
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:uuid/uuid.dart';
|
||||
import 'theme_provider.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
class Category{
|
||||
|
||||
Category(this.category_id, this.name, this.color, this.productive);
|
||||
@@ -80,8 +84,9 @@ class Queries{
|
||||
}
|
||||
|
||||
|
||||
class Settings{
|
||||
|
||||
|
||||
class Settings{
|
||||
static Future<String> UUID() async{
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
if(prefs.containsKey('uuid')){
|
||||
@@ -93,4 +98,11 @@ class Settings{
|
||||
return Future.value(_uuid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static Future<void> setTheme(int value) async{
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
await prefs.setInt("theme", value);
|
||||
}
|
||||
}
|
||||
final settings = Settings();
|
||||
Reference in New Issue
Block a user