Skip to content

Commit

Permalink
refactor: update tx list and details style
Browse files Browse the repository at this point in the history
  • Loading branch information
gabaldon committed Oct 4, 2024
1 parent ae7bafb commit 9f7e189
Show file tree
Hide file tree
Showing 29 changed files with 653 additions and 512 deletions.
3 changes: 3 additions & 0 deletions assets/svg/dots-bg.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions lib/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ const List<String> CUSTOM_ICON_NAMES = [
'stake-dark',
'stake-icon-dark',
'stake-icon',
'dots-bg',
'stake',
'transaction-error',
'transaction-success',
Expand Down
5 changes: 3 additions & 2 deletions lib/theme/colors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'
show Color, MaterialColor, WidgetState, WidgetStateColor;

class WitnetPallet {
static const black = Color(0xFF1D1D1B);
static const black = Color(0xFF232323);
static const white = Color(0xFFFFFFFF);
static const opacityWhite = Color(0xAFFFFFFF);
static const opacityWhite2 = Color(0xA0FFFFFF);
Expand All @@ -11,8 +11,9 @@ class WitnetPallet {

static const lighterGrey = Color(0xFFEDECEC);
static const lightGrey = Color(0xFFBDBDBD);
static const mediumGrey = Color(0xFF656565);
static const mediumGrey = Color(0xFF707070);
static const darkGrey = Color(0xFF424242);
static const darkGrey2 = Color(0xFF343434);
static const darkerGrey = Color(0xFF292929);

static const transparent = Color(0x00FFFFFF);
Expand Down
14 changes: 6 additions & 8 deletions lib/theme/dark_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -106,29 +106,27 @@ TextTheme textTheme = TextTheme(
fontWeight: FontWeight.normal),
);
InputDecorationTheme inputDecorationTheme = InputDecorationTheme(
fillColor: WitnetPallet.black,
fillColor: WitnetPallet.darkGrey2,
filled: true,
errorStyle: TextStyle(color: WitnetPallet.brightRed),
helperStyle: TextStyle(color: WitnetPallet.white),
helperMaxLines: 1,
errorMaxLines: 1,
hintStyle: TextStyle(color: WitnetPallet.lighterGrey),
labelStyle: TextStyle(color: WitnetPallet.opacityWhite),
hintStyle: TextStyle(color: WitnetPallet.mediumGrey),
labelStyle: TextStyle(color: WitnetPallet.mediumGrey),
hoverColor: const Color.fromARGB(9, 255, 255, 255),
focusColor: WitnetPallet.brightCyanOpacity1,
isDense: true,
isCollapsed: false,
contentPadding: EdgeInsets.all(16),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: WitnetPallet.white, width: 1.0, style: BorderStyle.solid),
color: WitnetPallet.darkGrey2, width: 1.0, style: BorderStyle.solid),
borderRadius: BorderRadius.circular(24),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: WitnetPallet.brightCyanOpacity1,
width: 2.0,
style: BorderStyle.solid),
color: WitnetPallet.brightCyan, width: 2.0, style: BorderStyle.solid),
borderRadius: BorderRadius.circular(24),
),
errorBorder: OutlineInputBorder(
Expand Down Expand Up @@ -176,7 +174,7 @@ ElevatedButtonThemeData elevatedButtonTheme = ElevatedButtonThemeData(
style: ElevatedButton.styleFrom(
padding: const EdgeInsets.all(16),
foregroundColor: WitnetPallet.black,
backgroundColor: WitnetPallet.white,
backgroundColor: WitnetPallet.brightCyan,
disabledForegroundColor:
Color.fromARGB(102, 164, 212, 204).withOpacity(0.38),
disabledBackgroundColor:
Expand Down
12 changes: 6 additions & 6 deletions lib/theme/extended_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ class ExtendedTheme extends ThemeExtension<ExtendedTheme> {
dropdownBackgroundColor: WitnetPallet.white,
dropdownTextColor: WitnetPallet.darkGrey,
navigationActiveButton: WitnetPallet.lightGrey,
navigationPointerActiveButton: WitnetPallet.deepAqua,
navigationPointerActiveButton: WitnetPallet.black,
headerActiveTextColor: WitnetPallet.black,
headerTextColor: WitnetPallet.black,
headerBackgroundColor: WitnetPallet.brightCyan,
Expand All @@ -345,8 +345,8 @@ class ExtendedTheme extends ThemeExtension<ExtendedTheme> {
txBorderColor: WitnetPallet.lightGrey,
txValueNegativeColor: WitnetPallet.darkRed,
txValuePositiveColor: WitnetPallet.darkGreen,
stepBarActiveColor: WitnetPallet.deepAqua,
stepBarActionableColor: WitnetPallet.darkGrey,
stepBarActiveColor: WitnetPallet.black,
stepBarActionableColor: WitnetPallet.mediumGrey,
stepBarColor: WitnetPallet.lightGrey,
switchActiveBg: WitnetPallet.black,
switchActiveFg: WitnetPallet.white,
Expand Down Expand Up @@ -408,7 +408,7 @@ class ExtendedTheme extends ThemeExtension<ExtendedTheme> {
selectedTextColor: WitnetPallet.black,
dropdownBackgroundColor: WitnetPallet.darkerGrey,
dropdownTextColor: WitnetPallet.lighterGrey,
navigationPointerActiveButton: WitnetPallet.deepAqua,
navigationPointerActiveButton: WitnetPallet.lightGrey,
navigationActiveButton: WitnetPallet.lightGrey,
headerActiveTextColor: WitnetPallet.black,
headerTextColor: WitnetPallet.black,
Expand All @@ -418,8 +418,8 @@ class ExtendedTheme extends ThemeExtension<ExtendedTheme> {
walletActiveItemBackgroundColor: WitnetPallet.brightCyanOpacity3,
walletActiveItemBorderColor: WitnetPallet.brightCyan,
walletItemBorderColor: WitnetPallet.opacityWhite2,
inputIconColor: WitnetPallet.opacityWhite2,
txBorderColor: WitnetPallet.opacityWhite2,
inputIconColor: WitnetPallet.white,
txBorderColor: WitnetPallet.darkGrey2,
txValueNegativeColor: WitnetPallet.brightRed,
txValuePositiveColor: WitnetPallet.brightGreen,
stepBarActiveColor: WitnetPallet.brightCyan,
Expand Down
20 changes: 10 additions & 10 deletions lib/theme/light_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ TextTheme textTheme = TextTheme(
fontFamily: 'Almarai',
letterSpacing: 0,
height: 1.15,
color: WitnetPallet.deepAqua,
color: WitnetPallet.black,
fontSize: 16,
fontWeight: FontWeight.normal),
titleLarge: TextStyle(
Expand Down Expand Up @@ -100,7 +100,7 @@ TextTheme textTheme = TextTheme(
fontFamily: 'Almarai',
letterSpacing: 0,
height: 1.15,
color: WitnetPallet.deepAqua,
color: WitnetPallet.black,
fontSize: 16,
fontWeight: FontWeight.normal),
);
Expand All @@ -116,7 +116,7 @@ InputDecorationTheme inputDecorationTheme = InputDecorationTheme(
helperStyle: TextStyle(color: WitnetPallet.darkerGrey),
helperMaxLines: 1,
errorMaxLines: 1,
hintStyle: TextStyle(),
hintStyle: TextStyle(color: WitnetPallet.mediumGrey),
hoverColor: WitnetPallet.white,
focusColor: WitnetPallet.brightCyan,
isDense: true,
Expand Down Expand Up @@ -198,25 +198,25 @@ OutlinedButtonThemeData outlinedButtonTheme = OutlinedButtonThemeData(
),
));
IconThemeData iconTheme = IconThemeData(
color: WitnetPallet.deepAqua,
color: WitnetPallet.black,
size: 16,
);
IconThemeData primaryIconTheme = IconThemeData(
color: WitnetPallet.deepAqua,
color: WitnetPallet.black,
size: 24,
);
CheckboxThemeData checkboxTheme = CheckboxThemeData(
splashRadius: 0,
side: WidgetStateBorderSide.resolveWith(
(_) => const BorderSide(width: 2, color: WitnetPallet.deepAqua)),
(_) => const BorderSide(width: 2, color: WitnetPallet.black)),
fillColor: WidgetStateProperty.resolveWith((Set<WidgetState> states) {
if (states.contains(WidgetState.selected)) {
return WitnetPallet.deepAqua;
return WitnetPallet.brightCyan;
}
return WitnetPallet.transparent;
}),
checkColor: WidgetStateProperty.all(WitnetPallet.white),
overlayColor: WidgetStateProperty.all(WitnetPallet.white),
checkColor: WidgetStateProperty.all(WitnetPallet.black),
overlayColor: WidgetStateProperty.all(WitnetPallet.black),
);

Color getColorPrimary(Set<WidgetState> states) {
Expand Down Expand Up @@ -255,7 +255,7 @@ PageTransitionsTheme pageTransitionsTheme = PageTransitionsTheme(
);

TimePickerThemeData timePickerTheme = TimePickerThemeData(
backgroundColor: const Color.fromARGB(255, 125, 80, 80),
backgroundColor: WitnetPallet.white,
cancelButtonStyle: textButtonTheme.style,
confirmButtonStyle: textButtonTheme.style,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ class BuildTransaction {
}
}

dynamic getAddress(layout.TransactionType txType) {
dynamic getOrigin(layout.TransactionType txType) {
switch (txType) {
case layout.TransactionType.Vtt:
return this.vtTransaction?.body.outputs[0].pkh.address;
Expand Down
1 change: 0 additions & 1 deletion lib/util/storage/database/database_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import 'package:my_wit_wallet/util/storage/database/get_account_vtts_map.dart';
import 'package:my_wit_wallet/util/storage/database/stats.dart';
import 'package:my_wit_wallet/util/storage/database/adapters/transaction_adapter.dart';
import 'package:sembast/sembast_io.dart';
import 'package:sembast/sembast.dart';
import 'package:witnet/explorer.dart';
import 'package:my_wit_wallet/constants.dart';
import 'package:my_wit_wallet/util/storage/database/account.dart';
Expand Down
14 changes: 6 additions & 8 deletions lib/util/transactions_list/get_transaction_label.dart
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
import 'package:my_wit_wallet/util/storage/database/account.dart';
import 'package:flutter/material.dart';
import 'package:my_wit_wallet/util/get_localization.dart';
import 'package:witnet/explorer.dart';

String getTransactionLabel(
List<String?> externalAddresses,
List<String?> internalAddresses,
List<InputUtxo> inputs,
Account? singleAddressAccount,
BuildContext? context) {
{required List<String?> externalAddresses,
required List<String?> internalAddresses,
required List<InputUtxo> inputs,
required Account? singleAddressAccount}) {
String label = '';
String _from = context != null ? localization.from : "from";
String _to = context != null ? localization.to : "to";
String _from = localization.from;
String _to = localization.to;
if (inputs.length < 1) {
return _from;
}
Expand Down
Loading

0 comments on commit 9f7e189

Please sign in to comment.