Files
hash-wallet/lib/src/widgets/option_tile.dart
T
7db23599fa UI enhancements (#1895)
* UI enhancements [skip ci]

* Fix spacing for swap screen

* Cleanup and update backup page [skip ci]

* Fix address book page

* Update address book page

* Update standard lists

* Update hamburger menu

* Make toggle rows tappable

* Make more components TextButtons

* Make button dock float

* Fix shadows

* Update [skip ci]

* Update all cards with shadow and proper alignment

* Fix component positioning and scaling

* Cleanup, update strings, rename strings

* Fix spacing on Swap and Send pages [skip ci]

* Remove Wallets action button [skip ci]

* Move Sign/Verify into settings [skip ci]

* Cleanup & fix merge conflicts (pls) [skip ci]

* Fix formatting [skip ci]

* Move bottom bar to navigation_dock.dart [skip ci]

* Fix card spacing

* Conflict resolution [skip ci]

* Conflict resolution [skip ci]

* Update shadow theming

* Update menu

* Temporarily remove shadow

* Temporarily remove shadows again

* Update setting_action_button.dart

---------

Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
2025-02-12 14:35:59 +03:00

80 lines
2.5 KiB
Dart

import 'package:cake_wallet/themes/extensions/option_tile_theme.dart';
import 'package:flutter/material.dart';
class OptionTile extends StatelessWidget {
const OptionTile({
required this.onPressed,
this.image,
this.icon,
required this.title,
required this.description,
super.key,
}) : assert(image != null || icon != null);
final VoidCallback onPressed;
final Image? image;
final Icon? icon;
final String title;
final String description;
@override
Widget build(BuildContext context) {
return Container(
width: double.infinity,
padding: EdgeInsets.only(left: 6, right: 6),
alignment: Alignment.center,
child: TextButton(
style: TextButton.styleFrom(
backgroundColor: Theme.of(context).cardColor,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
padding: EdgeInsets.all(24)
),
onPressed: onPressed,
child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
icon ?? image!,
Expanded(
child: Padding(
padding: EdgeInsets.only(left: 16),
child: Column(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
title,
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
color: Theme.of(context)
.extension<OptionTileTheme>()!
.titleColor,
),
),
Padding(
padding: EdgeInsets.only(top: 5),
child: Text(
description,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.normal,
color: Theme.of(context)
.extension<OptionTileTheme>()!
.descriptionColor,
),
),
)
],
),
),
)
],
),
),
);
}
}