-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
118 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:get/get.dart'; | ||
import 'package:nyalcf/io/userInfoStorage.dart'; | ||
import 'package:url_launcher/url_launcher.dart'; | ||
|
||
class AccountDialogX { | ||
const AccountDialogX({required this.context}); | ||
|
||
final context; | ||
|
||
Widget build() { | ||
return SimpleDialog( | ||
title: const Text('小可爱,喵呜?'), | ||
children: <Widget>[ | ||
SimpleDialogOption( | ||
child: const ListTile( | ||
leading: Icon(Icons.transit_enterexit), | ||
title: Text('退出登录'), | ||
), | ||
onPressed: () async { | ||
try { | ||
await UserInfoStorage.sigo(); | ||
} catch (e) { | ||
Get.snackbar( | ||
'发生错误', | ||
e.toString(), | ||
snackPosition: SnackPosition.BOTTOM, | ||
animationDuration: Duration(milliseconds: 300), | ||
); | ||
} | ||
Get.toNamed('/'); | ||
}), | ||
SimpleDialogOption( | ||
child: const ListTile( | ||
leading: Icon(Icons.headset), | ||
title: Text('编辑头像'), | ||
), | ||
onPressed: () async { | ||
const url = 'https://cravatar.cn'; | ||
if (!await launchUrl(Uri.parse(url))) { | ||
const snackBar = SnackBar( | ||
content: Text('无法打开网页,请检查设备是否存在WebView'), | ||
); | ||
ScaffoldMessenger.of(context).showSnackBar(snackBar); | ||
} | ||
}), | ||
], | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters