[auth] Show notes on bottom action bar

This commit is contained in:
Neeraj Gupta
2024-09-24 15:59:51 +05:30
parent 40f34417d9
commit 9dd18f0137
2 changed files with 41 additions and 22 deletions

View File

@@ -28,10 +28,14 @@ class Code {
bool get isPinned => display.pinned;
bool get isTrashed => display.trashed;
String get note => display.note;
final Object? err;
bool get hasError => err != null;
String get issuerAccount =>
account.isNotEmpty ? '$issuer ($account)' : issuer;
Code(
this.account,
this.issuer,

View File

@@ -24,34 +24,49 @@ class _ActionBarWidgetState extends State<ActionBarWidget> {
return SizedBox(
child: Padding(
padding: const EdgeInsets.fromLTRB(20, 8, 20, 8),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
child: Column(
// left align the text
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Flexible(
flex: 1,
child: Text(
widget.code.issuer,
if (widget.code.note.isNotEmpty)
Text(
widget.code.note,
style: textTheme.miniMuted,
),
),
Flexible(
flex: 1,
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 12),
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
widget.onCancel?.call();
},
child: Align(
alignment: Alignment.centerRight,
child: Text(
context.l10n.cancel,
style: textTheme.mini,
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Flexible(
flex: 1,
child: Column(
children: [
Text(
widget.code.issuerAccount,
style: textTheme.miniMuted,
),
],
),
),
Flexible(
flex: 1,
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 12),
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
widget.onCancel?.call();
},
child: Align(
alignment: Alignment.centerRight,
child: Text(
context.l10n.cancel,
style: textTheme.mini,
),
),
),
),
),
),
],
),
],
),