mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-03-25 08:39:06 +00:00
CW-392 Allow Users to rename Monero and Haven accounts (#1008)
This commit is contained in:
parent
d5c0012964
commit
76322a1777
1 changed files with 29 additions and 18 deletions
|
@ -1,4 +1,6 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_slidable/flutter_slidable.dart';
|
||||||
|
import 'package:cake_wallet/generated/i18n.dart';
|
||||||
|
|
||||||
class AccountTile extends StatelessWidget {
|
class AccountTile extends StatelessWidget {
|
||||||
AccountTile(
|
AccountTile(
|
||||||
|
@ -19,16 +21,17 @@ class AccountTile extends StatelessWidget {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final color = isCurrent
|
final color = isCurrent
|
||||||
? Theme.of(context).textTheme!.titleSmall!.decorationColor!
|
? Theme.of(context).textTheme.titleSmall!.decorationColor!
|
||||||
: Theme.of(context).textTheme!.displayLarge!.decorationColor!;
|
: Theme.of(context).textTheme.displayLarge!.decorationColor!;
|
||||||
final textColor = isCurrent
|
final textColor = isCurrent
|
||||||
? Theme.of(context).textTheme!.titleSmall!.color!
|
? Theme.of(context).textTheme.titleSmall!.color!
|
||||||
: Theme.of(context).textTheme!.displayLarge!.color!;
|
: Theme.of(context).textTheme.displayLarge!.color!;
|
||||||
|
|
||||||
final Widget cell = GestureDetector(
|
final Widget cell = GestureDetector(
|
||||||
onTap: onTap,
|
onTap: onTap,
|
||||||
child: Container(
|
child: Container(
|
||||||
height: 77,
|
height: 77,
|
||||||
|
width: double.infinity,
|
||||||
padding: EdgeInsets.only(left: 24, right: 24),
|
padding: EdgeInsets.only(left: 24, right: 24),
|
||||||
color: color,
|
color: color,
|
||||||
child: Wrap(
|
child: Wrap(
|
||||||
|
@ -58,7 +61,7 @@ class AccountTile extends StatelessWidget {
|
||||||
fontSize: 15,
|
fontSize: 15,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
fontFamily: 'Lato',
|
fontFamily: 'Lato',
|
||||||
color: Theme.of(context).textTheme!.headlineMedium!.color!,
|
color: Theme.of(context).textTheme.headlineMedium!.color!,
|
||||||
decoration: TextDecoration.none,
|
decoration: TextDecoration.none,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -67,18 +70,26 @@ class AccountTile extends StatelessWidget {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
// FIX-ME: Splidable
|
|
||||||
return cell;
|
// return cell;
|
||||||
// return Slidable(
|
return Slidable(
|
||||||
// key: Key(accountName),
|
key: Key(accountName),
|
||||||
// child: cell,
|
child: cell,
|
||||||
// actionPane: SlidableDrawerActionPane(),
|
endActionPane: _actionPane(context)
|
||||||
// secondaryActions: <Widget>[
|
);
|
||||||
// IconSlideAction(
|
|
||||||
// caption: S.of(context).edit,
|
|
||||||
// color: Colors.blue,
|
|
||||||
// icon: Icons.edit,
|
|
||||||
// onTap: () => onEdit?.call())
|
|
||||||
// ]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ActionPane _actionPane(BuildContext context) => ActionPane(
|
||||||
|
motion: const ScrollMotion(),
|
||||||
|
extentRatio: 0.3,
|
||||||
|
children: [
|
||||||
|
SlidableAction(
|
||||||
|
onPressed: (_) => onEdit.call(),
|
||||||
|
backgroundColor: Colors.blue,
|
||||||
|
foregroundColor: Colors.white,
|
||||||
|
icon: Icons.edit,
|
||||||
|
label: S.of(context).edit,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue