Hide a bunch of expert-properties by default
This commit is contained in:
@@ -3,6 +3,8 @@ import 'package:flutter/services.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:simplecloudnotifier/components/badge_display/badge_display.dart';
|
||||
import 'package:simplecloudnotifier/models/keytoken.dart';
|
||||
import 'package:simplecloudnotifier/state/app_auth.dart';
|
||||
import 'package:simplecloudnotifier/state/app_settings.dart';
|
||||
import 'package:simplecloudnotifier/utils/toaster.dart';
|
||||
import 'package:simplecloudnotifier/utils/ui.dart';
|
||||
|
||||
@@ -18,6 +20,8 @@ class KeyTokenCreatedModal extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final acc = AppAuth();
|
||||
|
||||
return AlertDialog(
|
||||
title: const Text('A new key was created'),
|
||||
content: Container(
|
||||
@@ -27,12 +31,27 @@ class KeyTokenCreatedModal extends StatelessWidget {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
UI.metaCard(
|
||||
context: context,
|
||||
icon: FontAwesomeIcons.solidIdCardClip,
|
||||
title: 'KeyTokenID',
|
||||
values: [keytoken.keytokenID],
|
||||
const BadgeDisplay(
|
||||
text: "Please copy and save the token now, it cannot be retrieved later.",
|
||||
icon: null,
|
||||
mode: BadgeMode.warn,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
if (acc.userID != null)
|
||||
UI.metaCard(
|
||||
context: context,
|
||||
icon: FontAwesomeIcons.solidIdCardClip,
|
||||
title: 'UserID',
|
||||
values: [acc.userID!],
|
||||
iconActions: [(FontAwesomeIcons.copy, null, () => _copy(acc.userID!))],
|
||||
),
|
||||
if (AppSettings().showExtendedAttributes)
|
||||
UI.metaCard(
|
||||
context: context,
|
||||
icon: FontAwesomeIcons.solidIdCardClip,
|
||||
title: 'KeyTokenID',
|
||||
values: [keytoken.keytokenID],
|
||||
),
|
||||
UI.metaCard(
|
||||
context: context,
|
||||
icon: FontAwesomeIcons.solidInputText,
|
||||
@@ -45,19 +64,12 @@ class KeyTokenCreatedModal extends StatelessWidget {
|
||||
title: 'Permissions',
|
||||
values: _formatPermissions(keytoken.permissions),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
const BadgeDisplay(
|
||||
text: "Please copy and save the token now, it cannot be retrieved later.",
|
||||
icon: null,
|
||||
mode: BadgeMode.warn,
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
UI.metaCard(
|
||||
context: context,
|
||||
icon: FontAwesomeIcons.solidKey,
|
||||
title: 'Token',
|
||||
values: [tokenValue.substring(0, 12) + '...'],
|
||||
iconActions: [(FontAwesomeIcons.copy, null, _copy)],
|
||||
values: [tokenValue],
|
||||
iconActions: [(FontAwesomeIcons.copy, null, () => _copy(tokenValue))],
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -89,9 +101,9 @@ class KeyTokenCreatedModal extends StatelessWidget {
|
||||
return result;
|
||||
}
|
||||
|
||||
void _copy() {
|
||||
Clipboard.setData(new ClipboardData(text: tokenValue));
|
||||
void _copy(String v) {
|
||||
Clipboard.setData(new ClipboardData(text: v));
|
||||
Toaster.info("Clipboard", 'Copied text to Clipboard');
|
||||
print('================= [CLIPBOARD] =================\n${tokenValue}\n================= [/CLIPBOARD] =================');
|
||||
print('================= [CLIPBOARD] =================\n${v}\n================= [/CLIPBOARD] =================');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user