mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-12-02 12:14:09 +01:00
New themes (#2239)
* Add theme base v2 * Initial new theme base files * Typos * Fixes * Update theme files * feat: Migrate to Material 3 Theming Foundation, Theme Data Refactor, and First Extension Cleanup Batch. This commit completes the first major phase of migrating to Material 3 theming by setting up the foundations for material 3 integration and begins the initial migration, removing custom theme extensions, updating theme data, and refactoring all relevant widget and page theming to use Material 3’s built-in color and typography tokens. These changes: - Lays the groundwork for Material 3 theming by restructuring the app’s theme configuration to use Material 3’s ColorScheme and TextTheme as the primary sources of color and typography throughout the app. - Refactors the core theme config files by removing legacy custom color roles ensuring all color definitions now map directly to Material 3’s role. - Begins the first batch migration of custom theme extensions (InfoTheme, PlaceholderTheme, KeyboardTheme, PinCodeTheme) and updates all affected widgets and pages to use Material 3 color and typography tokens instead of the custom properties. - Cleans up the codebase by deleting the files of the initial set of migrated extensions and eliminating all related imports and usages. * feat: Migrate to Material 3 Theming. This change: - Updates the themes README.md file to reflect the current structure and give more information based on the first major phase that was completed. * feat: Migrate to Material 3 Theming Deleting previous theme extensions * feat: Migrate to Material 3 Theming Another batch of migrations from existing extensions * feat: Migration to Material 3 Theming Third Migration batch for theme extensions * fwat: Migration to Material 3 Theming Final Migration batch for previous theme extensions * Update onboarding hero * Update button radius * Add surfaceContainer to light theme * feat(themes): Migrate to Material 3 Theming This change: - Adds new set of hero images - Modifies the core structure for the themes - Add missing color tokens to the theme classes - Adds a CustomThemeColor class for custom color tokens - Modifies the themelist to have a fall back for previous theme implementation - Adds localization for some texts - Modifies the flow for loading the theme on app start - Add a WidgetsBindingObserver that listens for changes in the device theme and updates the app theme when there is a change - Registers the themeStore as a Singleton for codebase wide use * feat(themes): Migrate to Material 3 theming This change: - Migrates UI flows across the app to the new themes - Confirms styling and typography of components across the app uses the new themes - Remove instances of Palette use - Switch TextStyles across the app to use theme text styles * feat(themes): Migrate to Material 3 Theming. This change: - Adjusts bottomsheets styling and removes duplicate close button - Removes more themedata extensions from the previous implementation * - Remove outlines from cards and dock - Update menu colors - Update padding/divider size for cards * - Update PIN screen - Fix navigation dock shadow - Update wallet screen colors * Update border radius --skip-ci * feat(themes): Migrate to Material 3 Theming. This change: - Adds gradient backgrounds to the dashbaord and balance cards. - Migrates the input fields across the app to BaseTextFormFields. - Removes dependence of input fields on individual styling, focusing instead on using theme defined InputDecoration styling with adjustments on individual components where needed. - Applies new theme styling to BaseTextFormField, AddressTextField and CurrencyAmountTextField. * - Switch some hero images to PNG - Fix nagivation_dock shadow - Minor fixes * feat: Add fallback to previous underline styling in central widgets This change: - Adds a fallback to CurrencyAmountTextField, AddressTextField, and BaseTextFormField, allowing them use the previous theme styling. - Adds localization for new texts * feat(themes): Update warning box colors for dark and light themes * feat(themes): Relaod themes when user restores from backup, ensuring the user previous theme preference is used. * feat(themes): Handle themes logic during restore from backup This change: - Refactors theme loading logic to handle backup restore edgecase - Refreshes the theme based on the user saved preference during restore from backup flow * Fix card gradients and spacing * Fix even more radiuses Test new icons for navigation_dock.dart * Update onboarding flow backgrounds Fix swap icon clipping Fix some text colors Add more hero images * Fix incorrect color for light theme * Fix more hero images and cleanup * Update text field icons Fix info box CTA colors Fix sync indicator colors * Update toggle colors Update dark theme colors (minor) Update crypto_balance_widget.dart icon * Update page transitions in router.dart Fix some colors * feat(themes): Display label by default for filled textfields * feat(themes): Refactor theme handling across various components This change: - Fixes issue with themeMode resetting to system mode when app is restarted causing a UI glitch - Updates theme checks from `currentTheme.type == ThemeType.dark` to `currentTheme.isDark` for consistency - Adjusts UI components to use the theme directly from the themeStore * feat(themes): Add animating tagline to the create pin welcome screen * Revert text fields label temporarily, fix a couple colors, and cleanup some images --------- Co-authored-by: OmarHatem <omarh.ismail1@gmail.com> Co-authored-by: Blazebrain <davidadegoke16@gmail.com>
This commit is contained in:
co-authored by
OmarHatem
Blazebrain
parent
7b8ddf9685
commit
df88914628
@@ -29,7 +29,7 @@ class MainActions {
|
||||
|
||||
static MainActions showWalletsAction = MainActions._(
|
||||
name: (context) => S.of(context).wallets,
|
||||
image: 'assets/images/wallet_new.png',
|
||||
image: 'assets/images/wallet_icon.png',
|
||||
onTap: (BuildContext context, DashboardViewModel viewModel) async {
|
||||
Navigator.pushNamed(
|
||||
context,
|
||||
@@ -42,7 +42,7 @@ class MainActions {
|
||||
|
||||
static MainActions receiveAction = MainActions._(
|
||||
name: (context) => S.of(context).receive,
|
||||
image: 'assets/images/received.png',
|
||||
image: 'assets/images/receive.png',
|
||||
onTap: (BuildContext context, DashboardViewModel viewModel) async {
|
||||
Navigator.pushNamed(context, Routes.addressPage);
|
||||
},
|
||||
@@ -50,7 +50,7 @@ class MainActions {
|
||||
|
||||
static MainActions swapAction = MainActions._(
|
||||
name: (context) => S.of(context).swap,
|
||||
image: 'assets/images/transfer.png',
|
||||
image: 'assets/images/swap.png',
|
||||
isEnabled: (viewModel) => viewModel.isEnabledSwapAction,
|
||||
canShow: (viewModel) => viewModel.hasSwapAction,
|
||||
onTap: (BuildContext context, DashboardViewModel viewModel) async {
|
||||
@@ -62,7 +62,7 @@ class MainActions {
|
||||
|
||||
static MainActions sendAction = MainActions._(
|
||||
name: (context) => S.of(context).send,
|
||||
image: 'assets/images/upload.png',
|
||||
image: 'assets/images/send2.png',
|
||||
isEnabled: (viewModel) => viewModel.canSend,
|
||||
onTap: (BuildContext context, DashboardViewModel viewModel) async {
|
||||
Navigator.pushNamed(context, Routes.send);
|
||||
@@ -71,7 +71,7 @@ class MainActions {
|
||||
|
||||
static MainActions tradeAction = MainActions._(
|
||||
name: (context) => S.of(context).buy,
|
||||
image: 'assets/images/buy_sell.png',
|
||||
image: 'assets/images/buy.png',
|
||||
isEnabled: (viewModel) => viewModel.isEnabledTradeAction,
|
||||
canShow: (viewModel) => viewModel.hasTradeAction,
|
||||
onTap: (BuildContext context, DashboardViewModel viewModel) async {
|
||||
|
||||
@@ -34,6 +34,7 @@ class PreferencesKey {
|
||||
static const disableExchangeKey = 'disable_exchange';
|
||||
static const exchangeStatusKey = 'exchange_status';
|
||||
static const currentTheme = 'current_theme';
|
||||
static const themeMode = 'theme_mode';
|
||||
static const displayActionListModeKey = 'display_list_mode';
|
||||
static const currentPinLength = 'current_pin_length';
|
||||
static const currentLanguageCode = 'language_code';
|
||||
|
||||
@@ -15,7 +15,7 @@ Future<String?> presentQRScanner(BuildContext context) async {
|
||||
try {
|
||||
final result = await Navigator.of(context).push<String>(
|
||||
MaterialPageRoute(
|
||||
builder:(context) {
|
||||
builder: (context) {
|
||||
return BarcodeScannerSimple();
|
||||
},
|
||||
),
|
||||
@@ -67,7 +67,7 @@ class _BarcodeScannerSimpleState extends State<BarcodeScannerSimple> {
|
||||
void _handleBarcodeInternal(BarcodeCapture barcodes) {
|
||||
for (final barcode in barcodes.barcodes) {
|
||||
// don't handle unknown QR codes
|
||||
if (barcode.rawValue?.trim().isEmpty??false == false) continue;
|
||||
if (barcode.rawValue?.trim().isEmpty ?? false == false) continue;
|
||||
if (barcode.rawValue!.startsWith("ur:")) {
|
||||
if (urCodes.contains(barcode.rawValue)) continue;
|
||||
setState(() {
|
||||
@@ -81,7 +81,8 @@ class _BarcodeScannerSimpleState extends State<BarcodeScannerSimple> {
|
||||
SchedulerBinding.instance.addPostFrameCallback((_) {
|
||||
Navigator.of(context).pop(ur.inputs.join("\n"));
|
||||
});
|
||||
};
|
||||
}
|
||||
;
|
||||
}
|
||||
}
|
||||
if (urCodes.isNotEmpty) return;
|
||||
@@ -110,18 +111,21 @@ class _BarcodeScannerSimpleState extends State<BarcodeScannerSimple> {
|
||||
ToggleFlashlightButton(controller: ctrl),
|
||||
],
|
||||
),
|
||||
backgroundColor: Colors.black,
|
||||
backgroundColor: Theme.of(context).colorScheme.surface,
|
||||
body: Stack(
|
||||
children: [
|
||||
MobileScanner(
|
||||
onDetect: _handleBarcode,
|
||||
controller: ctrl,
|
||||
),
|
||||
if (ur.inputs.length != 0)
|
||||
Center(child:
|
||||
Text(
|
||||
if (ur.inputs.length != 0)
|
||||
Center(
|
||||
child: Text(
|
||||
"${ur.inputs.length}/${ur.count}",
|
||||
style: Theme.of(context).textTheme.displayLarge?.copyWith(color: Colors.white)
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.displayLarge
|
||||
?.copyWith(color: Theme.of(context).colorScheme.onSurface),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
@@ -158,7 +162,6 @@ class _BarcodeScannerSimpleState extends State<BarcodeScannerSimple> {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class ToggleFlashlightButton extends StatelessWidget {
|
||||
const ToggleFlashlightButton({required this.controller, super.key});
|
||||
|
||||
@@ -199,9 +202,9 @@ class ToggleFlashlightButton extends StatelessWidget {
|
||||
},
|
||||
);
|
||||
case TorchState.unavailable:
|
||||
return const Icon(
|
||||
return Icon(
|
||||
Icons.no_flash,
|
||||
color: Colors.grey,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
);
|
||||
}
|
||||
},
|
||||
@@ -326,16 +329,14 @@ class ProgressPainter extends CustomPainter {
|
||||
const fullAngle = 360.0;
|
||||
var startAngle = 0.0;
|
||||
for (int i = 0; i < urQrProgress.expectedPartCount.toInt(); i++) {
|
||||
var sweepAngle =
|
||||
(1 / urQrProgress.expectedPartCount) * fullAngle * pi / 180.0;
|
||||
drawSector(canvas, urQrProgress.receivedPartIndexes.contains(i), rect,
|
||||
startAngle, sweepAngle);
|
||||
var sweepAngle = (1 / urQrProgress.expectedPartCount) * fullAngle * pi / 180.0;
|
||||
drawSector(
|
||||
canvas, urQrProgress.receivedPartIndexes.contains(i), rect, startAngle, sweepAngle);
|
||||
startAngle += sweepAngle;
|
||||
}
|
||||
}
|
||||
|
||||
void drawSector(Canvas canvas, bool isActive, Rect rect, double startAngle,
|
||||
double sweepAngle) {
|
||||
void drawSector(Canvas canvas, bool isActive, Rect rect, double startAngle, double sweepAngle) {
|
||||
final paint = Paint()
|
||||
..style = PaintingStyle.stroke
|
||||
..strokeWidth = 8
|
||||
|
||||
Reference in New Issue
Block a user