| 1 | import 'package:cake_wallet/src/screens/dashboard/widgets/sync_indicator_icon.dart'; |
| 2 | import 'package:flutter/material.dart'; |
| 3 | |
| 4 | class StandardListStatusRow extends StatelessWidget { |
| 5 | StandardListStatusRow({required this.title, required this.value, this.status}); |
| 6 | |
| 7 | final String title; |
| 8 | final String value; |
| 9 | final String? status; // waiting, action required, created, fetching, finished, success |
| 10 | |
| 11 | @override |
| 12 | Widget build(BuildContext context) { |
| 13 | return Container( |
| 14 | width: double.infinity, |
| 15 | color: Theme.of(context).colorScheme.surface, |
| 16 | child: Padding( |
| 17 | padding: const EdgeInsets.only(left: 24, top: 16, bottom: 16, right: 24), |
| 18 | child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ |
| 19 | Text( |
| 20 | title, |
| 21 | style: Theme.of(context).textTheme.bodyMedium!.copyWith( |
| 22 | fontWeight: FontWeight.w500, |
| 23 | color: Theme.of(context).colorScheme.onSurfaceVariant, |
| 24 | ), |
| 25 | textAlign: TextAlign.left, |
| 26 | ), |
| 27 | Padding( |
| 28 | padding: const EdgeInsets.only(top: 12), |
| 29 | child: Container( |
| 30 | decoration: BoxDecoration( |
| 31 | color: Theme.of(context).colorScheme.surfaceContainerHighest, |
| 32 | borderRadius: BorderRadius.circular(30.0), |
| 33 | ), |
| 34 | child: Padding( |
| 35 | padding: const EdgeInsets.symmetric(horizontal: 8.0, vertical: 4.0), |
| 36 | child: Row( |
| 37 | mainAxisSize: MainAxisSize.min, |
| 38 | children: <Widget>[ |
| 39 | SyncIndicatorIcon( |
| 40 | boolMode: false, |
| 41 | value: status ?? value, |
| 42 | size: 6, |
| 43 | ), |
| 44 | SizedBox( |
| 45 | width: 5, |
| 46 | ), |
| 47 | Text( |
| 48 | value, |
| 49 | style: Theme.of(context).textTheme.bodyMedium!.copyWith( |
| 50 | fontSize: 16, |
| 51 | fontWeight: FontWeight.w500, |
| 52 | ), |
| 53 | ) |
| 54 | ], |
| 55 | ), |
| 56 | ), |
| 57 | ), |
| 58 | ) |
| 59 | ]), |
| 60 | ), |
| 61 | ); |
| 62 | } |
| 63 | } |