rand dart fix
This commit is contained in:
@@ -2,7 +2,6 @@ import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
import '../../classes/index.dart';
|
||||
import '../../utils/directory.dart';
|
||||
import '../mobile/sdk.dart';
|
||||
import '../rest_api/client.dart';
|
||||
import 'impl.dart';
|
||||
@@ -35,12 +34,8 @@ class FBAuth implements FBAuthImpl {
|
||||
},
|
||||
onSave: (data) async {
|
||||
try {
|
||||
if (data == null) {
|
||||
await _saveFile.delete();
|
||||
} else {
|
||||
await _saveFile.writeAsString(json.encode(data));
|
||||
}
|
||||
} catch (e) {}
|
||||
await _saveFile.writeAsString(json.encode(data));
|
||||
} catch (e) {}
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -50,10 +45,7 @@ class FBAuth implements FBAuthImpl {
|
||||
}
|
||||
|
||||
Future _loadFile() async {
|
||||
if (_saveFile == null) {
|
||||
final dir = await PathUtils.getDocumentDir();
|
||||
_saveFile = File('${dir.path}/fb_auth.json');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
bool get useClient => isDesktop || useRestClient;
|
||||
|
||||
@@ -115,8 +115,8 @@ class FBAuth implements FBAuthImpl {
|
||||
Future editInfo({String displayName, String photoUrl}) async {
|
||||
final _user = _auth.currentUser;
|
||||
final _info = UserProfile();
|
||||
if (displayName != null) _info.displayName = displayName;
|
||||
if (photoUrl != null) _info.photoURL = photoUrl;
|
||||
_info.displayName = displayName;
|
||||
_info.photoURL = photoUrl;
|
||||
try {
|
||||
await _user.updateProfile(_info);
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user