cake_wallet/lib/src/widgets/standard_list_card.dart
Rafael Saes baabc0a915
Cw 373 theme refactoring in preparation to support additional themes (#933)
* refactor(Theme): migrate accentColor

- based on the specs at https://docs.flutter.dev/release/breaking-changes/theme-data-accent-properties#migration-guide.

* refactor(Theme): all deprecated TextTheme styles

* refactor(Theme): deprecated backgroundColor for colorScheme.background

* refactor(Theme): deprecated buttonColor to use TextTheme backgroundColor instead

* refactor(Theme): deprecated isAlwaysShown to use thumbVisibility instead
2023-05-25 02:19:51 +03:00

80 lines
2.6 KiB
Dart

import 'package:cake_wallet/palette.dart';
import 'package:flutter/material.dart';
import 'package:cake_wallet/themes/theme_base.dart';
class TradeDetailsStandardListCard extends StatelessWidget {
TradeDetailsStandardListCard(
{required this.id,
required this.create,
required this.pair,
required this.onTap,
required this.currentTheme});
final String id;
final String create;
final String pair;
final ThemeType currentTheme;
final Function onTap;
@override
Widget build(BuildContext context) {
final darkTheme = currentTheme == ThemeType.dark;
final baseGradient = LinearGradient(colors: [
Theme.of(context).primaryTextTheme!.titleSmall!.color!,
Theme.of(context).primaryTextTheme!.titleSmall!.decorationColor!,
], begin: Alignment.centerLeft, end: Alignment.centerRight);
final gradient = LinearGradient(colors: [
PaletteDark.wildNightBlue,
PaletteDark.oceanBlue,
], begin: Alignment.bottomCenter, end: Alignment.topCenter);
final textColor = Colors.white;
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 24.0, vertical: 12.0),
child: GestureDetector(
onTap: () => onTap(context),
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15.0),
gradient: darkTheme ? gradient : baseGradient),
child: Padding(
padding:
const EdgeInsets.symmetric(horizontal: 20.0, vertical: 16.0),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(id,
style: TextStyle(
fontSize: 16,
fontFamily: 'Lato',
fontWeight: FontWeight.w400,
color: textColor)),
SizedBox(
height: 8,
),
Text(create,
style: TextStyle(
fontSize: 12,
fontFamily: 'Lato',
fontWeight: FontWeight.w400,
color: textColor)),
SizedBox(
height: 35,
),
Text(pair,
style: TextStyle(
fontSize: 24,
fontFamily: 'Lato',
fontWeight: FontWeight.bold,
color: textColor)),
]),
),
),
),
);
}
}