forked from piaocbn2j/MTMusic
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
609 B
17 lines
609 B
11 months ago
|
import 'package:get/get.dart';
|
||
|
import 'package:get_storage/get_storage.dart';
|
||
|
|
||
|
class AppData extends GetxController{
|
||
|
final box = GetStorage();
|
||
|
bool get isFlag => box.read('isFlag');
|
||
|
bool get isLikes => box.read('isLikes') ?? false;
|
||
|
String get currentToken => box.read('currentToken');
|
||
|
String get currentUsername => box.read('currentUsername') ?? '游客';
|
||
|
String get currentAvatar=> box.read('currentAvatar') ?? 'http://b.hiphotos.baidu.com/image/pic/item/e824b899a9014c08878b2c4c0e7b02087af4f4a3.jpg';
|
||
|
|
||
|
initData(){
|
||
|
if(box.read('isFlag')==null){
|
||
|
box.write('isFlag', false);
|
||
|
}
|
||
|
}
|
||
|
}
|