-
Notifications
You must be signed in to change notification settings - Fork 61
fix(walletkit-example): UI refactor - phase 2 #349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
… KH Teka font Introduce a complete theme foundation for the WalletKit example app: - AppColors ThemeExtension with 17 color tokens (light + dark variants) - AppTypography with context-aware text styles (context.textStyles.*) - AppSpacing and AppRadius design token constants - ThemeProvider (ChangeNotifier + SharedPreferences persistence) - KH Teka font (Light/Regular/Medium) as app-wide default - Wire ThemeProvider in main() with ListenableBuilder around MaterialApp - Replace hardcoded colors in main.dart with context.colors.* - Remove NavigationRail and relay status indicator from AppBar - Add deprecated bridges in StyleConstants for backward compatibility Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… modal, and responsive nav - Replace pairing-based apps list with session-based list (SessionItem widget) - Add ScanModal consolidating QR scan and paste-URI with finally-based cleanup - Restore NavigationRail for tablet/desktop (>= 640px) with SVG icons - Fix crash risk in _onSessionTap with null-safe pairing lookup - Remove dead code: _onScanPressed in AppsPage, pairing_item.dart, uri_input_popup.dart - Make MyHomePage constructor const - Rename AppSpacing.s5 to mdLg for consistent naming - Migrate settings_page button colors from hardcoded Colors.white to theme-aware - Add doc comments to layerTextStyle2/3 explaining semantic distinction Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…x deactivated context bug After popping the bottom sheet, ScanModal's BuildContext was deactivated, causing the QR scanner dialog to never open and error dialogs to be silently suppressed. Now uses the global navigatorKey context and shows errors as floating SnackBars. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add fallback to AppColors.light in context.colors extension to prevent force-unwrap crash if theme extension is missing - Fix "Time out" typo to "Timeout" in error message - Remove unused WidgetsBindingObserver mixin from AppsPageState Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replace hardcoded StyleConstants with context.colors in balances page for proper light/dark mode support on address, balance rows, filter chips - Replace WCPTextField with inline themed containers for balance rows - Add dark mode toggle switch at top of settings page Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…nRail Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…mode Replace hardcoded colors and deprecated StyleConstants with context.colors across all WalletConnect Pay modal widgets, including payment details, payment result, confirming payment, get options, information capture, and shared widgets. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Prevents memory leak and setState-after-dispose crash by removing the currentSelectedChain listener and disposing the PageController when the widget is removed from the tree. Also adds a mounted guard before setState in _switchToChain. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Claude finished @ignaciosantise's task in 1m 20s —— View job Code Review CompleteFound 3 issue(s)Issue 1: PR too large for atomic reviewID: phase2-widgets-pr-size-a8d4 Context:
Recommendation: Split into focused PRs:
Issue 2: Missing dispose in settings_page.dart _EVMAccountsStateID: settings-evm-missing-dispose-b3f7 Context:
Recommendation: Add dispose override: @override
void dispose() {
_walletKitService.currentSelectedChain.removeListener(_onChainChanged);
_pageController.dispose();
super.dispose();
}Issue 3: Missing mounted guard in settings_page.dart setStateID: settings-evm-missing-mounted-f9a1 Context:
Recommendation: Add mounted guard before setState: if (!mounted) return;
setState(() => _selectedChain = chainMetadata);SummaryPR correctly fixes the dispose issue in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request addresses a critical memory leak and crash issue in the walletkit example app by adding proper resource cleanup to _EVMAccountsState, along with a comprehensive theming system refactor to support dark mode.
Changes:
- Fixes missing
dispose()method in_EVMAccountsStatethat removes listener and disposes PageController - Adds
mountedguards beforesetState()calls in async operations to prevent crashes - Introduces new theming system with
AppColors,AppTypography,ThemeProviderfor dark mode support - Refactors UI components to use theme-aware styling via context extensions
- Adds new session and scan modal widgets with improved UX
Reviewed changes
Copilot reviewed 31 out of 40 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
lib/pages/secret_keys_page.dart |
New file: Implements dispose() with listener removal and PageController cleanup, adds mounted guards |
lib/theme/app_spacing.dart |
New file: Defines spacing constants (missing s3, s2, s5, s05 constants - critical bug) |
lib/theme/app_colors.dart |
New file: Theme extension for light/dark color schemes with context.colors extension |
lib/theme/app_typography.dart |
New file: Typography system with context.textStyles extension |
lib/theme/app_theme.dart |
New file: ThemeData builders for light and dark modes |
lib/theme/theme_provider.dart |
New file: Theme mode state management with persistence |
lib/theme/app_radius.dart |
New file: Border radius constants |
lib/main.dart |
Integrates ThemeProvider, adds theme switching, updates navigation with new design |
lib/widgets/session_item.dart |
New file: Displays session information with chain icons |
lib/widgets/scan_modal.dart |
New file: Bottom sheet for QR scanning and URL pasting |
lib/pages/apps_page.dart |
Refactored to show sessions instead of pairings |
lib/pages/balances_page.dart |
Updated to use theme-aware styling |
lib/pages/settings_page.dart |
Adds dark mode toggle widget |
lib/widgets/custom_button.dart |
Enhanced with outlined style and disabled state support |
lib/utils/constants.dart |
Deprecated color/text constants, delegates to AppColors for backward compatibility |
pubspec.yaml |
Adds KH Teka font family with Light, Regular, and Medium weights |
assets/*.svg |
New files: Icon assets for navigation and UI |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This pull request introduces significant improvements to theming, UI consistency, and code organization in the example app. The main changes include implementing a centralized theme system, refactoring navigation and header components for a more modern look, updating navigation icons to use SVG assets, and simplifying the apps page to focus on sessions. These changes enhance maintainability, visual consistency, and user experience.
Theming and UI Consistency:
AppColors,AppTheme, andThemeProvider, replacing hardcoded colors and style constants throughout the app. The theme now responds to user preference and system settings. [1] [2] [3]Navigation and Header Refactor:
PageDataand navigation components accordingly. [1] [2] [3]Bottom Sheet Improvements:
_SheetIconButtonwidget for consistent icon button styling in bottom sheets, and updated the bottom sheet to use theme values for background, spacing, and radius. [1] [2]Code Cleanup and Simplification:
Navigation Data Model Update:
PageDatamodel to use an SVG icon path (svgIcon) instead of anIconData, supporting the new SVG-based navigation. [1] [2]These changes collectively modernize the app's appearance, improve maintainability, and lay the groundwork for future UI enhancements.