mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-11-18 09:54:01 +01:00
rework trade details screen (#449)
* create standart list card item * create standart list status item * update localization * fix date format * fix theme gradient * PR comments * fix issues from code review
This commit is contained in:
@@ -2,20 +2,56 @@ import 'package:flutter/material.dart';
|
||||
import 'package:cake_wallet/palette.dart';
|
||||
|
||||
class SyncIndicatorIcon extends StatelessWidget {
|
||||
SyncIndicatorIcon({this.isSynced});
|
||||
SyncIndicatorIcon(
|
||||
{this.boolMode = true,
|
||||
this.isSynced = false,
|
||||
this.value = waiting,
|
||||
this.size = 4.0});
|
||||
|
||||
final bool boolMode;
|
||||
final bool isSynced;
|
||||
final String value;
|
||||
final double size;
|
||||
|
||||
static const String waiting = 'waiting';
|
||||
static const String actionRequired = 'action required';
|
||||
static const String created = 'created';
|
||||
static const String fetching = 'fetching';
|
||||
static const String finished = 'finished';
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Color indicatorColor;
|
||||
|
||||
if (boolMode) {
|
||||
indicatorColor = isSynced
|
||||
? PaletteDark.brightGreen
|
||||
: Theme.of(context).textTheme.caption.color;
|
||||
} else {
|
||||
switch (value.toLowerCase()) {
|
||||
case waiting:
|
||||
indicatorColor = Colors.red;
|
||||
break;
|
||||
case actionRequired:
|
||||
indicatorColor = Theme.of(context).textTheme.display3.decorationColor;
|
||||
break;
|
||||
case created:
|
||||
indicatorColor = PaletteDark.brightGreen;
|
||||
break;
|
||||
case fetching:
|
||||
indicatorColor = Colors.red;
|
||||
break;
|
||||
case finished:
|
||||
indicatorColor = PaletteDark.brightGreen;
|
||||
break;
|
||||
default:
|
||||
indicatorColor = Colors.red;
|
||||
}
|
||||
}
|
||||
return Container(
|
||||
height: 4,
|
||||
width: 4,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: isSynced
|
||||
? PaletteDark.brightGreen
|
||||
: Theme.of(context).textTheme.caption.color),
|
||||
);
|
||||
height: size,
|
||||
width: size,
|
||||
decoration:
|
||||
BoxDecoration(shape: BoxShape.circle, color: indicatorColor));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user