Browse Source

Domain: add alert log for delete name

pull/18/head
Sun 4 years ago
parent
commit
3a900bb484
  1. 39
      lib/apps/domain/page.dart
  2. 4
      lib/l10n/localizations_en.dart
  3. 4
      lib/l10n/localizations_zh.dart

39
lib/apps/domain/page.dart

@ -204,7 +204,7 @@ class _ListNameScreenState extends State<_ListNameScreen> { @@ -204,7 +204,7 @@ class _ListNameScreenState extends State<_ListNameScreen> {
item.name.isActived
? ListTile(
leading: Icon(Icons.cancel, color: Colors.orange),
title: Text(lang.domainSetUnactived, style: TextStyle(color: Colors.orange)),
title: Text(lang.domainSetUnactived, style: TextStyle(color: Colors.orange, fontSize: 16.0)),
onTap: () {
rpc.send('domain-active', [item.name.name, item.provider.addr, false]);
setState(() {
@ -214,7 +214,7 @@ class _ListNameScreenState extends State<_ListNameScreen> { @@ -214,7 +214,7 @@ class _ListNameScreenState extends State<_ListNameScreen> {
})
: ListTile(
leading: Icon(Icons.done, color: color.primary),
title: Text(lang.domainSetActived, style: TextStyle(color: color.primary)),
title: Text(lang.domainSetActived, style: TextStyle(color: color.primary, fontSize: 16.0)),
onTap: () {
rpc.send('domain-active', [item.name.name, item.provider.addr, true]);
setState(() {
@ -224,14 +224,33 @@ class _ListNameScreenState extends State<_ListNameScreen> { @@ -224,14 +224,33 @@ class _ListNameScreenState extends State<_ListNameScreen> {
}),
ListTile(
leading: const Icon(Icons.delete, color: Colors.red),
title: Text(lang.domainDelete, style: TextStyle(color: Colors.red)),
onTap: () {
rpc.send('domain-remove', [item.name.name, item.provider.addr]);
setState(() {
this._data.removeWhere((_NameItem currentItem) => item == currentItem);
this._deleteTime = true;
});
}),
title: Text(lang.domainDelete, style: TextStyle(color: Colors.red, fontSize: 16.0)),
onTap: () => showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: Text(lang.delete + " ${item.name.name} ?"),
actions: [
TextButton(
child: Text(lang.cancel),
onPressed: () => Navigator.pop(context),
),
TextButton(
child: Text(lang.ok),
onPressed: () {
Navigator.pop(context);
rpc.send('domain-remove', [item.name.name, item.provider.addr]);
setState(() {
this._data.removeWhere((_NameItem currentItem) => item == currentItem);
this._deleteTime = true;
});
},
),
]
);
},
)
),
]
),
isExpanded: item.isExpanded,

4
lib/l10n/localizations_en.dart

@ -342,9 +342,9 @@ class AppLocalizationsEn extends AppLocalizations { @@ -342,9 +342,9 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get domainSetDefault => 'Set default ?';
@override
String get domainSetUnactived => 'Set to unactived ?';
String get domainSetUnactived => 'Set to unactived (others cannot search you) ?';
@override
String get domainSetActived => 'Set to actived ?';
String get domainSetActived => 'Set to actived (others can search you) ?';
@override
String get domainDelete => 'Delete from provider ?';
@override

4
lib/l10n/localizations_zh.dart

@ -342,9 +342,9 @@ class AppLocalizationsZh extends AppLocalizations { @@ -342,9 +342,9 @@ class AppLocalizationsZh extends AppLocalizations {
@override
String get domainSetDefault => '设为默认?';
@override
String get domainSetUnactived => '设为暂停状态?';
String get domainSetUnactived => '设为暂停状态 (别人无法搜索到你)';
@override
String get domainSetActived => '设为正常状态?';
String get domainSetActived => '设为正常状态 (别人可以搜索到你)';
@override
String get domainDelete => '从站点中删除?';
@override

Loading…
Cancel
Save