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>

tuxsudo committed May 25, 2025 at 20:11 UTC df8891462876f7760d382e8891b7b9d8a55e1dcc
412 files changed +11128 -13147
assets/images/2fa.png
Binary files /dev/null and b/assets/images/2fa.png differ
assets/images/2fa_warning_dark.svg new
+86
@@ -0,0 +1,86 @@
1 +<svg width="260" height="298" viewBox="0 0 260 298" fill="none" xmlns="http://www.w3.org/2000/svg">
2 +<path d="M119.655 6.27832C126.055 3.53578 133.272 3.45033 139.723 6.02148L140.345 6.27832L243.044 50.293C252.699 54.431 258.96 63.925 258.96 74.4297V128.542C258.96 175.815 236.309 220.2 198.085 247.94L197.18 248.593L145.264 285.676C136.276 292.096 124.25 292.197 115.167 285.978L114.736 285.676L62.8203 248.593C24.0499 220.899 1.04004 176.187 1.04004 128.542V74.4297C1.04004 64.0891 7.10644 54.7283 16.5059 50.4912L16.9561 50.293L119.655 6.27832Z" stroke="#708BF4" stroke-opacity="0.05" stroke-width="2.08"/>
3 +<path d="M120.451 17.2793C126.358 14.7477 133.02 14.6687 138.975 17.042L139.549 17.2793L234.349 57.9082C243.261 61.7279 249.04 70.491 249.04 80.1875V130.138C249.04 173.775 228.131 214.745 192.848 240.352L192.012 240.954L144.089 275.185C135.792 281.111 124.692 281.204 116.308 275.463L115.911 275.185L67.9883 240.954C32.2001 215.391 10.96 174.118 10.96 130.138V80.1875C10.9601 70.6424 16.56 62.0019 25.2363 58.0908L25.6514 57.9082L120.451 17.2793Z" stroke="#708BF4" stroke-opacity="0.15" stroke-width="1.92"/>
4 +<path d="M121.294 28.3906C126.68 26.0825 132.754 26.0099 138.183 28.1738L138.706 28.3906L225.605 65.6328C233.731 69.1153 239 77.1057 239 85.9463V131.733C239 171.381 220.152 208.625 188.301 232.109L186.774 233.218L142.846 264.596C135.282 269.999 125.161 270.083 117.517 264.849L117.154 264.596L73.2256 233.218C40.4513 209.807 21 172.01 21 131.733V85.9463C21 77.2438 26.1053 69.3657 34.0156 65.7998L34.3945 65.6328L121.294 28.3906Z" stroke="#708BF4" stroke-opacity="0.5" stroke-width="2"/>
5 +<path d="M77.8584 226.327L117.794 254.852C125.096 260.068 134.904 260.068 142.206 254.852L182.141 226.327C212.176 204.874 230 170.238 230 133.329V91.7041C230 83.3035 224.994 75.7112 217.272 72.4021L138.272 38.5449C132.99 36.281 127.01 36.281 121.728 38.5449L42.7277 72.4021C35.0063 75.7112 30 83.3035 30 91.7041V133.329C30 170.238 47.8247 204.874 77.8584 226.327Z" fill="black"/>
6 +<path d="M77.8584 226.327L117.794 254.852C125.096 260.068 134.904 260.068 142.206 254.852L182.141 226.327C212.176 204.874 230 170.238 230 133.329V91.7041C230 83.3035 224.994 75.7112 217.272 72.4021L138.272 38.5449C132.99 36.281 127.01 36.281 121.728 38.5449L42.7277 72.4021C35.0063 75.7112 30 83.3035 30 91.7041V133.329C30 170.238 47.8247 204.874 77.8584 226.327Z" fill="url(#paint0_linear_4774_13703)"/>
7 +<path d="M123.479 42.6295C127.513 40.9005 132.063 40.8473 136.13 42.4684L136.521 42.6295L215.521 76.4869C221.609 79.0957 225.556 85.0812 225.556 91.7037V133.329C225.556 168.248 208.955 201.05 180.902 221.734L179.559 222.711L139.623 251.236C134.047 255.219 126.615 255.343 120.923 251.609L120.377 251.236L80.4414 222.711C51.5757 202.092 34.4443 168.802 34.4443 133.329V91.7037C34.4445 85.2882 38.1486 79.4709 43.9141 76.7418L44.4785 76.4869L123.479 42.6295Z" stroke="url(#paint1_linear_4774_13703)" stroke-width="8.88889"/>
8 +<path d="M123.479 42.6295C127.513 40.9005 132.063 40.8473 136.13 42.4684L136.521 42.6295L215.521 76.4869C221.609 79.0957 225.556 85.0812 225.556 91.7037V133.329C225.556 168.248 208.955 201.05 180.902 221.734L179.559 222.711L139.623 251.236C134.047 255.219 126.615 255.343 120.923 251.609L120.377 251.236L80.4414 222.711C51.5757 202.092 34.4443 168.802 34.4443 133.329V91.7037C34.4445 85.2882 38.1486 79.4709 43.9141 76.7418L44.4785 76.4869L123.479 42.6295Z" stroke="url(#paint2_linear_4774_13703)" stroke-width="8.88889"/>
9 +<path d="M123.479 42.6295C127.513 40.9005 132.063 40.8473 136.13 42.4684L136.521 42.6295L215.521 76.4869C221.609 79.0957 225.556 85.0812 225.556 91.7037V133.329C225.556 168.248 208.955 201.05 180.902 221.734L179.559 222.711L139.623 251.236C134.047 255.219 126.615 255.343 120.923 251.609L120.377 251.236L80.4414 222.711C51.5757 202.092 34.4443 168.802 34.4443 133.329V91.7037C34.4445 85.2882 38.1486 79.4709 43.9141 76.7418L44.4785 76.4869L123.479 42.6295Z" stroke="url(#paint3_linear_4774_13703)" stroke-width="8.88889"/>
10 +<g filter="url(#filter0_ii_4774_13703)">
11 +<path d="M77.8584 226.327L117.794 254.852C125.096 260.068 134.904 260.068 142.206 254.852L182.141 226.327C212.176 204.874 230 170.238 230 133.329V91.7041C230 83.3035 224.994 75.7112 217.272 72.4021L138.272 38.5449C132.99 36.281 127.01 36.281 121.728 38.5449L42.7277 72.4021C35.0063 75.7112 30 83.3035 30 91.7041V133.329C30 170.238 47.8247 204.874 77.8584 226.327Z" fill="black" fill-opacity="0.01"/>
12 +</g>
13 +<rect x="66.5" y="110.5" width="127" height="69.5833" rx="9.33333" fill="url(#paint4_linear_4774_13703)" fill-opacity="0.15" stroke="url(#paint5_linear_4774_13703)" stroke-width="3"/>
14 +<g filter="url(#filter1_d_4774_13703)">
15 +<path d="M85.027 155.008L85.4252 147.997L79.5392 151.857L77.4272 148.187L83.7113 145.037L77.4272 141.886L79.5392 138.216L85.4252 142.076L85.027 135.065H89.2338L88.8529 142.076L94.739 138.216L96.851 141.886L90.5495 145.037L96.851 148.187L94.739 151.857L88.8529 147.997L89.2338 155.008H85.027ZM113.447 155.008L113.845 147.997L107.959 151.857L105.847 148.187L112.131 145.037L105.847 141.886L107.959 138.216L113.845 142.076L113.447 135.065H117.654L117.273 142.076L123.159 138.216L125.271 141.886L118.969 145.037L125.271 148.187L123.159 151.857L117.273 147.997L117.654 155.008H113.447ZM141.866 155.008L142.265 147.997L136.379 151.857L134.267 148.187L140.551 145.037L134.267 141.886L136.379 138.216L142.265 142.076L141.866 135.065H146.073L145.692 142.076L151.578 138.216L153.69 141.886L147.389 145.037L153.69 148.187L151.578 151.857L145.692 147.997L146.073 155.008H141.866ZM170.286 155.008L170.684 147.997L164.798 151.857L162.686 148.187L168.971 145.037L162.686 141.886L164.798 138.216L170.684 142.076L170.286 135.065H174.493L174.112 142.076L179.998 138.216L182.11 141.886L175.809 145.037L182.11 148.187L179.998 151.857L174.112 147.997L174.493 155.008H170.286Z" fill="#EFEFF8"/>
16 +</g>
17 +<path d="M164.716 223.419H215.284C220.845 223.419 224.31 217.386 221.508 212.583L196.224 169.239C193.443 164.473 186.556 164.473 183.776 169.239L158.492 212.583C155.69 217.386 159.155 223.419 164.716 223.419Z" fill="#D9D9D9"/>
18 +<path d="M164.716 223.419H215.284C220.845 223.419 224.31 217.386 221.508 212.583L196.224 169.239C193.443 164.473 186.556 164.473 183.776 169.239L158.492 212.583C155.69 217.386 159.155 223.419 164.716 223.419Z" fill="url(#paint6_linear_4774_13703)"/>
19 +<path d="M164.716 223.419H215.284C220.845 223.419 224.31 217.386 221.508 212.583L196.224 169.239C193.443 164.473 186.556 164.473 183.776 169.239L158.492 212.583C155.69 217.386 159.155 223.419 164.716 223.419Z" stroke="#312938" stroke-width="3.25" stroke-linecap="round" stroke-linejoin="round"/>
20 +<path d="M164.716 223.419H215.284C220.845 223.419 224.31 217.386 221.508 212.583L196.224 169.239C193.443 164.473 186.556 164.473 183.776 169.239L158.492 212.583C155.69 217.386 159.155 223.419 164.716 223.419Z" stroke="url(#paint7_linear_4774_13703)" stroke-width="3.25" stroke-linecap="round" stroke-linejoin="round"/>
21 +<path d="M164.716 223.419H215.284C220.845 223.419 224.31 217.386 221.508 212.583L196.224 169.239C193.443 164.473 186.556 164.473 183.776 169.239L158.492 212.583C155.69 217.386 159.155 223.419 164.716 223.419Z" stroke="url(#paint8_linear_4774_13703)" stroke-width="3.25" stroke-linecap="round" stroke-linejoin="round"/>
22 +<path d="M189.925 208.897H189.961M189.925 198.089V187.281" stroke="#312938" stroke-width="7.20545" stroke-linecap="round" stroke-linejoin="round"/>
23 +<defs>
24 +<filter id="filter0_ii_4774_13703" x="30" y="36.8469" width="200" height="221.917" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
25 +<feFlood flood-opacity="0" result="BackgroundImageFix"/>
26 +<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
27 +<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
28 +<feOffset dy="2"/>
29 +<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>
30 +<feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.5 0"/>
31 +<feBlend mode="plus-lighter" in2="shape" result="effect1_innerShadow_4774_13703"/>
32 +<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
33 +<feOffset dy="-2"/>
34 +<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>
35 +<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0"/>
36 +<feBlend mode="normal" in2="effect1_innerShadow_4774_13703" result="effect2_innerShadow_4774_13703"/>
37 +</filter>
38 +<filter id="filter1_d_4774_13703" x="68.1106" y="125.748" width="123.316" height="38.5765" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
39 +<feFlood flood-opacity="0" result="BackgroundImageFix"/>
40 +<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
41 +<feOffset/>
42 +<feGaussianBlur stdDeviation="4.65833"/>
43 +<feComposite in2="hardAlpha" operator="out"/>
44 +<feColorMatrix type="matrix" values="0 0 0 0 0.937255 0 0 0 0 0.937255 0 0 0 0 0.972549 0 0 0 0.3 0"/>
45 +<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_4774_13703"/>
46 +<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_4774_13703" result="shape"/>
47 +</filter>
48 +<linearGradient id="paint0_linear_4774_13703" x1="130" y1="34.9996" x2="130" y2="263.571" gradientUnits="userSpaceOnUse">
49 +<stop stop-color="#19233C"/>
50 +<stop offset="1" stop-color="#1647C3"/>
51 +</linearGradient>
52 +<linearGradient id="paint1_linear_4774_13703" x1="130" y1="34.9996" x2="130" y2="263.571" gradientUnits="userSpaceOnUse">
53 +<stop stop-color="#C1F2FF"/>
54 +<stop offset="0.42" stop-color="#2077F8"/>
55 +<stop offset="0.700262" stop-color="#000F4D"/>
56 +</linearGradient>
57 +<linearGradient id="paint2_linear_4774_13703" x1="130" y1="34.9996" x2="130" y2="263.571" gradientUnits="userSpaceOnUse">
58 +<stop stop-color="#C1F2FF"/>
59 +<stop offset="0.700262" stop-color="#718CF5"/>
60 +</linearGradient>
61 +<linearGradient id="paint3_linear_4774_13703" x1="130" y1="34.9996" x2="130" y2="263.571" gradientUnits="userSpaceOnUse">
62 +<stop stop-color="#D8E3FF"/>
63 +<stop offset="0.700262" stop-color="#718CF5"/>
64 +</linearGradient>
65 +<linearGradient id="paint4_linear_4774_13703" x1="130" y1="109" x2="130" y2="181.583" gradientUnits="userSpaceOnUse">
66 +<stop stop-color="#5590FF"/>
67 +<stop offset="1" stop-color="#5590FF" stop-opacity="0.5"/>
68 +</linearGradient>
69 +<linearGradient id="paint5_linear_4774_13703" x1="190.695" y1="181.583" x2="69.3054" y2="109" gradientUnits="userSpaceOnUse">
70 +<stop stop-color="#EFEFF8" stop-opacity="0"/>
71 +<stop offset="1" stop-color="#EFEFF8"/>
72 +</linearGradient>
73 +<linearGradient id="paint6_linear_4774_13703" x1="190" y1="165.664" x2="190.433" y2="233.264" gradientUnits="userSpaceOnUse">
74 +<stop stop-color="#FFC414"/>
75 +<stop offset="1" stop-color="#FF9500"/>
76 +</linearGradient>
77 +<linearGradient id="paint7_linear_4774_13703" x1="190" y1="165.664" x2="190" y2="223.419" gradientUnits="userSpaceOnUse">
78 +<stop stop-color="#5C486E"/>
79 +<stop offset="1" stop-color="#312938"/>
80 +</linearGradient>
81 +<linearGradient id="paint8_linear_4774_13703" x1="190" y1="165.664" x2="190" y2="223.419" gradientUnits="userSpaceOnUse">
82 +<stop stop-color="white"/>
83 +<stop offset="1" stop-color="#EBD4FF"/>
84 +</linearGradient>
85 +</defs>
86 +</svg>
assets/images/2fa_warning_light.svg new
+101
@@ -0,0 +1,101 @@
1 +<svg width="260" height="298" viewBox="0 0 260 298" fill="none" xmlns="http://www.w3.org/2000/svg">
2 +<path d="M119.655 6.2793C126.055 3.53675 133.272 3.4513 139.723 6.02246L140.345 6.2793L243.044 50.2939C252.699 54.432 258.96 63.9259 258.96 74.4307V128.543C258.96 175.816 236.309 220.201 198.085 247.941L197.18 248.594L145.264 285.677C136.276 292.097 124.25 292.198 115.167 285.979L114.736 285.677L62.8203 248.594C24.0499 220.9 1.04004 176.188 1.04004 128.543V74.4307C1.04004 64.09 7.10644 54.7293 16.5059 50.4922L16.9561 50.2939L119.655 6.2793Z" stroke="#4A98DC" stroke-opacity="0.05" stroke-width="2.08"/>
3 +<path d="M120.451 17.2803C126.358 14.7487 133.02 14.6696 138.975 17.043L139.549 17.2803L234.349 57.9092C243.261 61.7289 249.04 70.492 249.04 80.1885V130.139C249.04 173.775 228.131 214.746 192.848 240.353L192.012 240.955L144.089 275.186C135.792 281.112 124.692 281.205 116.308 275.464L115.911 275.186L67.9883 240.955C32.2001 215.392 10.96 174.119 10.96 130.139V80.1885C10.9601 70.6434 16.56 62.0028 25.2363 58.0918L25.6514 57.9092L120.451 17.2803Z" stroke="#4B98DC" stroke-opacity="0.15" stroke-width="1.92"/>
4 +<path d="M121.294 28.3916C126.68 26.0835 132.754 26.0109 138.183 28.1748L138.706 28.3916L225.605 65.6338C233.731 69.1163 239 77.1066 239 85.9473V131.734C239 171.382 220.152 208.626 188.301 232.11L186.774 233.219L142.846 264.597C135.282 270 125.161 270.084 117.517 264.85L117.154 264.597L73.2256 233.219C40.4513 209.808 21 172.011 21 131.734V85.9473C21 77.2448 26.1053 69.3666 34.0156 65.8008L34.3945 65.6338L121.294 28.3916Z" stroke="#4895DB" stroke-opacity="0.35" stroke-width="2"/>
5 +<path d="M77.8584 226.328L117.794 254.853C125.096 260.069 134.904 260.069 142.206 254.853L182.141 226.328C212.176 204.875 230 170.239 230 133.33V91.7051C230 83.3045 224.994 75.7122 217.272 72.403L138.272 38.5459C132.99 36.2819 127.01 36.2819 121.728 38.5459L42.7277 72.403C35.0063 75.7122 30 83.3045 30 91.7051V133.33C30 170.239 47.8247 204.875 77.8584 226.328Z" fill="black"/>
6 +<path d="M77.8584 226.328L117.794 254.853C125.096 260.069 134.904 260.069 142.206 254.853L182.141 226.328C212.176 204.875 230 170.239 230 133.33V91.7051C230 83.3045 224.994 75.7122 217.272 72.403L138.272 38.5459C132.99 36.2819 127.01 36.2819 121.728 38.5459L42.7277 72.403C35.0063 75.7122 30 83.3045 30 91.7051V133.33C30 170.239 47.8247 204.875 77.8584 226.328Z" fill="url(#paint0_linear_4774_13798)"/>
7 +<path d="M77.8584 226.328L117.794 254.853C125.096 260.069 134.904 260.069 142.206 254.853L182.141 226.328C212.176 204.875 230 170.239 230 133.33V91.7051C230 83.3045 224.994 75.7122 217.272 72.403L138.272 38.5459C132.99 36.2819 127.01 36.2819 121.728 38.5459L42.7277 72.403C35.0063 75.7122 30 83.3045 30 91.7051V133.33C30 170.239 47.8247 204.875 77.8584 226.328Z" fill="url(#paint1_linear_4774_13798)"/>
8 +<path d="M77.8584 226.328L117.794 254.853C125.096 260.069 134.904 260.069 142.206 254.853L182.141 226.328C212.176 204.875 230 170.239 230 133.33V91.7051C230 83.3045 224.994 75.7122 217.272 72.403L138.272 38.5459C132.99 36.2819 127.01 36.2819 121.728 38.5459L42.7277 72.403C35.0063 75.7122 30 83.3045 30 91.7051V133.33C30 170.239 47.8247 204.875 77.8584 226.328Z" fill="url(#paint2_linear_4774_13798)"/>
9 +<path d="M77.8584 226.328L117.794 254.853C125.096 260.069 134.904 260.069 142.206 254.853L182.141 226.328C212.176 204.875 230 170.239 230 133.33V91.7051C230 83.3045 224.994 75.7122 217.272 72.403L138.272 38.5459C132.99 36.2819 127.01 36.2819 121.728 38.5459L42.7277 72.403C35.0063 75.7122 30 83.3045 30 91.7051V133.33C30 170.239 47.8247 204.875 77.8584 226.328Z" fill="url(#paint3_linear_4774_13798)"/>
10 +<path d="M123.479 42.6305C127.513 40.9015 132.063 40.8482 136.13 42.4693L136.521 42.6305L215.521 76.4879C221.609 79.0967 225.556 85.0821 225.556 91.7047V133.33C225.556 168.249 208.955 201.051 180.902 221.735L179.559 222.712L139.623 251.237C134.047 255.22 126.615 255.344 120.923 251.61L120.377 251.237L80.4414 222.712C51.5757 202.093 34.4443 168.803 34.4443 133.33V91.7047C34.4445 85.2892 38.1486 79.4719 43.9141 76.7428L44.4785 76.4879L123.479 42.6305Z" stroke="url(#paint4_linear_4774_13798)" stroke-width="8.88889"/>
11 +<path d="M123.479 42.6305C127.513 40.9015 132.063 40.8482 136.13 42.4693L136.521 42.6305L215.521 76.4879C221.609 79.0967 225.556 85.0821 225.556 91.7047V133.33C225.556 168.249 208.955 201.051 180.902 221.735L179.559 222.712L139.623 251.237C134.047 255.22 126.615 255.344 120.923 251.61L120.377 251.237L80.4414 222.712C51.5757 202.093 34.4443 168.803 34.4443 133.33V91.7047C34.4445 85.2892 38.1486 79.4719 43.9141 76.7428L44.4785 76.4879L123.479 42.6305Z" stroke="url(#paint5_linear_4774_13798)" stroke-width="8.88889"/>
12 +<path d="M123.479 42.6305C127.513 40.9015 132.063 40.8482 136.13 42.4693L136.521 42.6305L215.521 76.4879C221.609 79.0967 225.556 85.0821 225.556 91.7047V133.33C225.556 168.249 208.955 201.051 180.902 221.735L179.559 222.712L139.623 251.237C134.047 255.22 126.615 255.344 120.923 251.61L120.377 251.237L80.4414 222.712C51.5757 202.093 34.4443 168.803 34.4443 133.33V91.7047C34.4445 85.2892 38.1486 79.4719 43.9141 76.7428L44.4785 76.4879L123.479 42.6305Z" stroke="url(#paint6_linear_4774_13798)" stroke-width="8.88889"/>
13 +<path d="M123.479 42.6305C127.513 40.9015 132.063 40.8482 136.13 42.4693L136.521 42.6305L215.521 76.4879C221.609 79.0967 225.556 85.0821 225.556 91.7047V133.33C225.556 168.249 208.955 201.051 180.902 221.735L179.559 222.712L139.623 251.237C134.047 255.22 126.615 255.344 120.923 251.61L120.377 251.237L80.4414 222.712C51.5757 202.093 34.4443 168.803 34.4443 133.33V91.7047C34.4445 85.2892 38.1486 79.4719 43.9141 76.7428L44.4785 76.4879L123.479 42.6305Z" stroke="url(#paint7_linear_4774_13798)" stroke-width="8.88889"/>
14 +<g filter="url(#filter0_ii_4774_13798)">
15 +<path d="M77.8584 226.328L117.794 254.853C125.096 260.069 134.904 260.069 142.206 254.853L182.141 226.328C212.176 204.875 230 170.239 230 133.33V91.7051C230 83.3045 224.994 75.7122 217.272 72.403L138.272 38.5459C132.99 36.2819 127.01 36.2819 121.728 38.5459L42.7277 72.403C35.0063 75.7122 30 83.3045 30 91.7051V133.33C30 170.239 47.8247 204.875 77.8584 226.328Z" fill="black" fill-opacity="0.01"/>
16 +</g>
17 +<rect x="67" y="111" width="126" height="68.5833" rx="8.83333" fill="url(#paint8_linear_4774_13798)" stroke="url(#paint9_linear_4774_13798)" stroke-width="4"/>
18 +<g filter="url(#filter1_d_4774_13798)">
19 +<path d="M85.027 155.008L85.4252 147.997L79.5392 151.857L77.4272 148.187L83.7113 145.037L77.4272 141.886L79.5392 138.216L85.4252 142.076L85.027 135.065H89.2338L88.8529 142.076L94.739 138.216L96.851 141.886L90.5495 145.037L96.851 148.187L94.739 151.857L88.8529 147.997L89.2338 155.008H85.027ZM113.447 155.008L113.845 147.997L107.959 151.857L105.847 148.187L112.131 145.037L105.847 141.886L107.959 138.216L113.845 142.076L113.447 135.065H117.654L117.273 142.076L123.159 138.216L125.271 141.886L118.969 145.037L125.271 148.187L123.159 151.857L117.273 147.997L117.654 155.008H113.447ZM141.866 155.008L142.265 147.997L136.379 151.857L134.267 148.187L140.551 145.037L134.267 141.886L136.379 138.216L142.265 142.076L141.866 135.065H146.073L145.692 142.076L151.578 138.216L153.69 141.886L147.389 145.037L153.69 148.187L151.578 151.857L145.692 147.997L146.073 155.008H141.866ZM170.286 155.008L170.684 147.997L164.798 151.857L162.686 148.187L168.971 145.037L162.686 141.886L164.798 138.216L170.684 142.076L170.286 135.065H174.493L174.112 142.076L179.998 138.216L182.11 141.886L175.809 145.037L182.11 148.187L179.998 151.857L174.112 147.997L174.493 155.008H170.286Z" fill="#2C71CC"/>
20 +</g>
21 +<path d="M164.716 223.418H215.284C220.845 223.418 224.31 217.386 221.508 212.582L196.224 169.239C193.443 164.472 186.556 164.472 183.776 169.239L158.492 212.582C155.69 217.386 159.155 223.418 164.716 223.418Z" fill="#D9D9D9"/>
22 +<path d="M164.716 223.418H215.284C220.845 223.418 224.31 217.386 221.508 212.582L196.224 169.239C193.443 164.472 186.556 164.472 183.776 169.239L158.492 212.582C155.69 217.386 159.155 223.418 164.716 223.418Z" fill="url(#paint10_linear_4774_13798)"/>
23 +<path d="M164.716 223.418H215.284C220.845 223.418 224.31 217.386 221.508 212.582L196.224 169.239C193.443 164.472 186.556 164.472 183.776 169.239L158.492 212.582C155.69 217.386 159.155 223.418 164.716 223.418Z" stroke="#312938" stroke-width="3.25" stroke-linecap="round" stroke-linejoin="round"/>
24 +<path d="M164.716 223.418H215.284C220.845 223.418 224.31 217.386 221.508 212.582L196.224 169.239C193.443 164.472 186.556 164.472 183.776 169.239L158.492 212.582C155.69 217.386 159.155 223.418 164.716 223.418Z" stroke="url(#paint11_linear_4774_13798)" stroke-width="3.25" stroke-linecap="round" stroke-linejoin="round"/>
25 +<path d="M189.925 208.896H189.961M189.925 198.088V187.28" stroke="#312938" stroke-width="7.20545" stroke-linecap="round" stroke-linejoin="round"/>
26 +<defs>
27 +<filter id="filter0_ii_4774_13798" x="30" y="36.8479" width="200" height="221.917" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
28 +<feFlood flood-opacity="0" result="BackgroundImageFix"/>
29 +<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
30 +<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
31 +<feOffset dy="2"/>
32 +<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>
33 +<feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.5 0"/>
34 +<feBlend mode="normal" in2="shape" result="effect1_innerShadow_4774_13798"/>
35 +<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
36 +<feOffset dy="-2"/>
37 +<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>
38 +<feColorMatrix type="matrix" values="0 0 0 0 0.022328 0 0 0 0 0.298259 0 0 0 0 0.663462 0 0 0 1 0"/>
39 +<feBlend mode="normal" in2="effect1_innerShadow_4774_13798" result="effect2_innerShadow_4774_13798"/>
40 +</filter>
41 +<filter id="filter1_d_4774_13798" x="68.1106" y="125.748" width="123.316" height="38.5765" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
42 +<feFlood flood-opacity="0" result="BackgroundImageFix"/>
43 +<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
44 +<feOffset/>
45 +<feGaussianBlur stdDeviation="4.65833"/>
46 +<feComposite in2="hardAlpha" operator="out"/>
47 +<feColorMatrix type="matrix" values="0 0 0 0 0.172549 0 0 0 0 0.443137 0 0 0 0 0.8 0 0 0 0.3 0"/>
48 +<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_4774_13798"/>
49 +<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_4774_13798" result="shape"/>
50 +</filter>
51 +<linearGradient id="paint0_linear_4774_13798" x1="130" y1="35.0006" x2="130" y2="263.572" gradientUnits="userSpaceOnUse">
52 +<stop stop-color="#002A52"/>
53 +<stop offset="1" stop-color="#0652DF"/>
54 +</linearGradient>
55 +<linearGradient id="paint1_linear_4774_13798" x1="130" y1="35.0006" x2="130" y2="263.572" gradientUnits="userSpaceOnUse">
56 +<stop stop-color="#19233C"/>
57 +<stop offset="1" stop-color="#144CD8"/>
58 +</linearGradient>
59 +<linearGradient id="paint2_linear_4774_13798" x1="130" y1="35.0006" x2="130" y2="263.572" gradientUnits="userSpaceOnUse">
60 +<stop stop-color="#19233C"/>
61 +<stop offset="1" stop-color="#1647C3"/>
62 +</linearGradient>
63 +<linearGradient id="paint3_linear_4774_13798" x1="130" y1="35.0006" x2="130" y2="263.572" gradientUnits="userSpaceOnUse">
64 +<stop offset="0.144488" stop-color="#FAFAFA"/>
65 +<stop offset="1" stop-color="#72AAFF"/>
66 +</linearGradient>
67 +<linearGradient id="paint4_linear_4774_13798" x1="130" y1="35.0006" x2="130" y2="263.572" gradientUnits="userSpaceOnUse">
68 +<stop stop-color="#C1F2FF"/>
69 +<stop offset="0.42" stop-color="#2077F8"/>
70 +<stop offset="0.700262" stop-color="#000F4D"/>
71 +</linearGradient>
72 +<linearGradient id="paint5_linear_4774_13798" x1="130" y1="35.0006" x2="130" y2="263.572" gradientUnits="userSpaceOnUse">
73 +<stop stop-color="#C1F2FF"/>
74 +<stop offset="0.700262" stop-color="#718CF5"/>
75 +</linearGradient>
76 +<linearGradient id="paint6_linear_4774_13798" x1="130" y1="35.0006" x2="130" y2="263.572" gradientUnits="userSpaceOnUse">
77 +<stop stop-color="#D8E3FF"/>
78 +<stop offset="0.700262" stop-color="#718CF5"/>
79 +</linearGradient>
80 +<linearGradient id="paint7_linear_4774_13798" x1="130" y1="35.0006" x2="130" y2="263.572" gradientUnits="userSpaceOnUse">
81 +<stop stop-color="#68BEEF"/>
82 +<stop offset="0.700262" stop-color="#2C71CC"/>
83 +</linearGradient>
84 +<linearGradient id="paint8_linear_4774_13798" x1="147.5" y1="170" x2="69.5" y2="100" gradientUnits="userSpaceOnUse">
85 +<stop offset="0.0455724" stop-color="white" stop-opacity="0"/>
86 +<stop offset="1" stop-color="white" stop-opacity="0.5"/>
87 +</linearGradient>
88 +<linearGradient id="paint9_linear_4774_13798" x1="65" y1="109" x2="195" y2="185.5" gradientUnits="userSpaceOnUse">
89 +<stop stop-color="#4794DA"/>
90 +<stop offset="0.954879" stop-color="#72AAFF" stop-opacity="0.2"/>
91 +</linearGradient>
92 +<linearGradient id="paint10_linear_4774_13798" x1="190" y1="165.664" x2="190.433" y2="233.264" gradientUnits="userSpaceOnUse">
93 +<stop stop-color="#FFC414"/>
94 +<stop offset="1" stop-color="#FF9500"/>
95 +</linearGradient>
96 +<linearGradient id="paint11_linear_4774_13798" x1="190" y1="165.664" x2="190" y2="223.418" gradientUnits="userSpaceOnUse">
97 +<stop stop-color="#5C486E"/>
98 +<stop offset="1" stop-color="#312938"/>
99 +</linearGradient>
100 +</defs>
101 +</svg>
assets/images/birthday_cake.png
Binary files a/assets/images/birthday_cake.png and b/assets/images/birthday_cake.png differ
assets/images/birthday_cake.svg deleted
-31
@@ -1,31 +0,0 @@
1 -<svg width="163" height="178" viewBox="0 0 163 178" fill="none" xmlns="http://www.w3.org/2000/svg">
2 - <path d="M47.5763 28.5814C46.1363 28.5814 44.9689 27.414 44.9689 25.974V22.2461C44.9689 20.8061 46.1363 19.6387 47.5763 19.6387C49.0163 19.6387 50.1837 20.8061 50.1837 22.2461V25.974C50.1837 27.414 49.0163 28.5814 47.5763 28.5814Z" fill="#14C846"/>
3 - <path d="M81.252 28.5814C79.812 28.5814 78.6445 27.414 78.6445 25.974V22.2461C78.6445 20.8061 79.812 19.6387 81.252 19.6387C82.6919 19.6387 83.8594 20.8061 83.8594 22.2461V25.974C83.8594 27.414 82.6919 28.5814 81.252 28.5814Z" fill="#14C846"/>
4 - <path d="M114.928 28.5814C113.488 28.5814 112.32 27.414 112.32 25.974V22.2461C112.32 20.8061 113.488 19.6387 114.928 19.6387C116.368 19.6387 117.535 20.8061 117.535 22.2461V25.974C117.535 27.414 116.368 28.5814 114.928 28.5814Z" fill="#14C846"/>
5 - <path d="M119.675 5.23777C118.208 2.28443 115.374 -2.62586 112.117 1.72088C109.646 5.02118 107.251 11.045 111.084 14.2782C113.143 16.0161 116.707 16.0196 118.771 14.2782C121.501 11.9753 121.084 8.07603 119.675 5.23777Z" fill="#FC914A"/>
6 - <path d="M85.9992 5.23777C84.5328 2.28443 81.698 -2.62586 78.4419 1.72088C75.9701 5.02118 73.5754 11.045 77.408 14.2782C79.4678 16.0161 83.0317 16.0196 85.0957 14.2782C87.8255 11.9753 87.4086 8.07603 85.9992 5.23777Z" fill="#FC914A"/>
7 - <path d="M147.295 113.917H15.2089V60.2027C15.2089 54.4747 19.8525 49.8311 25.5805 49.8311H136.923C142.651 49.8311 147.295 54.4747 147.295 60.2027V113.917Z" fill="#A06047"/>
8 - <path d="M120.67 56.9909H109.185C108.196 56.9909 107.395 56.1892 107.395 55.2005V27.7645C107.395 26.7758 108.196 25.9741 109.185 25.9741H120.67C121.659 25.9741 122.461 26.7758 122.461 27.7645V55.2008C122.461 56.1896 121.659 56.9909 120.67 56.9909Z" fill="#14C846"/>
9 - <path d="M86.9945 56.9909H75.5094C74.5206 56.9909 73.7189 56.1892 73.7189 55.2005V27.7645C73.7189 26.7758 74.5206 25.9741 75.5094 25.9741H86.9945C87.9832 25.9741 88.7849 26.7758 88.7849 27.7645V55.2008C88.7846 56.1896 87.9832 56.9909 86.9945 56.9909Z" fill="#14C846"/>
10 - <path d="M52.3235 5.23777C50.8571 2.28443 48.0223 -2.62586 44.7662 1.72088C42.2943 5.02118 39.8997 11.045 43.7322 14.2782C45.7921 16.0161 49.3559 16.0196 51.4199 14.2782C54.1497 11.9753 53.7326 8.07603 52.3235 5.23777Z" fill="#FC914A"/>
11 - <path d="M51.4183 14.2785C49.8107 15.6354 47.2898 15.9327 45.2776 15.1737C45.8432 14.9589 46.3696 14.6616 46.8243 14.2785C49.5527 11.9764 49.1373 8.07705 47.7265 5.2374C47.1 3.96985 46.2191 2.34421 45.1591 1.24145C48.249 -2.23546 50.9131 2.40158 52.3239 5.2374C53.7316 8.07705 54.1505 11.9764 51.4183 14.2785Z" fill="#EA7636"/>
12 - <path d="M85.0943 14.2785C83.4867 15.6354 80.9659 15.9327 78.9536 15.1737C79.5193 14.9589 80.0456 14.6616 80.5004 14.2785C83.2288 11.9764 82.8133 8.07705 81.4025 5.2374C80.776 3.96985 79.8951 2.34421 78.8351 1.24145C81.925 -2.23546 84.5891 2.40158 85.9999 5.2374C87.4076 8.07705 87.8265 11.9764 85.0943 14.2785Z" fill="#EA7636"/>
13 - <path d="M118.77 14.2785C117.163 15.6354 114.642 15.9327 112.63 15.1737C113.195 14.9589 113.722 14.6616 114.176 14.2785C116.905 11.9764 116.489 8.07705 115.078 5.2374C114.452 3.96985 113.571 2.34421 112.511 1.24145C115.601 -2.23546 118.265 2.40158 119.676 5.2374C121.083 8.07705 121.502 11.9764 118.77 14.2785Z" fill="#EA7636"/>
14 - <path d="M53.3189 56.9909H41.8338C40.845 56.9909 40.0433 56.1892 40.0433 55.2005V27.7645C40.0433 26.7758 40.845 25.9741 41.8338 25.9741H53.3189C54.3076 25.9741 55.1093 26.7758 55.1093 27.7645V55.2008C55.109 56.1896 54.3076 56.9909 53.3189 56.9909Z" fill="#14C846"/>
15 - <path d="M55.11 27.7659V55.2005C55.11 56.1888 54.3079 56.9909 53.3196 56.9909H48.8331V25.9758H53.3196C54.3079 25.9758 55.11 26.7744 55.11 27.7659Z" fill="#0EA939"/>
16 - <path d="M88.7846 27.7659V55.2005C88.7846 56.1888 87.9826 56.9909 86.9942 56.9909H82.5077V25.9758H86.9942C87.9826 25.9758 88.7846 26.7744 88.7846 27.7659Z" fill="#0EA939"/>
17 - <path d="M122.461 27.7659V55.2005C122.461 56.1888 121.659 56.9909 120.67 56.9909H116.184V25.9758H120.67C121.659 25.9758 122.461 26.7744 122.461 27.7659Z" fill="#0EA939"/>
18 - <path d="M147.295 60.2028V113.916H134.809V60.2028C134.809 54.4738 130.169 49.8298 124.44 49.8298H136.922C142.651 49.8298 147.295 54.4738 147.295 60.2028Z" fill="#824730"/>
19 - <path d="M147.296 60.2028V65.6885C144.844 67.6973 142.502 69.7953 137.607 69.7953C136.569 69.7953 135.645 69.7022 134.811 69.5304V60.2028C134.811 54.4738 130.17 49.8298 124.441 49.8298H136.923C142.652 49.8298 147.296 54.4738 147.296 60.2028Z" fill="#F7D443"/>
20 - <path d="M162.503 178H0.000671387V124.286C0.000671387 118.558 4.64431 113.915 10.3723 113.915H152.131C157.859 113.915 162.503 118.558 162.503 124.286L162.503 178Z" fill="#A06047"/>
21 - <path d="M162.503 124.286V177.999H147.296V124.286C147.296 118.557 142.652 113.916 136.923 113.916H152.13C157.859 113.916 162.503 118.557 162.503 124.286Z" fill="#824730"/>
22 - <path d="M162.503 124.286V129.771C159.488 131.78 156.602 133.882 150.583 133.882C149.37 133.882 148.281 133.796 147.296 133.642V124.286C147.296 118.557 142.652 113.917 136.923 113.917H152.13C157.859 113.916 162.503 118.557 162.503 124.286Z" fill="#F7D443"/>
23 - <path d="M147.293 83.5281H15.2078V96.4157H147.293V83.5281Z" fill="white"/>
24 - <path d="M147.294 83.5281H134.808V96.4157H147.294V83.5281Z" fill="#C7ABA1"/>
25 - <path d="M162.502 147.615H0.000671387V160.502H162.502V147.615Z" fill="white"/>
26 - <path d="M162.504 147.615H147.296V160.502H162.504V147.615Z" fill="#C7ABA1"/>
27 - <path d="M147.295 60.2028V65.6868C144.844 67.6973 142.501 69.7971 137.606 69.7971C128.214 69.7971 128.214 62.0638 118.822 62.0638C109.43 62.0638 109.43 69.7971 100.034 69.7971C90.6422 69.7971 90.6422 62.0638 81.2502 62.0638C71.8583 62.0638 71.8583 69.7971 62.4664 69.7971C53.0745 69.7971 53.0745 62.0638 43.6826 62.0638C34.2907 62.0638 34.2907 69.7971 24.8988 69.7971C20.0076 69.7971 17.6644 67.6976 15.2131 65.6868V60.2028C15.2131 54.4738 19.8574 49.8298 25.5861 49.8298H136.922C142.651 49.8298 147.295 54.4738 147.295 60.2028Z" fill="#2194FF"/>
28 - <path d="M147.296 61.03V65.6883C144.844 67.697 142.502 69.7951 137.607 69.7951C136.569 69.7951 135.645 69.7019 134.811 69.5302V60.2026C134.811 54.4736 130.17 49.8296 124.441 49.8296H136.096C143.689 49.8299 147.296 54.6637 147.296 61.03Z" fill="#1585EC"/>
29 - <path d="M162.504 125.114V129.77C159.488 131.781 156.604 133.881 150.584 133.881C139.026 133.881 139.026 126.148 127.469 126.148C115.916 126.148 115.916 133.881 104.359 133.881C92.8053 133.881 92.8053 126.148 81.2481 126.148C69.6949 126.148 69.6949 133.881 58.1377 133.881C46.5845 133.881 46.5845 126.148 35.0273 126.148C23.4741 126.148 23.4741 133.881 11.9169 133.881C5.89659 133.881 3.01591 131.781 0 129.77V124.287C0 118.558 4.64433 113.914 10.373 113.914H151.305C157.49 113.914 162.504 118.928 162.504 125.114Z" fill="#2194FF"/>
30 - <path d="M162.503 125.113V129.771C159.488 131.78 156.602 133.882 150.583 133.882C149.37 133.882 148.281 133.796 147.296 133.642V124.286C147.296 118.557 142.652 113.916 136.923 113.916H151.593C158.474 113.916 162.503 118.048 162.503 125.113Z" fill="#1585EC"/>
31 -</svg>
assets/images/btc_lock_dark.png
Binary files /dev/null and b/assets/images/btc_lock_dark.png differ
assets/images/btc_lock_light.png
Binary files /dev/null and b/assets/images/btc_lock_light.png differ
assets/images/buy.png
Binary files a/assets/images/buy.png and b/assets/images/buy.png differ
assets/images/cake_logo_dark.svg new
+3
@@ -0,0 +1,3 @@
1 +<svg width="28" height="37" viewBox="0 0 28 37" fill="none" xmlns="http://www.w3.org/2000/svg">
2 +<path d="M26.0117 0.00835344C26.0523 -0.000438375 26.0914 -0.00211226 26.1279 0.00249407C26.3832 0.0346771 26.5225 0.363833 26.3174 0.5689L11.9326 14.9625C11.4874 15.4075 11.2364 16.0124 11.2354 16.6421V35.7369C11.2354 35.8853 11.146 35.9965 11.0303 36.0445C10.9723 36.0685 10.9079 36.0769 10.8447 36.066C10.7815 36.055 10.7195 36.0247 10.667 35.9722L0.396484 25.7056C0.20853 25.5177 0.10361 25.2641 0.103516 24.9996V7.18218C0.103551 6.28774 0.727312 5.51391 1.60156 5.32378L26.0107 0.00835344H26.0117ZM27.1025 20.2906C27.1024 20.5551 26.9964 20.8079 26.8096 20.9947L12.9443 34.8316C12.9218 34.8541 12.8953 34.867 12.8682 34.8716C12.8413 34.8762 12.8137 34.873 12.7891 34.8628C12.7394 34.8423 12.7012 34.7942 12.7012 34.731L12.7031 27.6763L17.3975 23.0289C18.0656 22.4518 18.3422 22.2068 18.7549 22.1832C18.8235 22.1792 18.896 22.1822 18.9746 22.19C19.0532 22.1978 19.138 22.2106 19.2314 22.2291C19.6039 22.3026 19.9558 22.357 20.2842 22.3755C20.4156 22.3829 20.5432 22.3847 20.667 22.3794C21.2241 22.356 21.7026 22.1937 22.0898 21.7945C22.427 21.4466 22.853 20.8957 23.0713 19.4947C23.2236 18.5107 23.33 17.8883 23.5439 17.3169C23.7579 16.7456 24.0748 16.3552 24.4551 15.9761V15.9752L27.1201 13.2974L27.1025 20.2906ZM26.9834 7.87359C27.0584 7.90479 27.1162 7.97749 27.1162 8.07378L27.0967 11.2144L24.1006 14.3306C23.5194 14.8954 22.9476 15.67 22.6914 16.2759C22.4364 16.8808 22.1497 17.8845 22.0049 18.7476C21.8611 19.6097 21.8812 20.1323 21.1377 20.6011C20.9985 20.6888 20.8632 20.7369 20.7295 20.7574C20.6402 20.7711 20.5516 20.7729 20.4629 20.7652C20.0187 20.7267 19.5718 20.4629 19.0273 20.4019C18.973 20.3958 18.9177 20.3918 18.8613 20.3902L18.8604 20.3912C17.9582 20.3653 17.3076 21.023 17.3057 21.025L12.7021 25.6441V22.5533C12.7021 22.1752 12.8521 21.8114 13.1201 21.5435L26.749 7.92046C26.7832 7.88634 26.8233 7.86688 26.8643 7.85992C26.9048 7.85303 26.9462 7.85813 26.9834 7.87359ZM26.9277 2.16753C27.0287 2.17924 27.12 2.26134 27.1201 2.3814V5.49956H27.1211L12.7021 19.9498V16.8648C12.7022 16.4869 12.8522 16.1238 13.1201 15.856L26.752 2.22906C26.8026 2.17847 26.8672 2.16051 26.9277 2.16753Z" fill="#D7E2F7"/>
3 +</svg>
assets/images/cake_logo_light.svg new
+3
@@ -0,0 +1,3 @@
1 +<svg width="28" height="37" viewBox="0 0 28 37" fill="none" xmlns="http://www.w3.org/2000/svg">
2 +<path d="M26.0117 0.00769167C26.0523 -0.00110449 26.0914 -0.00180576 26.1279 0.00280886C26.3831 0.0350288 26.5224 0.363182 26.3174 0.568239L11.9326 14.9618C11.4874 15.4069 11.2364 16.0127 11.2354 16.6425V35.7372C11.2353 35.8856 11.1461 35.9969 11.0303 36.0448C10.9724 36.0688 10.9078 36.0772 10.8447 36.0663C10.7815 36.0554 10.7195 36.025 10.667 35.9725L0.396484 25.7059C0.208445 25.518 0.103516 25.2635 0.103516 24.9989V7.1825C0.103516 6.28802 0.727287 5.51423 1.60156 5.3241L26.0107 0.00769167H26.0117ZM27.1025 20.2899C27.1025 20.5545 26.9964 20.8071 26.8096 20.994L12.9443 34.8319C12.9218 34.8543 12.8952 34.8674 12.8682 34.8719C12.8413 34.8765 12.8138 34.8724 12.7891 34.8622C12.7396 34.8417 12.7013 34.7944 12.7012 34.7313L12.7031 27.6757L17.3975 23.0282C18.0655 22.4511 18.3423 22.2071 18.7549 22.1835C18.8235 22.1795 18.896 22.1815 18.9746 22.1893C19.0532 22.1971 19.138 22.2109 19.2314 22.2294C19.6039 22.303 19.9558 22.3574 20.2842 22.3759C20.4155 22.3833 20.5432 22.385 20.667 22.3798C21.224 22.3563 21.7026 22.1939 22.0898 21.7948C22.427 21.447 22.853 20.896 23.0713 19.495C23.2236 18.5109 23.33 17.8887 23.5439 17.3173C23.7579 16.7458 24.0747 16.3556 24.4551 15.9764V15.9755L27.1201 13.2977L27.1025 20.2899ZM26.9834 7.8739C27.0584 7.90515 27.1162 7.97782 27.1162 8.0741L27.0967 11.2137L24.1006 14.3309C23.5192 14.8958 22.9476 15.6702 22.6914 16.2762C22.4364 16.8812 22.1497 17.8848 22.0049 18.7479C21.8611 19.61 21.8812 20.1316 21.1377 20.6005C20.9984 20.6882 20.8633 20.7372 20.7295 20.7577C20.6402 20.7714 20.5516 20.7722 20.4629 20.7645C20.0188 20.7261 19.5717 20.4632 19.0273 20.4022C18.973 20.3961 18.9177 20.3912 18.8613 20.3895L18.8604 20.3915C17.9569 20.3655 17.3057 21.0253 17.3057 21.0253L12.7021 25.6444V22.5526C12.7022 22.1746 12.8523 21.8117 13.1201 21.5438L26.749 7.92078C26.7832 7.88666 26.8233 7.8672 26.8643 7.86023C26.9049 7.85331 26.9462 7.85839 26.9834 7.8739ZM26.9277 2.16785C27.0288 2.17959 27.1201 2.2615 27.1201 2.38172V5.4989H27.1211L12.7021 19.9501V16.8651C12.7021 16.4872 12.8523 16.1242 13.1201 15.8563L26.752 2.22937C26.8026 2.17876 26.8671 2.16081 26.9277 2.16785Z" fill="#1C1B1C"/>
3 +</svg>
assets/images/contact.png
Binary files /dev/null and b/assets/images/contact.png differ
assets/images/hero/cw_welcome_dark.svg new
+5
@@ -0,0 +1,5 @@
1 +<svg width="179" height="37" viewBox="0 0 179 37" fill="none" xmlns="http://www.w3.org/2000/svg">
2 +<path d="M76.2936 20.5227L77.9877 22.2168C77.2983 23.1262 76.3963 23.8522 75.2815 24.3949C74.1815 24.923 72.964 25.187 71.6293 25.187C70.4412 25.187 69.3485 24.9816 68.3511 24.5709C67.3684 24.1603 66.5103 23.5882 65.7769 22.8548C65.0582 22.1215 64.4935 21.2561 64.0828 20.2587C63.6868 19.2466 63.4888 18.1539 63.4888 16.9805C63.4888 15.7924 63.6941 14.6997 64.1048 13.7023C64.5155 12.6902 65.0876 11.8175 65.8209 11.0841C66.569 10.3507 67.4417 9.7787 68.4391 9.36801C69.4365 8.95732 70.5219 8.75197 71.6953 8.75197C73.0301 8.75197 74.2401 9.02332 75.3255 9.56602C76.4109 10.0941 77.2983 10.8128 77.9877 11.7222L76.2936 13.4163C75.7802 12.6682 75.1348 12.0815 74.3575 11.6561C73.5801 11.2161 72.6927 10.9961 71.6953 10.9961C70.6392 10.9961 69.6932 11.2601 68.8571 11.7882C68.0211 12.3015 67.361 13.0056 66.877 13.9003C66.393 14.795 66.151 15.8217 66.151 16.9805C66.151 18.1245 66.393 19.1439 66.877 20.0387C67.361 20.9334 68.0211 21.6448 68.8571 22.1728C69.6932 22.6862 70.6392 22.9428 71.6953 22.9428C72.6927 22.9428 73.5801 22.7228 74.3575 22.2828C75.1348 21.8428 75.7802 21.2561 76.2936 20.5227ZM89.1654 24.835H86.8993V22.6568L86.7893 22.1948V18.0805C86.7893 17.2592 86.5252 16.6211 85.9972 16.1664C85.4692 15.6971 84.7505 15.4624 83.8411 15.4624C83.181 15.4624 82.565 15.5944 81.993 15.8584C81.4356 16.1224 80.9516 16.4891 80.5409 16.9585L79.1328 15.4184C79.7342 14.817 80.4382 14.3476 81.2449 14.0103C82.0516 13.6729 82.9464 13.5043 83.9291 13.5043C84.9705 13.5043 85.8799 13.6876 86.6573 14.0543C87.4493 14.4063 88.0653 14.9197 88.5054 15.5944C88.9454 16.2691 89.1654 17.0758 89.1654 18.0145V24.835ZM83.005 25.187C82.169 25.187 81.4283 25.033 80.7829 24.725C80.1375 24.4169 79.6388 23.9989 79.2868 23.4709C78.9348 22.9428 78.7588 22.3268 78.7588 21.6228C78.7588 20.86 78.9788 20.2147 79.4188 19.6866C79.8588 19.1439 80.4675 18.7333 81.2449 18.4546C82.037 18.1612 82.9464 18.0145 83.9731 18.0145H87.0533V19.7086H84.1931C83.3277 19.7086 82.6237 19.8627 82.081 20.1707C81.5529 20.4787 81.2889 20.9334 81.2889 21.5348C81.2889 22.0775 81.4943 22.5102 81.905 22.8328C82.3157 23.1409 82.851 23.2949 83.5111 23.2949C84.1418 23.2949 84.7211 23.1629 85.2492 22.8988C85.7772 22.6348 86.1952 22.2755 86.5032 21.8208C86.8259 21.3514 87.0093 20.816 87.0533 20.2147L87.8453 20.5887C87.8453 21.4834 87.64 22.2828 87.2293 22.9868C86.8186 23.6762 86.2466 24.2189 85.5132 24.6149C84.7798 24.9963 83.9438 25.187 83.005 25.187ZM93.3326 24.835H90.8685V8.99398H93.3326V24.835ZM102.111 24.835H98.8549L92.7166 19.1366H92.9366L98.4149 13.8563H101.473L95.6427 19.3566V18.9386L102.111 24.835ZM111.222 21.5128L112.63 23.0529C112.058 23.7129 111.347 24.2336 110.496 24.6149C109.645 24.9963 108.699 25.187 107.658 25.187C106.426 25.187 105.333 24.9376 104.38 24.4389C103.441 23.9402 102.7 23.2509 102.158 22.3708C101.63 21.4908 101.366 20.486 101.366 19.3566C101.366 18.2126 101.622 17.2005 102.136 16.3204C102.649 15.4404 103.353 14.751 104.248 14.2523C105.142 13.7536 106.147 13.5043 107.262 13.5043C108.347 13.5043 109.308 13.7536 110.144 14.2523C110.98 14.7363 111.64 15.411 112.124 16.2764C112.608 17.1272 112.85 18.1172 112.85 19.2466V19.3786H110.408V19.1366C110.408 18.4032 110.269 17.7652 109.99 17.2225C109.726 16.6651 109.359 16.2398 108.89 15.9464C108.421 15.6384 107.871 15.4844 107.24 15.4844C106.58 15.4844 105.993 15.6457 105.48 15.9684C104.981 16.2764 104.592 16.7165 104.314 17.2885C104.035 17.8459 103.896 18.5206 103.896 19.3126C103.896 20.1047 104.057 20.794 104.38 21.3807C104.717 21.9675 105.172 22.4221 105.744 22.7448C106.33 23.0529 107.005 23.2069 107.768 23.2069C109.161 23.2069 110.313 22.6422 111.222 21.5128ZM112.85 20.1267H103.082V18.4546H112.498L112.85 19.2686V20.1267ZM134.362 24.835H131.524L127.915 12.2062H128.223L124.593 24.835H121.755L117.135 9.10399H119.841L123.581 22.8548H122.899L126.859 9.10399H129.279L133.24 22.8548H132.624L136.342 9.10399H138.982L134.362 24.835ZM148.664 24.835H146.397V22.6568L146.287 22.1948V18.0805C146.287 17.2592 146.023 16.6211 145.495 16.1664C144.967 15.6971 144.249 15.4624 143.339 15.4624C142.679 15.4624 142.063 15.5944 141.491 15.8584C140.934 16.1224 140.45 16.4891 140.039 16.9585L138.631 15.4184C139.232 14.817 139.936 14.3476 140.743 14.0103C141.55 13.6729 142.445 13.5043 143.427 13.5043C144.469 13.5043 145.378 13.6876 146.155 14.0543C146.948 14.4063 147.564 14.9197 148.004 15.5944C148.444 16.2691 148.664 17.0758 148.664 18.0145V24.835ZM142.503 25.187C141.667 25.187 140.926 25.033 140.281 24.725C139.636 24.4169 139.137 23.9989 138.785 23.4709C138.433 22.9428 138.257 22.3268 138.257 21.6228C138.257 20.86 138.477 20.2147 138.917 19.6866C139.357 19.1439 139.966 18.7333 140.743 18.4546C141.535 18.1612 142.445 18.0145 143.471 18.0145H146.551V19.7086H143.691C142.826 19.7086 142.122 19.8627 141.579 20.1707C141.051 20.4787 140.787 20.9334 140.787 21.5348C140.787 22.0775 140.992 22.5102 141.403 22.8328C141.814 23.1409 142.349 23.2949 143.009 23.2949C143.64 23.2949 144.219 23.1629 144.747 22.8988C145.275 22.6348 145.693 22.2755 146.001 21.8208C146.324 21.3514 146.507 20.816 146.551 20.2147L147.344 20.5887C147.344 21.4834 147.138 22.2828 146.727 22.9868C146.317 23.6762 145.745 24.2189 145.011 24.6149C144.278 24.9963 143.442 25.187 142.503 25.187ZM152.831 24.835H150.367V8.99398H152.831V24.835ZM157.172 24.835H154.708V8.99398H157.172V24.835ZM168.465 21.5128L169.873 23.0529C169.301 23.7129 168.59 24.2336 167.739 24.6149C166.888 24.9963 165.942 25.187 164.901 25.187C163.669 25.187 162.576 24.9376 161.623 24.4389C160.684 23.9402 159.943 23.2509 159.401 22.3708C158.873 21.4908 158.609 20.486 158.609 19.3566C158.609 18.2126 158.865 17.2005 159.379 16.3204C159.892 15.4404 160.596 14.751 161.491 14.2523C162.385 13.7536 163.39 13.5043 164.505 13.5043C165.59 13.5043 166.551 13.7536 167.387 14.2523C168.223 14.7363 168.883 15.411 169.367 16.2764C169.851 17.1272 170.093 18.1172 170.093 19.2466V19.3786H167.651V19.1366C167.651 18.4032 167.512 17.7652 167.233 17.2225C166.969 16.6651 166.602 16.2398 166.133 15.9464C165.664 15.6384 165.114 15.4844 164.483 15.4844C163.823 15.4844 163.236 15.6457 162.723 15.9684C162.224 16.2764 161.835 16.7165 161.557 17.2885C161.278 17.8459 161.139 18.5206 161.139 19.3126C161.139 20.1047 161.3 20.794 161.623 21.3807C161.96 21.9675 162.415 22.4221 162.987 22.7448C163.574 23.0529 164.248 23.2069 165.011 23.2069C166.404 23.2069 167.556 22.6422 168.465 21.5128ZM170.093 20.1267H160.325V18.4546H169.741L170.093 19.2686V20.1267ZM177.989 24.835H175.283C174.359 24.835 173.662 24.6003 173.193 24.1309C172.724 23.6469 172.489 22.9502 172.489 22.0408V10.8421H174.953V21.6668C174.953 22.0481 175.041 22.3341 175.217 22.5248C175.393 22.7008 175.672 22.7888 176.053 22.7888H177.989V24.835ZM177.835 15.8584H170.443V13.8563H177.835V15.8584Z" fill="#D7E2F7"/>
3 +<path d="M55.0117 0.00769167C55.0523 -0.00110449 55.0914 -0.00180576 55.1279 0.00280886C55.3831 0.0350288 55.5224 0.363182 55.3174 0.568239L40.9326 14.9618C40.4874 15.4069 40.2364 16.0127 40.2354 16.6425V35.7372C40.2353 35.8856 40.1461 35.9969 40.0303 36.0448C39.9724 36.0688 39.9078 36.0772 39.8447 36.0663C39.7815 36.0554 39.7195 36.025 39.667 35.9725L29.3965 25.7059C29.2084 25.518 29.1035 25.2635 29.1035 24.9989V7.1825C29.1035 6.28802 29.7273 5.51423 30.6016 5.3241L55.0107 0.00769167H55.0117ZM56.1025 20.2899C56.1025 20.5546 55.9965 20.8081 55.8096 20.995L41.9443 34.8319C41.9218 34.8544 41.8953 34.8673 41.8682 34.8719C41.8413 34.8765 41.8137 34.8733 41.7891 34.8632C41.7394 34.8427 41.7012 34.7946 41.7012 34.7313L41.7031 27.6766L46.3975 23.0292C47.0655 22.4521 47.3423 22.2071 47.7549 22.1835C47.8235 22.1795 47.896 22.1816 47.9746 22.1893C48.0532 22.1971 48.138 22.2109 48.2314 22.2294C48.6039 22.303 48.9558 22.3574 49.2842 22.3759C49.4156 22.3833 49.5432 22.385 49.667 22.3798C50.2241 22.3563 50.7026 22.1941 51.0898 21.7948C51.427 21.447 51.853 20.8961 52.0713 19.495C52.2236 18.511 52.33 17.8887 52.5439 17.3173C52.7579 16.7459 53.0748 16.3556 53.4551 15.9764V15.9755L56.1201 13.2977L56.1025 20.2899ZM55.749 7.92078C55.8852 7.78481 56.1161 7.88195 56.1162 8.0741L56.0967 11.2147L53.1006 14.3309C52.5193 14.8958 51.9466 15.6702 51.6904 16.2762C51.4354 16.8811 51.1497 17.8849 51.0049 18.7479C50.8611 19.61 50.8812 20.1326 50.1377 20.6014C49.3944 21.0697 48.7644 20.4166 47.8613 20.3905L47.8604 20.3915C46.962 20.3657 46.3129 21.018 46.3057 21.0253L41.7021 25.6444V22.5536C41.7021 22.1755 41.8521 21.8117 42.1201 21.5438L55.749 7.92078ZM55.9277 2.16785C56.0288 2.17959 56.1201 2.2615 56.1201 2.38172V5.4989H56.1211L41.7021 19.9501V16.8651C41.7021 16.4872 41.8523 16.1242 42.1201 15.8563L55.752 2.22937C55.8026 2.17876 55.8671 2.16081 55.9277 2.16785Z" fill="#D7E2F7"/>
4 +<path d="M3.67294 24.128C2.95827 24.128 2.40894 23.928 2.02494 23.528C1.64627 23.1227 1.45694 22.5653 1.45694 21.856V17.272H0.616938C0.510271 17.272 0.419604 17.2373 0.344938 17.168C0.270271 17.0987 0.232938 16.9947 0.232938 16.856V16.072L1.55294 15.856L1.96894 13.616C1.9956 13.5093 2.04627 13.4267 2.12094 13.368C2.1956 13.3093 2.2916 13.28 2.40894 13.28H3.43294V15.864H5.62494V17.272H3.43294V21.72C3.43294 21.976 3.49427 22.176 3.61694 22.32C3.74494 22.464 3.91827 22.536 4.13694 22.536C4.2596 22.536 4.36094 22.5227 4.44094 22.496C4.52627 22.464 4.59827 22.432 4.65694 22.4C4.72094 22.368 4.77694 22.3387 4.82494 22.312C4.87294 22.28 4.92094 22.264 4.96894 22.264C5.0276 22.264 5.0756 22.28 5.11294 22.312C5.15027 22.3387 5.19027 22.3813 5.23294 22.44L5.82494 23.4C5.53694 23.64 5.20627 23.8213 4.83294 23.944C4.4596 24.0667 4.07294 24.128 3.67294 24.128ZM10.4596 15.664C11.0676 15.664 11.6196 15.7627 12.1156 15.96C12.6169 16.1573 13.0436 16.4373 13.3956 16.8C13.7529 17.1627 14.0276 17.6053 14.2196 18.128C14.4116 18.6507 14.5076 19.2347 14.5076 19.88C14.5076 20.5307 14.4116 21.1173 14.2196 21.64C14.0276 22.1627 13.7529 22.608 13.3956 22.976C13.0436 23.344 12.6169 23.6267 12.1156 23.824C11.6196 24.0213 11.0676 24.12 10.4596 24.12C9.84623 24.12 9.2889 24.0213 8.78756 23.824C8.28623 23.6267 7.8569 23.344 7.49956 22.976C7.14756 22.608 6.8729 22.1627 6.67556 21.64C6.48356 21.1173 6.38756 20.5307 6.38756 19.88C6.38756 19.2347 6.48356 18.6507 6.67556 18.128C6.8729 17.6053 7.14756 17.1627 7.49956 16.8C7.8569 16.4373 8.28623 16.1573 8.78756 15.96C9.2889 15.7627 9.84623 15.664 10.4596 15.664ZM10.4596 22.6C11.1422 22.6 11.6462 22.3707 11.9716 21.912C12.3022 21.4533 12.4676 20.7813 12.4676 19.896C12.4676 19.0107 12.3022 18.336 11.9716 17.872C11.6462 17.408 11.1422 17.176 10.4596 17.176C9.76623 17.176 9.25156 17.4107 8.91556 17.88C8.5849 18.344 8.41956 19.016 8.41956 19.896C8.41956 20.776 8.5849 21.448 8.91556 21.912C9.25156 22.3707 9.76623 22.6 10.4596 22.6Z" fill="#D7E2F7"/>
5 +</svg>
assets/images/hero/cw_welcome_light.svg new
+5
@@ -0,0 +1,5 @@
1 +<svg width="179" height="37" viewBox="0 0 179 37" fill="none" xmlns="http://www.w3.org/2000/svg">
2 +<path d="M3.67294 24.128C2.95827 24.128 2.40894 23.928 2.02494 23.528C1.64627 23.1227 1.45694 22.5653 1.45694 21.856V17.272H0.616938C0.510271 17.272 0.419604 17.2373 0.344938 17.168C0.270271 17.0987 0.232938 16.9947 0.232938 16.856V16.072L1.55294 15.856L1.96894 13.616C1.9956 13.5093 2.04627 13.4267 2.12094 13.368C2.1956 13.3093 2.2916 13.28 2.40894 13.28H3.43294V15.864H5.62494V17.272H3.43294V21.72C3.43294 21.976 3.49427 22.176 3.61694 22.32C3.74494 22.464 3.91827 22.536 4.13694 22.536C4.2596 22.536 4.36094 22.5227 4.44094 22.496C4.52627 22.464 4.59827 22.432 4.65694 22.4C4.72094 22.368 4.77694 22.3387 4.82494 22.312C4.87294 22.28 4.92094 22.264 4.96894 22.264C5.0276 22.264 5.0756 22.28 5.11294 22.312C5.15027 22.3387 5.19027 22.3813 5.23294 22.44L5.82494 23.4C5.53694 23.64 5.20627 23.8213 4.83294 23.944C4.4596 24.0667 4.07294 24.128 3.67294 24.128ZM10.4596 15.664C11.0676 15.664 11.6196 15.7627 12.1156 15.96C12.6169 16.1573 13.0436 16.4373 13.3956 16.8C13.7529 17.1627 14.0276 17.6053 14.2196 18.128C14.4116 18.6507 14.5076 19.2347 14.5076 19.88C14.5076 20.5307 14.4116 21.1173 14.2196 21.64C14.0276 22.1627 13.7529 22.608 13.3956 22.976C13.0436 23.344 12.6169 23.6267 12.1156 23.824C11.6196 24.0213 11.0676 24.12 10.4596 24.12C9.84623 24.12 9.2889 24.0213 8.78756 23.824C8.28623 23.6267 7.8569 23.344 7.49956 22.976C7.14756 22.608 6.8729 22.1627 6.67556 21.64C6.48356 21.1173 6.38756 20.5307 6.38756 19.88C6.38756 19.2347 6.48356 18.6507 6.67556 18.128C6.8729 17.6053 7.14756 17.1627 7.49956 16.8C7.8569 16.4373 8.28623 16.1573 8.78756 15.96C9.2889 15.7627 9.84623 15.664 10.4596 15.664ZM10.4596 22.6C11.1422 22.6 11.6462 22.3707 11.9716 21.912C12.3022 21.4533 12.4676 20.7813 12.4676 19.896C12.4676 19.0107 12.3022 18.336 11.9716 17.872C11.6462 17.408 11.1422 17.176 10.4596 17.176C9.76623 17.176 9.25156 17.4107 8.91556 17.88C8.5849 18.344 8.41956 19.016 8.41956 19.896C8.41956 20.776 8.5849 21.448 8.91556 21.912C9.25156 22.3707 9.76623 22.6 10.4596 22.6Z" fill="#1C1B1C"/>
3 +<path d="M76.2936 20.5227L77.9877 22.2168C77.2983 23.1262 76.3963 23.8522 75.2815 24.3949C74.1815 24.923 72.964 25.187 71.6293 25.187C70.4412 25.187 69.3485 24.9816 68.3511 24.5709C67.3684 24.1603 66.5103 23.5882 65.7769 22.8548C65.0582 22.1215 64.4935 21.2561 64.0828 20.2587C63.6868 19.2466 63.4888 18.1539 63.4888 16.9805C63.4888 15.7924 63.6941 14.6997 64.1048 13.7023C64.5155 12.6902 65.0876 11.8175 65.8209 11.0841C66.569 10.3507 67.4417 9.7787 68.4391 9.36801C69.4365 8.95732 70.5219 8.75197 71.6953 8.75197C73.0301 8.75197 74.2401 9.02332 75.3255 9.56602C76.4109 10.0941 77.2983 10.8128 77.9877 11.7222L76.2936 13.4163C75.7802 12.6682 75.1348 12.0815 74.3575 11.6561C73.5801 11.2161 72.6927 10.9961 71.6953 10.9961C70.6392 10.9961 69.6932 11.2601 68.8571 11.7882C68.0211 12.3015 67.361 13.0056 66.877 13.9003C66.393 14.795 66.151 15.8217 66.151 16.9805C66.151 18.1245 66.393 19.1439 66.877 20.0387C67.361 20.9334 68.0211 21.6448 68.8571 22.1728C69.6932 22.6862 70.6392 22.9428 71.6953 22.9428C72.6927 22.9428 73.5801 22.7228 74.3575 22.2828C75.1348 21.8428 75.7802 21.2561 76.2936 20.5227ZM89.1654 24.835H86.8993V22.6568L86.7893 22.1948V18.0805C86.7893 17.2592 86.5252 16.6211 85.9972 16.1664C85.4692 15.6971 84.7505 15.4624 83.8411 15.4624C83.181 15.4624 82.565 15.5944 81.993 15.8584C81.4356 16.1224 80.9516 16.4891 80.5409 16.9585L79.1328 15.4184C79.7342 14.817 80.4382 14.3476 81.2449 14.0103C82.0516 13.6729 82.9464 13.5043 83.9291 13.5043C84.9705 13.5043 85.8799 13.6876 86.6573 14.0543C87.4493 14.4063 88.0653 14.9197 88.5054 15.5944C88.9454 16.2691 89.1654 17.0758 89.1654 18.0145V24.835ZM83.005 25.187C82.169 25.187 81.4283 25.033 80.7829 24.725C80.1375 24.4169 79.6388 23.9989 79.2868 23.4709C78.9348 22.9428 78.7588 22.3268 78.7588 21.6228C78.7588 20.86 78.9788 20.2147 79.4188 19.6866C79.8588 19.1439 80.4675 18.7333 81.2449 18.4546C82.037 18.1612 82.9464 18.0145 83.9731 18.0145H87.0533V19.7086H84.1931C83.3277 19.7086 82.6237 19.8627 82.081 20.1707C81.5529 20.4787 81.2889 20.9334 81.2889 21.5348C81.2889 22.0775 81.4943 22.5102 81.905 22.8328C82.3157 23.1409 82.851 23.2949 83.5111 23.2949C84.1418 23.2949 84.7211 23.1629 85.2492 22.8988C85.7772 22.6348 86.1952 22.2755 86.5032 21.8208C86.8259 21.3514 87.0093 20.816 87.0533 20.2147L87.8453 20.5887C87.8453 21.4834 87.64 22.2828 87.2293 22.9868C86.8186 23.6762 86.2466 24.2189 85.5132 24.6149C84.7798 24.9963 83.9438 25.187 83.005 25.187ZM93.3326 24.835H90.8685V8.99398H93.3326V24.835ZM102.111 24.835H98.8549L92.7166 19.1366H92.9366L98.4149 13.8563H101.473L95.6427 19.3566V18.9386L102.111 24.835ZM111.222 21.5128L112.63 23.0529C112.058 23.7129 111.347 24.2336 110.496 24.6149C109.645 24.9963 108.699 25.187 107.658 25.187C106.426 25.187 105.333 24.9376 104.38 24.4389C103.441 23.9402 102.7 23.2509 102.158 22.3708C101.63 21.4908 101.366 20.486 101.366 19.3566C101.366 18.2126 101.622 17.2005 102.136 16.3204C102.649 15.4404 103.353 14.751 104.248 14.2523C105.142 13.7536 106.147 13.5043 107.262 13.5043C108.347 13.5043 109.308 13.7536 110.144 14.2523C110.98 14.7363 111.64 15.411 112.124 16.2764C112.608 17.1272 112.85 18.1172 112.85 19.2466V19.3786H110.408V19.1366C110.408 18.4032 110.269 17.7652 109.99 17.2225C109.726 16.6651 109.359 16.2398 108.89 15.9464C108.421 15.6384 107.871 15.4844 107.24 15.4844C106.58 15.4844 105.993 15.6457 105.48 15.9684C104.981 16.2764 104.592 16.7165 104.314 17.2885C104.035 17.8459 103.896 18.5206 103.896 19.3126C103.896 20.1047 104.057 20.794 104.38 21.3807C104.717 21.9675 105.172 22.4221 105.744 22.7448C106.33 23.0529 107.005 23.2069 107.768 23.2069C109.161 23.2069 110.313 22.6422 111.222 21.5128ZM112.85 20.1267H103.082V18.4546H112.498L112.85 19.2686V20.1267ZM134.362 24.835H131.524L127.915 12.2062H128.223L124.593 24.835H121.755L117.135 9.10399H119.841L123.581 22.8548H122.899L126.859 9.10399H129.279L133.24 22.8548H132.624L136.342 9.10399H138.982L134.362 24.835ZM148.664 24.835H146.397V22.6568L146.287 22.1948V18.0805C146.287 17.2592 146.023 16.6211 145.495 16.1664C144.967 15.6971 144.249 15.4624 143.339 15.4624C142.679 15.4624 142.063 15.5944 141.491 15.8584C140.934 16.1224 140.45 16.4891 140.039 16.9585L138.631 15.4184C139.232 14.817 139.936 14.3476 140.743 14.0103C141.55 13.6729 142.445 13.5043 143.427 13.5043C144.469 13.5043 145.378 13.6876 146.155 14.0543C146.948 14.4063 147.564 14.9197 148.004 15.5944C148.444 16.2691 148.664 17.0758 148.664 18.0145V24.835ZM142.503 25.187C141.667 25.187 140.926 25.033 140.281 24.725C139.636 24.4169 139.137 23.9989 138.785 23.4709C138.433 22.9428 138.257 22.3268 138.257 21.6228C138.257 20.86 138.477 20.2147 138.917 19.6866C139.357 19.1439 139.966 18.7333 140.743 18.4546C141.535 18.1612 142.445 18.0145 143.471 18.0145H146.551V19.7086H143.691C142.826 19.7086 142.122 19.8627 141.579 20.1707C141.051 20.4787 140.787 20.9334 140.787 21.5348C140.787 22.0775 140.992 22.5102 141.403 22.8328C141.814 23.1409 142.349 23.2949 143.009 23.2949C143.64 23.2949 144.219 23.1629 144.747 22.8988C145.275 22.6348 145.693 22.2755 146.001 21.8208C146.324 21.3514 146.507 20.816 146.551 20.2147L147.344 20.5887C147.344 21.4834 147.138 22.2828 146.727 22.9868C146.317 23.6762 145.745 24.2189 145.011 24.6149C144.278 24.9963 143.442 25.187 142.503 25.187ZM152.831 24.835H150.367V8.99398H152.831V24.835ZM157.172 24.835H154.708V8.99398H157.172V24.835ZM168.465 21.5128L169.873 23.0529C169.301 23.7129 168.59 24.2336 167.739 24.6149C166.888 24.9963 165.942 25.187 164.901 25.187C163.669 25.187 162.576 24.9376 161.623 24.4389C160.684 23.9402 159.943 23.2509 159.401 22.3708C158.873 21.4908 158.609 20.486 158.609 19.3566C158.609 18.2126 158.865 17.2005 159.379 16.3204C159.892 15.4404 160.596 14.751 161.491 14.2523C162.385 13.7536 163.39 13.5043 164.505 13.5043C165.59 13.5043 166.551 13.7536 167.387 14.2523C168.223 14.7363 168.883 15.411 169.367 16.2764C169.851 17.1272 170.093 18.1172 170.093 19.2466V19.3786H167.651V19.1366C167.651 18.4032 167.512 17.7652 167.233 17.2225C166.969 16.6651 166.602 16.2398 166.133 15.9464C165.664 15.6384 165.114 15.4844 164.483 15.4844C163.823 15.4844 163.236 15.6457 162.723 15.9684C162.224 16.2764 161.835 16.7165 161.557 17.2885C161.278 17.8459 161.139 18.5206 161.139 19.3126C161.139 20.1047 161.3 20.794 161.623 21.3807C161.96 21.9675 162.415 22.4221 162.987 22.7448C163.574 23.0529 164.248 23.2069 165.011 23.2069C166.404 23.2069 167.556 22.6422 168.465 21.5128ZM170.093 20.1267H160.325V18.4546H169.741L170.093 19.2686V20.1267ZM177.989 24.835H175.283C174.359 24.835 173.662 24.6003 173.193 24.1309C172.724 23.6469 172.489 22.9502 172.489 22.0408V10.8421H174.953V21.6668C174.953 22.0481 175.041 22.3341 175.217 22.5248C175.393 22.7008 175.672 22.7888 176.053 22.7888H177.989V24.835ZM177.835 15.8584H170.443V13.8563H177.835V15.8584Z" fill="#1C1B1C"/>
4 +<path d="M55.0117 0.00819881C55.3359 -0.0620189 55.5519 0.335304 55.3174 0.569722L40.9326 14.9633C40.4875 15.4083 40.2364 16.0133 40.2354 16.643V35.7377C40.2352 36.0346 39.8766 36.1826 39.667 35.973L29.3965 25.7064C29.2084 25.5185 29.1035 25.264 29.1035 24.9994V7.183C29.1035 6.28853 29.7273 5.51474 30.6016 5.3246L55.0107 0.00819881H55.0117ZM56.1025 20.2904C56.1025 20.5551 55.9965 20.8086 55.8096 20.9955L41.9443 34.8324C41.9218 34.8549 41.8953 34.8679 41.8682 34.8725C41.8413 34.877 41.8137 34.8738 41.7891 34.8637C41.7394 34.8432 41.7012 34.7951 41.7012 34.7318L41.7031 27.6771L46.3975 23.0297C47.0655 22.4526 47.3423 22.2076 47.7549 22.184C47.8235 22.1801 47.896 22.1821 47.9746 22.1898C48.0532 22.1976 48.138 22.2114 48.2314 22.2299C48.6039 22.3035 48.9558 22.3579 49.2842 22.3764C49.4156 22.3838 49.5432 22.3855 49.667 22.3803C50.2241 22.3568 50.7026 22.1946 51.0898 21.7953C51.427 21.4475 51.853 20.8966 52.0713 19.4955C52.2236 18.5115 52.33 17.8892 52.5439 17.3178C52.7579 16.7464 53.0748 16.3561 53.4551 15.9769V15.976L56.1201 13.2982L56.1025 20.2904ZM55.749 7.92128C55.8852 7.78532 56.1161 7.88245 56.1162 8.0746L56.0967 11.2152L53.1006 14.3314C52.5193 14.8963 51.9466 15.6708 51.6904 16.2768C51.4354 16.8816 51.1497 17.8854 51.0049 18.7484C50.8611 19.6105 50.8812 20.1331 50.1377 20.6019C49.3944 21.0703 48.7644 20.4171 47.8613 20.391L47.8604 20.392C46.962 20.3662 46.3129 21.0185 46.3057 21.0258L41.7021 25.6449V22.5541C41.7021 22.176 41.8521 21.8122 42.1201 21.5443L55.749 7.92128ZM55.9277 2.16738C56.0288 2.17912 56.1191 2.26201 56.1191 2.38222V5.49941H56.1211L41.7021 19.9506V16.8656C41.7021 16.4876 41.8521 16.1237 42.1201 15.8559L55.752 2.22988C55.8026 2.17927 55.8671 2.16034 55.9277 2.16738Z" fill="#1C1B1C"/>
5 +</svg>
assets/images/home_screen_setting_icon.svg new
+6
@@ -0,0 +1,6 @@
1 +<svg width="45" height="46" viewBox="0 0 45 46" fill="none" xmlns="http://www.w3.org/2000/svg">
2 +<circle cx="22.5" cy="23" r="22.5" fill="#312938" fill-opacity="0.1"/>
3 +<path d="M25.391 19.4402C24.7502 15.2551 21.1352 12.0498 16.7708 12.0498C11.9548 12.0498 8.04984 15.9548 8.04984 20.7708C8.04984 24.1914 10.0183 27.1505 12.8847 28.5797C13.9003 29.087 15.0296 29.401 16.2246 29.4738C16.405 29.4857 16.5874 29.4917 16.7708 29.4917C20.8542 29.4917 24.2807 26.686 25.2306 22.8977C25.401 22.2169 25.4917 21.5043 25.4917 20.7708C25.4917 20.3183 25.4568 19.8738 25.391 19.4402ZM16.7708 26.5017C16.4518 26.5017 16.1379 26.4757 15.8329 26.4249C14.7794 26.2505 13.8226 25.788 13.0452 25.1223C11.8183 24.0708 11.0399 22.51 11.0399 20.7708C11.0399 17.6113 13.6113 15.0399 16.7708 15.0399C19.1429 15.0399 21.1821 16.488 22.0512 18.5462C22.3412 19.2309 22.5017 19.9824 22.5017 20.7708C22.5017 21.0508 22.4817 21.3259 22.4429 21.595C22.0422 24.3658 19.6512 26.5017 16.7708 26.5017Z" fill="#312938"/>
4 +<path d="M36.4551 15.7874H34.2126V13.5448C34.2126 12.7196 33.5429 12.0498 32.7176 12.0498C31.8924 12.0498 31.2226 12.7196 31.2226 13.5448V15.7874H28.9801C28.1548 15.7874 27.485 16.4571 27.485 17.2824C27.485 18.1076 28.1548 18.7774 28.9801 18.7774H31.2226V21.0199C31.2226 21.8452 31.8924 22.5149 32.7176 22.5149C33.5429 22.5149 34.2126 21.8452 34.2126 21.0199V18.7774H36.4551C37.2804 18.7774 37.9502 18.1076 37.9502 17.2824C37.9502 16.4571 37.2804 15.7874 36.4551 15.7874Z" fill="#312938"/>
5 +<path d="M25.391 19.4402C25.4568 19.8738 25.4917 20.3183 25.4917 20.7708C25.4917 21.5043 25.401 22.2169 25.2306 22.8977C26.4575 23.9502 27.2359 25.511 27.2359 27.2492C27.2359 30.4096 24.6654 32.9801 21.505 32.9801C19.1339 32.9801 17.0937 31.5319 16.2246 29.4738C15.0296 29.401 13.9003 29.087 12.8847 28.5797C13.5256 32.7658 17.1415 35.9701 21.505 35.9701C26.3219 35.9701 30.2259 32.0661 30.2259 27.2492C30.2259 23.8296 28.2575 20.8684 25.391 19.4402Z" fill="#312938"/>
6 +</svg>
assets/images/menu.svg new
+3
@@ -0,0 +1,3 @@
1 +<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
2 +<path d="M21 17V19H1V17H21ZM21 12H1V10H21V12ZM21 5H1V3H21V5Z" fill="white"/>
3 +</svg>
assets/images/notification_icon.svg
+3 -69
@@ -1,69 +1,3 @@
1 -<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 -<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3 -
4 -<svg
5 - xmlns:dc="http://purl.org/dc/elements/1.1/"
6 - xmlns:cc="http://creativecommons.org/ns#"
7 - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
8 - xmlns:svg="http://www.w3.org/2000/svg"
9 - xmlns="http://www.w3.org/2000/svg"
10 - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
11 - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
12 - version="1.1"
13 - id="Capa_1"
14 - x="0px"
15 - y="0px"
16 - width="510px"
17 - height="510px"
18 - viewBox="0 0 510 510"
19 - style="enable-background:new 0 0 510 510;"
20 - xml:space="preserve"
21 - inkscape:version="0.92.3 (2405546, 2018-03-11)"
22 - sodipodi:docname="notification_logo_tilt_white.svg"><metadata
23 - id="metadata42"><rdf:RDF><cc:Work
24 - rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
25 - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
26 - id="defs40" /><sodipodi:namedview
27 - pagecolor="#ffffff"
28 - bordercolor="#666666"
29 - borderopacity="1"
30 - objecttolerance="10"
31 - gridtolerance="10"
32 - guidetolerance="10"
33 - inkscape:pageopacity="0"
34 - inkscape:pageshadow="2"
35 - inkscape:window-width="1920"
36 - inkscape:window-height="1090"
37 - id="namedview38"
38 - showgrid="false"
39 - inkscape:zoom="0.4627451"
40 - inkscape:cx="-849.27966"
41 - inkscape:cy="255"
42 - inkscape:window-x="-12"
43 - inkscape:window-y="58"
44 - inkscape:window-maximized="1"
45 - inkscape:current-layer="notifications"
46 - inkscape:object-paths="true" /><g
47 - id="g3"
48 - transform="matrix(0.87658593,0,0,0.87658593,31.470588,31.470588)"><g
49 - id="notifications"
50 - transform="rotate(-20,255,255)"><path
51 - d="m 233.56017,502.19654 c 28.05,0 51,-22.95 51,-51 h -102 c 0,28.05 22.95,51 51,51 z m 165.75,-153 v -140.25 c 0,-79.05 -53.55,-142.8 -127.5,-160.65 v -17.85 c 0,-20.4 -17.85,-38.2499996 -38.25,-38.2499996 -20.4,0 -38.25,17.8499996 -38.25,38.2499996 v 17.85 c -73.95,17.85 -127.499999,81.6 -127.499999,160.65 v 140.25 l -51,51 v 25.5 H 450.31017 v -25.5 z"
52 - id="path6"
53 - inkscape:connector-curvature="0"
54 - style="opacity:1;fill:#ffffff;fill-opacity:0;stroke:#000000;stroke-width:19.39342117;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /></g></g><g
55 - id="g8" /><g
56 - id="g10" /><g
57 - id="g12" /><g
58 - id="g14" /><g
59 - id="g16" /><g
60 - id="g18" /><g
61 - id="g20" /><g
62 - id="g22" /><g
63 - id="g24" /><g
64 - id="g26" /><g
65 - id="g28" /><g
66 - id="g30" /><g
67 - id="g32" /><g
68 - id="g34" /><g
69 - id="g36" /></svg>
\ No newline at end of file
1 +<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
2 +<path d="M13.7842 18.8721C13.7841 20.5907 12.4091 22 10.6904 22C8.97183 21.9999 7.56261 20.5907 7.5625 18.8721C7.5625 18.7347 7.56238 18.6314 7.59668 18.5283H0V15.7783H2.40625V8.59375C2.40625 3.85 6.25625 0 11 0C15.7437 0 19.5938 3.85 19.5938 8.59375V15.7783H22V18.5283H13.7842V18.8721ZM11 2.75C7.76875 2.75 5.15625 5.3625 5.15625 8.59375V15.7783H16.8438V8.59375C16.8438 5.3625 14.2312 2.75 11 2.75Z" fill="white"/>
3 +</svg>
assets/images/passphrase_dark.png
Binary files /dev/null and b/assets/images/passphrase_dark.png differ
assets/images/passphrase_light.png
Binary files /dev/null and b/assets/images/passphrase_light.png differ
assets/images/receive.png
Binary files /dev/null and b/assets/images/receive.png differ
assets/images/seed_verified_dark.png
Binary files /dev/null and b/assets/images/seed_verified_dark.png differ
assets/images/seed_verified_light.png
Binary files /dev/null and b/assets/images/seed_verified_light.png differ
assets/images/seed_warning_dark.svg new
+86
@@ -0,0 +1,86 @@
1 +<svg width="260" height="298" viewBox="0 0 260 298" fill="none" xmlns="http://www.w3.org/2000/svg">
2 +<path d="M119.655 6.27832C126.055 3.53578 133.272 3.45033 139.723 6.02148L140.345 6.27832L243.044 50.293C252.699 54.431 258.96 63.925 258.96 74.4297V128.542C258.96 175.815 236.309 220.2 198.085 247.94L197.18 248.593L145.264 285.676C136.276 292.096 124.25 292.197 115.167 285.978L114.736 285.676L62.8203 248.593C24.0499 220.899 1.04004 176.187 1.04004 128.542V74.4297C1.04004 64.0891 7.10644 54.7283 16.5059 50.4912L16.9561 50.293L119.655 6.27832Z" stroke="#708BF4" stroke-opacity="0.05" stroke-width="2.08"/>
3 +<path d="M120.451 17.2793C126.358 14.7477 133.02 14.6687 138.975 17.042L139.549 17.2793L234.349 57.9082C243.261 61.7279 249.04 70.491 249.04 80.1875V130.138C249.04 173.775 228.131 214.745 192.848 240.352L192.012 240.954L144.089 275.185C135.792 281.111 124.692 281.204 116.308 275.463L115.911 275.185L67.9883 240.954C32.2001 215.391 10.96 174.118 10.96 130.138V80.1875C10.9601 70.6424 16.56 62.0019 25.2363 58.0908L25.6514 57.9082L120.451 17.2793Z" stroke="#708BF4" stroke-opacity="0.15" stroke-width="1.92"/>
4 +<path d="M121.294 28.3906C126.68 26.0825 132.754 26.0099 138.183 28.1738L138.706 28.3906L225.605 65.6328C233.731 69.1153 239 77.1057 239 85.9463V131.733C239 171.381 220.152 208.625 188.301 232.109L186.774 233.218L142.846 264.596C135.282 269.999 125.161 270.083 117.517 264.849L117.154 264.596L73.2256 233.218C40.4513 209.807 21 172.01 21 131.733V85.9463C21 77.2438 26.1053 69.3657 34.0156 65.7998L34.3945 65.6328L121.294 28.3906Z" stroke="#708BF4" stroke-opacity="0.5" stroke-width="2"/>
5 +<path d="M77.8584 226.327L117.794 254.853C125.096 260.068 134.904 260.068 142.206 254.853L182.141 226.327C212.176 204.874 230 170.238 230 133.329V91.7045C230 83.3039 224.994 75.7116 217.272 72.4024L138.272 38.5453C132.99 36.2813 127.01 36.2813 121.728 38.5453L42.7277 72.4024C35.0063 75.7116 30 83.3039 30 91.7045V133.329C30 170.238 47.8247 204.874 77.8584 226.327Z" fill="black"/>
6 +<path d="M77.8584 226.327L117.794 254.853C125.096 260.068 134.904 260.068 142.206 254.853L182.141 226.327C212.176 204.874 230 170.238 230 133.329V91.7045C230 83.3039 224.994 75.7116 217.272 72.4024L138.272 38.5453C132.99 36.2813 127.01 36.2813 121.728 38.5453L42.7277 72.4024C35.0063 75.7116 30 83.3039 30 91.7045V133.329C30 170.238 47.8247 204.874 77.8584 226.327Z" fill="url(#paint0_linear_4659_24215)"/>
7 +<path d="M123.479 42.6299C127.513 40.9009 132.063 40.8476 136.13 42.4688L136.521 42.6299L215.521 76.4873C221.609 79.0961 225.556 85.0816 225.556 91.7041V133.329C225.556 168.248 208.955 201.051 180.902 221.734L179.559 222.711L139.623 251.236C134.047 255.22 126.615 255.344 120.923 251.609L120.377 251.236L80.4414 222.711C51.5757 202.092 34.4443 168.802 34.4443 133.329V91.7041C34.4445 85.2886 38.1486 79.4713 43.9141 76.7422L44.4785 76.4873L123.479 42.6299Z" stroke="url(#paint1_linear_4659_24215)" stroke-width="8.88889"/>
8 +<path d="M123.479 42.6299C127.513 40.9009 132.063 40.8476 136.13 42.4688L136.521 42.6299L215.521 76.4873C221.609 79.0961 225.556 85.0816 225.556 91.7041V133.329C225.556 168.248 208.955 201.051 180.902 221.734L179.559 222.711L139.623 251.236C134.047 255.22 126.615 255.344 120.923 251.609L120.377 251.236L80.4414 222.711C51.5757 202.092 34.4443 168.802 34.4443 133.329V91.7041C34.4445 85.2886 38.1486 79.4713 43.9141 76.7422L44.4785 76.4873L123.479 42.6299Z" stroke="url(#paint2_linear_4659_24215)" stroke-width="8.88889"/>
9 +<path d="M123.479 42.6299C127.513 40.9009 132.063 40.8476 136.13 42.4688L136.521 42.6299L215.521 76.4873C221.609 79.0961 225.556 85.0816 225.556 91.7041V133.329C225.556 168.248 208.955 201.051 180.902 221.734L179.559 222.711L139.623 251.236C134.047 255.22 126.615 255.344 120.923 251.609L120.377 251.236L80.4414 222.711C51.5757 202.092 34.4443 168.802 34.4443 133.329V91.7041C34.4445 85.2886 38.1486 79.4713 43.9141 76.7422L44.4785 76.4873L123.479 42.6299Z" stroke="url(#paint3_linear_4659_24215)" stroke-width="8.88889"/>
10 +<g filter="url(#filter0_i_4659_24215)">
11 +<path d="M77.8584 226.327L117.794 254.853C125.096 260.068 134.904 260.068 142.206 254.853L182.141 226.327C212.176 204.874 230 170.238 230 133.329V91.7045C230 83.3039 224.994 75.7116 217.272 72.4024L138.272 38.5453C132.99 36.2813 127.01 36.2813 121.728 38.5453L42.7277 72.4024C35.0063 75.7116 30 83.3039 30 91.7045V133.329C30 170.238 47.8247 204.874 77.8584 226.327Z" fill="black" fill-opacity="0.01"/>
12 +</g>
13 +<g filter="url(#filter1_ii_4659_24215)">
14 +<path fill-rule="evenodd" clip-rule="evenodd" d="M147.625 154.25C163.158 154.25 175.75 141.658 175.75 126.125C175.75 110.592 163.158 98 147.625 98C132.092 98 119.5 110.592 119.5 126.125C119.5 131.628 121.081 136.763 123.813 141.098L85.6611 179.25L104.393 197.982L113.232 189.143L103.339 179.25L113.25 169.339L123.143 179.232L131.982 170.393L122.089 160.5L132.652 149.937C136.987 152.669 142.122 154.25 147.625 154.25ZM147.625 141.75C156.254 141.75 163.25 134.754 163.25 126.125C163.25 117.496 156.254 110.5 147.625 110.5C138.996 110.5 132 117.496 132 126.125C132 134.754 138.996 141.75 147.625 141.75Z" fill="black"/>
15 +<path fill-rule="evenodd" clip-rule="evenodd" d="M147.625 154.25C163.158 154.25 175.75 141.658 175.75 126.125C175.75 110.592 163.158 98 147.625 98C132.092 98 119.5 110.592 119.5 126.125C119.5 131.628 121.081 136.763 123.813 141.098L85.6611 179.25L104.393 197.982L113.232 189.143L103.339 179.25L113.25 169.339L123.143 179.232L131.982 170.393L122.089 160.5L132.652 149.937C136.987 152.669 142.122 154.25 147.625 154.25ZM147.625 141.75C156.254 141.75 163.25 134.754 163.25 126.125C163.25 117.496 156.254 110.5 147.625 110.5C138.996 110.5 132 117.496 132 126.125C132 134.754 138.996 141.75 147.625 141.75Z" fill="url(#paint4_linear_4659_24215)"/>
16 +<path fill-rule="evenodd" clip-rule="evenodd" d="M147.625 154.25C163.158 154.25 175.75 141.658 175.75 126.125C175.75 110.592 163.158 98 147.625 98C132.092 98 119.5 110.592 119.5 126.125C119.5 131.628 121.081 136.763 123.813 141.098L85.6611 179.25L104.393 197.982L113.232 189.143L103.339 179.25L113.25 169.339L123.143 179.232L131.982 170.393L122.089 160.5L132.652 149.937C136.987 152.669 142.122 154.25 147.625 154.25ZM147.625 141.75C156.254 141.75 163.25 134.754 163.25 126.125C163.25 117.496 156.254 110.5 147.625 110.5C138.996 110.5 132 117.496 132 126.125C132 134.754 138.996 141.75 147.625 141.75Z" fill="url(#paint5_linear_4659_24215)"/>
17 +</g>
18 +<path d="M158.882 230.082H221.118C227.963 230.082 232.227 222.658 228.779 216.746L197.66 163.4C194.238 157.533 185.762 157.533 182.34 163.4L151.221 216.746C147.773 222.658 152.037 230.082 158.882 230.082Z" fill="#D9D9D9"/>
19 +<path d="M158.882 230.082H221.118C227.963 230.082 232.227 222.658 228.779 216.746L197.66 163.4C194.238 157.533 185.762 157.533 182.34 163.4L151.221 216.746C147.773 222.658 152.037 230.082 158.882 230.082Z" fill="url(#paint6_linear_4659_24215)"/>
20 +<path d="M158.882 230.082H221.118C227.963 230.082 232.227 222.658 228.779 216.746L197.66 163.4C194.238 157.533 185.762 157.533 182.34 163.4L151.221 216.746C147.773 222.658 152.037 230.082 158.882 230.082Z" stroke="#312938" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/>
21 +<path d="M158.882 230.082H221.118C227.963 230.082 232.227 222.658 228.779 216.746L197.66 163.4C194.238 157.533 185.762 157.533 182.34 163.4L151.221 216.746C147.773 222.658 152.037 230.082 158.882 230.082Z" stroke="url(#paint7_linear_4659_24215)" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/>
22 +<path d="M158.882 230.082H221.118C227.963 230.082 232.227 222.658 228.779 216.746L197.66 163.4C194.238 157.533 185.762 157.533 182.34 163.4L151.221 216.746C147.773 222.658 152.037 230.082 158.882 230.082Z" stroke="url(#paint8_linear_4659_24215)" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/>
23 +<path d="M189.907 212.209H189.952M189.907 198.907V185.604" stroke="#312938" stroke-width="8.86825" stroke-linecap="round" stroke-linejoin="round"/>
24 +<defs>
25 +<filter id="filter0_i_4659_24215" x="30" y="36.8477" width="200" height="221.917" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
26 +<feFlood flood-opacity="0" result="BackgroundImageFix"/>
27 +<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
28 +<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
29 +<feOffset dy="2"/>
30 +<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>
31 +<feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.5 0"/>
32 +<feBlend mode="plus-lighter" in2="shape" result="effect1_innerShadow_4659_24215"/>
33 +</filter>
34 +<filter id="filter1_ii_4659_24215" x="85.6611" y="98" width="90.0889" height="99.9814" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
35 +<feFlood flood-opacity="0" result="BackgroundImageFix"/>
36 +<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
37 +<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
38 +<feOffset dy="2"/>
39 +<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>
40 +<feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.4 0"/>
41 +<feBlend mode="normal" in2="shape" result="effect1_innerShadow_4659_24215"/>
42 +<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
43 +<feOffset dy="-2"/>
44 +<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>
45 +<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0"/>
46 +<feBlend mode="normal" in2="effect1_innerShadow_4659_24215" result="effect2_innerShadow_4659_24215"/>
47 +</filter>
48 +<linearGradient id="paint0_linear_4659_24215" x1="130" y1="35" x2="130" y2="263.571" gradientUnits="userSpaceOnUse">
49 +<stop stop-color="#19233C"/>
50 +<stop offset="1" stop-color="#1647C3"/>
51 +</linearGradient>
52 +<linearGradient id="paint1_linear_4659_24215" x1="130" y1="35" x2="130" y2="263.571" gradientUnits="userSpaceOnUse">
53 +<stop stop-color="#C1F2FF"/>
54 +<stop offset="0.42" stop-color="#2077F8"/>
55 +<stop offset="0.700262" stop-color="#000F4D"/>
56 +</linearGradient>
57 +<linearGradient id="paint2_linear_4659_24215" x1="130" y1="35" x2="130" y2="263.571" gradientUnits="userSpaceOnUse">
58 +<stop stop-color="#C1F2FF"/>
59 +<stop offset="0.700262" stop-color="#718CF5"/>
60 +</linearGradient>
61 +<linearGradient id="paint3_linear_4659_24215" x1="130" y1="35" x2="130" y2="263.571" gradientUnits="userSpaceOnUse">
62 +<stop stop-color="#D8E3FF"/>
63 +<stop offset="0.700262" stop-color="#718CF5"/>
64 +</linearGradient>
65 +<linearGradient id="paint4_linear_4659_24215" x1="130.705" y1="98" x2="130.705" y2="197.982" gradientUnits="userSpaceOnUse">
66 +<stop stop-color="white"/>
67 +<stop offset="1" stop-color="#6DA8FF"/>
68 +</linearGradient>
69 +<linearGradient id="paint5_linear_4659_24215" x1="130.705" y1="98" x2="130.705" y2="197.982" gradientUnits="userSpaceOnUse">
70 +<stop stop-color="white"/>
71 +<stop offset="1" stop-color="#6891FE"/>
72 +</linearGradient>
73 +<linearGradient id="paint6_linear_4659_24215" x1="190" y1="159" x2="190.533" y2="242.2" gradientUnits="userSpaceOnUse">
74 +<stop stop-color="#FFC414"/>
75 +<stop offset="1" stop-color="#FF9500"/>
76 +</linearGradient>
77 +<linearGradient id="paint7_linear_4659_24215" x1="190" y1="159" x2="190" y2="230.082" gradientUnits="userSpaceOnUse">
78 +<stop stop-color="#5C486E"/>
79 +<stop offset="1" stop-color="#312938"/>
80 +</linearGradient>
81 +<linearGradient id="paint8_linear_4659_24215" x1="190" y1="159" x2="190" y2="230.082" gradientUnits="userSpaceOnUse">
82 +<stop stop-color="white"/>
83 +<stop offset="1" stop-color="#EBD4FF"/>
84 +</linearGradient>
85 +</defs>
86 +</svg>
assets/images/seed_warning_light.svg new
+111
@@ -0,0 +1,111 @@
1 +<svg width="260" height="298" viewBox="0 0 260 298" fill="none" xmlns="http://www.w3.org/2000/svg">
2 +<path d="M119.655 6.2793C126.055 3.53675 133.272 3.4513 139.723 6.02246L140.345 6.2793L243.044 50.2939C252.699 54.432 258.96 63.9259 258.96 74.4307V128.543C258.96 175.816 236.309 220.201 198.085 247.941L197.18 248.594L145.264 285.677C136.276 292.097 124.25 292.198 115.167 285.979L114.736 285.677L62.8203 248.594C24.0499 220.9 1.04004 176.188 1.04004 128.543V74.4307C1.04004 64.09 7.10644 54.7293 16.5059 50.4922L16.9561 50.2939L119.655 6.2793Z" stroke="#4A98DC" stroke-opacity="0.05" stroke-width="2.08"/>
3 +<path d="M120.451 17.2803C126.358 14.7487 133.02 14.6696 138.975 17.043L139.549 17.2803L234.349 57.9092C243.261 61.7289 249.04 70.492 249.04 80.1885V130.139C249.04 173.775 228.131 214.746 192.848 240.353L192.012 240.955L144.089 275.186C135.792 281.112 124.692 281.205 116.308 275.464L115.911 275.186L67.9883 240.955C32.2001 215.392 10.96 174.119 10.96 130.139V80.1885C10.9601 70.6434 16.56 62.0028 25.2363 58.0918L25.6514 57.9092L120.451 17.2803Z" stroke="#4B98DC" stroke-opacity="0.15" stroke-width="1.92"/>
4 +<path d="M121.294 28.3916C126.68 26.0835 132.754 26.0109 138.183 28.1748L138.706 28.3916L225.605 65.6338C233.731 69.1163 239 77.1066 239 85.9473V131.734C239 171.382 220.152 208.626 188.301 232.11L186.774 233.219L142.846 264.597C135.282 270 125.161 270.084 117.517 264.85L117.154 264.597L73.2256 233.219C40.4513 209.808 21 172.011 21 131.734V85.9473C21 77.2448 26.1053 69.3666 34.0156 65.8008L34.3945 65.6338L121.294 28.3916Z" stroke="#4895DB" stroke-opacity="0.35" stroke-width="2"/>
5 +<path d="M77.8584 226.328L117.794 254.854C125.096 260.069 134.904 260.069 142.206 254.854L182.141 226.328C212.176 204.875 230 170.239 230 133.33V91.7054C230 83.3049 224.994 75.7126 217.272 72.4034L138.272 38.5462C132.99 36.2823 127.01 36.2823 121.728 38.5463L42.7277 72.4034C35.0063 75.7126 30 83.3049 30 91.7054V133.33C30 170.239 47.8247 204.875 77.8584 226.328Z" fill="black"/>
6 +<path d="M77.8584 226.328L117.794 254.854C125.096 260.069 134.904 260.069 142.206 254.854L182.141 226.328C212.176 204.875 230 170.239 230 133.33V91.7054C230 83.3049 224.994 75.7126 217.272 72.4034L138.272 38.5462C132.99 36.2823 127.01 36.2823 121.728 38.5463L42.7277 72.4034C35.0063 75.7126 30 83.3049 30 91.7054V133.33C30 170.239 47.8247 204.875 77.8584 226.328Z" fill="url(#paint0_linear_5093_13165)"/>
7 +<path d="M77.8584 226.328L117.794 254.854C125.096 260.069 134.904 260.069 142.206 254.854L182.141 226.328C212.176 204.875 230 170.239 230 133.33V91.7054C230 83.3049 224.994 75.7126 217.272 72.4034L138.272 38.5462C132.99 36.2823 127.01 36.2823 121.728 38.5463L42.7277 72.4034C35.0063 75.7126 30 83.3049 30 91.7054V133.33C30 170.239 47.8247 204.875 77.8584 226.328Z" fill="url(#paint1_linear_5093_13165)"/>
8 +<path d="M77.8584 226.328L117.794 254.854C125.096 260.069 134.904 260.069 142.206 254.854L182.141 226.328C212.176 204.875 230 170.239 230 133.33V91.7054C230 83.3049 224.994 75.7126 217.272 72.4034L138.272 38.5462C132.99 36.2823 127.01 36.2823 121.728 38.5463L42.7277 72.4034C35.0063 75.7126 30 83.3049 30 91.7054V133.33C30 170.239 47.8247 204.875 77.8584 226.328Z" fill="url(#paint2_linear_5093_13165)"/>
9 +<path d="M77.8584 226.328L117.794 254.854C125.096 260.069 134.904 260.069 142.206 254.854L182.141 226.328C212.176 204.875 230 170.239 230 133.33V91.7054C230 83.3049 224.994 75.7126 217.272 72.4034L138.272 38.5462C132.99 36.2823 127.01 36.2823 121.728 38.5463L42.7277 72.4034C35.0063 75.7126 30 83.3049 30 91.7054V133.33C30 170.239 47.8247 204.875 77.8584 226.328Z" fill="url(#paint3_linear_5093_13165)"/>
10 +<path d="M77.8584 226.328L117.794 254.854C125.096 260.069 134.904 260.069 142.206 254.854L182.141 226.328C212.176 204.875 230 170.239 230 133.33V91.7054C230 83.3049 224.994 75.7126 217.272 72.4034L138.272 38.5462C132.99 36.2823 127.01 36.2823 121.728 38.5463L42.7277 72.4034C35.0063 75.7126 30 83.3049 30 91.7054V133.33C30 170.239 47.8247 204.875 77.8584 226.328Z" fill="url(#paint4_radial_5093_13165)" fill-opacity="0.3"/>
11 +<path d="M123.479 42.6309C127.513 40.9019 132.063 40.8486 136.13 42.4697L136.521 42.6309L215.521 76.4883C221.609 79.097 225.556 85.0825 225.556 91.7051V133.33C225.556 168.249 208.955 201.052 180.902 221.735L179.559 222.712L139.623 251.237C134.047 255.221 126.615 255.345 120.923 251.61L120.377 251.237L80.4414 222.712C51.5757 202.093 34.4443 168.803 34.4443 133.33V91.7051C34.4445 85.2895 38.1486 79.4723 43.9141 76.7432L44.4785 76.4883L123.479 42.6309Z" stroke="url(#paint5_linear_5093_13165)" stroke-width="8.88889"/>
12 +<path d="M123.479 42.6309C127.513 40.9019 132.063 40.8486 136.13 42.4697L136.521 42.6309L215.521 76.4883C221.609 79.097 225.556 85.0825 225.556 91.7051V133.33C225.556 168.249 208.955 201.052 180.902 221.735L179.559 222.712L139.623 251.237C134.047 255.221 126.615 255.345 120.923 251.61L120.377 251.237L80.4414 222.712C51.5757 202.093 34.4443 168.803 34.4443 133.33V91.7051C34.4445 85.2895 38.1486 79.4723 43.9141 76.7432L44.4785 76.4883L123.479 42.6309Z" stroke="url(#paint6_linear_5093_13165)" stroke-width="8.88889"/>
13 +<path d="M123.479 42.6309C127.513 40.9019 132.063 40.8486 136.13 42.4697L136.521 42.6309L215.521 76.4883C221.609 79.097 225.556 85.0825 225.556 91.7051V133.33C225.556 168.249 208.955 201.052 180.902 221.735L179.559 222.712L139.623 251.237C134.047 255.221 126.615 255.345 120.923 251.61L120.377 251.237L80.4414 222.712C51.5757 202.093 34.4443 168.803 34.4443 133.33V91.7051C34.4445 85.2895 38.1486 79.4723 43.9141 76.7432L44.4785 76.4883L123.479 42.6309Z" stroke="url(#paint7_linear_5093_13165)" stroke-width="8.88889"/>
14 +<path d="M123.479 42.6309C127.513 40.9019 132.063 40.8486 136.13 42.4697L136.521 42.6309L215.521 76.4883C221.609 79.097 225.556 85.0825 225.556 91.7051V133.33C225.556 168.249 208.955 201.052 180.902 221.735L179.559 222.712L139.623 251.237C134.047 255.221 126.615 255.345 120.923 251.61L120.377 251.237L80.4414 222.712C51.5757 202.093 34.4443 168.803 34.4443 133.33V91.7051C34.4445 85.2895 38.1486 79.4723 43.9141 76.7432L44.4785 76.4883L123.479 42.6309Z" stroke="url(#paint8_linear_5093_13165)" stroke-width="8.88889"/>
15 +<g filter="url(#filter0_i_5093_13165)">
16 +<path d="M77.8584 226.328L117.794 254.854C125.096 260.069 134.904 260.069 142.206 254.854L182.141 226.328C212.176 204.875 230 170.239 230 133.33V91.7054C230 83.3049 224.994 75.7126 217.272 72.4034L138.272 38.5462C132.99 36.2823 127.01 36.2823 121.728 38.5463L42.7277 72.4034C35.0063 75.7126 30 83.3049 30 91.7054V133.33C30 170.239 47.8247 204.875 77.8584 226.328Z" fill="black" fill-opacity="0.01"/>
17 +</g>
18 +<g filter="url(#filter1_ii_5093_13165)">
19 +<path fill-rule="evenodd" clip-rule="evenodd" d="M147.625 154.251C163.158 154.251 175.75 141.659 175.75 126.126C175.75 110.593 163.158 98.001 147.625 98.001C132.092 98.001 119.5 110.593 119.5 126.126C119.5 131.629 121.081 136.764 123.813 141.099L85.6611 179.251L104.393 197.983L113.232 189.144L103.339 179.251L113.25 169.34L123.143 179.233L131.982 170.394L122.089 160.501L132.652 149.938C136.987 152.67 142.122 154.251 147.625 154.251ZM147.625 141.751C156.254 141.751 163.25 134.755 163.25 126.126C163.25 117.497 156.254 110.501 147.625 110.501C138.996 110.501 132 117.497 132 126.126C132 134.755 138.996 141.751 147.625 141.751Z" fill="black"/>
20 +<path fill-rule="evenodd" clip-rule="evenodd" d="M147.625 154.251C163.158 154.251 175.75 141.659 175.75 126.126C175.75 110.593 163.158 98.001 147.625 98.001C132.092 98.001 119.5 110.593 119.5 126.126C119.5 131.629 121.081 136.764 123.813 141.099L85.6611 179.251L104.393 197.983L113.232 189.144L103.339 179.251L113.25 169.34L123.143 179.233L131.982 170.394L122.089 160.501L132.652 149.938C136.987 152.67 142.122 154.251 147.625 154.251ZM147.625 141.751C156.254 141.751 163.25 134.755 163.25 126.126C163.25 117.497 156.254 110.501 147.625 110.501C138.996 110.501 132 117.497 132 126.126C132 134.755 138.996 141.751 147.625 141.751Z" fill="url(#paint9_linear_5093_13165)"/>
21 +<path fill-rule="evenodd" clip-rule="evenodd" d="M147.625 154.251C163.158 154.251 175.75 141.659 175.75 126.126C175.75 110.593 163.158 98.001 147.625 98.001C132.092 98.001 119.5 110.593 119.5 126.126C119.5 131.629 121.081 136.764 123.813 141.099L85.6611 179.251L104.393 197.983L113.232 189.144L103.339 179.251L113.25 169.34L123.143 179.233L131.982 170.394L122.089 160.501L132.652 149.938C136.987 152.67 142.122 154.251 147.625 154.251ZM147.625 141.751C156.254 141.751 163.25 134.755 163.25 126.126C163.25 117.497 156.254 110.501 147.625 110.501C138.996 110.501 132 117.497 132 126.126C132 134.755 138.996 141.751 147.625 141.751Z" fill="url(#paint10_linear_5093_13165)"/>
22 +<path fill-rule="evenodd" clip-rule="evenodd" d="M147.625 154.251C163.158 154.251 175.75 141.659 175.75 126.126C175.75 110.593 163.158 98.001 147.625 98.001C132.092 98.001 119.5 110.593 119.5 126.126C119.5 131.629 121.081 136.764 123.813 141.099L85.6611 179.251L104.393 197.983L113.232 189.144L103.339 179.251L113.25 169.34L123.143 179.233L131.982 170.394L122.089 160.501L132.652 149.938C136.987 152.67 142.122 154.251 147.625 154.251ZM147.625 141.751C156.254 141.751 163.25 134.755 163.25 126.126C163.25 117.497 156.254 110.501 147.625 110.501C138.996 110.501 132 117.497 132 126.126C132 134.755 138.996 141.751 147.625 141.751Z" fill="url(#paint11_linear_5093_13165)"/>
23 +</g>
24 +<path d="M158.882 230.082H221.118C227.963 230.082 232.227 222.658 228.779 216.746L197.66 163.4C194.238 157.533 185.762 157.533 182.34 163.4L151.221 216.746C147.773 222.658 152.037 230.082 158.882 230.082Z" fill="#D9D9D9"/>
25 +<path d="M158.882 230.082H221.118C227.963 230.082 232.227 222.658 228.779 216.746L197.66 163.4C194.238 157.533 185.762 157.533 182.34 163.4L151.221 216.746C147.773 222.658 152.037 230.082 158.882 230.082Z" fill="url(#paint12_linear_5093_13165)"/>
26 +<path d="M158.882 230.082H221.118C227.963 230.082 232.227 222.658 228.779 216.746L197.66 163.4C194.238 157.533 185.762 157.533 182.34 163.4L151.221 216.746C147.773 222.658 152.037 230.082 158.882 230.082Z" stroke="#312938" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/>
27 +<path d="M158.882 230.082H221.118C227.963 230.082 232.227 222.658 228.779 216.746L197.66 163.4C194.238 157.533 185.762 157.533 182.34 163.4L151.221 216.746C147.773 222.658 152.037 230.082 158.882 230.082Z" stroke="url(#paint13_linear_5093_13165)" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/>
28 +<path d="M189.907 212.209H189.952M189.907 198.907V185.604" stroke="#312938" stroke-width="8.86825" stroke-linecap="round" stroke-linejoin="round"/>
29 +<defs>
30 +<filter id="filter0_i_5093_13165" x="30" y="36.8486" width="200" height="221.917" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
31 +<feFlood flood-opacity="0" result="BackgroundImageFix"/>
32 +<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
33 +<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
34 +<feOffset dy="2"/>
35 +<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>
36 +<feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.5 0"/>
37 +<feBlend mode="normal" in2="shape" result="effect1_innerShadow_5093_13165"/>
38 +</filter>
39 +<filter id="filter1_ii_5093_13165" x="85.6611" y="98.001" width="90.0889" height="99.9814" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
40 +<feFlood flood-opacity="0" result="BackgroundImageFix"/>
41 +<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
42 +<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
43 +<feOffset dy="2"/>
44 +<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>
45 +<feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.3 0"/>
46 +<feBlend mode="normal" in2="shape" result="effect1_innerShadow_5093_13165"/>
47 +<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
48 +<feOffset dy="-2"/>
49 +<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>
50 +<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0"/>
51 +<feBlend mode="normal" in2="effect1_innerShadow_5093_13165" result="effect2_innerShadow_5093_13165"/>
52 +</filter>
53 +<linearGradient id="paint0_linear_5093_13165" x1="130" y1="35.001" x2="130" y2="263.572" gradientUnits="userSpaceOnUse">
54 +<stop stop-color="#002A52"/>
55 +<stop offset="1" stop-color="#0652DF"/>
56 +</linearGradient>
57 +<linearGradient id="paint1_linear_5093_13165" x1="130" y1="35.001" x2="130" y2="263.572" gradientUnits="userSpaceOnUse">
58 +<stop stop-color="#19233C"/>
59 +<stop offset="1" stop-color="#144CD8"/>
60 +</linearGradient>
61 +<linearGradient id="paint2_linear_5093_13165" x1="130" y1="35.001" x2="130" y2="263.572" gradientUnits="userSpaceOnUse">
62 +<stop stop-color="#19233C"/>
63 +<stop offset="1" stop-color="#1647C3"/>
64 +</linearGradient>
65 +<linearGradient id="paint3_linear_5093_13165" x1="130" y1="35.001" x2="130" y2="263.572" gradientUnits="userSpaceOnUse">
66 +<stop stop-color="#FAFAFA"/>
67 +<stop offset="1" stop-color="#72AAFF"/>
68 +</linearGradient>
69 +<radialGradient id="paint4_radial_5093_13165" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(130 149.287) rotate(90) scale(97.381 85.2083)">
70 +<stop stop-color="white"/>
71 +<stop offset="1" stop-color="white" stop-opacity="0"/>
72 +</radialGradient>
73 +<linearGradient id="paint5_linear_5093_13165" x1="130" y1="35.001" x2="130" y2="263.572" gradientUnits="userSpaceOnUse">
74 +<stop stop-color="#C1F2FF"/>
75 +<stop offset="0.42" stop-color="#2077F8"/>
76 +<stop offset="0.700262" stop-color="#000F4D"/>
77 +</linearGradient>
78 +<linearGradient id="paint6_linear_5093_13165" x1="130" y1="35.001" x2="130" y2="263.572" gradientUnits="userSpaceOnUse">
79 +<stop stop-color="#C1F2FF"/>
80 +<stop offset="0.700262" stop-color="#718CF5"/>
81 +</linearGradient>
82 +<linearGradient id="paint7_linear_5093_13165" x1="130" y1="35.001" x2="130" y2="263.572" gradientUnits="userSpaceOnUse">
83 +<stop stop-color="#D8E3FF"/>
84 +<stop offset="0.700262" stop-color="#718CF5"/>
85 +</linearGradient>
86 +<linearGradient id="paint8_linear_5093_13165" x1="130" y1="35.001" x2="130" y2="263.572" gradientUnits="userSpaceOnUse">
87 +<stop stop-color="#68BEEF"/>
88 +<stop offset="0.700262" stop-color="#2C71CC"/>
89 +</linearGradient>
90 +<linearGradient id="paint9_linear_5093_13165" x1="130.705" y1="98.001" x2="130.705" y2="197.983" gradientUnits="userSpaceOnUse">
91 +<stop stop-color="white"/>
92 +<stop offset="1" stop-color="#6DA8FF"/>
93 +</linearGradient>
94 +<linearGradient id="paint10_linear_5093_13165" x1="130.705" y1="98.001" x2="130.705" y2="197.983" gradientUnits="userSpaceOnUse">
95 +<stop stop-color="#68BEEF"/>
96 +<stop offset="1" stop-color="#0047A3"/>
97 +</linearGradient>
98 +<linearGradient id="paint11_linear_5093_13165" x1="130.705" y1="98.001" x2="130.705" y2="197.983" gradientUnits="userSpaceOnUse">
99 +<stop stop-color="#68BEEF"/>
100 +<stop offset="0.700262" stop-color="#2C71CC"/>
101 +</linearGradient>
102 +<linearGradient id="paint12_linear_5093_13165" x1="190" y1="159" x2="190.533" y2="242.2" gradientUnits="userSpaceOnUse">
103 +<stop stop-color="#FFC414"/>
104 +<stop offset="1" stop-color="#FF9500"/>
105 +</linearGradient>
106 +<linearGradient id="paint13_linear_5093_13165" x1="190" y1="159" x2="190" y2="230.082" gradientUnits="userSpaceOnUse">
107 +<stop stop-color="#5C486E"/>
108 +<stop offset="1" stop-color="#312938"/>
109 +</linearGradient>
110 +</defs>
111 +</svg>
assets/images/send.png
Binary files a/assets/images/send.png and /dev/null differ
assets/images/send2.png
Binary files /dev/null and b/assets/images/send2.png differ
assets/images/swap.png
Binary files /dev/null and b/assets/images/swap.png differ
assets/images/wallet_group_bright.png
Binary files a/assets/images/wallet_group_bright.png and /dev/null differ
assets/images/wallet_group_confirmed_dark.png
Binary files /dev/null and b/assets/images/wallet_group_confirmed_dark.png differ
assets/images/wallet_group_confirmed_light.png
Binary files /dev/null and b/assets/images/wallet_group_confirmed_light.png differ
assets/images/wallet_group_dark.png
Binary files a/assets/images/wallet_group_dark.png and /dev/null differ
assets/images/wallet_group_empty_dark.png
Binary files /dev/null and b/assets/images/wallet_group_empty_dark.png differ
assets/images/wallet_group_empty_light.png
Binary files /dev/null and b/assets/images/wallet_group_empty_light.png differ
assets/images/wallet_group_light.png
Binary files a/assets/images/wallet_group_light.png and /dev/null differ
assets/images/wallet_group_options_dark.png
Binary files /dev/null and b/assets/images/wallet_group_options_dark.png differ
assets/images/wallet_group_options_light.png
Binary files /dev/null and b/assets/images/wallet_group_options_light.png differ
assets/images/wallet_name.png
Binary files a/assets/images/wallet_name.png and /dev/null differ
assets/images/wallet_name_light.png
Binary files a/assets/images/wallet_name_light.png and /dev/null differ
assets/images/wallet_type.png
Binary files a/assets/images/wallet_type.png and /dev/null differ
assets/images/wallet_type_light.png
Binary files a/assets/images/wallet_type_light.png and /dev/null differ
assets/images/wallet_type_wallet_dark.png
Binary files /dev/null and b/assets/images/wallet_type_wallet_dark.png differ
assets/images/wallet_type_wallet_light.png
Binary files /dev/null and b/assets/images/wallet_type_wallet_light.png differ
assets/images/wallets.png
Binary files /dev/null and b/assets/images/wallets.png differ
assets/images/welcome.png
Binary files a/assets/images/welcome.png and /dev/null differ
assets/images/welcome_dark_theme.svg new
+215
@@ -0,0 +1,215 @@
1 +<svg width="375" height="304" viewBox="0 0 375 304" fill="none" xmlns="http://www.w3.org/2000/svg">
2 +<rect x="-40" width="475" height="304" fill="url(#paint0_linear_4656_21674)"/>
3 +<g filter="url(#filter0_df_4656_21674)">
4 +<circle cx="298.5" cy="121.5" r="2.5" fill="#E0E7FA"/>
5 +</g>
6 +<g opacity="0.5" filter="url(#filter1_df_4656_21674)">
7 +<ellipse cx="261" cy="64.5" rx="1" ry="2.5" fill="#E0E7FA"/>
8 +</g>
9 +<g filter="url(#filter2_df_4656_21674)">
10 +<path d="M95.5 59L96.3061 65.6939L103 66.5L96.3061 67.3061L95.5 74L94.6939 67.3061L88 66.5L94.6939 65.6939L95.5 59Z" fill="#D7E2F7"/>
11 +</g>
12 +<g filter="url(#filter3_df_4656_21674)">
13 +<path d="M38.5 156L39.3061 162.694L46 163.5L39.3061 164.306L38.5 171L37.6939 164.306L31 163.5L37.6939 162.694L38.5 156Z" fill="#D7E2F7"/>
14 +</g>
15 +<g filter="url(#filter4_df_4656_21674)">
16 +<path d="M336.5 79L337.306 85.6939L344 86.5L337.306 87.3061L336.5 94L335.694 87.3061L329 86.5L335.694 85.6939L336.5 79Z" fill="#D7E2F7"/>
17 +</g>
18 +<g filter="url(#filter5_df_4656_21674)">
19 +<path d="M75.5 123.5L76.1449 128.855L81.5 129.5L76.1449 130.145L75.5 135.5L74.8551 130.145L69.5 129.5L74.8551 128.855L75.5 123.5Z" fill="#D7E2F7"/>
20 +</g>
21 +<g filter="url(#filter6_df_4656_21674)">
22 +<circle cx="271.5" cy="216.5" r="2.5" fill="#E0E7FA"/>
23 +</g>
24 +<g filter="url(#filter7_df_4656_21674)">
25 +<path d="M316.5 171L317.844 182.156L329 183.5L317.844 184.844L316.5 196L315.156 184.844L304 183.5L315.156 182.156L316.5 171Z" fill="#D7E2F7"/>
26 +</g>
27 +<line x1="316.5" y1="161" x2="316.5" y2="207" stroke="url(#paint1_linear_4656_21674)"/>
28 +<line x1="293" y1="183.5" x2="339" y2="183.5" stroke="url(#paint2_linear_4656_21674)"/>
29 +<g opacity="0.2">
30 +<g filter="url(#filter8_df_4656_21674)">
31 +<path d="M54.5 77L55.8435 88.1565L67 89.5L55.8435 90.8435L54.5 102L53.1565 90.8435L42 89.5L53.1565 88.1565L54.5 77Z" fill="#D7E2F7"/>
32 +</g>
33 +<line x1="54.5" y1="67" x2="54.5" y2="113" stroke="url(#paint3_linear_4656_21674)"/>
34 +<line x1="31" y1="89.5" x2="77" y2="89.5" stroke="url(#paint4_linear_4656_21674)"/>
35 +</g>
36 +<g opacity="0.5" filter="url(#filter9_df_4656_21674)">
37 +<ellipse cx="102" cy="173.5" rx="1" ry="2.5" fill="#E0E7FA"/>
38 +</g>
39 +<path d="M176.165 126.986C174.967 129.623 174.3 132.551 174.3 135.636C174.3 147.197 183.672 156.569 195.232 156.569C200.746 156.569 205.761 154.436 209.5 150.951C206.208 158.196 198.909 163.235 190.433 163.235C178.872 163.235 169.5 153.863 169.5 142.302C169.5 136.255 172.065 130.808 176.165 126.986Z" fill="#D9D9D9"/>
40 +<path d="M176.165 126.986C174.967 129.623 174.3 132.551 174.3 135.636C174.3 147.197 183.672 156.569 195.232 156.569C200.746 156.569 205.761 154.436 209.5 150.951C206.208 158.196 198.909 163.235 190.433 163.235C178.872 163.235 169.5 153.863 169.5 142.302C169.5 136.255 172.065 130.808 176.165 126.986Z" fill="url(#paint5_linear_4656_21674)"/>
41 +<path d="M176.165 126.986C174.967 129.623 174.3 132.551 174.3 135.636C174.3 147.197 183.672 156.569 195.232 156.569C200.746 156.569 205.761 154.436 209.5 150.951C206.208 158.196 198.909 163.235 190.433 163.235C178.872 163.235 169.5 153.863 169.5 142.302C169.5 136.255 172.065 130.808 176.165 126.986Z" fill="url(#paint6_linear_4656_21674)"/>
42 +<g opacity="0.5" filter="url(#filter10_f_4656_21674)">
43 +<path d="M176.165 126.986C174.967 129.623 174.3 132.551 174.3 135.636C174.3 147.197 183.672 156.569 195.232 156.569C200.746 156.569 205.761 154.436 209.5 150.951C206.208 158.196 198.909 163.235 190.433 163.235C178.872 163.235 169.5 153.863 169.5 142.302C169.5 136.255 172.065 130.808 176.165 126.986Z" fill="#D9D9D9"/>
44 +<path d="M176.165 126.986C174.967 129.623 174.3 132.551 174.3 135.636C174.3 147.197 183.672 156.569 195.232 156.569C200.746 156.569 205.761 154.436 209.5 150.951C206.208 158.196 198.909 163.235 190.433 163.235C178.872 163.235 169.5 153.863 169.5 142.302C169.5 136.255 172.065 130.808 176.165 126.986Z" fill="url(#paint7_linear_4656_21674)"/>
45 +<path d="M176.165 126.986C174.967 129.623 174.3 132.551 174.3 135.636C174.3 147.197 183.672 156.569 195.232 156.569C200.746 156.569 205.761 154.436 209.5 150.951C206.208 158.196 198.909 163.235 190.433 163.235C178.872 163.235 169.5 153.863 169.5 142.302C169.5 136.255 172.065 130.808 176.165 126.986Z" fill="url(#paint8_linear_4656_21674)"/>
46 +</g>
47 +<defs>
48 +<filter id="filter0_df_4656_21674" x="284.5" y="107.5" width="28" height="28" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
49 +<feFlood flood-opacity="0" result="BackgroundImageFix"/>
50 +<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
51 +<feMorphology radius="1" operator="dilate" in="SourceAlpha" result="effect1_dropShadow_4656_21674"/>
52 +<feOffset/>
53 +<feGaussianBlur stdDeviation="5.25"/>
54 +<feComposite in2="hardAlpha" operator="out"/>
55 +<feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.7 0"/>
56 +<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_4656_21674"/>
57 +<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_4656_21674" result="shape"/>
58 +<feGaussianBlur stdDeviation="2" result="effect2_foregroundBlur_4656_21674"/>
59 +</filter>
60 +<filter id="filter1_df_4656_21674" x="248.5" y="50.5" width="25" height="28" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
61 +<feFlood flood-opacity="0" result="BackgroundImageFix"/>
62 +<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
63 +<feMorphology radius="1" operator="dilate" in="SourceAlpha" result="effect1_dropShadow_4656_21674"/>
64 +<feOffset/>
65 +<feGaussianBlur stdDeviation="5.25"/>
66 +<feComposite in2="hardAlpha" operator="out"/>
67 +<feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.7 0"/>
68 +<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_4656_21674"/>
69 +<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_4656_21674" result="shape"/>
70 +<feGaussianBlur stdDeviation="2" result="effect2_foregroundBlur_4656_21674"/>
71 +</filter>
72 +<filter id="filter2_df_4656_21674" x="81.1" y="52.1" width="28.8" height="28.8" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
73 +<feFlood flood-opacity="0" result="BackgroundImageFix"/>
74 +<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
75 +<feMorphology radius="0.6" operator="dilate" in="SourceAlpha" result="effect1_dropShadow_4656_21674"/>
76 +<feOffset/>
77 +<feGaussianBlur stdDeviation="3.15"/>
78 +<feComposite in2="hardAlpha" operator="out"/>
79 +<feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.7 0"/>
80 +<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_4656_21674"/>
81 +<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_4656_21674" result="shape"/>
82 +<feGaussianBlur stdDeviation="0.3" result="effect2_foregroundBlur_4656_21674"/>
83 +</filter>
84 +<filter id="filter3_df_4656_21674" x="24.1" y="149.1" width="28.8" height="28.8" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
85 +<feFlood flood-opacity="0" result="BackgroundImageFix"/>
86 +<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
87 +<feMorphology radius="0.6" operator="dilate" in="SourceAlpha" result="effect1_dropShadow_4656_21674"/>
88 +<feOffset/>
89 +<feGaussianBlur stdDeviation="3.15"/>
90 +<feComposite in2="hardAlpha" operator="out"/>
91 +<feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.7 0"/>
92 +<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_4656_21674"/>
93 +<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_4656_21674" result="shape"/>
94 +<feGaussianBlur stdDeviation="0.3" result="effect2_foregroundBlur_4656_21674"/>
95 +</filter>
96 +<filter id="filter4_df_4656_21674" x="322.1" y="72.1" width="28.8" height="28.8" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
97 +<feFlood flood-opacity="0" result="BackgroundImageFix"/>
98 +<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
99 +<feMorphology radius="0.6" operator="dilate" in="SourceAlpha" result="effect1_dropShadow_4656_21674"/>
100 +<feOffset/>
101 +<feGaussianBlur stdDeviation="3.15"/>
102 +<feComposite in2="hardAlpha" operator="out"/>
103 +<feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.7 0"/>
104 +<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_4656_21674"/>
105 +<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_4656_21674" result="shape"/>
106 +<feGaussianBlur stdDeviation="0.3" result="effect2_foregroundBlur_4656_21674"/>
107 +</filter>
108 +<filter id="filter5_df_4656_21674" x="63.98" y="117.98" width="23.04" height="23.04" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
109 +<feFlood flood-opacity="0" result="BackgroundImageFix"/>
110 +<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
111 +<feMorphology radius="0.48" operator="dilate" in="SourceAlpha" result="effect1_dropShadow_4656_21674"/>
112 +<feOffset/>
113 +<feGaussianBlur stdDeviation="2.52"/>
114 +<feComposite in2="hardAlpha" operator="out"/>
115 +<feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.7 0"/>
116 +<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_4656_21674"/>
117 +<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_4656_21674" result="shape"/>
118 +<feGaussianBlur stdDeviation="0.24" result="effect2_foregroundBlur_4656_21674"/>
119 +</filter>
120 +<filter id="filter6_df_4656_21674" x="257.5" y="202.5" width="28" height="28" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
121 +<feFlood flood-opacity="0" result="BackgroundImageFix"/>
122 +<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
123 +<feMorphology radius="1" operator="dilate" in="SourceAlpha" result="effect1_dropShadow_4656_21674"/>
124 +<feOffset/>
125 +<feGaussianBlur stdDeviation="5.25"/>
126 +<feComposite in2="hardAlpha" operator="out"/>
127 +<feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.7 0"/>
128 +<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_4656_21674"/>
129 +<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_4656_21674" result="shape"/>
130 +<feGaussianBlur stdDeviation="2" result="effect2_foregroundBlur_4656_21674"/>
131 +</filter>
132 +<filter id="filter7_df_4656_21674" x="292.5" y="159.5" width="48" height="48" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
133 +<feFlood flood-opacity="0" result="BackgroundImageFix"/>
134 +<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
135 +<feMorphology radius="1" operator="dilate" in="SourceAlpha" result="effect1_dropShadow_4656_21674"/>
136 +<feOffset/>
137 +<feGaussianBlur stdDeviation="5.25"/>
138 +<feComposite in2="hardAlpha" operator="out"/>
139 +<feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.7 0"/>
140 +<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_4656_21674"/>
141 +<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_4656_21674" result="shape"/>
142 +<feGaussianBlur stdDeviation="0.5" result="effect2_foregroundBlur_4656_21674"/>
143 +</filter>
144 +<filter id="filter8_df_4656_21674" x="30.5" y="65.5" width="48" height="48" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
145 +<feFlood flood-opacity="0" result="BackgroundImageFix"/>
146 +<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
147 +<feMorphology radius="1" operator="dilate" in="SourceAlpha" result="effect1_dropShadow_4656_21674"/>
148 +<feOffset/>
149 +<feGaussianBlur stdDeviation="5.25"/>
150 +<feComposite in2="hardAlpha" operator="out"/>
151 +<feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.7 0"/>
152 +<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_4656_21674"/>
153 +<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_4656_21674" result="shape"/>
154 +<feGaussianBlur stdDeviation="0.5" result="effect2_foregroundBlur_4656_21674"/>
155 +</filter>
156 +<filter id="filter9_df_4656_21674" x="89.5" y="159.5" width="25" height="28" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
157 +<feFlood flood-opacity="0" result="BackgroundImageFix"/>
158 +<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
159 +<feMorphology radius="1" operator="dilate" in="SourceAlpha" result="effect1_dropShadow_4656_21674"/>
160 +<feOffset/>
161 +<feGaussianBlur stdDeviation="5.25"/>
162 +<feComposite in2="hardAlpha" operator="out"/>
163 +<feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.7 0"/>
164 +<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_4656_21674"/>
165 +<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_4656_21674" result="shape"/>
166 +<feGaussianBlur stdDeviation="2" result="effect2_foregroundBlur_4656_21674"/>
167 +</filter>
168 +<filter id="filter10_f_4656_21674" x="156.1" y="113.586" width="66.8" height="63.049" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
169 +<feFlood flood-opacity="0" result="BackgroundImageFix"/>
170 +<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
171 +<feGaussianBlur stdDeviation="6.7" result="effect1_foregroundBlur_4656_21674"/>
172 +</filter>
173 +<linearGradient id="paint0_linear_4656_21674" x1="198" y1="22.9607" x2="198" y2="268.181" gradientUnits="userSpaceOnUse">
174 +<stop stop-color="#142040"/>
175 +<stop offset="0.644231" stop-color="#14234B"/>
176 +<stop offset="1" stop-color="#1B284A" stop-opacity="0"/>
177 +</linearGradient>
178 +<linearGradient id="paint1_linear_4656_21674" x1="315.5" y1="161" x2="315.5" y2="207" gradientUnits="userSpaceOnUse">
179 +<stop stop-color="#D7E2F7" stop-opacity="0"/>
180 +<stop offset="0.466346" stop-color="#D7E2F7"/>
181 +<stop offset="1" stop-color="#D7E2F7" stop-opacity="0"/>
182 +</linearGradient>
183 +<linearGradient id="paint2_linear_4656_21674" x1="293" y1="184.5" x2="339" y2="184.5" gradientUnits="userSpaceOnUse">
184 +<stop stop-color="#D7E2F7" stop-opacity="0"/>
185 +<stop offset="0.466346" stop-color="#D7E2F7"/>
186 +<stop offset="1" stop-color="#D7E2F7" stop-opacity="0"/>
187 +</linearGradient>
188 +<linearGradient id="paint3_linear_4656_21674" x1="53.5" y1="67" x2="53.5" y2="113" gradientUnits="userSpaceOnUse">
189 +<stop stop-color="#D7E2F7" stop-opacity="0"/>
190 +<stop offset="0.466346" stop-color="#D7E2F7"/>
191 +<stop offset="1" stop-color="#D7E2F7" stop-opacity="0"/>
192 +</linearGradient>
193 +<linearGradient id="paint4_linear_4656_21674" x1="31" y1="90.5" x2="77" y2="90.5" gradientUnits="userSpaceOnUse">
194 +<stop stop-color="#D7E2F7" stop-opacity="0"/>
195 +<stop offset="0.466346" stop-color="#D7E2F7"/>
196 +<stop offset="1" stop-color="#D7E2F7" stop-opacity="0"/>
197 +</linearGradient>
198 +<linearGradient id="paint5_linear_4656_21674" x1="189.5" y1="126.986" x2="189.5" y2="163.235" gradientUnits="userSpaceOnUse">
199 +<stop stop-color="#D7E2F7"/>
200 +<stop offset="1" stop-color="#7891C1"/>
201 +</linearGradient>
202 +<linearGradient id="paint6_linear_4656_21674" x1="189.5" y1="126.986" x2="195.774" y2="163.063" gradientUnits="userSpaceOnUse">
203 +<stop stop-color="white"/>
204 +<stop offset="1" stop-color="#7891C1"/>
205 +</linearGradient>
206 +<linearGradient id="paint7_linear_4656_21674" x1="189.5" y1="126.986" x2="189.5" y2="163.235" gradientUnits="userSpaceOnUse">
207 +<stop stop-color="#D7E2F7"/>
208 +<stop offset="1" stop-color="#7891C1"/>
209 +</linearGradient>
210 +<linearGradient id="paint8_linear_4656_21674" x1="189.5" y1="126.986" x2="195.774" y2="163.063" gradientUnits="userSpaceOnUse">
211 +<stop stop-color="white"/>
212 +<stop offset="1" stop-color="#7891C1"/>
213 +</linearGradient>
214 +</defs>
215 +</svg>
assets/images/welcome_light.png
Binary files a/assets/images/welcome_light.png and /dev/null differ
assets/images/welcome_light_theme.svg new
+14
@@ -0,0 +1,14 @@
1 +<svg width="375" height="304" viewBox="0 0 375 304" fill="none" xmlns="http://www.w3.org/2000/svg">
2 +<rect x="-40" y="-27" width="475" height="331" fill="url(#paint0_linear_4656_21863)"/>
3 +<rect x="285" y="163" width="101" height="49" rx="24.5" fill="#EFEFF8"/>
4 +<circle cx="331" cy="173" r="31" fill="#EFEFF8"/>
5 +<rect x="-30" y="108" width="115" height="49" rx="24.5" fill="#EFEFF8"/>
6 +<circle cx="16" cy="118" r="31" fill="#EFEFF8"/>
7 +<rect x="251" y="193" width="30" height="19" rx="9.5" fill="#EFEFF8"/>
8 +<defs>
9 +<linearGradient id="paint0_linear_4656_21863" x1="197.5" y1="-27" x2="197.5" y2="304" gradientUnits="userSpaceOnUse">
10 +<stop stop-color="#68BEEF"/>
11 +<stop offset="1" stop-color="white" stop-opacity="0"/>
12 +</linearGradient>
13 +</defs>
14 +</svg>
assets/images/welcome_wallet_dark.png
Binary files /dev/null and b/assets/images/welcome_wallet_dark.png differ
assets/images/welcome_wallet_light.png
Binary files /dev/null and b/assets/images/welcome_wallet_light.png differ
assets/images/wyre-icon.png
Binary files a/assets/images/wyre-icon.png and /dev/null differ
assets/images/wyre.png
Binary files a/assets/images/wyre.png and /dev/null differ
assets/images/yat_crypto.png
Binary files a/assets/images/yat_crypto.png and /dev/null differ
integration_test/robots/new_wallet_type_page_robot.dart
+1 -1
@@ -1,6 +1,6 @@
1 import 'package:cake_wallet/generated/i18n.dart';
2 import 'package:cake_wallet/src/screens/new_wallet/new_wallet_type_page.dart';
3 -import 'package:cake_wallet/themes/theme_base.dart';
3 +import 'package:cake_wallet/themes/core/material_base_theme.dart';
4 import 'package:cw_core/wallet_type.dart';
5 import 'package:flutter/material.dart';
6 import 'package:flutter_test/flutter_test.dart';
lib/buy/moonpay/moonpay_provider.dart
+9 -14
@@ -14,8 +14,8 @@ import 'package:cake_wallet/exchange/trade_state.dart';
14 import 'package:cake_wallet/generated/i18n.dart';
15 import 'package:cake_wallet/palette.dart';
16 import 'package:cake_wallet/src/widgets/alert_with_one_action.dart';
17 -import 'package:cake_wallet/store/settings_store.dart';
18 -import 'package:cake_wallet/themes/theme_base.dart';
17 +import 'package:cake_wallet/store/app_store.dart';
18 +import 'package:cake_wallet/themes/core/material_base_theme.dart';
19 import 'package:cw_core/crypto_currency.dart';
20 import 'package:cw_core/wallet_base.dart';
21 import 'package:cw_core/wallet_type.dart';
@@ -26,12 +26,12 @@ import 'package:url_launcher/url_launcher.dart';
26
27 class MoonPayProvider extends BuyProvider {
28 MoonPayProvider({
29 - required SettingsStore settingsStore,
29 + required AppStore appStore,
30 required WalletBase wallet,
31 bool isTestEnvironment = false,
32 }) : baseSellUrl = isTestEnvironment ? _baseSellTestUrl : _baseSellProductUrl,
33 baseBuyUrl = isTestEnvironment ? _baseBuyTestUrl : _baseBuyProductUrl,
34 - this._settingsStore = settingsStore,
34 + this._appStore = appStore,
35 super(
36 wallet: wallet,
37 isTestEnvironment: isTestEnvironment,
@@ -41,7 +41,7 @@ class MoonPayProvider extends BuyProvider {
41 supportedFiatList: supportedFiatToCryptoPairs(
42 notSupportedFiat: _notSupportedFiat, notSupportedCrypto: _notSupportedCrypto));
43
44 - final SettingsStore _settingsStore;
44 + final AppStore _appStore;
45
46 static const _baseSellTestUrl = 'sell-sandbox.moonpay.com';
47 static const _baseSellProductUrl = 'sell.moonpay.com';
@@ -86,15 +86,12 @@ class MoonPayProvider extends BuyProvider {
86
87 static String get _exchangeHelperApiKey => secrets.exchangeHelperApiKey;
88
89 - static String themeToMoonPayTheme(ThemeBase theme) {
89 + static String themeToMoonPayTheme(MaterialThemeBase theme) {
90 switch (theme.type) {
91 - case ThemeType.bright:
91 case ThemeType.light:
92 return 'light';
93 case ThemeType.dark:
94 return 'dark';
96 - case ThemeType.oled:
97 - return 'dark';
95 }
96 }
97
@@ -237,9 +234,9 @@ class MoonPayProvider extends BuyProvider {
234 required String cryptoCurrencyAddress,
235 String? countryCode}) async {
236 final Map<String, String> params = {
240 - 'theme': themeToMoonPayTheme(_settingsStore.currentTheme),
241 - 'language': _settingsStore.languageCode,
242 - 'colorCode': _settingsStore.currentTheme.type == ThemeType.dark
237 + 'theme': themeToMoonPayTheme(_appStore.themeStore.currentTheme),
238 + 'language': _appStore.settingsStore.languageCode,
239 + 'colorCode': _appStore.themeStore.currentTheme.isDark
240 ? '#${Palette.blueCraiola.value.toRadixString(16).substring(2, 8)}'
241 : '#${Palette.moderateSlateBlue.value.toRadixString(16).substring(2, 8)}',
242 'baseCurrencyCode': isBuyAction ? quote.fiatCurrency.name : quote.cryptoCurrency.name,
@@ -260,7 +257,6 @@ class MoonPayProvider extends BuyProvider {
257 try {
258 final uri = await requestMoonPayUrl(
259 walletAddress: cryptoCurrencyAddress,
263 - settingsStore: _settingsStore,
260 isBuyAction: isBuyAction,
261 amount: amount.toString(),
262 params: params);
@@ -289,7 +285,6 @@ class MoonPayProvider extends BuyProvider {
285
286 Future<Uri> requestMoonPayUrl({
287 required String walletAddress,
292 - required SettingsStore settingsStore,
288 required bool isBuyAction,
289 required Map<String, String> params,
290 String? amount,
lib/buy/onramper/onramper_buy_provider.dart
+9 -14
@@ -8,8 +8,7 @@ import 'package:cake_wallet/buy/pairs_utils.dart';
8 import 'package:cake_wallet/buy/payment_method.dart';
9 import 'package:cake_wallet/entities/fiat_currency.dart';
10 import 'package:cake_wallet/generated/i18n.dart';
11 -import 'package:cake_wallet/store/settings_store.dart';
12 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
11 +import 'package:cake_wallet/themes/core/theme_store.dart';
12 import 'package:cw_core/crypto_currency.dart';
13 import 'package:cw_core/utils/print_verbose.dart';
14 import 'package:cw_core/wallet_base.dart';
@@ -18,7 +17,7 @@ import 'package:http/http.dart' as http;
17 import 'package:url_launcher/url_launcher.dart';
18
19 class OnRamperBuyProvider extends BuyProvider {
21 - OnRamperBuyProvider(this._settingsStore,
20 + OnRamperBuyProvider(this._themeStore,
21 {required WalletBase wallet, bool isTestEnvironment = false})
22 : super(wallet: wallet,
23 isTestEnvironment: isTestEnvironment,
@@ -39,7 +38,7 @@ class OnRamperBuyProvider extends BuyProvider {
38 static const List<FiatCurrency> _notSupportedFiat = [];
39 static Map<String, dynamic> _onrampMetadata = {};
40
42 - final SettingsStore _settingsStore;
41 + final ThemeStore _themeStore;
42
43 String? recommendedPaymentType;
44
@@ -246,17 +245,13 @@ class OnRamperBuyProvider extends BuyProvider {
245 String? countryCode}) async {
246 final actionType = isBuyAction ? 'buy' : 'sell';
247
249 - final primaryColor = getColorStr(Theme.of(context).primaryColor);
250 - final secondaryColor = getColorStr(Theme.of(context).colorScheme.background);
251 - final primaryTextColor = getColorStr(Theme.of(context).extension<CakeTextTheme>()!.titleColor);
248 + final primaryColor = getColorStr(Theme.of(context).colorScheme.primary,);
249 + final secondaryColor = getColorStr(Theme.of(context).colorScheme.surface);
250 + final primaryTextColor = getColorStr(Theme.of(context).colorScheme.onSurface);
251 final secondaryTextColor =
253 - getColorStr(Theme.of(context).extension<CakeTextTheme>()!.secondaryTextColor);
254 - final containerColor = getColorStr(Theme.of(context).colorScheme.background);
255 - var cardColor = getColorStr(Theme.of(context).cardColor);
256 -
257 - if (_settingsStore.currentTheme.title == S.current.high_contrast_theme) {
258 - cardColor = getColorStr(Colors.white);
259 - }
252 + getColorStr(Theme.of(context).colorScheme.onSurfaceVariant);
253 + final containerColor = getColorStr(Theme.of(context).colorScheme.surface);
254 + var cardColor = getColorStr(Theme.of(context).colorScheme.surfaceContainer);
255
256 final defaultCrypto =
257 quote.cryptoCurrency.title + _getNormalizeNetwork(quote.cryptoCurrency).toLowerCase();
lib/core/backup_service.dart
+1 -1
@@ -3,7 +3,7 @@ import 'dart:io';
3 import 'package:cake_wallet/core/secure_storage.dart';
4 import 'package:cake_wallet/entities/get_encryption_key.dart';
5 import 'package:cake_wallet/entities/transaction_description.dart';
6 -import 'package:cake_wallet/themes/theme_list.dart';
6 +import 'package:cake_wallet/themes/utils/theme_list.dart';
7 import 'package:cw_core/root_dir.dart';
8 import 'package:cake_wallet/utils/device_info.dart';
9 import 'package:cw_core/utils/print_verbose.dart';
lib/di.dart
+15 -14
@@ -39,6 +39,7 @@ import 'package:cake_wallet/src/screens/settings/background_sync_page.dart';
39 import 'package:cake_wallet/src/screens/wallet_connect/services/bottom_sheet_service.dart';
40 import 'package:cake_wallet/src/screens/wallet_connect/services/key_service/wallet_connect_key_service.dart';
41 import 'package:cake_wallet/src/screens/wallet_connect/services/walletkit_service.dart';
42 +import 'package:cake_wallet/themes/core/theme_store.dart';
43 import 'package:cake_wallet/view_model/dev/monero_background_sync.dart';
44 import 'package:cake_wallet/view_model/dev/secure_preferences.dart';
45 import 'package:cake_wallet/view_model/dev/shared_preferences.dart';
@@ -152,11 +153,9 @@ import 'package:cake_wallet/src/screens/wallet/wallet_edit_page.dart';
153 import 'package:cake_wallet/src/screens/wallet_connect/wc_connections_listing_view.dart';
154 import 'package:cake_wallet/src/screens/wallet_unlock/wallet_unlock_arguments.dart';
155 import 'package:cake_wallet/src/screens/wallet_unlock/wallet_unlock_page.dart';
155 -import 'package:cake_wallet/themes/theme_list.dart';
156 import 'package:cake_wallet/utils/device_info.dart';
157 import 'package:cake_wallet/store/anonpay/anonpay_transactions_store.dart';
158 import 'package:cake_wallet/utils/payment_request.dart';
159 -import 'package:cake_wallet/utils/responsive_layout_util.dart';
159 import 'package:cake_wallet/view_model/buy/buy_sell_view_model.dart';
160 import 'package:cake_wallet/view_model/animated_ur_model.dart';
161 import 'package:cake_wallet/view_model/dashboard/desktop_sidebar_view_model.dart';
@@ -325,6 +324,11 @@ Future<void> setup({
324 if (!_isSetupFinished) {
325 getIt.registerSingletonAsync<SharedPreferences>(() => SharedPreferences.getInstance());
326 getIt.registerSingleton<SecureStorage>(secureStorage);
327 + getIt.registerSingletonAsync<ThemeStore>(() async {
328 + final store = ThemeStore();
329 + await store.loadThemePreferences();
330 + return store;
331 + });
332 }
333
334 final isBitcoinBuyEnabled = (secrets.wyreSecretKey.isNotEmpty) &&
@@ -335,10 +339,6 @@ Future<void> setup({
339 nodeSource: _nodeSource,
340 powNodeSource: _powNodeSource,
341 isBitcoinBuyEnabled: isBitcoinBuyEnabled,
338 - // Enforce darkTheme on platforms other than mobile till the design for other themes is completed
339 - initialTheme: responsiveLayoutUtil.shouldRenderMobileUI && DeviceInfo.instance.isMobile
340 - ? null
341 - : ThemeList.darkTheme,
342 );
343
344 if (_isSetupFinished) {
@@ -356,7 +356,8 @@ Future<void> setup({
356 authenticationStore: getIt.get<AuthenticationStore>(),
357 walletList: getIt.get<WalletListStore>(),
358 settingsStore: getIt.get<SettingsStore>(),
359 - nodeListStore: getIt.get<NodeListStore>()));
359 + nodeListStore: getIt.get<NodeListStore>(),
360 + themeStore: getIt.get<ThemeStore>()));
361 getIt.registerSingleton<TradesStore>(
362 TradesStore(tradesSource: _tradesSource, settingsStore: getIt.get<SettingsStore>()));
363 getIt.registerSingleton<OrdersStore>(
@@ -901,7 +902,7 @@ Future<void> setup({
902 getIt.get<NanoAccountEditOrCreateViewModel>(param1: account)));
903
904 getIt.registerFactory(() =>
904 - DisplaySettingsViewModel(getIt.get<SettingsStore>()));
905 + DisplaySettingsViewModel(getIt.get<SettingsStore>(), getIt.get<ThemeStore>()));
906
907 getIt.registerFactory(() =>
908 SilentPaymentsSettingsViewModel(getIt.get<SettingsStore>(), getIt.get<AppStore>().wallet!));
@@ -1030,13 +1031,13 @@ Future<void> setup({
1031 getIt.get<AppStore>().wallet!.isHardwareWallet ? getIt.get<LedgerViewModel>() : null));
1032
1033 getIt.registerFactory<MoonPayProvider>(() => MoonPayProvider(
1033 - settingsStore: getIt.get<AppStore>().settingsStore,
1034 + appStore: getIt.get<AppStore>(),
1035 wallet: getIt.get<AppStore>().wallet!,
1036 isTestEnvironment: kDebugMode,
1037 ));
1038
1039 getIt.registerFactory<OnRamperBuyProvider>(() => OnRamperBuyProvider(
1039 - getIt.get<AppStore>().settingsStore,
1040 + getIt.get<ThemeStore>(),
1041 wallet: getIt.get<AppStore>().wallet!,
1042 ));
1043
@@ -1056,7 +1057,7 @@ Future<void> setup({
1057 _tradesSource,
1058 getIt.get<ExchangeTemplateStore>(),
1059 getIt.get<TradesStore>(),
1059 - getIt.get<AppStore>().settingsStore,
1060 + getIt.get<SettingsStore>(),
1061 getIt.get<SharedPreferences>(),
1062 getIt.get<ContactListViewModel>(),
1063 getIt.get<FeesViewModel>(),
@@ -1236,7 +1237,7 @@ Future<void> setup({
1237 TradeDetailsViewModel(
1238 tradeForDetails: trade,
1239 trades: _tradesSource,
1239 - settingsStore: getIt.get<SettingsStore>()));
1240 + appStore: getIt.get<AppStore>()));
1241
1242 getIt.registerFactory(() => CakeFeaturesViewModel(getIt.get<CakePayService>()));
1243
@@ -1431,7 +1432,7 @@ Future<void> setup({
1432 (AnonpayInvoiceInfo anonpayInvoiceInfo, _) => AnonpayDetailsViewModel(
1433 anonPayApi: getIt.get<AnonPayApi>(),
1434 anonpayInvoiceInfo: anonpayInvoiceInfo,
1434 - settingsStore: getIt.get<SettingsStore>(),
1435 + themeStore: getIt.get<ThemeStore>(),
1436 ));
1437
1438 getIt.registerFactoryParam<PayjoinDetailsViewModel, String, TransactionInfo?>(
@@ -1440,7 +1441,7 @@ Future<void> setup({
1441 sessionId,
1442 transactionInfo,
1443 payjoinSessionSource: _payjoinSessionSource,
1443 - settingsStore: getIt.get<SettingsStore>(),
1444 + themeStore: getIt.get<ThemeStore>(),
1445 ));
1446
1447 getIt.registerFactoryParam<AnonPayReceivePage, AnonpayInfoBase, void>(
lib/entities/main_actions.dart
+5 -5
@@ -29,7 +29,7 @@ class MainActions {
29
30 static MainActions showWalletsAction = MainActions._(
31 name: (context) => S.of(context).wallets,
32 - image: 'assets/images/wallet_new.png',
32 + image: 'assets/images/wallet_icon.png',
33 onTap: (BuildContext context, DashboardViewModel viewModel) async {
34 Navigator.pushNamed(
35 context,
@@ -42,7 +42,7 @@ class MainActions {
42
43 static MainActions receiveAction = MainActions._(
44 name: (context) => S.of(context).receive,
45 - image: 'assets/images/received.png',
45 + image: 'assets/images/receive.png',
46 onTap: (BuildContext context, DashboardViewModel viewModel) async {
47 Navigator.pushNamed(context, Routes.addressPage);
48 },
@@ -50,7 +50,7 @@ class MainActions {
50
51 static MainActions swapAction = MainActions._(
52 name: (context) => S.of(context).swap,
53 - image: 'assets/images/transfer.png',
53 + image: 'assets/images/swap.png',
54 isEnabled: (viewModel) => viewModel.isEnabledSwapAction,
55 canShow: (viewModel) => viewModel.hasSwapAction,
56 onTap: (BuildContext context, DashboardViewModel viewModel) async {
@@ -62,7 +62,7 @@ class MainActions {
62
63 static MainActions sendAction = MainActions._(
64 name: (context) => S.of(context).send,
65 - image: 'assets/images/upload.png',
65 + image: 'assets/images/send2.png',
66 isEnabled: (viewModel) => viewModel.canSend,
67 onTap: (BuildContext context, DashboardViewModel viewModel) async {
68 Navigator.pushNamed(context, Routes.send);
@@ -71,7 +71,7 @@ class MainActions {
71
72 static MainActions tradeAction = MainActions._(
73 name: (context) => S.of(context).buy,
74 - image: 'assets/images/buy_sell.png',
74 + image: 'assets/images/buy.png',
75 isEnabled: (viewModel) => viewModel.isEnabledTradeAction,
76 canShow: (viewModel) => viewModel.hasTradeAction,
77 onTap: (BuildContext context, DashboardViewModel viewModel) async {
lib/entities/preferences_key.dart
+1
@@ -34,6 +34,7 @@ class PreferencesKey {
34 static const disableExchangeKey = 'disable_exchange';
35 static const exchangeStatusKey = 'exchange_status';
36 static const currentTheme = 'current_theme';
37 + static const themeMode = 'theme_mode';
38 static const displayActionListModeKey = 'display_list_mode';
39 static const currentPinLength = 'current_pin_length';
40 static const currentLanguageCode = 'language_code';
lib/entities/qr_scanner.dart
+18 -17
@@ -15,7 +15,7 @@ Future<String?> presentQRScanner(BuildContext context) async {
15 try {
16 final result = await Navigator.of(context).push<String>(
17 MaterialPageRoute(
18 - builder:(context) {
18 + builder: (context) {
19 return BarcodeScannerSimple();
20 },
21 ),
@@ -67,7 +67,7 @@ class _BarcodeScannerSimpleState extends State<BarcodeScannerSimple> {
67 void _handleBarcodeInternal(BarcodeCapture barcodes) {
68 for (final barcode in barcodes.barcodes) {
69 // don't handle unknown QR codes
70 - if (barcode.rawValue?.trim().isEmpty??false == false) continue;
70 + if (barcode.rawValue?.trim().isEmpty ?? false == false) continue;
71 if (barcode.rawValue!.startsWith("ur:")) {
72 if (urCodes.contains(barcode.rawValue)) continue;
73 setState(() {
@@ -81,7 +81,8 @@ class _BarcodeScannerSimpleState extends State<BarcodeScannerSimple> {
81 SchedulerBinding.instance.addPostFrameCallback((_) {
82 Navigator.of(context).pop(ur.inputs.join("\n"));
83 });
84 - };
84 + }
85 + ;
86 }
87 }
88 if (urCodes.isNotEmpty) return;
@@ -110,18 +111,21 @@ class _BarcodeScannerSimpleState extends State<BarcodeScannerSimple> {
111 ToggleFlashlightButton(controller: ctrl),
112 ],
113 ),
113 - backgroundColor: Colors.black,
114 + backgroundColor: Theme.of(context).colorScheme.surface,
115 body: Stack(
116 children: [
117 MobileScanner(
118 onDetect: _handleBarcode,
119 controller: ctrl,
120 ),
120 - if (ur.inputs.length != 0)
121 - Center(child:
122 - Text(
121 + if (ur.inputs.length != 0)
122 + Center(
123 + child: Text(
124 "${ur.inputs.length}/${ur.count}",
124 - style: Theme.of(context).textTheme.displayLarge?.copyWith(color: Colors.white)
125 + style: Theme.of(context)
126 + .textTheme
127 + .displayLarge
128 + ?.copyWith(color: Theme.of(context).colorScheme.onSurface),
129 ),
130 ),
131 SizedBox(
@@ -158,7 +162,6 @@ class _BarcodeScannerSimpleState extends State<BarcodeScannerSimple> {
162 }
163 }
164
161 -
165 class ToggleFlashlightButton extends StatelessWidget {
166 const ToggleFlashlightButton({required this.controller, super.key});
167
@@ -199,9 +202,9 @@ class ToggleFlashlightButton extends StatelessWidget {
202 },
203 );
204 case TorchState.unavailable:
202 - return const Icon(
205 + return Icon(
206 Icons.no_flash,
204 - color: Colors.grey,
207 + color: Theme.of(context).colorScheme.onSurfaceVariant,
208 );
209 }
210 },
@@ -326,16 +329,14 @@ class ProgressPainter extends CustomPainter {
329 const fullAngle = 360.0;
330 var startAngle = 0.0;
331 for (int i = 0; i < urQrProgress.expectedPartCount.toInt(); i++) {
329 - var sweepAngle =
330 - (1 / urQrProgress.expectedPartCount) * fullAngle * pi / 180.0;
331 - drawSector(canvas, urQrProgress.receivedPartIndexes.contains(i), rect,
332 - startAngle, sweepAngle);
332 + var sweepAngle = (1 / urQrProgress.expectedPartCount) * fullAngle * pi / 180.0;
333 + drawSector(
334 + canvas, urQrProgress.receivedPartIndexes.contains(i), rect, startAngle, sweepAngle);
335 startAngle += sweepAngle;
336 }
337 }
338
337 - void drawSector(Canvas canvas, bool isActive, Rect rect, double startAngle,
338 - double sweepAngle) {
339 + void drawSector(Canvas canvas, bool isActive, Rect rect, double startAngle, double sweepAngle) {
340 final paint = Paint()
341 ..style = PaintingStyle.stroke
342 ..strokeWidth = 8
lib/main.dart
+93 -60
@@ -25,7 +25,8 @@ import 'package:cake_wallet/routes.dart';
25 import 'package:cake_wallet/src/screens/root/root.dart';
26 import 'package:cake_wallet/store/app_store.dart';
27 import 'package:cake_wallet/store/authentication_store.dart';
28 -import 'package:cake_wallet/themes/theme_base.dart';
28 +import 'package:cake_wallet/themes/core/material_base_theme.dart';
29 +import 'package:cake_wallet/themes/utils/theme_provider.dart';
30 import 'package:cake_wallet/utils/device_info.dart';
31 import 'package:cake_wallet/utils/exception_handler.dart';
32 import 'package:cake_wallet/view_model/link_view_model.dart';
@@ -206,8 +207,7 @@ Future<void> initializeAppConfigs({bool loadWallet = true}) async {
207
208 final havenSeedStoreBoxKey =
209 await getEncryptionKey(secureStorage: secureStorage, forKey: HavenSeedStore.boxKey);
209 - final havenSeedStore = await CakeHive.openBox<HavenSeedStore>(
210 - HavenSeedStore.boxName,
210 + final havenSeedStore = await CakeHive.openBox<HavenSeedStore>(HavenSeedStore.boxName,
211 encryptionKey: havenSeedStoreBoxKey);
212
213 await initialSetup(
@@ -232,25 +232,26 @@ Future<void> initializeAppConfigs({bool loadWallet = true}) async {
232 );
233 }
234
235 -Future<void> initialSetup(
236 - {required bool loadWallet,
237 - required SharedPreferences sharedPreferences,
238 - required Box<Node> nodes,
239 - required Box<Node> powNodes,
240 - required Box<WalletInfo> walletInfoSource,
241 - required Box<Contact> contactSource,
242 - required Box<Trade> tradesSource,
243 - required Box<Order> ordersSource,
244 - // required FiatConvertationService fiatConvertationService,
245 - required Box<Template> templates,
246 - required Box<ExchangeTemplate> exchangeTemplates,
247 - required Box<TransactionDescription> transactionDescriptions,
248 - required SecureStorage secureStorage,
249 - required Box<AnonpayInvoiceInfo> anonpayInvoiceInfo,
250 - required Box<UnspentCoinsInfo> unspentCoinsInfoSource,
251 - required Box<PayjoinSession> payjoinSessionSource,
252 - required Box<HavenSeedStore> havenSeedStore,
253 - int initialMigrationVersion = 15, }) async {
235 +Future<void> initialSetup({
236 + required bool loadWallet,
237 + required SharedPreferences sharedPreferences,
238 + required Box<Node> nodes,
239 + required Box<Node> powNodes,
240 + required Box<WalletInfo> walletInfoSource,
241 + required Box<Contact> contactSource,
242 + required Box<Trade> tradesSource,
243 + required Box<Order> ordersSource,
244 + // required FiatConvertationService fiatConvertationService,
245 + required Box<Template> templates,
246 + required Box<ExchangeTemplate> exchangeTemplates,
247 + required Box<TransactionDescription> transactionDescriptions,
248 + required SecureStorage secureStorage,
249 + required Box<AnonpayInvoiceInfo> anonpayInvoiceInfo,
250 + required Box<UnspentCoinsInfo> unspentCoinsInfoSource,
251 + required Box<PayjoinSession> payjoinSessionSource,
252 + required Box<HavenSeedStore> havenSeedStore,
253 + int initialMigrationVersion = 15,
254 +}) async {
255 LanguageService.loadLocaleList();
256 await defaultSettingsMigration(
257 secureStorage: secureStorage,
@@ -289,50 +290,78 @@ class App extends StatefulWidget {
290 AppState createState() => AppState();
291 }
292
292 -class AppState extends State<App> with SingleTickerProviderStateMixin {
293 +class AppState extends State<App> with SingleTickerProviderStateMixin, WidgetsBindingObserver {
294 + @override
295 + void initState() {
296 + super.initState();
297 + WidgetsBinding.instance.addObserver(this);
298 + }
299 +
300 + @override
301 + void dispose() {
302 + WidgetsBinding.instance.removeObserver(this);
303 + super.dispose();
304 + }
305 +
306 + @override
307 + void didChangePlatformBrightness() {
308 + final appStore = getIt.get<AppStore>();
309 + if (appStore.themeStore.themeMode == ThemeMode.system) {
310 + final systemTheme = appStore.themeStore.getThemeFromSystem();
311 + if (appStore.themeStore.currentTheme != systemTheme) {
312 + appStore.themeStore.setTheme(systemTheme);
313 + }
314 + }
315 + }
316 +
317 @override
318 Widget build(BuildContext context) {
295 - return Observer(builder: (BuildContext context) {
296 - final appStore = getIt.get<AppStore>();
297 - final authService = getIt.get<AuthService>();
298 - final linkViewModel = getIt.get<LinkViewModel>();
299 - final settingsStore = appStore.settingsStore;
300 - final statusBarColor = Colors.transparent;
301 - final authenticationStore = getIt.get<AuthenticationStore>();
302 - final initialRoute = authenticationStore.state == AuthenticationState.uninitialized
303 - ? Routes.welcome
304 - : Routes.login;
305 - final currentTheme = settingsStore.currentTheme;
306 - final statusBarBrightness =
307 - currentTheme.type == ThemeType.dark ? Brightness.light : Brightness.dark;
308 - final statusBarIconBrightness =
309 - currentTheme.type == ThemeType.dark ? Brightness.light : Brightness.dark;
310 - SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
311 - statusBarColor: statusBarColor,
312 - statusBarBrightness: statusBarBrightness,
313 - statusBarIconBrightness: statusBarIconBrightness));
314 -
315 - return Root(
319 + return Observer(
320 + builder: (BuildContext context) {
321 + final appStore = getIt.get<AppStore>();
322 + final authService = getIt.get<AuthService>();
323 + final linkViewModel = getIt.get<LinkViewModel>();
324 + final statusBarColor = Colors.transparent;
325 + final authenticationStore = getIt.get<AuthenticationStore>();
326 + final initialRoute = authenticationStore.state == AuthenticationState.uninitialized
327 + ? Routes.welcome
328 + : Routes.login;
329 + final currentTheme = appStore.themeStore.currentTheme;
330 + final statusBarBrightness = currentTheme.isDark ? Brightness.light : Brightness.dark;
331 + final statusBarIconBrightness = currentTheme.isDark ? Brightness.light : Brightness.dark;
332 + SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
333 + statusBarColor: statusBarColor,
334 + statusBarBrightness: statusBarBrightness,
335 + statusBarIconBrightness: statusBarIconBrightness));
336 +
337 + return Root(
338 key: widget.key ?? rootKey,
339 appStore: appStore,
340 authenticationStore: authenticationStore,
341 navigatorKey: navigatorKey,
342 authService: authService,
343 linkViewModel: linkViewModel,
322 - child: MaterialApp(
323 - navigatorObservers: [routeObserver],
324 - navigatorKey: navigatorKey,
325 - debugShowCheckedModeBanner: false,
326 - theme: settingsStore.theme,
327 - localizationsDelegates: localizationDelegates,
328 - supportedLocales: S.delegate.supportedLocales,
329 - locale: Locale(settingsStore.languageCode),
330 - onGenerateRoute: (settings) => Router.createRoute(settings),
331 - initialRoute: initialRoute,
332 - scrollBehavior: AppScrollBehavior(),
333 - home: _Home(),
334 - ));
335 - });
344 + child: ThemeProvider(
345 + themeStore: appStore.themeStore,
346 + materialAppBuilder: (context, theme, darkTheme, themeMode) => MaterialApp(
347 + navigatorObservers: [routeObserver],
348 + navigatorKey: navigatorKey,
349 + debugShowCheckedModeBanner: false,
350 + theme: theme,
351 + darkTheme: darkTheme,
352 + themeMode: themeMode,
353 + localizationsDelegates: localizationDelegates,
354 + supportedLocales: S.delegate.supportedLocales,
355 + locale: Locale(appStore.settingsStore.languageCode),
356 + onGenerateRoute: (settings) => Router.createRoute(settings),
357 + initialRoute: initialRoute,
358 + scrollBehavior: AppScrollBehavior(),
359 + home: _Home(),
360 + ),
361 + ),
362 + );
363 + },
364 + );
365 }
366 }
367
@@ -392,11 +421,15 @@ class TopLevelErrorWidget extends StatelessWidget {
421 children: [
422 Text(
423 'Error:\n${error.toString()}',
395 - style: TextStyle(fontSize: 22),
424 + style: Theme.of(context).textTheme.bodyLarge!.copyWith(
425 + fontSize: 22,
426 + ),
427 ),
428 Text(
429 'Stack trace:\n${stackTrace.toString()}',
399 - style: TextStyle(fontSize: 16),
430 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
431 + fontSize: 16,
432 + ),
433 ),
434 ],
435 ),
lib/router.dart
+220 -92
@@ -1,3 +1,5 @@
1 +import 'dart:io';
2 +
3 import 'package:cake_wallet/anonpay/anonpay_info_base.dart';
4 import 'package:cake_wallet/anonpay/anonpay_invoice_info.dart';
5 import 'package:cake_wallet/core/new_wallet_arguments.dart';
@@ -160,7 +162,13 @@ Route<dynamic> createRoute(RouteSettings settings) {
162 if (SettingsStoreBase.walletPasswordDirectInput) {
163 return createRoute(RouteSettings(name: Routes.welcomePage));
164 }
163 - return CupertinoPageRoute<void>(
165 + if (Platform.isIOS) return CupertinoPageRoute<void>(
166 + builder: (_) =>
167 + getIt.get<SetupPinCodePage>(param1: (PinCodeState<PinCodeWidget> context, dynamic _) {
168 + Navigator.of(context.context).pushNamed(Routes.welcomePage);
169 + }),
170 + fullscreenDialog: true);
171 + else return MaterialPageRoute<void>(
172 builder: (_) =>
173 getIt.get<SetupPinCodePage>(param1: (PinCodeState<PinCodeWidget> context, dynamic _) {
174 Navigator.of(context.context).pushNamed(Routes.welcomePage);
@@ -182,26 +190,44 @@ Route<dynamic> createRoute(RouteSettings settings) {
190 return createRoute(RouteSettings(name: Routes.newWalletType));
191
192 case Routes.newWalletType:
185 - return CupertinoPageRoute<void>(
186 - builder: (_) => getIt.get<NewWalletTypePage>(
187 - param1: NewWalletTypeArguments(
188 - onTypeSelected: (BuildContext context, WalletType type) =>
189 - Navigator.of(context).pushNamed(
190 - Routes.newWallet,
191 - arguments: NewWalletArguments(type: type),
193 + if (Platform.isIOS) {
194 + return CupertinoPageRoute<void>(
195 + builder: (_) => getIt.get<NewWalletTypePage>(
196 + param1: NewWalletTypeArguments(
197 + onTypeSelected: (BuildContext context, WalletType type) =>
198 + Navigator.of(context).pushNamed(
199 + Routes.newWallet,
200 + arguments: NewWalletArguments(type: type),
201 + ),
202 + isCreate: true,
203 + isHardwareWallet: false,
204 ),
193 - isCreate: true,
194 - isHardwareWallet: false,
205 ),
196 - ),
197 - );
206 + );
207 + } else {
208 + return MaterialPageRoute<void>(
209 + builder: (_) => getIt.get<NewWalletTypePage>(
210 + param1: NewWalletTypeArguments(
211 + onTypeSelected: (BuildContext context, WalletType type) =>
212 + Navigator.of(context).pushNamed(
213 + Routes.newWallet,
214 + arguments: NewWalletArguments(type: type),
215 + ),
216 + isCreate: true,
217 + isHardwareWallet: false,
218 + ),
219 + ),
220 + );
221 + }
222 +
223
224 case Routes.walletGroupsDisplayPage:
225 final type = settings.arguments as WalletType;
226 final walletGroupsDisplayVM = getIt.get<WalletGroupsDisplayViewModel>(param1: type);
227
203 - return CupertinoPageRoute<void>(
204 - builder: (_) => WalletGroupsDisplayPage(walletGroupsDisplayVM));
228 + if (Platform.isIOS) return CupertinoPageRoute<void>(builder: (_) => WalletGroupsDisplayPage(walletGroupsDisplayVM));
229 + else return MaterialPageRoute<void>(builder: (_) => WalletGroupsDisplayPage(walletGroupsDisplayVM));
230 +
231
232 case Routes.newWallet:
233 final args = settings.arguments as NewWalletArguments;
@@ -209,7 +235,14 @@ Route<dynamic> createRoute(RouteSettings settings) {
235 final walletNewVM = getIt.get<WalletNewVM>(param1: args);
236 final seedSettingsViewModel = getIt.get<SeedSettingsViewModel>();
237
212 - return CupertinoPageRoute<void>(
238 + if (Platform.isIOS) return CupertinoPageRoute<void>(
239 + builder: (_) => NewWalletPage(
240 + walletNewVM,
241 + seedSettingsViewModel,
242 + isChildWallet: args.isChildWallet,
243 + ),
244 + );
245 + else return MaterialPageRoute<void>(
246 builder: (_) => NewWalletPage(
247 walletNewVM,
248 seedSettingsViewModel,
@@ -234,16 +267,27 @@ Route<dynamic> createRoute(RouteSettings settings) {
267 callback = settings.arguments as Function(PinCodeState<PinCodeWidget>, String);
268 }
269
237 - return CupertinoPageRoute<void>(
238 - builder: (_) => getIt.get<SetupPinCodePage>(param1: callback));
270 + if (Platform.isIOS) return CupertinoPageRoute<void>(builder: (_) => getIt.get<SetupPinCodePage>(param1: callback));
271 + else return MaterialPageRoute<void>(builder: (_) => getIt.get<SetupPinCodePage>(param1: callback));
272
273 case Routes.restoreWalletType:
241 - return CupertinoPageRoute<void>(
274 + if (Platform.isIOS) return CupertinoPageRoute<void>(
275 builder: (_) => getIt.get<NewWalletTypePage>(
276 param1: NewWalletTypeArguments(
277 onTypeSelected: (BuildContext context, WalletType type) {
278 final arg = {'walletType': type};
246 - Navigator.of(context).pushNamed(Routes.restoreWallet, arguments: arg);},
279 + Navigator.of(context).pushNamed(Routes.restoreWallet, arguments: arg);},
280 + isCreate: false,
281 + isHardwareWallet: false,
282 + ),
283 + ),
284 + );
285 + else return MaterialPageRoute<void>(
286 + builder: (_) => getIt.get<NewWalletTypePage>(
287 + param1: NewWalletTypeArguments(
288 + onTypeSelected: (BuildContext context, WalletType type) {
289 + final arg = {'walletType': type};
290 + Navigator.of(context).pushNamed(Routes.restoreWallet, arguments: arg);},
291 isCreate: false,
292 isHardwareWallet: false,
293 ),
@@ -256,15 +300,21 @@ Route<dynamic> createRoute(RouteSettings settings) {
300 }
301
302 final isNewInstall = settings.arguments as bool;
259 - return CupertinoPageRoute<void>(
260 - fullscreenDialog: true,
261 - builder: (_) => getIt.get<RestoreOptionsPage>(param1: isNewInstall));
303 + if (Platform.isIOS) {
304 + return CupertinoPageRoute<void>(builder: (context) => getIt.get<RestoreOptionsPage>(param1: isNewInstall));
305 + } else {
306 + return MaterialPageRoute<void>(builder: (context) => getIt.get<RestoreOptionsPage>(param1: isNewInstall));
307 + }
308
309 case Routes.restoreWalletFromSeedKeys:
310 if (isSingleCoin) {
265 - return CupertinoPageRoute<void>(
266 - builder: (_) => getIt.get<WalletRestorePage>(param1: availableWalletTypes.first));
311 + if (Platform.isIOS) {
312 + return CupertinoPageRoute<void>(builder: (context) => getIt.get<WalletRestorePage>(param1: availableWalletTypes.first));
313 + } else {
314 + return MaterialPageRoute<void>(builder: (context) => getIt.get<WalletRestorePage>(param1: availableWalletTypes.first));
315 + }
316 }
317 + if (Platform.isIOS) {
318 return CupertinoPageRoute<void>(
319 builder: (_) => getIt.get<NewWalletTypePage>(
320 param1: NewWalletTypeArguments(
@@ -276,6 +326,19 @@ Route<dynamic> createRoute(RouteSettings settings) {
326 ),
327 ),
328 );
329 + } else {
330 + return MaterialPageRoute<void>(
331 + builder: (_) => getIt.get<NewWalletTypePage>(
332 + param1: NewWalletTypeArguments(
333 + onTypeSelected: (BuildContext context, WalletType type) {
334 + final arg = {'walletType': type};
335 + Navigator.of(context).pushNamed(Routes.restoreWallet, arguments: arg);},
336 + isCreate: false,
337 + isHardwareWallet: false,
338 + ),
339 + ),
340 + );
341 + }
342
343 case Routes.restoreWalletFromHardwareWallet:
344 if (isSingleCoin) {
@@ -328,9 +391,11 @@ Route<dynamic> createRoute(RouteSettings settings) {
391 );
392
393 case Routes.seed:
331 - return MaterialPageRoute<void>(
332 - fullscreenDialog: true,
333 - builder: (_) => getIt.get<WalletSeedPage>(param1: settings.arguments as bool));
394 + if (Platform.isIOS) {
395 + return CupertinoPageRoute<void>(builder: (context) => getIt.get<WalletSeedPage>(param1: settings.arguments as bool));
396 + } else {
397 + return MaterialPageRoute<void>(builder: (context) => getIt.get<WalletSeedPage>(param1: settings.arguments as bool));
398 + }
399
400 case Routes.restoreWallet:
401 final args = settings.arguments as Map<String, dynamic>?;
@@ -356,24 +421,29 @@ Route<dynamic> createRoute(RouteSettings settings) {
421 final initialPaymentRequest = args?['paymentRequest'] as PaymentRequest?;
422 final coinTypeToSpendFrom = args?['coinTypeToSpendFrom'] as UnspentCoinType?;
423
359 - return CupertinoPageRoute<void>(
360 - fullscreenDialog: true,
361 - builder: (_) => getIt.get<SendPage>(
424 + if (Platform.isIOS) {
425 + return CupertinoPageRoute<void>(builder: (context) => getIt.get<SendPage>(
426 param1: initialPaymentRequest,
427 param2: coinTypeToSpendFrom,
364 - ),
365 - );
428 + ));
429 + } else {
430 + return MaterialPageRoute<void>(builder: (context) => getIt.get<SendPage>(
431 + param1: initialPaymentRequest,
432 + param2: coinTypeToSpendFrom,
433 + ));
434 + }
435
436 case Routes.sendTemplate:
437 return CupertinoPageRoute<void>(
438 fullscreenDialog: true, builder: (_) => getIt.get<SendTemplatePage>());
439
440 case Routes.receive:
372 - return CupertinoPageRoute<void>(builder: (_) => getIt.get<ReceivePage>());
441 + return CupertinoPageRoute<void>(builder: (context) => getIt.get<ReceivePage>());
442
443 case Routes.addressPage:
375 - return CupertinoPageRoute<void>(
376 - fullscreenDialog: true, builder: (_) => getIt.get<AddressPage>());
444 + if (Platform.isIOS) return CupertinoPageRoute<void>(builder: (context) => getIt.get<AddressPage>());
445 + else return MaterialPageRoute<void>(builder: (context) => getIt.get<AddressPage>());
446 +
447
448 case Routes.transactionDetails:
449 return CupertinoPageRoute<void>(
@@ -459,32 +529,41 @@ Route<dynamic> createRoute(RouteSettings settings) {
529 onWillPop: () async => false));
530
531 case Routes.silentPaymentsSettings:
462 - return CupertinoPageRoute<void>(
463 - fullscreenDialog: true, builder: (_) => getIt.get<SilentPaymentsSettingsPage>());
532 + if (Platform.isIOS) return CupertinoPageRoute<void>(builder: (context) => getIt.get<SilentPaymentsSettingsPage>());
533 + else return MaterialPageRoute<void>(builder: (context) => getIt.get<SilentPaymentsSettingsPage>());
534
535 case Routes.mwebSettings:
466 - return CupertinoPageRoute<void>(
467 - fullscreenDialog: true, builder: (_) => getIt.get<MwebSettingsPage>());
536 + if (Platform.isIOS) return CupertinoPageRoute<void>(builder: (context) => getIt.get<MwebSettingsPage>());
537 + else return MaterialPageRoute<void>(builder: (context) => getIt.get<MwebSettingsPage>());
538
539 case Routes.mwebLogs:
470 - return CupertinoPageRoute<void>(
471 - fullscreenDialog: true, builder: (_) => getIt.get<MwebLogsPage>());
540 + if (Platform.isIOS) return CupertinoPageRoute<void>(builder: (context) => getIt.get<MwebLogsPage>());
541 + else return MaterialPageRoute<void>(builder: (context) => getIt.get<MwebLogsPage>());
542
543 case Routes.mwebNode:
474 - return CupertinoPageRoute<void>(
475 - fullscreenDialog: true, builder: (_) => getIt.get<MwebNodePage>());
544 + if (Platform.isIOS) return CupertinoPageRoute<void>(builder: (context) => getIt.get<MwebNodePage>());
545 + else return MaterialPageRoute<void>(builder: (context) => getIt.get<MwebNodePage>());
546
547 case Routes.connectionSync:
478 - return CupertinoPageRoute<void>(
479 - fullscreenDialog: true, builder: (_) => getIt.get<ConnectionSyncPage>());
548 + if (Platform.isIOS) {
549 + return CupertinoPageRoute<void>(builder: (context) => getIt.get<ConnectionSyncPage>());
550 + } else {
551 + return MaterialPageRoute<void>(builder: (context) => getIt.get<ConnectionSyncPage>());
552 + }
553
554 case Routes.securityBackupPage:
482 - return CupertinoPageRoute<void>(
483 - fullscreenDialog: true, builder: (_) => getIt.get<SecurityBackupPage>());
555 + if (Platform.isIOS) {
556 + return CupertinoPageRoute<void>(builder: (context) => getIt.get<SecurityBackupPage>());
557 + } else {
558 + return MaterialPageRoute<void>(builder: (context) => getIt.get<SecurityBackupPage>());
559 + }
560
561 case Routes.privacyPage:
486 - return CupertinoPageRoute<void>(
487 - fullscreenDialog: true, builder: (_) => getIt.get<PrivacyPage>());
562 + if (Platform.isIOS) {
563 + return CupertinoPageRoute<void>(builder: (context) => getIt.get<PrivacyPage>());
564 + } else {
565 + return MaterialPageRoute<void>(builder: (context) => getIt.get<PrivacyPage>());
566 + }
567
568 case Routes.trocadorProvidersPage:
569 return CupertinoPageRoute<void>(
@@ -495,12 +574,18 @@ Route<dynamic> createRoute(RouteSettings settings) {
574 fullscreenDialog: true, builder: (_) => getIt.get<DomainLookupsPage>());
575
576 case Routes.displaySettingsPage:
498 - return CupertinoPageRoute<void>(
499 - fullscreenDialog: true, builder: (_) => getIt.get<DisplaySettingsPage>());
577 + if (Platform.isIOS) {
578 + return CupertinoPageRoute<void>(builder: (context) => getIt.get<DisplaySettingsPage>());
579 + } else {
580 + return MaterialPageRoute<void>(builder: (context) => getIt.get<DisplaySettingsPage>());
581 + }
582
583 case Routes.otherSettingsPage:
502 - return CupertinoPageRoute<void>(
503 - fullscreenDialog: true, builder: (_) => getIt.get<OtherSettingsPage>());
584 + if (Platform.isIOS) {
585 + return CupertinoPageRoute<void>(builder: (context) => getIt.get<OtherSettingsPage>());
586 + } else {
587 + return MaterialPageRoute<void>(builder: (context) => getIt.get<OtherSettingsPage>());
588 + }
589
590 case Routes.newNode:
591 final args = settings.arguments as Map<String, dynamic>?;
@@ -537,8 +622,12 @@ Route<dynamic> createRoute(RouteSettings settings) {
622 getIt.get<NanoAccountEditOrCreatePage>(param1: settings.arguments as NanoAccount?));
623
624 case Routes.addressBook:
540 - return MaterialPageRoute<void>(
541 - fullscreenDialog: true, builder: (_) => getIt.get<ContactListPage>());
625 + if (Platform.isIOS) {
626 + return CupertinoPageRoute<void>(builder: (context) => getIt.get<ContactListPage>());
627 + } else {
628 + return MaterialPageRoute<void>(builder: (context) => getIt.get<ContactListPage>());
629 + }
630 +
631
632 case Routes.pickerAddressBook:
633 final selectedCurrency = settings.arguments as CryptoCurrency?;
@@ -549,12 +638,19 @@ Route<dynamic> createRoute(RouteSettings settings) {
638 return MaterialPageRoute<void>(builder: (_) => getIt.get<AddressListPage>());
639
640 case Routes.addressBookAddContact:
552 - return CupertinoPageRoute<void>(
553 - builder: (_) => getIt.get<ContactPage>(param1: settings.arguments as ContactRecord?));
641 + if (Platform.isIOS) {
642 + return CupertinoPageRoute<void>(builder: (context) => getIt.get<ContactPage>(param1: settings.arguments as ContactRecord?));
643 + } else {
644 + return MaterialPageRoute<void>(builder: (context) => getIt.get<ContactPage>(param1: settings.arguments as ContactRecord?));
645 + }
646 +
647
648 case Routes.showKeys:
556 - return MaterialPageRoute<void>(
557 - builder: (_) => getIt.get<WalletKeysPage>(), fullscreenDialog: true);
649 + if (Platform.isIOS) {
650 + return CupertinoPageRoute<void>(builder: (context) => getIt.get<WalletKeysPage>());
651 + } else {
652 + return MaterialPageRoute<void>(builder: (context) => getIt.get<WalletKeysPage>());
653 + }
654
655 case Routes.exchangeTrade:
656 return CupertinoPageRoute<void>(builder: (_) => getIt.get<ExchangeTradePage>());
@@ -573,7 +669,11 @@ Route<dynamic> createRoute(RouteSettings settings) {
669
670 case Routes.buySellPage:
671 final args = settings.arguments as bool;
576 - return MaterialPageRoute<void>(builder: (_) => getIt.get<BuySellPage>(param1: args));
672 + if (Platform.isIOS) {
673 + return CupertinoPageRoute<void>(builder: (context) => getIt.get<BuySellPage>(param1: args));
674 + } else {
675 + return MaterialPageRoute<void>(builder: (context) => getIt.get<BuySellPage>(param1: args));
676 + }
677
678 case Routes.buyOptionsPage:
679 final args = settings.arguments as List;
@@ -590,10 +690,12 @@ Route<dynamic> createRoute(RouteSettings settings) {
690 fullscreenDialog: true, builder: (_) => getIt.get<BuyWebViewPage>(param1: args));
691
692 case Routes.exchange:
593 - return CupertinoPageRoute<void>(
594 - fullscreenDialog: true,
595 - builder: (_) => getIt.get<ExchangePage>(param1: settings.arguments as PaymentRequest?),
596 - );
693 + if (Platform.isIOS) {
694 + return CupertinoPageRoute<void>(builder: (context) => getIt.get<ExchangePage>(param1: settings.arguments as PaymentRequest?));
695 + } else {
696 + return MaterialPageRoute<void>(builder: (context) => getIt.get<ExchangePage>(param1: settings.arguments as PaymentRequest?));
697 + }
698 +
699
700 case Routes.exchangeTemplate:
701 return CupertinoPageRoute<void>(builder: (_) => getIt.get<ExchangeTemplatePage>());
@@ -615,8 +717,11 @@ Route<dynamic> createRoute(RouteSettings settings) {
717 builder: (_) => getIt.get<TransactionSuccessPage>(param1: settings.arguments as String));
718
719 case Routes.backup:
618 - return CupertinoPageRoute<void>(
619 - fullscreenDialog: true, builder: (_) => getIt.get<BackupPage>());
720 + if (Platform.isIOS) {
721 + return CupertinoPageRoute<void>(builder: (context) => getIt.get<BackupPage>());
722 + } else {
723 + return MaterialPageRoute<void>(builder: (context) => getIt.get<BackupPage>());
724 + }
725
726 case Routes.editBackupPassword:
727 return CupertinoPageRoute<void>(builder: (_) => getIt.get<EditBackupPasswordPage>());
@@ -626,15 +731,21 @@ Route<dynamic> createRoute(RouteSettings settings) {
731 fullscreenDialog: true, builder: (_) => getIt.get<RestoreFromBackupPage>());
732
733 case Routes.support:
629 - return CupertinoPageRoute<void>(
630 - fullscreenDialog: true, builder: (_) => getIt.get<SupportPage>());
734 + if (Platform.isIOS) {
735 + return CupertinoPageRoute<void>(builder: (context) => getIt.get<SupportPage>());
736 + } else {
737 + return MaterialPageRoute<void>(builder: (context) => getIt.get<SupportPage>());
738 + }
739
740 case Routes.supportLiveChat:
741 return CupertinoPageRoute<void>(builder: (_) => getIt.get<SupportChatPage>());
742
743 case Routes.supportOtherLinks:
636 - return CupertinoPageRoute<void>(
637 - fullscreenDialog: true, builder: (_) => getIt.get<SupportOtherLinksPage>());
744 + if (Platform.isIOS) {
745 + return CupertinoPageRoute<void>(builder: (context) => getIt.get<SupportOtherLinksPage>());
746 + } else {
747 + return MaterialPageRoute<void>(builder: (context) => getIt.get<SupportOtherLinksPage>());
748 + }
749
750 case Routes.unspentCoinsList:
751 final coinTypeToSpendFrom = settings.arguments as UnspentCoinType?;
@@ -654,29 +765,32 @@ Route<dynamic> createRoute(RouteSettings settings) {
765 ));
766
767 case Routes.cakePayCardsPage:
657 - return CupertinoPageRoute<void>(builder: (_) => getIt.get<CakePayCardsPage>());
768 + if (Platform.isIOS) return CupertinoPageRoute<void>(builder: (context) => getIt.get<CakePayCardsPage>());
769 + else return MaterialPageRoute<void>(builder: (context) => getIt.get<CakePayCardsPage>());
770 +
771
772 case Routes.cakePayBuyCardPage:
773 final args = settings.arguments as List;
661 - return CupertinoPageRoute<void>(builder: (_) => getIt.get<CakePayBuyCardPage>(param1: args));
774 + if (Platform.isIOS) return CupertinoPageRoute<void>(builder: (_) => getIt.get<CakePayBuyCardPage>(param1: args));
775 + else return MaterialPageRoute<void>(builder: (_) => getIt.get<CakePayBuyCardPage>(param1: args));
776
777 case Routes.cakePayBuyCardDetailPage:
778 final args = settings.arguments as List;
665 - return CupertinoPageRoute<void>(
666 - builder: (_) => getIt.get<CakePayBuyCardDetailPage>(param1: args));
779 + if (Platform.isIOS) return CupertinoPageRoute<void>(builder: (_) => getIt.get<CakePayBuyCardDetailPage>(param1: args));
780 + else return MaterialPageRoute<void>(builder: (_) => getIt.get<CakePayBuyCardDetailPage>(param1: args));
781
782 case Routes.cakePayWelcomePage:
669 - return CupertinoPageRoute<void>(
670 - builder: (_) => getIt.get<CakePayWelcomePage>(),
671 - );
783 + if (Platform.isIOS) return CupertinoPageRoute<void>(builder: (_) => getIt.get<CakePayWelcomePage>(),);
784 + else return MaterialPageRoute<void>(builder: (_) => getIt.get<CakePayWelcomePage>(),);
785
786 case Routes.cakePayVerifyOtpPage:
787 final args = settings.arguments as List;
675 - return CupertinoPageRoute<void>(
676 - builder: (_) => getIt.get<CakePayVerifyOtpPage>(param1: args));
788 + if (Platform.isIOS) return CupertinoPageRoute<void>(builder: (_) => getIt.get<CakePayVerifyOtpPage>(param1: args));
789 + else return MaterialPageRoute<void>(builder: (_) => getIt.get<CakePayVerifyOtpPage>(param1: args));
790
791 case Routes.cakePayAccountPage:
679 - return CupertinoPageRoute<void>(builder: (_) => getIt.get<CakePayAccountPage>());
792 + if (Platform.isIOS) return CupertinoPageRoute<void>(builder: (_) => getIt.get<CakePayAccountPage>());
793 + else return MaterialPageRoute<void>(builder: (_) => getIt.get<CakePayAccountPage>());
794
795 case Routes.webViewPage:
796 final args = settings.arguments as List;
@@ -694,17 +808,28 @@ Route<dynamic> createRoute(RouteSettings settings) {
808 final toggleTestnet = args['toggleTestnet'] as Function(bool? val);
809 final restoredWallet = args['restoredWallet'] as RestoredWallet?;
810
697 - return CupertinoPageRoute<void>(
811 + if (Platform.isIOS) return CupertinoPageRoute<void>(
812 builder: (_) => AdvancedPrivacySettingsPage(
699 - isFromRestore: isFromRestore,
700 - isChildWallet: isChildWallet,
701 - useTestnet: useTestnet,
702 - toggleUseTestnet: toggleTestnet,
703 - advancedPrivacySettingsViewModel:
704 - getIt.get<AdvancedPrivacySettingsViewModel>(param1: type),
705 - nodeViewModel: getIt.get<NodeCreateOrEditViewModel>(param1: type, param2: false),
706 - seedSettingsViewModel: getIt.get<SeedSettingsViewModel>(),
707 - ));
813 + isFromRestore: isFromRestore,
814 + isChildWallet: isChildWallet,
815 + useTestnet: useTestnet,
816 + toggleUseTestnet: toggleTestnet,
817 + advancedPrivacySettingsViewModel:
818 + getIt.get<AdvancedPrivacySettingsViewModel>(param1: type),
819 + nodeViewModel: getIt.get<NodeCreateOrEditViewModel>(param1: type, param2: false),
820 + seedSettingsViewModel: getIt.get<SeedSettingsViewModel>(),
821 + ));
822 + else return MaterialPageRoute<void>(
823 + builder: (_) => AdvancedPrivacySettingsPage(
824 + isFromRestore: isFromRestore,
825 + isChildWallet: isChildWallet,
826 + useTestnet: useTestnet,
827 + toggleUseTestnet: toggleTestnet,
828 + advancedPrivacySettingsViewModel:
829 + getIt.get<AdvancedPrivacySettingsViewModel>(param1: type),
830 + nodeViewModel: getIt.get<NodeCreateOrEditViewModel>(param1: type, param2: false),
831 + seedSettingsViewModel: getIt.get<SeedSettingsViewModel>(),
832 + ));
833
834 case Routes.anonPayInvoicePage:
835 final args = settings.arguments as List;
@@ -842,8 +967,11 @@ Route<dynamic> createRoute(RouteSettings settings) {
967 return MaterialPageRoute<void>(builder: (_) => getIt.get<ExchangeTradeExternalSendPage>(),);
968
969 case Routes.backgroundSync:
845 - return CupertinoPageRoute<void>(
846 - fullscreenDialog: true, builder: (_) => getIt.get<BackgroundSyncPage>());
970 + if (Platform.isIOS) {
971 + return CupertinoPageRoute<void>(builder: (context) => getIt.get<BackgroundSyncPage>());
972 + } else {
973 + return MaterialPageRoute<void>(builder: (context) => getIt.get<BackgroundSyncPage>());
974 + }
975 case Routes.devMoneroBackgroundSync:
976 return MaterialPageRoute<void>(
977 builder: (_) => getIt.get<DevMoneroBackgroundSyncPage>(),
lib/src/screens/Info_page.dart
+22 -18
@@ -1,7 +1,7 @@
1 import 'package:cake_wallet/src/screens/base_page.dart';
2 +import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
3 +import 'package:cake_wallet/src/widgets/gradient_background.dart';
4 import 'package:cake_wallet/src/widgets/primary_button.dart';
3 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
4 -import 'package:cake_wallet/themes/theme_base.dart';
5 import 'package:cake_wallet/utils/responsive_layout_util.dart';
6 import 'package:flutter/material.dart';
7
@@ -14,9 +14,6 @@ abstract class InfoPage extends BasePage {
14 final String imageLightPath;
15 final String imageDarkPath;
16
17 - Image get imageLight => Image.asset(imageLightPath);
18 - Image get imageDark => Image.asset(imageDarkPath);
19 -
17 bool get onWillPop => true;
18 String get pageTitle;
19 String get pageDescription;
@@ -24,6 +21,13 @@ abstract class InfoPage extends BasePage {
21 Key? get buttonKey;
22 void Function(BuildContext) get onPressed;
23
24 + @override
25 + bool get gradientBackground => true;
26 +
27 + @override
28 + Widget Function(BuildContext, Widget) get rootWrapper =>
29 + (BuildContext context, Widget scaffold) => GradientBackground(scaffold: scaffold);
30 +
31 @override
32 Widget? leading(BuildContext context) => null;
33
@@ -32,10 +36,10 @@ abstract class InfoPage extends BasePage {
36
37 @override
38 Widget body(BuildContext context) {
35 - final image = currentTheme.type == ThemeType.dark ? imageDark : imageLight;
39 + final image = currentTheme.isDark ? imageDarkPath : imageLightPath;
40
37 - return WillPopScope(
38 - onWillPop: () async => onWillPop,
41 + return PopScope(
42 + canPop: onWillPop,
43 child: Container(
44 alignment: Alignment.center,
45 padding: EdgeInsets.all(24),
@@ -47,8 +51,13 @@ abstract class InfoPage extends BasePage {
51 children: <Widget>[
52 Expanded(
53 child: ConstrainedBox(
50 - constraints: BoxConstraints(maxHeight: MediaQuery.of(context).size.height * 0.3),
51 - child: AspectRatio(aspectRatio: 1, child: image),
54 + constraints: BoxConstraints(
55 + maxHeight: MediaQuery.of(context).size.height * 0.3,
56 + ),
57 + child: AspectRatio(
58 + aspectRatio: 0.9,
59 + child: CakeImageWidget(imageUrl: image),
60 + ),
61 ),
62 ),
63 Expanded(
@@ -57,12 +66,7 @@ abstract class InfoPage extends BasePage {
66 child: Text(
67 pageDescription,
68 textAlign: TextAlign.center,
60 - style: TextStyle(
61 - height: 1.7,
62 - fontSize: 14,
63 - fontWeight: FontWeight.normal,
64 - color: Theme.of(context).extension<CakeTextTheme>()!.secondaryTextColor,
65 - ),
69 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(height: 1.6),
70 ),
71 ),
72 ),
@@ -70,8 +74,8 @@ abstract class InfoPage extends BasePage {
74 key: buttonKey,
75 onPressed: () => onPressed(context),
76 text: buttonText,
73 - color: Theme.of(context).primaryColor,
74 - textColor: Colors.white,
77 + color: Theme.of(context).colorScheme.primary,
78 + textColor: Theme.of(context).colorScheme.onPrimary,
79 ),
80 ],
81 ),
lib/src/screens/anonpay_details/anonpay_details_page.dart
+1 -1
@@ -56,7 +56,7 @@ class _AnonpayDetailsPageBodyState extends State<AnonpayDetailsPageBody> {
56 id: item.id,
57 create: item.createdAt,
58 pair: item.pair,
59 - currentTheme: widget.anonpayDetailsViewModel.settingsStore.currentTheme.type,
59 + currentTheme: widget.anonpayDetailsViewModel.themeStore.currentTheme.type,
60 onTap: item.onTap,
61 );
62 }
lib/src/screens/auth/auth_page.dart
+21 -28
@@ -22,9 +22,7 @@ abstract class AuthPageState<T extends StatefulWidget> extends State<T> {
22 }
23
24 class AuthPage extends StatefulWidget {
25 - AuthPage(this.authViewModel,
26 - {required this.onAuthenticationFinished,
27 - this.closable = true});
25 + AuthPage(this.authViewModel, {required this.onAuthenticationFinished, this.closable = true});
26
27 final AuthViewModel authViewModel;
28 final OnAuthenticationFinished onAuthenticationFinished;
@@ -37,16 +35,14 @@ class AuthPage extends StatefulWidget {
35 class AuthPagePinCodeStateImpl extends AuthPageState<AuthPage> {
36 final _key = GlobalKey<ScaffoldState>();
37 final _pinCodeKey = GlobalKey<PinCodeState>();
40 - final _backArrowImageDarkTheme =
41 - Image.asset('assets/images/close_button.png');
38 + final _backArrowImageDarkTheme = Image.asset('assets/images/close_button.png');
39 ReactionDisposer? _reaction;
40 Flushbar<void>? _authBar;
41 Flushbar<void>? _progressBar;
42
43 @override
44 void initState() {
48 - _reaction ??=
49 - reaction((_) => widget.authViewModel.state, (ExecutionState state) {
45 + _reaction ??= reaction((_) => widget.authViewModel.state, (ExecutionState state) {
46 if (state is ExecutedSuccessfullyState) {
47 WidgetsBinding.instance.addPostFrameCallback((_) {
48 widget.onAuthenticationFinished(true, this);
@@ -55,20 +51,20 @@ class AuthPagePinCodeStateImpl extends AuthPageState<AuthPage> {
51 }
52
53 if (state is IsExecutingState) {
58 - WidgetsBinding.instance.addPostFrameCallback((_) {
59 - // null duration to make it indefinite until its disposed
60 - _authBar =
61 - createBar<void>(S.of(context).authentication, duration: null)
62 - ..show(context);
63 - });
54 + WidgetsBinding.instance.addPostFrameCallback(
55 + (_) {
56 + // null duration to make it indefinite until its disposed
57 + _authBar = createBar<void>(S.of(context).authentication, context, duration: null)
58 + ..show(context);
59 + },
60 + );
61 }
62
63 if (state is FailureState) {
64 WidgetsBinding.instance.addPostFrameCallback((_) async {
65 _pinCodeKey.currentState?.clear();
66 dismissFlushBar(_authBar);
70 - showBar<void>(
71 - context, S.of(context).failed_authentication(state.error));
67 + showBar<void>(context, S.of(context).failed_authentication(state.error));
68 widget.onAuthenticationFinished(false, this);
69 });
70 }
@@ -77,14 +73,12 @@ class AuthPagePinCodeStateImpl extends AuthPageState<AuthPage> {
73 WidgetsBinding.instance.addPostFrameCallback((_) async {
74 _pinCodeKey.currentState?.clear();
75 dismissFlushBar(_authBar);
80 - showBar<void>(
81 - context, S.of(context).failed_authentication(state.error));
76 + showBar<void>(context, S.of(context).failed_authentication(state.error));
77 widget.onAuthenticationFinished(false, this);
78 });
79 }
80 });
81
87 -
82 if (widget.authViewModel.isBiometricalAuthenticationAllowed) {
83 WidgetsBinding.instance.addPostFrameCallback((_) async {
84 await Future<void>.delayed(Duration(milliseconds: 100));
@@ -95,8 +89,8 @@ class AuthPagePinCodeStateImpl extends AuthPageState<AuthPage> {
89 super.initState();
90 }
91
98 - Future<void> _showSeedsPopup(BuildContext context, String message) async {
99 - await showPopUp<void>(
92 + Future<void> _showSeedsPopup(BuildContext context, String message) async {
93 + await showPopUp<void>(
94 context: context,
95 builder: (BuildContext context) {
96 return AlertWithTwoActions(
@@ -109,8 +103,8 @@ class AuthPagePinCodeStateImpl extends AuthPageState<AuthPage> {
103 },
104 actionRightButton: () => Navigator.of(context).pop(),
105 );
112 - });
113 - }
106 + });
107 + }
108
109 @override
110 void dispose() {
@@ -121,8 +115,7 @@ class AuthPagePinCodeStateImpl extends AuthPageState<AuthPage> {
115 @override
116 void changeProcessText(String text) {
117 dismissFlushBar(_authBar);
124 - _progressBar = createBar<void>(text, duration: null)
125 - ..show(_key.currentContext!);
118 + _progressBar = createBar<void>(text,context, duration: null)..show(_key.currentContext!);
119 }
120
121 @override
@@ -163,15 +156,15 @@ class AuthPagePinCodeStateImpl extends AuthPageState<AuthPage> {
156 width: 37,
157 child: InkWell(
158 onTap: () => Navigator.of(context).pop(),
166 - child: _backArrowImageDarkTheme,
159 + child: _backArrowImageDarkTheme,
160 ),
161 ))
162 : Container(),
170 - backgroundColor: Theme.of(context).colorScheme.background,
163 + backgroundColor: Theme.of(context).colorScheme.surface,
164 border: null),
165 resizeToAvoidBottomInset: false,
173 - body: PinCode((pin, _) => widget.authViewModel.auth(password: pin),
174 - (_) => null, widget.authViewModel.pinLength, false, _pinCodeKey));
166 + body: PinCode((pin, _) => widget.authViewModel.auth(password: pin), (_) => null,
167 + widget.authViewModel.pinLength, false, _pinCodeKey));
168 }
169
170 void dismissFlushBar(Flushbar<dynamic>? bar) {
lib/src/screens/backup/backup_page.dart
+91 -86
@@ -5,7 +5,6 @@ import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
5 import 'package:cake_wallet/src/widgets/primary_button.dart';
6 import 'package:cake_wallet/generated/i18n.dart';
7 import 'package:cake_wallet/routes.dart';
8 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
8 import 'package:cake_wallet/utils/clipboard_util.dart';
9 import 'package:cake_wallet/utils/exception_handler.dart';
10 import 'package:cake_wallet/utils/share_util.dart';
@@ -31,65 +30,72 @@ class BackupPage extends BasePage {
30 fit: StackFit.expand,
31 children: [
32 Center(
34 - child: Container(
35 - padding: EdgeInsets.only(left: 24, right: 24),
36 - height: 300,
37 - child: Column(children: [
38 - Text(
39 - S.of(context).backup_password + ':',
40 - textAlign: TextAlign.center,
41 - style: TextStyle(fontSize: 30),
42 - ),
43 - Padding(
44 - padding: EdgeInsets.only(top: 20, bottom: 10),
45 - child: Observer(
46 - builder: (_) => GestureDetector(
47 - onTap: () {
48 - ClipboardUtil.setSensitiveDataToClipboard(
49 - ClipboardData(
50 - text: backupViewModelBase
51 - .backupPassword));
52 - showBar<void>(
53 - context,
54 - S.of(context).transaction_details_copied(
55 - S.of(context).backup_password));
56 - },
57 - child: Text(
58 - backupViewModelBase.backupPassword,
59 - style: TextStyle(fontSize: 26),
60 - textAlign: TextAlign.center,
61 - ),
62 - ))),
63 - Padding(
64 - padding: EdgeInsets.all(20),
33 + child: Container(
34 + padding: EdgeInsets.only(left: 24, right: 24),
35 + height: 300,
36 + child: Column(
37 + children: [
38 + Text(
39 + S.of(context).backup_password + ':',
40 + textAlign: TextAlign.center,
41 + style: Theme.of(context).textTheme.headlineMedium,
42 + ),
43 + Padding(
44 + padding: EdgeInsets.only(top: 20, bottom: 10),
45 + child: Observer(
46 + builder: (_) => GestureDetector(
47 + onTap: () {
48 + ClipboardUtil.setSensitiveDataToClipboard(
49 + ClipboardData(text: backupViewModelBase.backupPassword),
50 + );
51 + showBar<void>(
52 + context,
53 + S.of(context).transaction_details_copied(S.of(context).backup_password),
54 + );
55 + },
56 child: Text(
66 - S.of(context).write_down_backup_password,
67 - style: TextStyle(fontSize: 14, color: Colors.grey),
57 + backupViewModelBase.backupPassword,
58 + style: Theme.of(context).textTheme.titleLarge,
59 textAlign: TextAlign.center,
69 - ))
70 - ]))),
71 - Positioned(
72 - child: Column(children: [
73 - PrimaryButton(
74 - onPressed: () =>
75 - Navigator.of(context).pushNamed(Routes.editBackupPassword),
76 - text: S.of(context).change_password,
77 - color: Theme.of(context).cardColor,
78 - textColor: Theme.of(context)
79 - .extension<CakeTextTheme>()!
80 - .buttonTextColor,
60 + ),
61 + ),
62 + ),
63 + ),
64 + Padding(
65 + padding: EdgeInsets.all(20),
66 + child: Text(
67 + S.of(context).write_down_backup_password,
68 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
69 + color: Theme.of(context).colorScheme.onSurfaceVariant,
70 + ),
71 + textAlign: TextAlign.center,
72 + ),
73 + )
74 + ],
75 ),
82 - SizedBox(height: 10),
83 - Observer(
84 - builder: (_) => LoadingPrimaryButton(
85 - isLoading: backupViewModelBase.state is IsExecutingState,
86 - onPressed: () => onExportBackup(context),
87 - text: S.of(context).export_backup,
88 - color: Theme.of(context).primaryColor,
89 - textColor: Colors.white,
76 + ),
77 + ),
78 + Positioned(
79 + child: Column(
80 + children: [
81 + PrimaryButton(
82 + onPressed: () => Navigator.of(context).pushNamed(Routes.editBackupPassword),
83 + text: S.of(context).change_password,
84 + color: Theme.of(context).colorScheme.surfaceContainer,
85 + textColor: Theme.of(context).colorScheme.onSecondaryContainer,
86 ),
91 - ),
92 - ]),
87 + const SizedBox(height: 10),
88 + Observer(
89 + builder: (_) => LoadingPrimaryButton(
90 + isLoading: backupViewModelBase.state is IsExecutingState,
91 + onPressed: () => onExportBackup(context),
92 + text: S.of(context).export_backup,
93 + color: Theme.of(context).colorScheme.primary,
94 + textColor: Theme.of(context).colorScheme.onPrimary,
95 + ),
96 + ),
97 + ],
98 + ),
99 bottom: 24,
100 left: 24,
101 right: 24,
@@ -100,31 +106,33 @@ class BackupPage extends BasePage {
106
107 void onExportBackup(BuildContext context) {
108 showPopUp<void>(
103 - context: context,
104 - builder: (dialogContext) {
105 - return AlertWithTwoActions(
106 - alertTitle: S.of(context).export_backup,
107 - alertContent: S.of(context).save_backup_password,
108 - rightButtonText: S.of(context).seed_alert_yes,
109 - leftButtonText: S.of(context).seed_alert_back,
110 - actionRightButton: () async {
111 - Navigator.of(dialogContext).pop();
112 - final backup = await backupViewModelBase.exportBackup();
109 + context: context,
110 + builder: (dialogContext) {
111 + return AlertWithTwoActions(
112 + alertTitle: S.of(context).export_backup,
113 + alertContent: S.of(context).save_backup_password,
114 + rightButtonText: S.of(context).seed_alert_yes,
115 + leftButtonText: S.of(context).seed_alert_back,
116 + actionRightButton: () async {
117 + Navigator.of(dialogContext).pop();
118 + final backup = await backupViewModelBase.exportBackup();
119
114 - if (backup == null) {
115 - return;
116 - }
120 + if (backup == null) {
121 + return;
122 + }
123
118 - if (Platform.isAndroid) {
119 - onExportAndroid(context, backup);
120 - } else if (Platform.isIOS) {
121 - await share(backup, context);
122 - } else {
123 - await _saveFile(backup);
124 - }
125 - },
126 - actionLeftButton: () => Navigator.of(dialogContext).pop());
127 - });
124 + if (Platform.isAndroid) {
125 + onExportAndroid(context, backup);
126 + } else if (Platform.isIOS) {
127 + await share(backup, context);
128 + } else {
129 + await _saveFile(backup);
130 + }
131 + },
132 + actionLeftButton: () => Navigator.of(dialogContext).pop(),
133 + );
134 + },
135 + );
136 }
137
138 void onExportAndroid(BuildContext context, BackupExportFile backup) {
@@ -137,8 +145,7 @@ class BackupPage extends BasePage {
145 rightButtonText: S.of(context).save_to_downloads,
146 leftButtonText: S.of(context).share,
147 actionRightButton: () async {
140 - await backupViewModelBase.saveToDownload(
141 - backup.name, backup.file);
148 + await backupViewModelBase.saveToDownload(backup.name, backup.file);
149 Navigator.of(dialogContext).pop();
150 await showBar<void>(context, S.of(context).file_saved);
151 },
@@ -151,15 +158,13 @@ class BackupPage extends BasePage {
158
159 Future<void> share(BackupExportFile backup, BuildContext context) async {
160 final path = await backupViewModelBase.saveBackupFileLocally(backup);
154 - await ShareUtil.shareFile(
155 - filePath: path, fileName: backup.name, context: context);
161 + await ShareUtil.shareFile(filePath: path, fileName: backup.name, context: context);
162 await backupViewModelBase.removeBackupFileLocally(backup);
163 }
164
165 Future<void> _saveFile(BackupExportFile backup) async {
160 - String? outputFile = await FilePicker.platform.saveFile(
161 - dialogTitle: 'Save Your File to desired location',
162 - fileName: backup.name);
166 + String? outputFile = await FilePicker.platform
167 + .saveFile(dialogTitle: 'Save Your File to desired location', fileName: backup.name);
168
169 try {
170 await backup.file.copy(outputFile!);
lib/src/screens/backup/edit_backup_password_page.dart
+38 -31
@@ -1,3 +1,4 @@
1 +import 'package:cake_wallet/src/widgets/base_text_form_field.dart';
2 import 'package:flutter/material.dart';
3 import 'package:flutter_mobx/flutter_mobx.dart';
4 import 'package:cake_wallet/generated/i18n.dart';
@@ -6,14 +7,13 @@ import 'package:cake_wallet/src/screens/base_page.dart';
7 import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
8 import 'package:cake_wallet/src/widgets/primary_button.dart';
9 import 'package:cake_wallet/view_model/edit_backup_password_view_model.dart';
9 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
10
11 class EditBackupPasswordPage extends BasePage {
12 EditBackupPasswordPage(this.editBackupPasswordViewModel)
13 : textEditingController = TextEditingController() {
14 textEditingController.text = editBackupPasswordViewModel.backupPassword;
15 - textEditingController.addListener(() => editBackupPasswordViewModel
16 - .backupPassword = textEditingController.text);
15 + textEditingController
16 + .addListener(() => editBackupPasswordViewModel.backupPassword = textEditingController.text);
17 }
18
19 final EditBackupPasswordViewModel editBackupPasswordViewModel;
@@ -25,34 +25,41 @@ class EditBackupPasswordPage extends BasePage {
25 @override
26 Widget body(BuildContext context) {
27 return Padding(
28 - padding: EdgeInsets.only(left: 24, right: 24),
29 - child: Stack(
30 - fit: StackFit.expand,
31 - children: [
32 - Center(
33 - child: Observer(
34 - builder: (_) => TextFormField(
35 - autofocus: true,
36 - enableSuggestions: false,
37 - autocorrect: false,
38 - keyboardType: TextInputType.visiblePassword,
39 - controller: textEditingController,
40 - style: TextStyle(
41 - fontSize: 26,
42 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor)))),
43 - Positioned(
44 - child: Observer(
45 - builder: (_) => PrimaryButton(
46 - onPressed: () => onSave(context),
47 - text: S.of(context).save,
48 - color: Theme.of(context).primaryColor,
49 - textColor: Colors.white,
50 - isDisabled: !editBackupPasswordViewModel.canSave)),
51 - bottom: 24,
52 - left: 0,
53 - right: 0)
54 - ],
55 - ));
28 + padding: EdgeInsets.only(left: 24, right: 24),
29 + child: Stack(
30 + fit: StackFit.expand,
31 + children: [
32 + Center(
33 + child: Observer(
34 + builder: (_) => BaseTextFormField(
35 + autofocus: true,
36 + enableSuggestions: false,
37 + autocorrect: false,
38 + keyboardType: TextInputType.visiblePassword,
39 + controller: textEditingController,
40 + textStyle: Theme.of(context).textTheme.titleLarge?.copyWith(
41 + color: Theme.of(context).colorScheme.onSurface,
42 + ),
43 + ),
44 + ),
45 + ),
46 + Positioned(
47 + child: Observer(
48 + builder: (_) => PrimaryButton(
49 + onPressed: () => onSave(context),
50 + text: S.of(context).save,
51 + color: Theme.of(context).colorScheme.primary,
52 + textColor: Theme.of(context).colorScheme.onPrimary,
53 + isDisabled: !editBackupPasswordViewModel.canSave,
54 + ),
55 + ),
56 + bottom: 24,
57 + left: 0,
58 + right: 0,
59 + )
60 + ],
61 + ),
62 + );
63 }
64
65 void onSave(BuildContext context) {
lib/src/screens/base_page.dart
+17 -26
@@ -1,9 +1,9 @@
1 -import 'package:cake_wallet/themes/theme_base.dart';
1 +import 'package:cake_wallet/themes/core/material_base_theme.dart';
2 +import 'package:cake_wallet/themes/core/theme_store.dart';
3 import 'package:cake_wallet/utils/route_aware.dart';
4 import 'package:flutter/cupertino.dart';
5 import 'package:flutter/material.dart';
6 import 'package:cake_wallet/di.dart';
6 -import 'package:cake_wallet/store/settings_store.dart';
7 import 'package:cake_wallet/src/widgets/nav_bar.dart';
8 import 'package:cake_wallet/generated/i18n.dart';
9
@@ -14,8 +14,7 @@ abstract class BasePage extends StatelessWidget {
14 final GlobalKey<ScaffoldState> _scaffoldKey;
15
16 final Image closeButtonImage = Image.asset('assets/images/close_button.png');
17 - final Image closeButtonImageDarkTheme =
18 - Image.asset('assets/images/close_button_dark_theme.png');
17 + final Image closeButtonImageDarkTheme = Image.asset('assets/images/close_button_dark_theme.png');
18
19 String? get title => null;
20
@@ -45,30 +44,22 @@ abstract class BasePage extends StatelessWidget {
44
45 Widget Function(BuildContext, Widget)? get rootWrapper => null;
46
48 - ThemeBase get currentTheme => getIt.get<SettingsStore>().currentTheme;
47 + MaterialThemeBase get currentTheme => getIt.get<ThemeStore>().currentTheme;
48
49 void onOpenEndDrawer() => _scaffoldKey.currentState!.openEndDrawer();
50
51 void onClose(BuildContext context) => Navigator.of(context).pop();
52
53 Color pageBackgroundColor(BuildContext context) =>
55 - (currentTheme.type == ThemeType.dark
56 - ? backgroundDarkColor
57 - : backgroundLightColor) ??
58 - (gradientBackground && currentTheme.type == ThemeType.bright
59 - ? Colors.transparent
60 - : Theme.of(context).colorScheme.background);
61 -
62 - Color titleColor(BuildContext context) =>
63 - (gradientBackground && currentTheme.type == ThemeType.bright) ||
64 - (gradientAll && currentTheme.brightness == Brightness.light)
65 - ? Colors.white
66 - : Theme.of(context).appBarTheme.titleTextStyle!.color!;
54 + (currentTheme.isDark ? backgroundDarkColor : backgroundLightColor) ??
55 + (gradientBackground ? Colors.transparent : Theme.of(context).colorScheme.surface);
56 +
57 + Color titleColor(BuildContext context) => Theme.of(context).colorScheme.onSurface;
58
59 Color? pageIconColor(BuildContext context) => titleColor(context);
60
61 Widget closeButton(BuildContext context) => Image.asset(
71 - currentTheme.type == ThemeType.dark
62 + currentTheme.isDark
63 ? 'assets/images/close_button_dark_theme.png'
64 : 'assets/images/close_button.png',
65 color: pageIconColor(context),
@@ -95,9 +86,9 @@ abstract class BasePage extends StatelessWidget {
86 child: Semantics(
87 label: S.of(context).seed_alert_back,
88 child: TextButton(
98 - style: ButtonStyle(
99 - overlayColor: MaterialStateColor.resolveWith(
100 - (states) => Colors.transparent),
89 + style: TextButton.styleFrom(
90 + foregroundColor: Theme.of(context).colorScheme.onSurface,
91 + overlayColor: WidgetStateColor.resolveWith((states) => Colors.transparent),
92 ),
93 onPressed: () => onClose(context),
94 child: backButton(context),
@@ -113,11 +104,11 @@ abstract class BasePage extends StatelessWidget {
104 ? null
105 : Text(
106 title!,
116 - style: TextStyle(
117 - fontSize: 18.0,
118 - fontWeight: FontWeight.bold,
119 - fontFamily: 'Lato',
120 - color: titleColor(context)),
107 + style: Theme.of(context).textTheme.titleLarge?.copyWith(
108 + fontSize: 18.0,
109 + fontWeight: FontWeight.w600,
110 + color: titleColor(context),
111 + ),
112 );
113 }
114
lib/src/screens/buy/buy_sell_page.dart
+186 -188
@@ -14,12 +14,6 @@ import 'package:cake_wallet/src/widgets/primary_button.dart';
14 import 'package:cake_wallet/src/widgets/provider_optoin_tile.dart';
15 import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
16 import 'package:cake_wallet/src/widgets/trail_button.dart';
17 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
18 -import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart';
19 -import 'package:cake_wallet/themes/extensions/keyboard_theme.dart';
20 -import 'package:cake_wallet/themes/extensions/send_page_theme.dart';
21 -import 'package:cake_wallet/themes/theme_base.dart';
22 -import 'package:cake_wallet/typography.dart';
17 import 'package:cake_wallet/src/screens/send/widgets/extract_address_from_parsed.dart';
18 import 'package:cake_wallet/utils/responsive_layout_util.dart';
19 import 'package:cake_wallet/view_model/buy/buy_sell_view_model.dart';
@@ -43,17 +37,6 @@ class BuySellPage extends BasePage {
37 final _cryptoAddressFocus = FocusNode();
38 var _isReactionsSet = false;
39
46 - final arrowBottomPurple = Image.asset(
47 - 'assets/images/arrow_bottom_purple_icon.png',
48 - color: Colors.white,
49 - height: 8,
50 - );
51 - final arrowBottomCakeGreen = Image.asset(
52 - 'assets/images/arrow_bottom_cake_green.png',
53 - color: Colors.white,
54 - height: 8,
55 - );
56 -
40 late final String? depositWalletName;
41 late final String? receiveWalletName;
42
@@ -95,11 +78,11 @@ class BuySellPage extends BasePage {
78 Widget? leading(BuildContext context) {
79 final _backButton = Icon(
80 Icons.arrow_back_ios,
98 - color: titleColor(context),
81 + color: Theme.of(context).colorScheme.onSurface,
82 size: 16,
83 );
84 final _closeButton =
102 - currentTheme.type == ThemeType.dark ? closeButtonImageDarkTheme : closeButtonImage;
85 + buySellViewModel.isDarkTheme ? closeButtonImageDarkTheme : closeButtonImage;
86
87 bool isMobileView = responsiveLayoutUtil.shouldRenderMobileUI;
88
@@ -113,7 +96,7 @@ class BuySellPage extends BasePage {
96 label: !isMobileView ? S.of(context).close : S.of(context).seed_alert_back,
97 child: TextButton(
98 style: ButtonStyle(
116 - overlayColor: MaterialStateColor.resolveWith((states) => Colors.transparent),
99 + overlayColor: WidgetStateColor.resolveWith((states) => Colors.transparent),
100 ),
101 onPressed: () => onClose(context),
102 child: !isMobileView ? _closeButton : _backButton,
@@ -129,89 +112,94 @@ class BuySellPage extends BasePage {
112 WidgetsBinding.instance.addPostFrameCallback((_) => _setReactions(context, buySellViewModel));
113
114 return KeyboardActions(
132 - disableScroll: true,
133 - config: KeyboardActionsConfig(
134 - keyboardActionsPlatform: KeyboardActionsPlatform.IOS,
135 - keyboardBarColor: Theme.of(context).extension<KeyboardTheme>()!.keyboardBarColor,
136 - nextFocus: false,
137 - actions: [
138 - KeyboardActionsItem(
139 - focusNode: _fiatAmountFocus, toolbarButtons: [(_) => KeyboardDoneButton()]),
140 - KeyboardActionsItem(
141 - focusNode: _cryptoAmountFocus, toolbarButtons: [(_) => KeyboardDoneButton()])
142 - ]),
143 - child: Container(
144 - color: Theme.of(context).colorScheme.background,
145 - child: Form(
146 - key: _formKey,
147 - child: ScrollableWithBottomSection(
148 - contentPadding: EdgeInsets.only(bottom: 24),
149 - content: Observer(
150 - builder: (_) => Column(children: [
151 - _exchangeCardsSection(context),
152 - Padding(
153 - padding: EdgeInsets.symmetric(horizontal: 24),
154 - child: Column(
155 - children: [
156 - SizedBox(height: 12),
157 - _buildPaymentMethodTile(context),
158 - ],
159 - ),
160 - ),
161 - ])),
162 - bottomSectionPadding: EdgeInsets.only(left: 24, right: 24, bottom: 24),
163 - bottomSection: Observer(
164 - builder: (_) => Column(children: [
165 - buySellViewModel.isBuySellQuotFailed
166 - ? Padding(
167 - padding: EdgeInsets.only(bottom: 15),
168 - child: Row(
169 - children: [
170 - Expanded(
171 - child: Container(
172 - alignment: Alignment.centerRight,
173 - child: Icon(Icons.warning_amber_rounded,
174 - color: Theme.of(context)
175 - .extension<ExchangePageTheme>()!
176 - .receiveAmountColor,
177 - size: 26),
115 + disableScroll: true,
116 + config: KeyboardActionsConfig(
117 + keyboardActionsPlatform: KeyboardActionsPlatform.IOS,
118 + keyboardBarColor: Theme.of(context).colorScheme.surface,
119 + nextFocus: false,
120 + actions: [
121 + KeyboardActionsItem(
122 + focusNode: _fiatAmountFocus, toolbarButtons: [(_) => KeyboardDoneButton()]),
123 + KeyboardActionsItem(
124 + focusNode: _cryptoAmountFocus, toolbarButtons: [(_) => KeyboardDoneButton()])
125 + ]),
126 + child: Container(
127 + color: Theme.of(context).colorScheme.surface,
128 + child: Form(
129 + key: _formKey,
130 + child: ScrollableWithBottomSection(
131 + contentPadding: EdgeInsets.only(bottom: 24),
132 + content: Observer(
133 + builder: (_) => Column(
134 + children: [
135 + _exchangeCardsSection(context),
136 + Padding(
137 + padding: EdgeInsets.symmetric(horizontal: 24),
138 + child: Column(
139 + children: [
140 + SizedBox(height: 12),
141 + _buildPaymentMethodTile(context),
142 + ],
143 + ),
144 + ),
145 + ],
146 + ),
147 + ),
148 + bottomSectionPadding: EdgeInsets.only(left: 24, right: 24, bottom: 24),
149 + bottomSection: Observer(
150 + builder: (_) => Column(
151 + children: [
152 + if (buySellViewModel.isBuySellQuotFailed)
153 + Padding(
154 + padding: EdgeInsets.only(bottom: 15),
155 + child: Row(
156 + children: [
157 + Expanded(
158 + child: Container(
159 + alignment: Alignment.centerRight,
160 + child: Icon(
161 + Icons.warning_amber_rounded,
162 + color: Theme.of(context).colorScheme.error,
163 + size: 26,
164 ),
165 ),
180 - Expanded(
181 - flex: 8,
182 - child: Text(
183 - S.of(context).buy_sell_pair_is_not_supported_warning,
184 - textAlign: TextAlign.center,
185 - softWrap: true,
186 - overflow: TextOverflow.ellipsis,
187 - maxLines: 3,
188 - style: TextStyle(
189 - color: Theme.of(context)
190 - .extension<ExchangePageTheme>()!
191 - .receiveAmountColor,
192 - fontWeight: FontWeight.w500,
193 - fontSize: 12,
194 - ),
195 - ),
166 + ),
167 + Expanded(
168 + flex: 8,
169 + child: Text(
170 + S.of(context).buy_sell_pair_is_not_supported_warning,
171 + textAlign: TextAlign.center,
172 + softWrap: true,
173 + overflow: TextOverflow.ellipsis,
174 + maxLines: 3,
175 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
176 + color: Theme.of(context).colorScheme.error,
177 + fontWeight: FontWeight.w500,
178 + ),
179 ),
197 - ],
198 - ),
199 - )
200 - : Container(),
201 - LoadingPrimaryButton(
202 - text: S.current.choose_a_provider,
203 - onPressed: () async {
204 - if(!_formKey.currentState!.validate()) return;
205 - buySellViewModel.onTapChoseProvider(context);
206 - },
207 - color: Theme.of(context).primaryColor,
208 - textColor: Colors.white,
209 - isDisabled: buySellViewModel.isBuySellQuotFailed,
210 - isLoading: !buySellViewModel.isReadyToTrade &&
211 - !buySellViewModel.isBuySellQuotFailed),
212 - ])),
213 - )),
214 - ));
180 + ),
181 + ],
182 + ),
183 + ),
184 + LoadingPrimaryButton(
185 + text: S.current.choose_a_provider,
186 + onPressed: () async {
187 + if (!_formKey.currentState!.validate()) return;
188 + buySellViewModel.onTapChoseProvider(context);
189 + },
190 + color: Theme.of(context).colorScheme.primary,
191 + textColor: Theme.of(context).colorScheme.onPrimary,
192 + isDisabled: buySellViewModel.isBuySellQuotFailed,
193 + isLoading:
194 + !buySellViewModel.isReadyToTrade && !buySellViewModel.isBuySellQuotFailed,
195 + ),
196 + ],
197 + ),
198 + ),
199 + ),
200 + ),
201 + ),
202 + );
203 }
204
205 Widget _buildPaymentMethodTile(BuildContext context) {
@@ -230,21 +218,21 @@ class BuySellPage extends BasePage {
218 }
219 if (buySellViewModel.paymentMethodState is PaymentMethodLoaded &&
220 buySellViewModel.selectedPaymentMethod != null) {
233 - return Observer(builder: (_) {
234 - final selectedPaymentMethod = buySellViewModel.selectedPaymentMethod!;
235 - return ProviderOptionTile(
236 - lightImagePath: selectedPaymentMethod.lightIconPath,
237 - darkImagePath: selectedPaymentMethod.darkIconPath,
238 - title: selectedPaymentMethod.title,
239 - onPressed: () => _pickPaymentMethod(context),
240 - leadingIcon: Icons.arrow_forward_ios,
241 - isLightMode: !buySellViewModel.isDarkTheme,
242 - borderRadius: 30,
243 - padding: EdgeInsets.symmetric(horizontal: 24, vertical: 8),
244 - titleTextStyle:
245 - textLargeBold(color: Theme.of(context).extension<CakeTextTheme>()!.titleColor),
246 - );
247 - });
221 + final selectedPaymentMethod = buySellViewModel.selectedPaymentMethod!;
222 + return ProviderOptionTile(
223 + lightImagePath: selectedPaymentMethod.lightIconPath,
224 + darkImagePath: selectedPaymentMethod.darkIconPath,
225 + title: selectedPaymentMethod.title,
226 + onPressed: () => _pickPaymentMethod(context),
227 + leadingIcon: Icons.arrow_forward_ios,
228 + isLightMode: !buySellViewModel.isDarkTheme,
229 + borderRadius: 30,
230 + padding: EdgeInsets.symmetric(horizontal: 24, vertical: 8),
231 + titleTextStyle: Theme.of(context).textTheme.titleMedium?.copyWith(
232 + color: Theme.of(context).colorScheme.onSurface,
233 + fontWeight: FontWeight.w600,
234 + ),
235 + );
236 }
237 return OptionTilePlaceholder(errorText: 'No payment methods available', borderRadius: 30);
238 }
@@ -280,19 +268,17 @@ class BuySellPage extends BasePage {
268 _onCurrencyChange(buySellViewModel.fiatCurrency, buySellViewModel, fiatCurrencyKey);
269
270 reaction(
283 - (_) => buySellViewModel.wallet.name,
284 - (String _) =>
285 - _onWalletNameChange(buySellViewModel, buySellViewModel.cryptoCurrency, cryptoCurrencyKey));
271 + (_) => buySellViewModel.wallet.name,
272 + (String _) => _onWalletNameChange(
273 + buySellViewModel, buySellViewModel.cryptoCurrency, cryptoCurrencyKey));
274
275 reaction(
276 (_) => buySellViewModel.cryptoCurrency,
277 (CryptoCurrency currency) =>
278 _onCurrencyChange(currency, buySellViewModel, cryptoCurrencyKey));
279
292 - reaction(
293 - (_) => buySellViewModel.fiatCurrency,
294 - (FiatCurrency currency) =>
295 - _onCurrencyChange(currency, buySellViewModel, fiatCurrencyKey));
280 + reaction((_) => buySellViewModel.fiatCurrency,
281 + (FiatCurrency currency) => _onCurrencyChange(currency, buySellViewModel, fiatCurrencyKey));
282
283 reaction((_) => buySellViewModel.fiatAmount, (String amount) {
284 if (fiatCurrencyKey.currentState!.amountController.text != amount) {
@@ -318,13 +304,13 @@ class BuySellPage extends BasePage {
304
305 fiatAmountController.addListener(() {
306 if (fiatAmountController.text != buySellViewModel.fiatAmount) {
321 - buySellViewModel.changeFiatAmount(amount: fiatAmountController.text);
307 + buySellViewModel.changeFiatAmount(amount: fiatAmountController.text);
308 }
309 });
310
311 cryptoAmountController.addListener(() {
312 if (cryptoAmountController.text != buySellViewModel.cryptoAmount) {
327 - buySellViewModel.changeCryptoAmount(amount: cryptoAmountController.text);
313 + buySellViewModel.changeCryptoAmount(amount: cryptoAmountController.text);
314 }
315 });
316
@@ -336,7 +322,7 @@ class BuySellPage extends BasePage {
322 if (!_cryptoAddressFocus.hasFocus && cryptoAddressController.text.isNotEmpty) {
323 final domain = cryptoAddressController.text;
324 buySellViewModel.cryptoCurrencyAddress =
339 - await fetchParsedAddress(context, domain, buySellViewModel.cryptoCurrency);
325 + await fetchParsedAddress(context, domain, buySellViewModel.cryptoCurrency);
326 }
327 });
328
@@ -365,15 +351,16 @@ class BuySellPage extends BasePage {
351 _isReactionsSet = true;
352 }
353
368 - void _onCurrencyChange(Currency currency, BuySellViewModel buySellViewModel,
369 - GlobalKey<ExchangeCardState> key) {
354 + void _onCurrencyChange(
355 + Currency currency, BuySellViewModel buySellViewModel, GlobalKey<ExchangeCardState> key) {
356 final isCurrentTypeWallet = currency == buySellViewModel.wallet.currency;
357
358 key.currentState!.changeSelectedCurrency(currency);
359 key.currentState!.changeWalletName(isCurrentTypeWallet ? buySellViewModel.wallet.name : '');
360
361 key.currentState!.changeAddress(
376 - address: isCurrentTypeWallet ? buySellViewModel.wallet.walletAddresses.addressForExchange : '');
362 + address:
363 + isCurrentTypeWallet ? buySellViewModel.wallet.walletAddresses.addressForExchange : '');
364
365 key.currentState!.changeAmount(amount: '');
366 }
@@ -384,7 +371,8 @@ class BuySellPage extends BasePage {
371
372 if (isCurrentTypeWallet) {
373 key.currentState!.changeWalletName(buySellViewModel.wallet.name);
387 - key.currentState!.addressController.text = buySellViewModel.wallet.walletAddresses.addressForExchange;
374 + key.currentState!.addressController.text =
375 + buySellViewModel.wallet.walletAddresses.addressForExchange;
376 } else if (key.currentState!.addressController.text ==
377 buySellViewModel.wallet.walletAddresses.addressForExchange) {
378 key.currentState!.changeWalletName('');
@@ -396,67 +384,77 @@ class BuySellPage extends BasePage {
384
385 Widget _exchangeCardsSection(BuildContext context) {
386 final fiatExchangeCard = Observer(
399 - builder: (_) => ExchangeCard(
400 - cardInstanceName: 'fiat_currency_trade_card',
401 - onDispose: disposeBestRateSync,
402 - amountFocusNode: _fiatAmountFocus,
403 - key: fiatCurrencyKey,
404 - title: 'FIAT ${S.of(context).amount}',
405 - initialCurrency: buySellViewModel.fiatCurrency,
406 - initialWalletName: '',
407 - initialAddress: '',
408 - initialIsAmountEditable: true,
409 - isAmountEstimated: false,
410 - currencyRowPadding: EdgeInsets.zero,
411 - addressRowPadding: EdgeInsets.zero,
412 - isMoneroWallet: buySellViewModel.wallet == WalletType.monero,
413 - showAddressField: false,
414 - showLimitsField: false,
415 - currencies: buySellViewModel.fiatCurrencies,
416 - onCurrencySelected: (currency) =>
417 - buySellViewModel.changeFiatCurrency(currency: currency),
418 - imageArrow: arrowBottomPurple,
419 - currencyButtonColor: Colors.transparent,
420 - addressButtonsColor:
421 - Theme.of(context).extension<SendPageTheme>()!.textFieldButtonColor,
422 - borderColor:
423 - Theme.of(context).extension<ExchangePageTheme>()!.textFieldBorderTopPanelColor,
424 - onPushPasteButton: (context) async {},
425 - onPushAddressBookButton: (context) async {},
426 - ));
387 + builder: (_) => ExchangeCard(
388 + cardInstanceName: 'fiat_currency_trade_card',
389 + onDispose: disposeBestRateSync,
390 + amountFocusNode: _fiatAmountFocus,
391 + key: fiatCurrencyKey,
392 + title: 'FIAT ${S.of(context).amount}',
393 + initialCurrency: buySellViewModel.fiatCurrency,
394 + initialWalletName: '',
395 + initialAddress: '',
396 + initialIsAmountEditable: true,
397 + isAmountEstimated: false,
398 + currencyRowPadding: EdgeInsets.zero,
399 + addressRowPadding: EdgeInsets.zero,
400 + isMoneroWallet: buySellViewModel.wallet == WalletType.monero,
401 + showAddressField: false,
402 + showLimitsField: false,
403 + currencies: buySellViewModel.fiatCurrencies,
404 + onCurrencySelected: (currency) => buySellViewModel.changeFiatCurrency(currency: currency),
405 + imageArrow: Image.asset(
406 + 'assets/images/arrow_bottom_purple_icon.png',
407 + color: Theme.of(context).colorScheme.onSurface,
408 + height: 8,
409 + ),
410 + currencyButtonColor: Colors.transparent,
411 + addressButtonsColor: Theme.of(context).colorScheme.surfaceContainerHighest,
412 + borderColor: Theme.of(context).colorScheme.outlineVariant,
413 + onPushPasteButton: (context) async {},
414 + onPushAddressBookButton: (context) async {},
415 + fillColor: buySellViewModel.isBuyAction
416 + ? Theme.of(context).colorScheme.surfaceContainer
417 + : Theme.of(context).colorScheme.surfaceContainerLow,
418 + ),
419 + );
420
421 final cryptoExchangeCard = Observer(
429 - builder: (_) => ExchangeCard(
430 - cardInstanceName: 'crypto_currency_trade_card',
431 - onDispose: disposeBestRateSync,
432 - amountFocusNode: _cryptoAmountFocus,
433 - addressFocusNode: _cryptoAddressFocus,
434 - key: cryptoCurrencyKey,
435 - title: 'Crypto ${S.of(context).amount}',
436 - initialCurrency: buySellViewModel.cryptoCurrency,
437 - initialWalletName: '',
438 - initialAddress: buySellViewModel.cryptoCurrency == buySellViewModel.wallet.currency
439 - ? buySellViewModel.wallet.walletAddresses.addressForExchange
440 - : buySellViewModel.cryptoCurrencyAddress,
441 - initialIsAmountEditable: true,
442 - isAmountEstimated: true,
443 - showLimitsField: false,
444 - currencyRowPadding: EdgeInsets.zero,
445 - addressRowPadding: EdgeInsets.zero,
446 - isMoneroWallet: buySellViewModel.wallet == WalletType.monero,
447 - currencies: buySellViewModel.cryptoCurrencies,
448 - onCurrencySelected: (currency) =>
449 - buySellViewModel.changeCryptoCurrency(currency: currency),
450 - imageArrow: arrowBottomCakeGreen,
451 - currencyButtonColor: Colors.transparent,
452 - addressButtonsColor:
453 - Theme.of(context).extension<SendPageTheme>()!.textFieldButtonColor,
454 - borderColor:
455 - Theme.of(context).extension<ExchangePageTheme>()!.textFieldBorderBottomPanelColor,
456 - addressTextFieldValidator: AddressValidator(type: buySellViewModel.cryptoCurrency),
457 - onPushPasteButton: (context) async {},
458 - onPushAddressBookButton: (context) async {},
459 - ));
422 + builder: (_) => ExchangeCard(
423 + cardInstanceName: 'crypto_currency_trade_card',
424 + onDispose: disposeBestRateSync,
425 + amountFocusNode: _cryptoAmountFocus,
426 + addressFocusNode: _cryptoAddressFocus,
427 + key: cryptoCurrencyKey,
428 + title: 'Crypto ${S.of(context).amount}',
429 + initialCurrency: buySellViewModel.cryptoCurrency,
430 + initialWalletName: '',
431 + initialAddress: buySellViewModel.cryptoCurrency == buySellViewModel.wallet.currency
432 + ? buySellViewModel.wallet.walletAddresses.addressForExchange
433 + : buySellViewModel.cryptoCurrencyAddress,
434 + initialIsAmountEditable: true,
435 + isAmountEstimated: true,
436 + showLimitsField: false,
437 + currencyRowPadding: EdgeInsets.zero,
438 + addressRowPadding: EdgeInsets.zero,
439 + isMoneroWallet: buySellViewModel.wallet == WalletType.monero,
440 + currencies: buySellViewModel.cryptoCurrencies,
441 + onCurrencySelected: (currency) => buySellViewModel.changeCryptoCurrency(currency: currency),
442 + imageArrow: Image.asset(
443 + 'assets/images/arrow_bottom_cake_green.png',
444 + color: Theme.of(context).colorScheme.onSurface,
445 + height: 8,
446 + ),
447 + currencyButtonColor: Colors.transparent,
448 + addressButtonsColor: Theme.of(context).colorScheme.surfaceContainerHighest,
449 + borderColor: Theme.of(context).colorScheme.outlineVariant,
450 + addressTextFieldValidator: AddressValidator(type: buySellViewModel.cryptoCurrency),
451 + onPushPasteButton: (context) async {},
452 + onPushAddressBookButton: (context) async {},
453 + fillColor: buySellViewModel.isBuyAction
454 + ? Theme.of(context).colorScheme.surfaceContainerLow
455 + : Theme.of(context).colorScheme.surfaceContainer,
456 + ),
457 + );
458
459 if (responsiveLayoutUtil.shouldRenderMobileUI) {
460 return Observer(
lib/src/screens/buy/buy_webview_page.dart
-3
@@ -19,9 +19,6 @@ class BuyWebViewPage extends BasePage {
19 @override
20 String get title => S.current.buy;
21
22 - @override
23 - Color get backgroundDarkColor => Colors.white;
24 -
22 @override
23 Widget body(BuildContext context) =>
24 BuyWebViewPageBody(buyViewModel, ordersStore: ordersStore, url: url);
lib/src/screens/buy/widgets/buy_list_item.dart deleted
-148
@@ -1,148 +0,0 @@
1 -import 'package:cake_wallet/buy/buy_provider.dart';
2 -import 'package:cw_core/crypto_currency.dart';
3 -import 'package:cake_wallet/entities/fiat_currency.dart';
4 -import 'package:cake_wallet/palette.dart';
5 -import 'package:flutter/cupertino.dart';
6 -import 'package:flutter/material.dart';
7 -
8 -class BuyListItem extends StatelessWidget {
9 - BuyListItem({
10 - required this.selectedProvider,
11 - required this.provider,
12 - required this.sourceAmount,
13 - required this.sourceCurrency,
14 - required this.destAmount,
15 - required this.destCurrency,
16 - required this.achSourceAmount,
17 - this.onTap
18 - });
19 -
20 - final BuyProvider? selectedProvider;
21 - final BuyProvider provider;
22 - final double sourceAmount;
23 - final FiatCurrency sourceCurrency;
24 - final double destAmount;
25 - final CryptoCurrency destCurrency;
26 - final double achSourceAmount;
27 - final VoidCallback? onTap;
28 -
29 - @override
30 - Widget build(BuildContext context) {
31 - final isSelected = selectedProvider?.providerDescription == provider.providerDescription;
32 - final iconColor = isSelected ? Colors.white : Colors.black;
33 -
34 - final providerIcon = Image.asset('assets/images/wyre-icon.png', width: 36, height: 36);
35 -
36 - final backgroundColor = isSelected
37 - ? Palette.greyBlueCraiola
38 - : Palette.shadowWhite;
39 -
40 - final primaryTextColor = isSelected
41 - ? Colors.white
42 - : Palette.darkGray;
43 -
44 - final secondaryTextColor = isSelected
45 - ? Colors.white
46 - : Palette.darkBlueCraiola;
47 -
48 - return GestureDetector(
49 - onTap: onTap,
50 - child: Container(
51 - padding: EdgeInsets.only(
52 - left: 20,
53 - top: 28,
54 - bottom: 28,
55 - right: 20
56 - ),
57 - decoration: BoxDecoration(
58 - borderRadius: BorderRadius.all(Radius.circular(25)),
59 - color: backgroundColor
60 - ),
61 - child: Column(
62 - children: [
63 - Row(
64 - mainAxisAlignment: MainAxisAlignment.spaceBetween,
65 - mainAxisSize: MainAxisSize.max,
66 - crossAxisAlignment: CrossAxisAlignment.center,
67 - children: [
68 - Row(
69 - mainAxisAlignment: MainAxisAlignment.start,
70 - mainAxisSize: MainAxisSize.min,
71 - children: [
72 - if (providerIcon != null)
73 - Padding(
74 - padding: EdgeInsets.only(right: 10),
75 - child: providerIcon),
76 - Text(
77 - provider.title,
78 - style: TextStyle(
79 - color: secondaryTextColor,
80 - fontSize: 20,
81 - fontWeight: FontWeight.bold),
82 - )
83 - ],
84 - ),
85 - Column(
86 - crossAxisAlignment: CrossAxisAlignment.end,
87 - children: [
88 - if(achSourceAmount != null)...[
89 - Text(
90 - '${destAmount?.toString()} ${destCurrency.title}',
91 - style: TextStyle(
92 - color: secondaryTextColor,
93 - fontSize: 20,
94 - fontWeight: FontWeight.bold),
95 - ),
96 - Row(
97 - children: [
98 - Icon(
99 - Icons.account_balance_outlined,
100 - size: 12,
101 - color: primaryTextColor,
102 - ),
103 - SizedBox(width: 5),
104 - Text(
105 - '${achSourceAmount?.toString()} ${sourceCurrency.title}',
106 - style: TextStyle(
107 - color: primaryTextColor,
108 - fontSize: 16,
109 - fontWeight: FontWeight.bold),
110 - ),
111 - ],
112 - ),
113 - SizedBox(height: 10),
114 - ],
115 - Text(
116 - '${destAmount?.toString()} ${destCurrency.title}',
117 - style: TextStyle(
118 - color: secondaryTextColor,
119 - fontSize: 20,
120 - fontWeight: FontWeight.bold),
121 - ),
122 - Row(
123 - children: [
124 - Icon(
125 - CupertinoIcons.creditcard,
126 - size: 12,
127 - color: primaryTextColor,
128 - ),
129 - SizedBox(width: 5),
130 - Text(
131 - '${sourceAmount?.toString()} ${sourceCurrency.title}',
132 - style: TextStyle(
133 - color: primaryTextColor,
134 - fontSize: 16,
135 - fontWeight: FontWeight.bold),
136 - ),
137 - ],
138 - ),
139 - ],
140 - ),
141 - ],
142 - ),
143 - ],
144 - ),
145 - )
146 - );
147 - }
148 -}
\ No newline at end of file
lib/src/screens/cake_pay/auth/cake_pay_account_page.dart
+17 -15
@@ -1,11 +1,9 @@
1 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
1 import 'package:cake_wallet/routes.dart';
2 import 'package:cake_wallet/src/screens/base_page.dart';
3 import 'package:cake_wallet/generated/i18n.dart';
4 import 'package:cake_wallet/src/screens/cake_pay/widgets/cake_pay_tile.dart';
5 import 'package:cake_wallet/src/widgets/primary_button.dart';
6 import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
8 -import 'package:cake_wallet/typography.dart';
7 import 'package:cake_wallet/view_model/cake_pay/cake_pay_account_view_model.dart';
8 import 'package:flutter/material.dart';
9 import 'package:flutter_mobx/flutter_mobx.dart';
@@ -15,8 +13,6 @@ class CakePayAccountPage extends BasePage {
13
14 final CakePayAccountViewModel cakePayAccountViewModel;
15
18 -
19 -
16 @override
17 Widget leading(BuildContext context) {
18 return MergeSemantics(
@@ -29,7 +25,7 @@ class CakePayAccountPage extends BasePage {
25 label: S.of(context).seed_alert_back,
26 child: TextButton(
27 style: ButtonStyle(
32 - overlayColor: MaterialStateColor.resolveWith(
28 + overlayColor: WidgetStateColor.resolveWith(
29 (states) => Colors.transparent),
30 ),
31 onPressed: () => Navigator.pop(context),
@@ -45,8 +41,9 @@ class CakePayAccountPage extends BasePage {
41 Widget middle(BuildContext context) {
42 return Text(
43 S.current.account,
48 - style: textMediumSemiBold(
49 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
44 + style: Theme.of(context).textTheme.titleMedium?.copyWith(
45 + color: Theme.of(context).colorScheme.onSurface,
46 + fontWeight: FontWeight.w600,
47 ),
48 );
49 }
@@ -59,15 +56,20 @@ class CakePayAccountPage extends BasePage {
56 children: [
57 SizedBox(height: 20),
58 Observer(
62 - builder: (_) => Container(decoration: BoxDecoration(
63 - border: Border(
64 - bottom: BorderSide(
59 + builder: (_) => Container(
60 + decoration: BoxDecoration(
61 + border: Border(
62 + bottom: BorderSide(
63 width: 1.0,
66 - color:
67 - Theme.of(context).extension<CakeTextTheme>()!.secondaryTextColor),
64 + color: Theme.of(context).colorScheme.outlineVariant,
65 + ),
66 + ),
67 + ),
68 + child: CakePayTile(
69 + title: S.of(context).email_address,
70 + subTitle: cakePayAccountViewModel.email
71 ),
72 ),
70 - child: CakePayTile(title: S.of(context).email_address, subTitle: cakePayAccountViewModel.email)),
73 ),
74 ],
75 ),
@@ -75,8 +77,8 @@ class CakePayAccountPage extends BasePage {
77 bottomSection: Column(
78 children: [
79 PrimaryButton(
78 - color: Theme.of(context).primaryColor,
79 - textColor: Colors.white,
80 + color: Theme.of(context).colorScheme.primary,
81 + textColor: Theme.of(context).colorScheme.onPrimary,
82 text: S.of(context).logout,
83 onPressed: () {
84 cakePayAccountViewModel.logout();
lib/src/screens/cake_pay/auth/cake_pay_verify_otp_page.dart
+12 -12
@@ -1,14 +1,11 @@
1 import 'package:cake_wallet/generated/i18n.dart';
2 import 'package:cake_wallet/cake_pay/cake_pay_states.dart';
3 -import 'package:cake_wallet/palette.dart';
3 import 'package:cake_wallet/src/screens/base_page.dart';
4 import 'package:cake_wallet/src/widgets/alert_with_one_action.dart';
5 import 'package:cake_wallet/src/widgets/base_text_form_field.dart';
6 import 'package:cake_wallet/src/widgets/keyboard_done_button.dart';
7 import 'package:cake_wallet/src/widgets/primary_button.dart';
8 import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
10 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
11 -import 'package:cake_wallet/themes/extensions/keyboard_theme.dart';
9 import 'package:cake_wallet/typography.dart';
10 import 'package:cake_wallet/utils/show_pop_up.dart';
11 import 'package:cake_wallet/view_model/cake_pay/cake_pay_auth_view_model.dart';
@@ -42,7 +39,7 @@ class CakePayVerifyOtpPage extends BasePage {
39 return Text(
40 S.current.verification,
41 style: textMediumSemiBold(
45 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
42 + color: Theme.of(context).colorScheme.onSurface,
43 ),
44 );
45 }
@@ -63,7 +60,7 @@ class CakePayVerifyOtpPage extends BasePage {
60 return KeyboardActions(
61 config: KeyboardActionsConfig(
62 keyboardActionsPlatform: KeyboardActionsPlatform.IOS,
66 - keyboardBarColor: Theme.of(context).extension<KeyboardTheme>()!.keyboardBarColor,
63 + keyboardBarColor: Theme.of(context).colorScheme.surface,
64 nextFocus: false,
65 actions: [
66 KeyboardActionsItem(
@@ -73,7 +70,7 @@ class CakePayVerifyOtpPage extends BasePage {
70 ]),
71 child: Container(
72 height: 0,
76 - color: Theme.of(context).colorScheme.background,
73 + color: Theme.of(context).colorScheme.surface,
74 child: ScrollableWithBottomSection(
75 contentPadding: EdgeInsets.all(24),
76 content: Column(
@@ -88,7 +85,9 @@ class CakePayVerifyOtpPage extends BasePage {
85 SizedBox(height: 14),
86 Text(
87 S.of(context).fill_code,
91 - style: TextStyle(color: Color(0xff7A93BA), fontSize: 12),
88 + style: Theme.of(context).textTheme.bodySmall!.copyWith(
89 + color: Theme.of(context).colorScheme.onSurfaceVariant,
90 + ),
91 ),
92 SizedBox(height: 34),
93 Row(
@@ -100,7 +99,9 @@ class CakePayVerifyOtpPage extends BasePage {
99 onTap: () => _authViewModel.logIn(_email),
100 child: Text(
101 S.of(context).resend_code,
103 - style: textSmallSemiBold(color: Palette.blueCraiola),
102 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
103 + color: Theme.of(context).colorScheme.primary,
104 + ),
105 ),
106 ),
107 ],
@@ -119,8 +120,8 @@ class CakePayVerifyOtpPage extends BasePage {
120 onPressed: _verify,
121 isDisabled: _authViewModel.otpState is CakePayOtpSendDisabled,
122 isLoading: _authViewModel.otpState is CakePayOtpValidating,
122 - color: Theme.of(context).primaryColor,
123 - textColor: Colors.white,
123 + color: Theme.of(context).colorScheme.primary,
124 + textColor: Theme.of(context).colorScheme.onPrimary,
125 ),
126 ),
127 SizedBox(height: 20),
@@ -145,8 +146,7 @@ class CakePayVerifyOtpPage extends BasePage {
146 });
147 }
148
148 - void _onOtpSuccessful(BuildContext context) =>
149 - Navigator.pop(context);
149 + void _onOtpSuccessful(BuildContext context) => Navigator.pop(context);
150
151 void _verify() async => await _authViewModel.verifyEmail(_codeController.text);
152 }
lib/src/screens/cake_pay/auth/cake_pay_welcome_page.dart
+5 -6
@@ -7,7 +7,6 @@ import 'package:cake_wallet/src/widgets/alert_with_one_action.dart';
7 import 'package:cake_wallet/src/widgets/base_text_form_field.dart';
8 import 'package:cake_wallet/src/widgets/primary_button.dart';
9 import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
10 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
10 import 'package:cake_wallet/typography.dart';
11 import 'package:cake_wallet/utils/show_pop_up.dart';
12 import 'package:cake_wallet/view_model/cake_pay/cake_pay_auth_view_model.dart';
@@ -34,7 +33,7 @@ class CakePayWelcomePage extends BasePage {
33 return Text(
34 S.current.welcome_to_cakepay,
35 style: textMediumSemiBold(
37 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
36 + color: Theme.of(context).colorScheme.onSurface,
37 ),
38 );
39 }
@@ -68,12 +67,12 @@ class CakePayWelcomePage extends BasePage {
67 Text(
68 S.of(context).about_cake_pay,
69 style: textLarge(
71 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
70 + color: Theme.of(context).colorScheme.onSurface,
71 ),
72 ),
73 SizedBox(height: 20),
74 Text(S.of(context).cake_pay_account_note,
76 - style: textLarge(color: Theme.of(context).extension<CakeTextTheme>()!.titleColor)),
75 + style: textLarge(color: Theme.of(context).colorScheme.onSurface)),
76 ],
77 ),
78 bottomSectionPadding: EdgeInsets.symmetric(vertical: 36, horizontal: 24),
@@ -88,8 +87,8 @@ class CakePayWelcomePage extends BasePage {
87 onPressed: _login,
88 isLoading:
89 _authViewModel.userVerificationState is CakePayUserVerificationStateLoading,
91 - color: Theme.of(context).primaryColor,
92 - textColor: Colors.white,
90 + color: Theme.of(context).colorScheme.primary,
91 + textColor: Theme.of(context).colorScheme.onPrimary,
92 ),
93 ),
94 SizedBox(
lib/src/screens/cake_pay/cards/cake_pay_buy_card_page.dart
+45 -62
@@ -15,9 +15,6 @@ import 'package:cake_wallet/src/widgets/keyboard_done_button.dart';
15 import 'package:cake_wallet/src/widgets/number_text_fild_widget.dart';
16 import 'package:cake_wallet/src/widgets/primary_button.dart';
17 import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
18 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
19 -import 'package:cake_wallet/themes/extensions/keyboard_theme.dart';
20 -import 'package:cake_wallet/themes/extensions/send_page_theme.dart';
18 import 'package:cake_wallet/typography.dart';
19 import 'package:cake_wallet/utils/responsive_layout_util.dart';
20 import 'package:cake_wallet/utils/show_pop_up.dart';
@@ -60,11 +57,10 @@ class CakePayBuyCardPage extends BasePage {
57 title,
58 textAlign: TextAlign.center,
59 maxLines: 2,
63 - style: TextStyle(
64 - fontSize: 18.0,
65 - fontWeight: FontWeight.bold,
66 - fontFamily: 'Lato',
67 - color: titleColor(context)),
60 + style: Theme.of(context).textTheme.titleLarge?.copyWith(
61 + color: Theme.of(context).colorScheme.onSurface,
62 + fontWeight: FontWeight.w600,
63 + ),
64 );
65 }
66
@@ -82,7 +78,7 @@ class CakePayBuyCardPage extends BasePage {
78 disableScroll: true,
79 config: KeyboardActionsConfig(
80 keyboardActionsPlatform: KeyboardActionsPlatform.IOS,
85 - keyboardBarColor: Theme.of(context).extension<KeyboardTheme>()!.keyboardBarColor,
81 + keyboardBarColor: Theme.of(context).colorScheme.surface,
82 nextFocus: false,
83 actions: [
84 KeyboardActionsItem(
@@ -91,7 +87,7 @@ class CakePayBuyCardPage extends BasePage {
87 ),
88 ]),
89 child: Container(
94 - color: Theme.of(context).colorScheme.background,
90 + color: Theme.of(context).colorScheme.surface,
91 child: ScrollableWithBottomSection(
92 contentPadding: EdgeInsets.zero,
93 content: Column(
@@ -103,8 +99,8 @@ class CakePayBuyCardPage extends BasePage {
99 decoration: BoxDecoration(
100 gradient: LinearGradient(
101 colors: [
106 - Theme.of(context).extension<SendPageTheme>()!.firstGradientColor,
107 - Theme.of(context).extension<SendPageTheme>()!.secondGradientColor,
102 + Theme.of(context).colorScheme.primary,
103 + Theme.of(context).colorScheme.secondary,
104 ],
105 begin: Alignment.topLeft,
106 end: Alignment.bottomRight,
@@ -145,12 +141,13 @@ class CakePayBuyCardPage extends BasePage {
141 children: [
142 SizedBox(height: 24),
143 Expanded(
148 - child: Text(S.of(context).enter_amount,
149 - style: TextStyle(
150 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
151 - fontSize: 24,
152 - fontWeight: FontWeight.w600,
153 - )),
144 + child: Text(
145 + S.of(context).enter_amount,
146 + style: Theme.of(context).textTheme.bodyLarge!.copyWith(
147 + fontSize: 24,
148 + fontWeight: FontWeight.w600,
149 + ),
150 + ),
151 ),
152 card.denominations.isNotEmpty
153 ? Expanded(
@@ -187,16 +184,22 @@ class CakePayBuyCardPage extends BasePage {
184 padding: const EdgeInsets.only(bottom: 8.0),
185 child: Container(
186 decoration: BoxDecoration(
190 - color: Theme.of(context).primaryColor,
187 + color: Theme.of(context).colorScheme.primary,
188 borderRadius: BorderRadius.circular(10),
192 - border: Border.all(color: Colors.white.withOpacity(0.20)),
189 + border: Border.all(
190 + color:
191 + Theme.of(context).colorScheme.onPrimary.withOpacity(0.20),
192 + ),
193 ),
194 child: Padding(
195 padding: const EdgeInsets.all(8.0),
196 child: Text(
197 vendor.cakeWarnings!,
198 textAlign: TextAlign.center,
199 - style: textSmallSemiBold(color: Colors.white),
199 + style: Theme.of(context).textTheme.bodySmall?.copyWith(
200 + color: Theme.of(context).colorScheme.onPrimary,
201 + fontWeight: FontWeight.w600,
202 + ),
203 ),
204 ),
205 ),
@@ -205,13 +208,10 @@ class CakePayBuyCardPage extends BasePage {
208 child: SingleChildScrollView(
209 child: ClickableLinksText(
210 text: card.description ?? '',
208 - textStyle: TextStyle(
209 - color: Theme.of(context)
210 - .extension<CakeTextTheme>()!
211 - .secondaryTextColor,
212 - fontSize: 18,
213 - fontWeight: FontWeight.w400,
214 - ),
211 + textStyle: Theme.of(context).textTheme.bodyMedium!.copyWith(
212 + color: Theme.of(context).colorScheme.onSurfaceVariant,
213 + fontSize: 18,
214 + ),
215 ),
216 ),
217 ),
@@ -235,8 +235,8 @@ class CakePayBuyCardPage extends BasePage {
235 : navigateToCakePayBuyCardDetailPage(context, card),
236 text: S.of(context).buy_now,
237 isDisabled: !cakePayBuyCardViewModel.isEnablePurchase,
238 - color: Theme.of(context).primaryColor,
239 - textColor: Colors.white,
238 + color: Theme.of(context).colorScheme.primary,
239 + textColor: Theme.of(context).colorScheme.onPrimary,
240 ),
241 );
242 }),
@@ -358,8 +358,7 @@ class _DenominationsAmountWidget extends StatelessWidget {
358 items: denominations,
359 itemPrefix: fiatCurrency,
360 selectedItem: denominations.first,
361 - textStyle: textMediumSemiBold(
362 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor),
361 + textStyle: textMediumSemiBold(color: Theme.of(context).colorScheme.onSurface),
362 onItemSelected: (value) {
363 amountController.text = value;
364 onAmountChanged(value);
@@ -374,14 +373,12 @@ class _DenominationsAmountWidget extends StatelessWidget {
373 decoration: BoxDecoration(
374 border: Border(
375 top: BorderSide(
377 - width: 1.0,
378 - color: Theme.of(context).extension<CakeTextTheme>()!.secondaryTextColor),
376 + width: 1.0, color: Theme.of(context).colorScheme.onSurfaceVariant),
377 ),
378 ),
379 child: Text(S.of(context).choose_card_value + ':',
380 maxLines: 2,
383 - style: textSmall(
384 - color: Theme.of(context).extension<CakeTextTheme>()!.secondaryTextColor)),
381 + style: textSmall(color: Theme.of(context).colorScheme.onSurfaceVariant)),
382 ),
383 ),
384 ],
@@ -408,14 +405,12 @@ class _DenominationsAmountWidget extends StatelessWidget {
405 decoration: BoxDecoration(
406 border: Border(
407 top: BorderSide(
411 - width: 1.0,
412 - color: Theme.of(context).extension<CakeTextTheme>()!.secondaryTextColor),
408 + width: 1.0, color: Theme.of(context).colorScheme.onSurfaceVariant),
409 ),
410 ),
411 child: Text(S.of(context).quantity + ':',
412 maxLines: 1,
417 - style: textSmall(
418 - color: Theme.of(context).extension<CakeTextTheme>()!.secondaryTextColor)),
413 + style: textSmall(color: Theme.of(context).colorScheme.onSurfaceVariant)),
414 ),
415 ),
416 ],
@@ -434,8 +429,7 @@ class _DenominationsAmountWidget extends StatelessWidget {
429 '$fiatCurrency ${cakePayBuyCardViewModel.totalAmount}',
430 maxLines: 1,
431 style: textMediumSemiBold(
437 - color:
438 - Theme.of(context).extension<CakeTextTheme>()!.titleColor)))),
432 + color: Theme.of(context).colorScheme.onSurface)))),
433 ),
434 const SizedBox(height: 4),
435 Expanded(
@@ -444,16 +438,12 @@ class _DenominationsAmountWidget extends StatelessWidget {
438 decoration: BoxDecoration(
439 border: Border(
440 top: BorderSide(
447 - width: 1.0,
448 - color:
449 - Theme.of(context).extension<CakeTextTheme>()!.secondaryTextColor),
441 + width: 1.0, color: Theme.of(context).colorScheme.onSurfaceVariant),
442 ),
443 ),
444 child: Text(S.of(context).total + ':',
445 maxLines: 1,
454 - style: textSmall(
455 - color:
456 - Theme.of(context).extension<CakeTextTheme>()!.secondaryTextColor)),
446 + style: textSmall(color: Theme.of(context).colorScheme.onSurfaceVariant)),
447 ),
448 ),
449 ],
@@ -487,9 +477,7 @@ class _EnterAmountWidget extends StatelessWidget {
477 Container(
478 decoration: BoxDecoration(
479 border: Border(
490 - bottom: BorderSide(
491 - width: 1.0,
492 - color: Theme.of(context).extension<CakeTextTheme>()!.secondaryTextColor),
480 + bottom: BorderSide(width: 1.0, color: Theme.of(context).colorScheme.onSurfaceVariant),
481 ),
482 ),
483 child: BaseTextFormField(
@@ -497,19 +485,16 @@ class _EnterAmountWidget extends StatelessWidget {
485 keyboardType: TextInputType.numberWithOptions(signed: false, decimal: true),
486 hintText: '0.00',
487 maxLines: null,
500 - borderColor: Colors.transparent,
488 prefixIcon: Padding(
489 padding: const EdgeInsets.only(top: 12),
490 child: Text(
491 '$fiatCurrency: ',
505 - style: textMediumSemiBold(
506 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor),
492 + style: textMediumSemiBold(color: Theme.of(context).colorScheme.onSurface),
493 ),
494 ),
509 - textStyle:
510 - textMediumSemiBold(color: Theme.of(context).extension<CakeTextTheme>()!.titleColor),
511 - placeholderTextStyle: textMediumSemiBold(
512 - color: Theme.of(context).extension<CakeTextTheme>()!.secondaryTextColor),
495 + textStyle: textMediumSemiBold(color: Theme.of(context).colorScheme.onSurface),
496 + placeholderTextStyle:
497 + textMediumSemiBold(color: Theme.of(context).colorScheme.onSurfaceVariant),
498 inputFormatters: [
499 FilteringTextInputFormatter.deny(RegExp('[\-|\ ]')),
500 FilteringTextInputFormatter.allow(
@@ -523,11 +508,9 @@ class _EnterAmountWidget extends StatelessWidget {
508 mainAxisAlignment: MainAxisAlignment.spaceBetween,
509 children: [
510 Text(S.of(context).min_amount(minValue) + ' $fiatCurrency',
526 - style: textSmall(
527 - color: Theme.of(context).extension<CakeTextTheme>()!.secondaryTextColor)),
511 + style: textSmall(color: Theme.of(context).colorScheme.onSurfaceVariant)),
512 Text(S.of(context).max_amount(maxValue) + ' $fiatCurrency',
529 - style: textSmall(
530 - color: Theme.of(context).extension<CakeTextTheme>()!.secondaryTextColor)),
513 + style: textSmall(color: Theme.of(context).colorScheme.onSurfaceVariant)),
514 ],
515 ),
516 ],
lib/src/screens/cake_pay/cards/cake_pay_cards_page.dart
+105 -122
@@ -7,14 +7,10 @@ import 'package:cake_wallet/src/screens/base_page.dart';
7 import 'package:cake_wallet/src/screens/cake_pay/widgets/card_item.dart';
8 import 'package:cake_wallet/src/screens/cake_pay/widgets/card_menu.dart';
9 import 'package:cake_wallet/src/screens/dashboard/widgets/filter_widget.dart';
10 +import 'package:cake_wallet/src/widgets/base_text_form_field.dart';
11 import 'package:cake_wallet/src/widgets/cake_scrollbar.dart';
12 import 'package:cake_wallet/src/widgets/gradient_background.dart';
13 import 'package:cake_wallet/src/widgets/picker.dart';
13 -import 'package:cake_wallet/themes/extensions/balance_page_theme.dart';
14 -import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
15 -import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart';
16 -import 'package:cake_wallet/themes/extensions/filter_theme.dart';
17 -import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart';
14 import 'package:cake_wallet/typography.dart';
15 import 'package:cake_wallet/utils/debounce.dart';
16 import 'package:cake_wallet/utils/responsive_layout_util.dart';
@@ -60,7 +56,7 @@ class CakePayCardsPage extends BasePage {
56 return Text(
57 'Cake Pay',
58 style: textMediumSemiBold(
63 - color: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
59 + color: Theme.of(context).colorScheme.onSurface,
60 ),
61 );
62 }
@@ -68,66 +64,70 @@ class CakePayCardsPage extends BasePage {
64 @override
65 Widget trailing(BuildContext context) {
66 return _TrailingIcon(
71 - asset: 'assets/images/profile.png',
72 - iconColor: pageIconColor(context) ?? Colors.white,
73 - onPressed: () {
74 - _cardsListViewModel.isCakePayUserAuthenticated().then((value) {
67 + asset: 'assets/images/profile.png',
68 + iconColor: Theme.of(context).colorScheme.onSurface,
69 + onPressed: () {
70 + _cardsListViewModel.isCakePayUserAuthenticated().then(
71 + (value) {
72 if (value) {
73 Navigator.pushNamed(context, Routes.cakePayAccountPage);
74 return;
75 }
76 Navigator.pushNamed(context, Routes.cakePayWelcomePage);
80 - });
81 - });
77 + },
78 + );
79 + },
80 + );
81 }
82
83 @override
84 Widget body(BuildContext context) {
86 -
85 if (_cardsListViewModel.settingsStore.selectedCakePayCountry == null) {
88 - WidgetsBinding.instance.addPostFrameCallback((_) {
89 - reaction((_) => _cardsListViewModel.shouldShowCountryPicker, (bool shouldShowCountryPicker) async {
90 - if (shouldShowCountryPicker) {
91 - _cardsListViewModel.storeInitialFilterStates();
92 - await showCountryPicker(context, _cardsListViewModel);
93 - if (_cardsListViewModel.hasFiltersChanged) {
94 - _cardsListViewModel.resetLoadingNextPageState();
95 - _cardsListViewModel.getVendors();
96 - }
97 -
98 - _cardsListViewModel.settingsStore.selectedCakePayCountry =
99 - _cardsListViewModel.selectedCountry;
86 + WidgetsBinding.instance.addPostFrameCallback((_) {
87 + reaction((_) => _cardsListViewModel.shouldShowCountryPicker,
88 + (bool shouldShowCountryPicker) async {
89 + if (shouldShowCountryPicker) {
90 + _cardsListViewModel.storeInitialFilterStates();
91 + await showCountryPicker(context, _cardsListViewModel);
92 + if (_cardsListViewModel.hasFiltersChanged) {
93 + _cardsListViewModel.resetLoadingNextPageState();
94 + _cardsListViewModel.getVendors();
95 + }
96
101 - }
97 + _cardsListViewModel.settingsStore.selectedCakePayCountry =
98 + _cardsListViewModel.selectedCountry;
99 + }
100 + });
101 });
103 - });
102 }
103
104 final filterButton = Semantics(
105 label: S.of(context).filter_by,
106 child: GestureDetector(
109 - onTap: () async {
110 - _cardsListViewModel.storeInitialFilterStates();
111 - await showFilterWidget(context);
112 - if (_cardsListViewModel.hasFiltersChanged) {
113 - _cardsListViewModel.resetLoadingNextPageState();
114 - _cardsListViewModel.getVendors();
115 - }
116 - },
117 - child: Container(
118 - width: 32,
119 - padding: EdgeInsets.only(top: 7, bottom: 7),
120 - decoration: BoxDecoration(
121 - color: Theme.of(context).extension<SyncIndicatorTheme>()!.syncedBackgroundColor,
122 - border: Border.all(
123 - color: Colors.transparent,
124 - ),
125 - borderRadius: BorderRadius.circular(10),
126 - ),
127 - child: Image.asset(
128 - 'assets/images/filter_icon.png',
129 - color: Theme.of(context).extension<FilterTheme>()!.iconColor,
130 - ))),
107 + onTap: () async {
108 + _cardsListViewModel.storeInitialFilterStates();
109 + await showFilterWidget(context);
110 + if (_cardsListViewModel.hasFiltersChanged) {
111 + _cardsListViewModel.resetLoadingNextPageState();
112 + _cardsListViewModel.getVendors();
113 + }
114 + },
115 + child: Container(
116 + width: 32,
117 + padding: EdgeInsets.only(top: 7, bottom: 7),
118 + decoration: BoxDecoration(
119 + color: Theme.of(context).colorScheme.surface,
120 + border: Border.all(
121 + color: Colors.transparent,
122 + ),
123 + borderRadius: BorderRadius.circular(10),
124 + ),
125 + child: Image.asset(
126 + 'assets/images/filter_icon.png',
127 + color: Theme.of(context).colorScheme.onSurfaceVariant,
128 + ),
129 + ),
130 + ),
131 );
132 final _countryPicker = Semantics(
133 label: S.of(context).filter_by,
@@ -143,7 +143,7 @@ class CakePayCardsPage extends BasePage {
143 child: Container(
144 padding: EdgeInsets.symmetric(horizontal: 8),
145 decoration: BoxDecoration(
146 - color: Theme.of(context).extension<SyncIndicatorTheme>()!.syncedBackgroundColor,
146 + color: Theme.of(context).colorScheme.surface,
147 border: Border.all(color: Colors.transparent),
148 borderRadius: BorderRadius.circular(10),
149 ),
@@ -163,11 +163,10 @@ class CakePayCardsPage extends BasePage {
163 SizedBox(width: 6),
164 Text(
165 _cardsListViewModel.selectedCountry.countryCode,
166 - style: TextStyle(
167 - color: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
168 - fontSize: 16,
169 - fontWeight: FontWeight.w700,
170 - ),
166 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
167 + fontSize: 16,
168 + fontWeight: FontWeight.w700,
169 + ),
170 ),
171 ],
172 ),
@@ -177,25 +176,32 @@ class CakePayCardsPage extends BasePage {
176 );
177
178 return Padding(
180 - padding: const EdgeInsets.all(14.0),
181 - child: Column(children: [
179 + padding: const EdgeInsets.all(14.0),
180 + child: Column(
181 + children: [
182 Container(
183 - padding: EdgeInsets.only(left: 2, right: 22),
184 - height: 32,
185 - child: Row(children: [
183 + padding: EdgeInsets.only(left: 2, right: 22),
184 + height: 32,
185 + child: Row(
186 + children: [
187 Expanded(
187 - child: _SearchWidget(
188 - controller: _searchController,
189 - focusNode: searchFocusNode,
190 - )),
188 + child: _SearchWidget(
189 + controller: _searchController,
190 + focusNode: searchFocusNode,
191 + ),
192 + ),
193 SizedBox(width: 5),
194 filterButton,
195 SizedBox(width: 5),
196 _countryPicker
195 - ])),
197 + ],
198 + ),
199 + ),
200 SizedBox(height: 8),
201 Expanded(child: CakePayCardsPageBody(cardsListViewModel: _cardsListViewModel))
198 - ]));
202 + ],
203 + ),
204 + );
205 }
206
207 Future<void> showFilterWidget(BuildContext context) async {
@@ -208,26 +214,25 @@ class CakePayCardsPage extends BasePage {
214 }
215 }
216
211 -
212 -Future<void> showCountryPicker(BuildContext context, CakePayCardsListViewModel cardsListViewModel) async {
217 +Future<void> showCountryPicker(
218 + BuildContext context, CakePayCardsListViewModel cardsListViewModel) async {
219 await showPopUp<void>(
220 context: context,
221 builder: (_) => Picker(
216 - title: S.of(context).select_your_country,
222 + title: S.of(context).select_your_country,
223 items: cardsListViewModel.availableCountries,
224 images: cardsListViewModel.availableCountries
225 .map((e) => Image.asset(
220 - e.iconPath,
221 - errorBuilder: (context, error, stackTrace) => Container(
222 - width: 58,
223 - height: 58,
224 - ),
225 - ))
226 + e.iconPath,
227 + errorBuilder: (context, error, stackTrace) => Container(
228 + width: 58,
229 + height: 58,
230 + ),
231 + ))
232 .toList(),
227 - selectedAtIndex: cardsListViewModel.availableCountries
228 - .indexOf(cardsListViewModel.selectedCountry),
229 - onItemSelected: (Country country) =>
230 - cardsListViewModel.setSelectedCountry(country),
233 + selectedAtIndex:
234 + cardsListViewModel.availableCountries.indexOf(cardsListViewModel.selectedCountry),
235 + onItemSelected: (Country country) => cardsListViewModel.setSelectedCountry(country),
236 isSeparated: false,
237 hintText: S.of(context).search,
238 matchingCriteria: (Country country, String searchText) =>
@@ -310,10 +315,9 @@ class _CakePayCardsPageBodyState extends State<CakePayCardsPageBody> {
315 },
316 title: vendor.name,
317 subTitle: vendor.card?.description ?? '',
313 - backgroundColor:
314 - Theme.of(context).extension<SyncIndicatorTheme>()!.syncedBackgroundColor,
315 - titleColor: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
316 - subtitleColor: Theme.of(context).extension<BalancePageTheme>()!.labelTextColor,
318 + backgroundColor: Theme.of(context).colorScheme.surface,
319 + titleColor: Theme.of(context).colorScheme.onSurface,
320 + subtitleColor: Theme.of(context).colorScheme.onSecondary,
321 discount: 0.0,
322 );
323 },
@@ -324,10 +328,8 @@ class _CakePayCardsPageBodyState extends State<CakePayCardsPageBody> {
328 thumbHeight: thumbHeight,
329 rightOffset: 1,
330 width: 3,
327 - backgroundColor:
328 - Theme.of(context).extension<FilterTheme>()!.iconColor.withOpacity(0.05),
329 - thumbColor:
330 - Theme.of(context).extension<FilterTheme>()!.iconColor.withOpacity(0.5),
331 + backgroundColor: Theme.of(context).colorScheme.onSurfaceVariant.withOpacity(0.05),
332 + thumbColor: Theme.of(context).colorScheme.onSurfaceVariant.withOpacity(0.5),
333 fromTop: widget.cardsListViewModel.scrollOffsetFromTop,
334 )
335 : Offstage()
@@ -343,9 +345,8 @@ class _VendorLoadedIndicator extends StatelessWidget {
345 Widget build(BuildContext context) {
346 return Center(
347 child: CircularProgressIndicator(
346 - backgroundColor: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
347 - valueColor: AlwaysStoppedAnimation<Color>(
348 - Theme.of(context).extension<ExchangePageTheme>()!.firstGradientBottomPanelColor),
348 + backgroundColor: Theme.of(context).colorScheme.onSurface,
349 + valueColor: AlwaysStoppedAnimation<Color>(Theme.of(context).colorScheme.primary),
350 ),
351 );
352 }
@@ -362,41 +363,23 @@ class _SearchWidget extends StatelessWidget {
363
364 @override
365 Widget build(BuildContext context) {
365 - final searchIcon = ExcludeSemantics(
366 - child: Icon( Icons.search,
367 - color: Theme.of(context).extension<FilterTheme>()!.iconColor,
368 - //size: 24
369 - ),
370 - );
371 -
372 - return TextField(
366 + return BaseTextFormField(
367 focusNode: focusNode,
374 - style: TextStyle(color: Theme.of(context).extension<DashboardPageTheme>()!.textColor),
368 + textStyle: Theme.of(context).textTheme.bodyMedium,
369 controller: controller,
376 - decoration: InputDecoration(
377 - filled: true,
378 - contentPadding: EdgeInsets.only(
379 - top: 8,
380 - left: 8,
370 + contentPadding: EdgeInsets.only(top: 8, left: 8),
371 + hintText: S.of(context).search,
372 + placeholderTextStyle: Theme.of(context).textTheme.bodyMedium?.copyWith(
373 + color: Theme.of(context).colorScheme.onSurface,
374 ),
382 - fillColor: Theme.of(context).extension<SyncIndicatorTheme>()!.syncedBackgroundColor,
383 - hintText: S.of(context).search,
384 - hintStyle: TextStyle(
385 - color: Theme.of(context).extension<BalancePageTheme>()!.labelTextColor,
386 - ),
387 - alignLabelWithHint: true,
388 - floatingLabelBehavior: FloatingLabelBehavior.never,
389 - suffixIcon: searchIcon,
390 - enabledBorder: OutlineInputBorder(
391 - borderSide: BorderSide(
392 - color: Colors.transparent,
393 - ),
394 - borderRadius: BorderRadius.circular(10),
395 - ),
396 - focusedBorder: OutlineInputBorder(
397 - borderSide: BorderSide(color: Colors.white.withOpacity(0.2)),
398 - borderRadius: BorderRadius.circular(10),
399 - )),
375 + alignLabelWithHint: true,
376 + floatingLabelBehavior: FloatingLabelBehavior.never,
377 + suffixIcon: ExcludeSemantics(
378 + child: Icon(
379 + Icons.search,
380 + color: Theme.of(context).colorScheme.primary,
381 + ),
382 + ),
383 );
384 }
385 }
lib/src/screens/cake_pay/cards/cake_pay_confirm_purchase_card_page.dart
+86 -85
@@ -1,6 +1,6 @@
1 +import 'package:cake_wallet/cake_pay/cake_pay_card.dart';
2 import 'package:cake_wallet/core/execution_state.dart';
3 import 'package:cake_wallet/generated/i18n.dart';
3 -import 'package:cake_wallet/cake_pay/cake_pay_card.dart';
4 import 'package:cake_wallet/routes.dart';
5 import 'package:cake_wallet/src/screens/base_page.dart';
6 import 'package:cake_wallet/src/screens/cake_pay/widgets/cake_pay_alert_modal.dart';
@@ -15,10 +15,6 @@ import 'package:cake_wallet/src/widgets/bottom_sheet/info_bottom_sheet_widget.da
15 import 'package:cake_wallet/src/widgets/primary_button.dart';
16 import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
17 import 'package:cake_wallet/src/widgets/standard_checkbox.dart';
18 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
19 -import 'package:cake_wallet/themes/extensions/picker_theme.dart';
20 -import 'package:cake_wallet/themes/extensions/receive_page_theme.dart';
21 -import 'package:cake_wallet/typography.dart';
18 import 'package:cake_wallet/utils/show_pop_up.dart';
19 import 'package:cake_wallet/view_model/cake_pay/cake_pay_purchase_view_model.dart';
20 import 'package:cake_wallet/view_model/send/send_view_model_state.dart';
@@ -42,11 +38,10 @@ class CakePayBuyCardDetailPage extends BasePage {
38 title,
39 textAlign: TextAlign.center,
40 maxLines: 2,
45 - style: TextStyle(
46 - fontSize: 18.0,
47 - fontWeight: FontWeight.bold,
48 - fontFamily: 'Lato',
49 - color: titleColor(context)),
41 + style: Theme.of(context).textTheme.titleLarge?.copyWith(
42 + color: Theme.of(context).colorScheme.onSurface,
43 + fontWeight: FontWeight.bold,
44 + ),
45 );
46 }
47
@@ -72,9 +67,11 @@ class CakePayBuyCardDetailPage extends BasePage {
67 BorderRadius.horizontal(left: Radius.circular(20), right: Radius.circular(20)),
68 child: Container(
69 decoration: BoxDecoration(
75 - color: Theme.of(context).extension<PickerTheme>()!.searchBackgroundFillColor,
70 + color: Theme.of(context).colorScheme.surfaceContainerLowest,
71 borderRadius: BorderRadius.circular(20),
77 - border: Border.all(color: Colors.white.withOpacity(0.20)),
72 + border: Border.all(
73 + color: Theme.of(context).colorScheme.outline.withOpacity(0.20),
74 + ),
75 ),
76 child: Row(
77 children: [
@@ -104,16 +101,16 @@ class CakePayBuyCardDetailPage extends BasePage {
101 children: [
102 Text(
103 S.of(context).value + ':',
107 - style: textLarge(
108 - color:
109 - Theme.of(context).extension<CakeTextTheme>()!.titleColor),
104 + style: Theme.of(context).textTheme.titleLarge?.copyWith(
105 + color: Theme.of(context).colorScheme.onSurface,
106 + ),
107 ),
108 SizedBox(width: 8),
109 Text(
110 '${cakePayPurchaseViewModel.amount.toStringAsFixed(2)} ${cakePayPurchaseViewModel.fiatCurrency}',
114 - style: textLarge(
115 - color:
116 - Theme.of(context).extension<CakeTextTheme>()!.titleColor),
111 + style: Theme.of(context).textTheme.titleLarge?.copyWith(
112 + color: Theme.of(context).colorScheme.onSurface,
113 + ),
114 ),
115 ],
116 ),
@@ -122,16 +119,16 @@ class CakePayBuyCardDetailPage extends BasePage {
119 children: [
120 Text(
121 S.of(context).quantity + ':',
125 - style: textLarge(
126 - color:
127 - Theme.of(context).extension<CakeTextTheme>()!.titleColor),
122 + style: Theme.of(context).textTheme.titleLarge?.copyWith(
123 + color: Theme.of(context).colorScheme.onSurface,
124 + ),
125 ),
126 SizedBox(width: 8),
127 Text(
128 '${cakePayPurchaseViewModel.quantity}',
132 - style: textLarge(
133 - color:
134 - Theme.of(context).extension<CakeTextTheme>()!.titleColor),
129 + style: Theme.of(context).textTheme.titleLarge?.copyWith(
130 + color: Theme.of(context).colorScheme.onSurface,
131 + ),
132 ),
133 ],
134 ),
@@ -140,16 +137,16 @@ class CakePayBuyCardDetailPage extends BasePage {
137 children: [
138 Text(
139 S.of(context).total + ':',
143 - style: textLarge(
144 - color:
145 - Theme.of(context).extension<CakeTextTheme>()!.titleColor),
140 + style: Theme.of(context).textTheme.titleLarge?.copyWith(
141 + color: Theme.of(context).colorScheme.onSurface,
142 + ),
143 ),
144 SizedBox(width: 8),
145 Text(
146 '${cakePayPurchaseViewModel.totalAmount.toStringAsFixed(2)} ${cakePayPurchaseViewModel.fiatCurrency}',
150 - style: textLarge(
151 - color:
152 - Theme.of(context).extension<CakeTextTheme>()!.titleColor),
147 + style: Theme.of(context).textTheme.titleLarge?.copyWith(
148 + color: Theme.of(context).colorScheme.onSurface,
149 + ),
150 ),
151 ],
152 ),
@@ -176,15 +173,17 @@ class CakePayBuyCardDetailPage extends BasePage {
173 crossAxisAlignment: CrossAxisAlignment.start,
174 children: [
175 Text(S.of(context).expiry_and_validity + ':',
179 - style: textMediumSemiBold(
180 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor)),
176 + style: Theme.of(context).textTheme.titleLarge?.copyWith(
177 + color: Theme.of(context).colorScheme.onSurface,
178 + fontWeight: FontWeight.w600,
179 + )),
180 SizedBox(height: 10),
181 Container(
182 width: double.infinity,
183 decoration: BoxDecoration(
184 border: Border(
185 bottom: BorderSide(
187 - color: Theme.of(context).extension<CakeTextTheme>()!.secondaryTextColor,
186 + color: Theme.of(context).colorScheme.outline.withOpacity(0.20),
187 width: 1,
188 ),
189 ),
@@ -193,9 +192,9 @@ class CakePayBuyCardDetailPage extends BasePage {
192 padding: const EdgeInsets.only(bottom: 8.0),
193 child: Text(
194 card.expiryAndValidity ?? '',
196 - style: textMedium(
197 - color: Theme.of(context).extension<CakeTextTheme>()!.secondaryTextColor,
198 - ),
195 + style: Theme.of(context).textTheme.bodyLarge?.copyWith(
196 + color: Theme.of(context).colorScheme.onSurfaceVariant,
197 + ),
198 ),
199 ),
200 ),
@@ -216,18 +215,21 @@ class CakePayBuyCardDetailPage extends BasePage {
215 cakePayPurchaseViewModel.sendViewModel.state is IsExecutingState,
216 onPressed: () => confirmPurchaseFirst(context),
217 text: S.of(context).purchase_gift_card,
219 - color: Theme.of(context).primaryColor,
220 - textColor: Colors.white,
218 + color: Theme.of(context).colorScheme.primary,
219 + textColor: Theme.of(context).colorScheme.onPrimary,
220 );
221 }),
222 ),
223 SizedBox(height: 8),
224 InkWell(
225 onTap: () => _showTermsAndCondition(context, card.termsAndConditions),
227 - child: Text(S.of(context).settings_terms_and_conditions,
228 - style: textMediumSemiBold(
229 - color: Theme.of(context).primaryColor,
230 - ).copyWith(fontSize: 12)),
226 + child: Text(
227 + S.of(context).settings_terms_and_conditions,
228 + style: Theme.of(context).textTheme.bodySmall?.copyWith(
229 + color: Theme.of(context).colorScheme.primary,
230 + fontWeight: FontWeight.w600,
231 + ),
232 + ),
233 ),
234 SizedBox(height: 16)
235 ],
@@ -245,11 +247,14 @@ class CakePayBuyCardDetailPage extends BasePage {
247 alignment: Alignment.bottomLeft,
248 child: ClickableLinksText(
249 text: termsAndConditions ?? '',
248 - textStyle: TextStyle(
249 - color: Theme.of(context).extension<CakeTextTheme>()!.secondaryTextColor,
250 - fontSize: 18,
251 - fontWeight: FontWeight.w400,
252 - ),
250 + textStyle: Theme.of(context).textTheme.bodyLarge?.copyWith(
251 + color: Theme.of(context).colorScheme.onSurfaceVariant,
252 + fontSize: 18,
253 + ) ??
254 + Theme.of(context).textTheme.bodyMedium!.copyWith(
255 + color: Theme.of(context).colorScheme.onSurfaceVariant,
256 + fontSize: 18,
257 + ),
258 ),
259 ),
260 actionTitle: S.of(context).agree,
@@ -311,9 +316,8 @@ class CakePayBuyCardDetailPage extends BasePage {
316 } catch (_) {
317 await cakePayPurchaseViewModel.cakePayService.logout();
318 }
314 -
315 - }
316 - cakePayPurchaseViewModel.isPurchasing = false;
319 + }
320 + cakePayPurchaseViewModel.isPurchasing = false;
321 }
322
323 void _showHowToUseCard(
@@ -330,23 +334,27 @@ class CakePayBuyCardDetailPage extends BasePage {
334 padding: EdgeInsets.all(10),
335 child: Text(
336 card.name,
333 - style: textLargeSemiBold(
334 - color: Theme.of(context).extension<ReceivePageTheme>()!.tilesTextColor,
335 - ),
337 + style: Theme.of(context).textTheme.titleLarge?.copyWith(
338 + color: Theme.of(context).colorScheme.onSurface,
339 + fontWeight: FontWeight.w600,
340 + ),
341 )),
342 ClickableLinksText(
343 text: card.howToUse ?? '',
339 - textStyle: TextStyle(
340 - color: Theme.of(context).extension<CakeTextTheme>()!.secondaryTextColor,
341 - fontSize: 18,
342 - fontWeight: FontWeight.w400,
343 - ),
344 - linkStyle: TextStyle(
345 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
346 - fontSize: 18,
347 - fontStyle: FontStyle.italic,
348 - fontWeight: FontWeight.w400,
349 - ),
344 + textStyle: Theme.of(context).textTheme.bodyLarge?.copyWith(
345 + color: Theme.of(context).colorScheme.onSurfaceVariant,
346 + ) ??
347 + Theme.of(context).textTheme.bodyMedium!.copyWith(
348 + color: Theme.of(context).colorScheme.onSurfaceVariant,
349 + ),
350 + linkStyle: Theme.of(context).textTheme.bodyLarge?.copyWith(
351 + color: Theme.of(context).colorScheme.onSurface,
352 + fontStyle: FontStyle.italic,
353 + ) ??
354 + Theme.of(context).textTheme.bodyMedium!.copyWith(
355 + color: Theme.of(context).colorScheme.onSurface,
356 + fontStyle: FontStyle.italic,
357 + ),
358 ),
359 ]),
360 actionTitle: S.current.got_it,
@@ -390,10 +398,12 @@ class CakePayBuyCardDetailPage extends BasePage {
398 currency: cakePayPurchaseViewModel.sendViewModel.selectedCryptoCurrency,
399 amount: S.of(popupContext).send_amount,
400 amountValue: cakePayPurchaseViewModel.sendViewModel.pendingTransaction!.amountFormatted,
393 - fiatAmountValue: cakePayPurchaseViewModel.sendViewModel.pendingTransactionFiatAmountFormatted,
401 + fiatAmountValue:
402 + cakePayPurchaseViewModel.sendViewModel.pendingTransactionFiatAmountFormatted,
403 fee: S.of(popupContext).send_fee,
404 feeValue: cakePayPurchaseViewModel.sendViewModel.pendingTransaction!.feeFormatted,
396 - feeFiatAmount: cakePayPurchaseViewModel.sendViewModel.pendingTransactionFeeFiatAmountFormatted,
405 + feeFiatAmount:
406 + cakePayPurchaseViewModel.sendViewModel.pendingTransactionFeeFiatAmountFormatted,
407 outputs: cakePayPurchaseViewModel.sendViewModel.outputs,
408 onSlideComplete: () async {
409 Navigator.of(popupContext).pop();
@@ -532,19 +542,15 @@ class ThreeCheckboxAlert extends BaseAlertDialog {
542
543 @override
544 String get titleText => alertTitle;
535 -
545 @override
546 bool get isDividerExists => true;
547
548 @override
549 String get leftActionButtonText => leftButtonText;
541 -
550 @override
551 String get rightActionButtonText => rightButtonText;
544 -
552 @override
553 VoidCallback get actionLeft => actionLeftButton;
547 -
554 @override
555 VoidCallback get actionRight => () {
556 actionRightButton(checkbox1, checkbox2, checkbox3);
@@ -669,14 +675,12 @@ class _ThreeCheckboxAlertContentState extends State<ThreeCheckboxAlertContent> {
675 padding: const EdgeInsets.only(top: 8.0),
676 child: Text(
677 S.of(context).settings_terms_and_conditions,
672 - style: TextStyle(
673 - fontSize: 16,
674 - fontFamily: 'Lato',
675 - fontWeight: FontWeight.w400,
676 - color: Theme.of(context).primaryColor,
677 - decoration: TextDecoration.none,
678 - height: 1,
679 - ),
678 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
679 + fontSize: 16,
680 + color: Theme.of(context).colorScheme.primary,
681 + decoration: TextDecoration.none,
682 + height: 1,
683 + ),
684 softWrap: true,
685 ),
686 ),
@@ -686,13 +690,10 @@ class _ThreeCheckboxAlertContentState extends State<ThreeCheckboxAlertContent> {
690 padding: const EdgeInsets.only(top: 8.0),
691 child: Text(
692 'Please confirm all checkboxes',
689 - style: TextStyle(
690 - color: Colors.red,
691 - fontSize: 14,
692 - fontFamily: 'Lato',
693 - fontWeight: FontWeight.w400,
694 - decoration: TextDecoration.none,
695 - ),
693 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
694 + color: Theme.of(context).colorScheme.errorContainer,
695 + decoration: TextDecoration.none,
696 + ),
697 ),
698 ),
699 ],
lib/src/screens/cake_pay/widgets/cake_pay_alert_modal.dart
+8 -11
@@ -1,8 +1,5 @@
1 import 'package:cake_wallet/src/widgets/alert_background.dart';
2 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
2 import 'package:cake_wallet/src/widgets/primary_button.dart';
4 -import 'package:cake_wallet/themes/extensions/cake_scrollbar_theme.dart';
5 -import 'package:cake_wallet/typography.dart';
3 import 'package:flutter/material.dart';
4
5 class CakePayAlertModal extends StatelessWidget {
@@ -34,7 +31,7 @@ class CakePayAlertModal extends StatelessWidget {
31 padding: EdgeInsets.only(top: 24, left: 24, right: 24),
32 margin: EdgeInsets.all(24),
33 decoration: BoxDecoration(
37 - color: Theme.of(context).colorScheme.background,
34 + color: Theme.of(context).colorScheme.surface,
35 borderRadius: BorderRadius.circular(30),
36 ),
37 child: Column(
@@ -42,8 +39,9 @@ class CakePayAlertModal extends StatelessWidget {
39 if (title.isNotEmpty)
40 Text(
41 title,
45 - style: textLargeSemiBold(
46 - color: Theme.of(context).extension<CakeScrollbarTheme>()!.thumbColor,
42 + style: Theme.of(context).textTheme.titleLarge?.copyWith(
43 + color: Theme.of(context).colorScheme.onSurface,
44 + fontWeight: FontWeight.bold,
45 ),
46 ),
47 Container(
@@ -58,9 +56,8 @@ class CakePayAlertModal extends StatelessWidget {
56 PrimaryButton(
57 onPressed: () => Navigator.pop(context),
58 text: actionTitle,
61 - color: Theme.of(context).cardColor,
62 - textColor:
63 - Theme.of(context).extension<CakeTextTheme>()!.titleColor,
59 + color: Theme.of(context).colorScheme.surfaceContainer,
60 + textColor: Theme.of(context).colorScheme.primary,
61 ),
62 SizedBox(height: 21),
63 ],
@@ -75,9 +72,9 @@ class CakePayAlertModal extends StatelessWidget {
72 child: CircleAvatar(
73 child: Icon(
74 Icons.close,
78 - color: Colors.black,
75 + color: Theme.of(context).colorScheme.onSurface,
76 ),
80 - backgroundColor: Colors.white,
77 + backgroundColor: Theme.of(context).colorScheme.surfaceContainer,
78 ),
79 ),
80 )
lib/src/screens/cake_pay/widgets/cake_pay_tile.dart
+24 -23
@@ -1,7 +1,4 @@
1 -import 'package:cake_wallet/typography.dart';
2 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
1 import 'package:flutter/material.dart';
4 -import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart';
2
3 class CakePayTile extends StatelessWidget {
4 const CakePayTile({
@@ -17,30 +14,34 @@ class CakePayTile extends StatelessWidget {
14
15 @override
16 Widget build(BuildContext context) {
17 + final colorScheme = Theme.of(context).colorScheme;
18 +
19 return GestureDetector(
20 onTap: onTap,
21 child: Row(
23 - mainAxisAlignment: MainAxisAlignment.spaceBetween,
24 - children: [
25 - Column(
26 - crossAxisAlignment: CrossAxisAlignment.start,
27 - children: [
28 - Text(
29 - title,
30 - style: textXSmall(
31 - color: Theme.of(context).extension<TransactionTradeTheme>()!.detailsTitlesColor,
22 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
23 + children: [
24 + Column(
25 + crossAxisAlignment: CrossAxisAlignment.start,
26 + children: [
27 + Text(
28 + title,
29 + style: Theme.of(context).textTheme.bodySmall?.copyWith(
30 + color: colorScheme.onSurfaceVariant,
31 + ),
32 ),
33 - ),
34 - SizedBox(height: 8),
35 - Text(
36 - subTitle,
37 - style: textMediumBold(
38 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
33 + SizedBox(height: 8),
34 + Text(
35 + subTitle,
36 + style: Theme.of(context).textTheme.titleMedium?.copyWith(
37 + color: colorScheme.onSurface,
38 + fontWeight: FontWeight.w600,
39 + ),
40 ),
40 - ),
41 - ],
42 - )
43 - ],
44 - ));
41 + ],
42 + )
43 + ],
44 + ),
45 + );
46 }
47 }
lib/src/screens/cake_pay/widgets/card_item.dart
+5 -3
@@ -44,7 +44,9 @@ class CardItem extends StatelessWidget {
44 borderRadius: BorderRadius.circular(10),
45 border: hideBorder
46 ? Border.all(color: Colors.transparent)
47 - : Border.all(color: Colors.white.withOpacity(0.20)),
47 + : Border.all(
48 + color: Theme.of(context).colorScheme.outlineVariant.withOpacity(0.20),
49 + ),
50 ),
51 child: Row(
52 children: [
@@ -75,7 +77,7 @@ class CardItem extends StatelessWidget {
77 title,
78 maxLines: 1,
79 overflow: TextOverflow.ellipsis,
78 - style: TextStyle(
80 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
81 color: titleColor,
82 fontSize: 18,
83 fontWeight: FontWeight.w700,
@@ -85,7 +87,7 @@ class CardItem extends StatelessWidget {
87 subTitle,
88 maxLines: 2,
89 overflow: TextOverflow.ellipsis,
88 - style: TextStyle(
90 + style: Theme.of(context).textTheme.bodySmall!.copyWith(
91 color: titleColor,
92 fontSize: 10,
93 fontWeight: FontWeight.w700,
lib/src/screens/cake_pay/widgets/image_placeholder.dart
+5 -6
@@ -13,15 +13,14 @@ class CakePayCardImagePlaceholder extends StatelessWidget {
13 child: Center(
14 child: Text(
15 text ?? 'Image not found!',
16 - style: TextStyle(
17 - color: Colors.black,
18 - fontSize: 12,
19 - fontWeight: FontWeight.w900,
20 - ),
16 + style: Theme.of(context).textTheme.bodySmall?.copyWith(
17 + color: Theme.of(context).colorScheme.onSurface,
18 + fontWeight: FontWeight.w900,
19 + ),
20 ),
21 ),
22 decoration: BoxDecoration(
24 - color: Colors.white,
23 + color: Theme.of(context).colorScheme.surfaceContainer,
24 ),
25 ),
26 );
lib/src/screens/cake_pay/widgets/link_extractor.dart
+4 -5
@@ -29,11 +29,10 @@ class ClickableLinksText extends StatelessWidget {
29 spans.add(
30 TextSpan(
31 text: url,
32 - style: TextStyle(
33 - color: Colors.blue,
34 - fontSize: 18,
35 - fontWeight: FontWeight.w400,
36 - ),
32 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
33 + color: Theme.of(context).colorScheme.primary,
34 + fontSize: 18,
35 + ),
36 recognizer: TapGestureRecognizer()
37 ..onTap = () async {
38 if (await canLaunchUrl(Uri.parse(url))) {
lib/src/screens/cake_pay/widgets/rounded_checkbox.dart
+2 -2
@@ -15,11 +15,11 @@ class RoundedCheckbox extends StatelessWidget {
15 width: 20.0,
16 decoration: BoxDecoration(
17 borderRadius: BorderRadius.all(Radius.circular(50.0)),
18 - color: Theme.of(context).primaryColor,
18 + color: Theme.of(context).colorScheme.primary,
19 ),
20 child: Icon(
21 Icons.check,
22 - color: Theme.of(context).colorScheme.background,
22 + color: Theme.of(context).colorScheme.surface,
23 size: 14.0,
24 ))
25 : Offstage();
lib/src/screens/cake_pay/widgets/text_icon_button.dart
+18 -20
@@ -1,5 +1,3 @@
1 -import 'package:cake_wallet/typography.dart';
2 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
1 import 'package:flutter/material.dart';
2
3 class TextIconButton extends StatelessWidget {
@@ -14,24 +12,24 @@ class TextIconButton extends StatelessWidget {
12
13 @override
14 Widget build(BuildContext context) {
17 - return
18 - InkWell(
19 - onTap: onTap,
20 - child: Row(
21 - mainAxisAlignment: MainAxisAlignment.spaceBetween,
22 - children: [
23 - Text(
24 - label,
25 - style: textMediumSemiBold(
26 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
27 - ),
28 - ),
29 - Icon(
30 - Icons.chevron_right_rounded,
31 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
32 - ),
33 - ],
34 - ),
15 + return InkWell(
16 + onTap: onTap,
17 + child: Row(
18 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
19 + children: [
20 + Text(
21 + label,
22 + style: Theme.of(context).textTheme.titleMedium?.copyWith(
23 + color: Theme.of(context).colorScheme.onSurface,
24 + fontWeight: FontWeight.w600,
25 + ),
26 + ),
27 + Icon(
28 + Icons.chevron_right_rounded,
29 + color: Theme.of(context).colorScheme.onSurface,
30 + ),
31 + ],
32 + ),
33 );
34 }
35 }
lib/src/screens/connect_device/connect_device_page.dart
+7 -40
@@ -6,8 +6,6 @@ import 'package:cake_wallet/routes.dart';
6 import 'package:cake_wallet/src/screens/base_page.dart';
7 import 'package:cake_wallet/src/screens/connect_device/widgets/device_tile.dart';
8 import 'package:cake_wallet/src/widgets/primary_button.dart';
9 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
10 -import 'package:cake_wallet/themes/extensions/wallet_list_theme.dart';
9 import 'package:cake_wallet/utils/responsive_layout_util.dart';
10 import 'package:cake_wallet/view_model/hardware_wallet/ledger_view_model.dart';
11 import 'package:cw_core/utils/print_verbose.dart';
@@ -195,12 +193,7 @@ class ConnectDevicePageBodyState extends State<ConnectDevicePageBody> {
193 Platform.isIOS
194 ? S.of(context).connect_your_hardware_wallet_ios
195 : S.of(context).connect_your_hardware_wallet,
198 - style: TextStyle(
199 - fontSize: 16,
200 - fontWeight: FontWeight.w500,
201 - color: Theme.of(context)
202 - .extension<CakeTextTheme>()!
203 - .titleColor),
196 + style: Theme.of(context).textTheme.titleMedium,
197 textAlign: TextAlign.center,
198 ),
199 ),
@@ -210,12 +203,7 @@ class ConnectDevicePageBodyState extends State<ConnectDevicePageBody> {
203 padding: EdgeInsets.only(left: 20, right: 20, bottom: 20),
204 child: Text(
205 S.of(context).if_you_dont_see_your_device,
213 - style: TextStyle(
214 - fontSize: 16,
215 - fontWeight: FontWeight.w500,
216 - color: Theme.of(context)
217 - .extension<CakeTextTheme>()!
218 - .titleColor),
206 + style: Theme.of(context).textTheme.titleMedium,
207 textAlign: TextAlign.center,
208 ),
209 ),
@@ -227,12 +215,7 @@ class ConnectDevicePageBodyState extends State<ConnectDevicePageBody> {
215 padding: EdgeInsets.only(left: 20, right: 20, bottom: 20),
216 child: Text(
217 S.of(context).ledger_please_enable_bluetooth,
230 - style: TextStyle(
231 - fontSize: 16,
232 - fontWeight: FontWeight.w500,
233 - color: Theme.of(context)
234 - .extension<CakeTextTheme>()!
235 - .titleColor),
218 + style: Theme.of(context).textTheme.titleMedium,
219 textAlign: TextAlign.center,
220 ),
221 ),
@@ -245,13 +228,7 @@ class ConnectDevicePageBodyState extends State<ConnectDevicePageBody> {
228 width: double.infinity,
229 child: Text(
230 S.of(context).bluetooth,
248 - style: TextStyle(
249 - fontSize: 14,
250 - fontWeight: FontWeight.w400,
251 - color: Theme.of(context)
252 - .extension<CakeTextTheme>()!
253 - .titleColor,
254 - ),
231 + style: Theme.of(context).textTheme.bodyMedium,
232 ),
233 ),
234 ),
@@ -276,13 +253,7 @@ class ConnectDevicePageBodyState extends State<ConnectDevicePageBody> {
253 width: double.infinity,
254 child: Text(
255 S.of(context).usb,
279 - style: TextStyle(
280 - fontSize: 14,
281 - fontWeight: FontWeight.w400,
282 - color: Theme.of(context)
283 - .extension<CakeTextTheme>()!
284 - .titleColor,
285 - ),
256 + style: Theme.of(context).textTheme.bodyMedium,
257 ),
258 ),
259 ),
@@ -303,12 +274,8 @@ class ConnectDevicePageBodyState extends State<ConnectDevicePageBody> {
274 if (widget.allowChangeWallet) ...[
275 PrimaryButton(
276 text: S.of(context).wallets,
306 - color: Theme.of(context)
307 - .extension<WalletListTheme>()!
308 - .createNewWalletButtonBackgroundColor,
309 - textColor: Theme.of(context)
310 - .extension<WalletListTheme>()!
311 - .restoreWalletButtonTextColor,
277 + color: Theme.of(context).colorScheme.primary,
278 + textColor: Theme.of(context).colorScheme.onPrimary,
279 onPressed: _onChangeWallet,
280 )
281 ],
lib/src/screens/connect_device/debug_device_page.dart
+8 -8
@@ -127,8 +127,8 @@
127 // child: PrimaryButton(
128 // text: "Disconnect",
129 // onPressed: () => disconnectCurrentDevice(),
130 -// color: Theme.of(context).primaryColor,
131 -// textColor: Colors.white),
130 +// color: Theme.of(context).colorScheme.primary,
131 +// textColor: Theme.of(context).colorScheme.onPrimary),
132 // ),
133 // ],
134 // if (selectedDevice == null) ...[
@@ -156,8 +156,8 @@
156 // devices.add(device);
157 // }));
158 // },
159 -// color: Theme.of(context).primaryColor,
160 -// textColor: Colors.white),
159 +// color: Theme.of(context).colorScheme.primary,
160 +// textColor: Theme.of(context).colorScheme.onPrimary),
161 // Padding(
162 // padding: EdgeInsets.only(top: 20),
163 // child: PrimaryButton(
@@ -166,8 +166,8 @@
166 // final dev = await ledger.listUsbDevices();
167 // setState(() => devices = dev);
168 // },
169 -// color: Theme.of(context).primaryColor,
170 -// textColor: Colors.white),
169 +// color: Theme.of(context).colorScheme.primary,
170 +// textColor: Theme.of(context).colorScheme.onPrimary),
171 // ),
172 // ],
173 // ],
@@ -229,8 +229,8 @@
229 // printV("${ex.errorCode.toRadixString(16)} ${ex.message}");
230 // }
231 // },
232 -// color: Theme.of(context).primaryColor,
233 -// textColor: Colors.white),
232 +// color: Theme.of(context).colorScheme.primary,
233 +// textColor: Theme.of(context).colorScheme.onPrimary),
234 // );
235 // }
236 // }
lib/src/screens/connect_device/monero_hardware_wallet_options_page.dart
+35 -66
@@ -3,12 +3,10 @@ import 'package:cake_wallet/entities/generate_name.dart';
3 import 'package:cake_wallet/generated/i18n.dart';
4 import 'package:cake_wallet/src/screens/base_page.dart';
5 import 'package:cake_wallet/src/widgets/alert_with_one_action.dart';
6 +import 'package:cake_wallet/src/widgets/base_text_form_field.dart';
7 import 'package:cake_wallet/src/widgets/blockchain_height_widget.dart';
8 import 'package:cake_wallet/src/widgets/primary_button.dart';
9 import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
9 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
10 -import 'package:cake_wallet/themes/extensions/new_wallet_theme.dart';
11 -import 'package:cake_wallet/themes/extensions/send_page_theme.dart';
10 import 'package:cake_wallet/utils/responsive_layout_util.dart';
11 import 'package:cake_wallet/utils/show_pop_up.dart';
12 import 'package:cake_wallet/view_model/wallet_hardware_restore_view_model.dart';
@@ -26,8 +24,7 @@ class MoneroHardwareWalletOptionsPage extends BasePage {
24 String get title => S.current.restore_title_from_hardware_wallet;
25
26 @override
29 - Widget body(BuildContext context) =>
30 - _MoneroHardwareWalletOptionsForm(_walletHardwareRestoreVM);
27 + Widget body(BuildContext context) => _MoneroHardwareWalletOptionsForm(_walletHardwareRestoreVM);
28 }
29
30 class _MoneroHardwareWalletOptionsForm extends StatefulWidget {
@@ -40,8 +37,7 @@ class _MoneroHardwareWalletOptionsForm extends StatefulWidget {
37 _MoneroHardwareWalletOptionsFormState(_walletHardwareRestoreVM);
38 }
39
43 -class _MoneroHardwareWalletOptionsFormState
44 - extends State<_MoneroHardwareWalletOptionsForm> {
40 +class _MoneroHardwareWalletOptionsFormState extends State<_MoneroHardwareWalletOptionsForm> {
41 _MoneroHardwareWalletOptionsFormState(this._walletHardwareRestoreVM)
42 : _formKey = GlobalKey<FormState>(),
43 _blockchainHeightKey = GlobalKey<BlockchainHeightState>(),
@@ -68,8 +64,8 @@ class _MoneroHardwareWalletOptionsFormState
64 contentPadding: EdgeInsets.only(left: 24, right: 24, bottom: 24),
65 content: Center(
66 child: ConstrainedBox(
71 - constraints: BoxConstraints(
72 - maxWidth: ResponsiveLayoutUtilBase.kDesktopMaxWidthConstraint),
67 + constraints:
68 + BoxConstraints(maxWidth: ResponsiveLayoutUtilBase.kDesktopMaxWidthConstraint),
69 child: Column(
70 crossAxisAlignment: CrossAxisAlignment.center,
71 children: [
@@ -80,60 +76,34 @@ class _MoneroHardwareWalletOptionsFormState
76 child: Stack(
77 alignment: Alignment.centerRight,
78 children: [
83 - TextFormField(
84 - onChanged: (value) =>
85 - _walletHardwareRestoreVM.name = value,
79 + BaseTextFormField(
80 + onChanged: (value) => _walletHardwareRestoreVM.name = value,
81 controller: _controller,
87 - style: TextStyle(
88 - fontSize: 20.0,
89 - fontWeight: FontWeight.w600,
90 - color: Theme.of(context)
91 - .extension<CakeTextTheme>()!
92 - .titleColor,
93 - ),
94 - decoration: InputDecoration(
95 - hintStyle: TextStyle(
96 - fontSize: 18.0,
97 - fontWeight: FontWeight.w500,
98 - color: Theme.of(context)
99 - .extension<NewWalletTheme>()!
100 - .hintTextColor,
101 - ),
102 - hintText: S.of(context).wallet_name,
103 - focusedBorder: UnderlineInputBorder(
104 - borderSide: BorderSide(
105 - color: Theme.of(context)
106 - .extension<NewWalletTheme>()!
107 - .underlineColor,
108 - width: 1.0,
82 + textStyle: Theme.of(context).textTheme.bodyMedium!.copyWith(
83 + fontSize: 20.0,
84 + fontWeight: FontWeight.w600,
85 ),
110 - ),
111 - enabledBorder: UnderlineInputBorder(
112 - borderSide: BorderSide(
113 - color: Theme.of(context)
114 - .extension<NewWalletTheme>()!
115 - .underlineColor,
116 - width: 1.0,
86 + placeholderTextStyle: Theme.of(context).textTheme.bodyMedium!.copyWith(
87 + fontSize: 18.0,
88 + fontWeight: FontWeight.w500,
89 + color: Theme.of(context).colorScheme.onSurfaceVariant,
90 ),
118 - ),
119 - suffixIcon: Semantics(
120 - label: S.of(context).generate_name,
121 - child: IconButton(
122 - onPressed: _onGenerateName,
123 - icon: Container(
124 - padding: const EdgeInsets.all(8),
125 - decoration: BoxDecoration(
126 - borderRadius: BorderRadius.circular(6.0),
127 - color: Theme.of(context).hintColor,
128 - ),
129 - width: 34,
130 - height: 34,
131 - child: Image.asset(
132 - 'assets/images/refresh_icon.png',
133 - color: Theme.of(context)
134 - .extension<SendPageTheme>()!
135 - .textFieldButtonIconColor,
136 - ),
91 + hintText: S.of(context).wallet_name,
92 + suffixIcon: Semantics(
93 + label: S.of(context).generate_name,
94 + child: IconButton(
95 + onPressed: _onGenerateName,
96 + icon: Container(
97 + padding: const EdgeInsets.all(8),
98 + decoration: BoxDecoration(
99 + borderRadius: BorderRadius.circular(6.0),
100 + color: Theme.of(context).colorScheme.surfaceContainerHighest,
101 + ),
102 + width: 34,
103 + height: 34,
104 + child: Image.asset(
105 + 'assets/images/refresh_icon.png',
106 + color: Theme.of(context).colorScheme.primary,
107 ),
108 ),
109 ),
@@ -162,8 +132,8 @@ class _MoneroHardwareWalletOptionsFormState
132 builder: (context) => LoadingPrimaryButton(
133 onPressed: _confirmForm,
134 text: S.of(context).seed_language_next,
165 - color: Colors.green,
166 - textColor: Colors.white,
135 + color: Theme.of(context).colorScheme.primary,
136 + textColor: Theme.of(context).colorScheme.onPrimary,
137 isDisabled: _walletHardwareRestoreVM.name.isEmpty,
138 ),
139 ),
@@ -178,8 +148,8 @@ class _MoneroHardwareWalletOptionsFormState
148 setState(() {
149 _controller.text = rName;
150 _walletHardwareRestoreVM.name = rName;
181 - _controller.selection = TextSelection.fromPosition(
182 - TextPosition(offset: _controller.text.length));
151 + _controller.selection =
152 + TextSelection.fromPosition(TextPosition(offset: _controller.text.length));
153 });
154 }
155
@@ -206,8 +176,7 @@ class _MoneroHardwareWalletOptionsFormState
176
177 reaction((_) => _walletHardwareRestoreVM.error, (String? error) {
178 if (error != null) {
209 - if (error == S.current.ledger_connection_error)
210 - Navigator.of(context).pop();
179 + if (error == S.current.ledger_connection_error) Navigator.of(context).pop();
180
181 WidgetsBinding.instance.addPostFrameCallback((_) {
182 showPopUp<void>(
lib/src/screens/connect_device/select_hardware_wallet_account_page.dart
+60 -78
@@ -4,11 +4,9 @@ import 'package:cake_wallet/generated/i18n.dart';
4 import 'package:cake_wallet/src/screens/base_page.dart';
5 import 'package:cake_wallet/src/screens/new_wallet/widgets/select_button.dart';
6 import 'package:cake_wallet/src/widgets/alert_with_one_action.dart';
7 +import 'package:cake_wallet/src/widgets/base_text_form_field.dart';
8 import 'package:cake_wallet/src/widgets/primary_button.dart';
9 import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
9 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
10 -import 'package:cake_wallet/themes/extensions/new_wallet_theme.dart';
11 -import 'package:cake_wallet/themes/extensions/send_page_theme.dart';
10 import 'package:cake_wallet/utils/responsive_layout_util.dart';
11 import 'package:cake_wallet/utils/show_pop_up.dart';
12 import 'package:cake_wallet/view_model/wallet_hardware_restore_view_model.dart';
@@ -75,63 +73,50 @@ class _SelectHardwareWalletAccountFormState extends State<SelectHardwareWalletAc
73 child: Stack(
74 alignment: Alignment.centerRight,
75 children: [
78 - TextFormField(
76 + BaseTextFormField(
77 onChanged: (value) => _walletHardwareRestoreVM.name = value,
78 controller: _controller,
81 - style: TextStyle(
82 - fontSize: 20.0,
83 - fontWeight: FontWeight.w600,
84 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
85 - ),
86 - decoration: InputDecoration(
87 - hintStyle: TextStyle(
88 - fontSize: 18.0,
89 - fontWeight: FontWeight.w500,
90 - color: Theme.of(context).extension<NewWalletTheme>()!.hintTextColor,
91 - ),
92 - hintText: S.of(context).wallet_name,
93 - focusedBorder: UnderlineInputBorder(
94 - borderSide: BorderSide(
95 - color:
96 - Theme.of(context).extension<NewWalletTheme>()!.underlineColor,
97 - width: 1.0,
79 + textStyle: Theme.of(context).textTheme.bodyMedium!.copyWith(
80 + fontSize: 20.0,
81 + fontWeight: FontWeight.w600,
82 ),
99 - ),
100 - enabledBorder: UnderlineInputBorder(
101 - borderSide: BorderSide(
102 - color:
103 - Theme.of(context).extension<NewWalletTheme>()!.underlineColor,
104 - width: 1.0,
83 + placeholderTextStyle: Theme.of(context).textTheme.bodyMedium!.copyWith(
84 + fontSize: 18.0,
85 + fontWeight: FontWeight.w500,
86 + color: Theme.of(context).colorScheme.onSurfaceVariant,
87 ),
106 - ),
107 - suffixIcon: Semantics(
108 - label: S.of(context).generate_name,
109 - child: IconButton(
110 - onPressed: () async {
111 - final rName = await generateName();
112 - FocusManager.instance.primaryFocus?.unfocus();
113 -
114 - setState(() {
115 - _controller.text = rName;
116 - _walletHardwareRestoreVM.name = rName;
117 - _controller.selection = TextSelection.fromPosition(
118 - TextPosition(offset: _controller.text.length));
119 - });
120 - },
121 - icon: Container(
122 - padding: const EdgeInsets.all(8),
123 - decoration: BoxDecoration(
124 - borderRadius: BorderRadius.circular(6.0),
125 - color: Theme.of(context).hintColor,
126 - ),
127 - width: 34,
128 - height: 34,
129 - child: Image.asset(
130 - 'assets/images/refresh_icon.png',
131 - color: Theme.of(context)
132 - .extension<SendPageTheme>()!
133 - .textFieldButtonIconColor,
134 - ),
88 + hintText: S.of(context).wallet_name,
89 + // enabledBorder: UnderlineInputBorder(
90 + // borderSide: BorderSide(
91 + // color: Theme.of(context).colorScheme.outline,
92 + // width: 100,
93 + // ),
94 + // ),
95 + suffixIcon: Semantics(
96 + label: S.of(context).generate_name,
97 + child: IconButton(
98 + onPressed: () async {
99 + final rName = await generateName();
100 + FocusManager.instance.primaryFocus?.unfocus();
101 +
102 + setState(() {
103 + _controller.text = rName;
104 + _walletHardwareRestoreVM.name = rName;
105 + _controller.selection = TextSelection.fromPosition(
106 + TextPosition(offset: _controller.text.length));
107 + });
108 + },
109 + icon: Container(
110 + padding: const EdgeInsets.all(8),
111 + decoration: BoxDecoration(
112 + borderRadius: BorderRadius.circular(6.0),
113 + color: Theme.of(context).colorScheme.surfaceContainerHighest,
114 + ),
115 + width: 34,
116 + height: 34,
117 + child: Image.asset(
118 + 'assets/images/refresh_icon.png',
119 + color: Theme.of(context).colorScheme.primary,
120 ),
121 ),
122 ),
@@ -148,18 +133,16 @@ class _SelectHardwareWalletAccountFormState extends State<SelectHardwareWalletAc
133 width: double.infinity,
134 child: Text(
135 S.of(context).select_hw_account_below,
151 - style: TextStyle(
152 - fontSize: 16,
153 - fontWeight: FontWeight.w500,
154 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
155 - ),
136 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
137 + fontSize: 16,
138 + fontWeight: FontWeight.w500,
139 + ),
140 ),
141 ),
142 ),
143 Observer(
144 builder: (context) => Column(
145 children: _walletHardwareRestoreVM.availableAccounts.map((acc) {
162 -
146 final address = acc.address;
147 return Padding(
148 padding: EdgeInsets.only(top: 10),
@@ -171,7 +154,7 @@ class _SelectHardwareWalletAccountFormState extends State<SelectHardwareWalletAc
154 width: 24,
155 ),
156 text:
174 - "${acc.accountIndex} - ${address.substring(0, 6)}...${address.substring(address.length - 6)}",
157 + "${acc.accountIndex} - ${address.substring(0, 6)}...${address.substring(address.length - 6)}",
158 showTrailingIcon: false,
159 height: 54,
160 isSelected: _walletHardwareRestoreVM.selectedAccount == acc,
@@ -184,15 +167,17 @@ class _SelectHardwareWalletAccountFormState extends State<SelectHardwareWalletAc
167 ),
168 Padding(
169 padding: EdgeInsets.only(top: 10),
187 - child: Observer(builder: (context) {
188 - return LoadingPrimaryButton(
189 - onPressed: _loadMoreAccounts,
190 - text: S.of(context).load_more,
191 - color: Theme.of(context).primaryColor,
192 - textColor: Colors.white,
193 - isLoading: _walletHardwareRestoreVM.isLoadingMoreAccounts,
194 - );
195 - }),
170 + child: Observer(
171 + builder: (context) {
172 + return LoadingPrimaryButton(
173 + onPressed: _loadMoreAccounts,
174 + text: S.of(context).load_more,
175 + color: Theme.of(context).colorScheme.surfaceContainer,
176 + textColor: Theme.of(context).colorScheme.onSecondaryContainer,
177 + isLoading: _walletHardwareRestoreVM.isLoadingMoreAccounts,
178 + );
179 + },
180 + ),
181 ),
182 ],
183 ),
@@ -204,8 +189,8 @@ class _SelectHardwareWalletAccountFormState extends State<SelectHardwareWalletAc
189 return LoadingPrimaryButton(
190 onPressed: _confirmForm,
191 text: S.of(context).seed_language_next,
207 - color: Colors.green,
208 - textColor: Colors.white,
192 + color: Theme.of(context).colorScheme.primary,
193 + textColor: Theme.of(context).colorScheme.onPrimary,
194 isDisabled: _walletHardwareRestoreVM.name.isEmpty,
195 );
196 },
@@ -229,11 +214,8 @@ class _SelectHardwareWalletAccountFormState extends State<SelectHardwareWalletAc
214 if (_effectsInstalled) return;
215
216 reaction((_) => _walletHardwareRestoreVM.error, (String? error) {
232 -
217 if (error != null) {
234 -
235 - if (error == S.current.ledger_connection_error)
236 - Navigator.of(context).pop();
218 + if (error == S.current.ledger_connection_error) Navigator.of(context).pop();
219
220 WidgetsBinding.instance.addPostFrameCallback((_) {
221 showPopUp<void>(
lib/src/screens/connect_device/widgets/device_tile.dart
+4 -6
@@ -1,4 +1,3 @@
1 -import 'package:cake_wallet/themes/extensions/option_tile_theme.dart';
1 import 'package:flutter/material.dart';
2 import 'package:ledger_flutter_plus/ledger_flutter_plus.dart';
3
@@ -36,7 +35,7 @@ class DeviceTile extends StatelessWidget {
35 alignment: Alignment.center,
36 decoration: BoxDecoration(
37 borderRadius: BorderRadius.all(Radius.circular(12)),
39 - color: Theme.of(context).cardColor,
38 + color: Theme.of(context).colorScheme.surfaceContainer,
39 ),
40 child: Row(
41 mainAxisSize: MainAxisSize.max,
@@ -47,17 +46,16 @@ class DeviceTile extends StatelessWidget {
46 Image.asset(
47 leading!,
48 height: 30,
50 - color: Theme.of(context).extension<OptionTileTheme>()!.titleColor,
49 + color: Theme.of(context).colorScheme.onSurface,
50 ),
51 Expanded(
52 child: Padding(
53 padding: EdgeInsets.only(left: 16),
54 child: Text(
55 title,
57 - style: TextStyle(
56 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
57 fontSize: 20,
58 fontWeight: FontWeight.w500,
60 - color: Theme.of(context).extension<OptionTileTheme>()!.titleColor,
59 ),
60 ),
61 ),
@@ -67,7 +65,7 @@ class DeviceTile extends StatelessWidget {
65 child: Image.asset(
66 connectionTypeIcon!,
67 height: 25,
70 - color: Theme.of(context).extension<OptionTileTheme>()!.titleColor,
68 + color: Theme.of(context).colorScheme.onSurface,
69 ),
70 )
71 ],
lib/src/screens/contact/contact_list_page.dart
+118 -133
@@ -1,5 +1,4 @@
1 import 'package:cake_wallet/core/auth_service.dart';
2 -import 'package:cake_wallet/entities/contact.dart';
2 import 'package:cake_wallet/entities/contact_base.dart';
3 import 'package:cake_wallet/entities/contact_record.dart';
4 import 'package:cake_wallet/entities/wallet_list_order_types.dart';
@@ -10,8 +9,6 @@ import 'package:cake_wallet/src/screens/dashboard/widgets/filter_list_widget.dar
9 import 'package:cake_wallet/src/screens/wallet_list/filtered_list.dart';
10 import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
11 import 'package:cake_wallet/src/widgets/standard_list.dart';
13 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
14 -import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart';
12 import 'package:cake_wallet/utils/address_formatter.dart';
13 import 'package:cake_wallet/utils/show_bar.dart';
14 import 'package:cake_wallet/utils/show_pop_up.dart';
@@ -38,8 +35,9 @@ class ContactListPage extends BasePage {
35 width: 32.0,
36 height: 32.0,
37 decoration: BoxDecoration(
41 - shape: BoxShape.circle,
42 - color: Theme.of(context).extension<ExchangePageTheme>()!.buttonBackgroundColor),
38 + shape: BoxShape.circle,
39 + color: Theme.of(context).colorScheme.surfaceContainerHighest,
40 + ),
41 child: Semantics(
42 label: S.of(context).add_contact,
43 button: true,
@@ -48,28 +46,29 @@ class ContactListPage extends BasePage {
46 children: <Widget>[
47 Icon(
48 Icons.add,
51 - color: Theme.of(context).appBarTheme.titleTextStyle!.color,
49 + color: Theme.of(context).colorScheme.onSurface,
50 size: 22.0,
51 ),
52 ButtonTheme(
53 minWidth: 32.0,
54 height: 32.0,
55 child: TextButton(
58 - // FIX-ME: Style
59 - //shape: CircleBorder(),
60 - onPressed: () async {
61 - if (contactListViewModel.shouldRequireTOTP2FAForAddingContacts) {
62 - authService.authenticateAction(
63 - context,
64 - route: Routes.addressBookAddContact,
65 - conditionToDetermineIfToUse2FA:
66 - contactListViewModel.shouldRequireTOTP2FAForAddingContacts,
67 - );
68 - } else {
69 - await Navigator.of(context).pushNamed(Routes.addressBookAddContact);
70 - }
71 - },
72 - child: Offstage()),
56 + // FIX-ME: Style
57 + //shape: CircleBorder(),
58 + onPressed: () async {
59 + if (contactListViewModel.shouldRequireTOTP2FAForAddingContacts) {
60 + authService.authenticateAction(
61 + context,
62 + route: Routes.addressBookAddContact,
63 + conditionToDetermineIfToUse2FA:
64 + contactListViewModel.shouldRequireTOTP2FAForAddingContacts,
65 + );
66 + } else {
67 + await Navigator.of(context).pushNamed(Routes.addressBookAddContact);
68 + }
69 + },
70 + child: Offstage(),
71 + ),
72 )
73 ],
74 ),
@@ -117,46 +116,45 @@ class _ContactPageBodyState extends State<ContactPageBody> with SingleTickerProv
116 children: [
117 Padding(
118 padding: const EdgeInsets.only(left: 24, right: 24, bottom: 8),
120 - child: Align(
121 - alignment: Alignment.centerLeft,
122 - child: TabBar(
123 - controller: _tabController,
124 - splashFactory: NoSplash.splashFactory,
125 - indicatorSize: TabBarIndicatorSize.label,
126 - isScrollable: true,
127 - labelStyle: TextStyle(
128 - fontSize: 18,
129 - fontFamily: 'Lato',
130 - fontWeight: FontWeight.w600,
131 - color: Theme.of(context).appBarTheme.titleTextStyle!.color,
119 + child: Align(
120 + alignment: Alignment.centerLeft,
121 + child: TabBar(
122 + controller: _tabController,
123 + splashFactory: NoSplash.splashFactory,
124 + indicatorSize: TabBarIndicatorSize.label,
125 + isScrollable: true,
126 + labelStyle: Theme.of(context).textTheme.bodyLarge!.copyWith(
127 + fontSize: 20,
128 + fontWeight: FontWeight.w600,
129 + color: Theme.of(context).colorScheme.primary,
130 + ),
131 + unselectedLabelStyle: Theme.of(context).textTheme.bodyLarge!.copyWith(
132 + fontSize: 20,
133 + fontWeight: FontWeight.w600,
134 + color: Theme.of(context).colorScheme.onSurfaceVariant,
135 + ),
136 + indicatorColor: Theme.of(context).colorScheme.primary,
137 + indicatorPadding: EdgeInsets.zero,
138 + labelPadding: EdgeInsets.only(right: 24),
139 + tabAlignment: TabAlignment.start,
140 + dividerColor: Colors.transparent,
141 + padding: EdgeInsets.zero,
142 + tabs: [
143 + Tab(text: S.of(context).wallets),
144 + Tab(text: S.of(context).contact_list_contacts),
145 + ],
146 ),
133 - unselectedLabelStyle: TextStyle(
134 - fontSize: 18,
135 - fontFamily: 'Lato',
136 - fontWeight: FontWeight.w600,
137 - color: Theme.of(context).appBarTheme.titleTextStyle!.color?.withOpacity(0.5)),
138 - labelColor: Theme.of(context).appBarTheme.titleTextStyle!.color,
139 - indicatorColor: Theme.of(context).appBarTheme.titleTextStyle!.color,
140 - indicatorPadding: EdgeInsets.zero,
141 - labelPadding: EdgeInsets.only(right: 24),
142 - tabAlignment: TabAlignment.start,
143 - dividerColor: Colors.transparent,
144 - padding: EdgeInsets.zero,
145 - tabs: [
146 - Tab(text: S.of(context).wallets),
147 - Tab(text: S.of(context).contact_list_contacts),
148 - ],
147 ),
148 ),
151 - ),
149 Expanded(
150 child: TabBarView(
151 controller: _tabController,
152 children: [
153 _buildWalletContacts(context),
154 ContactListBody(
158 - contactListViewModel: widget.contactListViewModel,
159 - tabController: _tabController),
155 + contactListViewModel: widget.contactListViewModel,
156 + tabController: _tabController,
157 + ),
158 ],
159 ),
160 ),
@@ -195,26 +193,22 @@ class _ContactPageBodyState extends State<ContactPageBody> with SingleTickerProv
193
194 return Padding(
195 padding: const EdgeInsets.only(left: 16, right: 16, top: 4, bottom: 4),
198 - child: ExpansionTile(
199 - title: Text(
200 - groupName,
201 - style: TextStyle(
202 - fontSize: 14,
203 - fontWeight: FontWeight.normal,
204 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
196 + child: ExpansionTile(
197 + title: Text(
198 + groupName,
199 + style: Theme.of(context).textTheme.bodyMedium!,
200 ),
201 + leading: _buildCurrencyIcon(activeContact),
202 + tilePadding: const EdgeInsets.only(left: 16, right: 16),
203 + childrenPadding: const EdgeInsets.only(left: 16),
204 + expandedCrossAxisAlignment: CrossAxisAlignment.start,
205 + expandedAlignment: Alignment.topLeft,
206 + backgroundColor: Theme.of(context).colorScheme.surfaceContainer,
207 + collapsedBackgroundColor: Theme.of(context).colorScheme.surfaceContainer,
208 + collapsedShape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
209 + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
210 + children: groupContacts.map((contact) => generateRaw(context, contact)).toList(),
211 ),
207 - leading: _buildCurrencyIcon(activeContact),
208 - tilePadding: const EdgeInsets.only(left: 16, right: 16),
209 - childrenPadding: const EdgeInsets.only(left: 16),
210 - expandedCrossAxisAlignment: CrossAxisAlignment.start,
211 - expandedAlignment: Alignment.topLeft,
212 - backgroundColor: Theme.of(context).cardColor,
213 - collapsedBackgroundColor: Theme.of(context).cardColor,
214 - collapsedShape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
215 - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
216 - children: groupContacts.map((contact) => generateRaw(context, contact)).toList(),
217 - ),
212 );
213 }
214 }
@@ -246,10 +240,10 @@ class _ContactPageBodyState extends State<ContactPageBody> with SingleTickerProv
240 },
241 behavior: HitTestBehavior.opaque,
242 child: Container(
249 - decoration: BoxDecoration(
250 - borderRadius: BorderRadius.all(Radius.circular(10)),
251 - color: Theme.of(context).cardColor,
252 - ),
243 + decoration: BoxDecoration(
244 + borderRadius: BorderRadius.all(Radius.circular(10)),
245 + color: Theme.of(context).colorScheme.surfaceContainer,
246 + ),
247 margin: const EdgeInsets.only(top: 4, bottom: 4, left: 16, right: 16),
248 padding: const EdgeInsets.only(top: 16, bottom: 16, right: 16, left: 16),
249 child: Row(
@@ -262,11 +256,7 @@ class _ContactPageBodyState extends State<ContactPageBody> with SingleTickerProv
256 padding: EdgeInsets.only(left: 12),
257 child: Text(
258 contact.name,
265 - style: TextStyle(
266 - fontSize: 14,
267 - fontWeight: FontWeight.normal,
268 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
269 - ),
259 + style: Theme.of(context).textTheme.bodyMedium!,
260 ),
261 ),
262 ),
@@ -324,7 +314,7 @@ class _ContactListBodyState extends State<ContactListBody> {
314 ? widget.contactListViewModel.contacts
315 : widget.contactListViewModel.contactsToShow;
316 return Scaffold(
327 - backgroundColor: Theme.of(context).colorScheme.background,
317 + backgroundColor: Theme.of(context).colorScheme.surface,
318 body: Container(
319 child: FilteredList(
320 list: contacts,
@@ -343,8 +333,7 @@ class _ContactListBodyState extends State<ContactListBody> {
333 return;
334 }
335
346 - final isCopied =
347 - await DialogService.showNameAndAddressDialog(context, contact);
336 + final isCopied = await DialogService.showNameAndAddressDialog(context, contact);
337
338 if (isCopied) {
339 await Clipboard.setData(ClipboardData(text: contact.address));
@@ -356,7 +345,8 @@ class _ContactListBodyState extends State<ContactListBody> {
345 ? Slidable(
346 key: Key('${contact.key}'),
347 endActionPane: _actionPane(context, contact),
359 - child: contactContent)
348 + child: contactContent,
349 + )
350 : contactContent,
351 );
352 },
@@ -379,7 +369,7 @@ class _ContactListBodyState extends State<ContactListBody> {
369 key: Key('${contact.name}'),
370 decoration: BoxDecoration(
371 borderRadius: BorderRadius.all(Radius.circular(8)),
382 - color: Theme.of(context).cardColor,
372 + color: Theme.of(context).colorScheme.surfaceContainer,
373 ),
374 margin: const EdgeInsets.only(top: 4, bottom: 4, left: 16, right: 16),
375 padding: const EdgeInsets.only(top: 16, bottom: 16, right: 16, left: 16),
@@ -393,11 +383,7 @@ class _ContactListBodyState extends State<ContactListBody> {
383 padding: EdgeInsets.only(left: 12),
384 child: Text(
385 contact.name,
396 - style: TextStyle(
397 - fontSize: 14,
398 - fontWeight: FontWeight.normal,
399 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
400 - ),
386 + style: Theme.of(context).textTheme.bodyMedium!,
387 ),
388 ))
389 ],
@@ -407,37 +393,41 @@ class _ContactListBodyState extends State<ContactListBody> {
393 );
394 }
395
410 - ActionPane _actionPane(BuildContext context, ContactRecord contact) => ActionPane(
396 + ActionPane _actionPane(BuildContext context, ContactRecord contact) {
397 + return ActionPane(
398 motion: const ScrollMotion(),
399 extentRatio: 0.4,
400 children: [
401 SlidableAction(
402 onPressed: (_) async => await Navigator.of(context)
403 .pushNamed(Routes.addressBookAddContact, arguments: contact),
417 - backgroundColor: Colors.blue,
418 - foregroundColor: Colors.white,
404 + backgroundColor: Theme.of(context).colorScheme.primary,
405 + foregroundColor: Theme.of(context).colorScheme.onSurface,
406 icon: Icons.edit,
407 label: S.of(context).edit,
408 ),
409 SlidableAction(
410 onPressed: (_) async {
411 final isDelete = await DialogService.showAlertDialog(context);
425 -
412 +
413 if (isDelete) {
414 await widget.contactListViewModel.delete(contact);
415 }
416 },
430 - backgroundColor: Colors.red,
431 - foregroundColor: Colors.white,
417 + backgroundColor: Theme.of(context).colorScheme.error,
418 + foregroundColor: Theme.of(context).colorScheme.onSurface,
419 icon: CupertinoIcons.delete,
420 label: S.of(context).delete,
421 ),
422 ],
423 );
424 + }
425
426 Widget filterButtonWidget(BuildContext context, ContactListViewModel contactListViewModel) {
439 - final filterIcon = Image.asset('assets/images/filter_icon.png',
440 - color: Theme.of(context).appBarTheme.titleTextStyle!.color);
427 + final filterIcon = Image.asset(
428 + 'assets/images/filter_icon.png',
429 + color: Theme.of(context).colorScheme.onSurface,
430 + );
431 return MergeSemantics(
432 child: SizedBox(
433 height: 58,
@@ -469,7 +459,7 @@ class _ContactListBodyState extends State<ContactListBody> {
459 width: 36,
460 decoration: BoxDecoration(
461 shape: BoxShape.circle,
472 - color: Theme.of(context).extension<ExchangePageTheme>()!.buttonBackgroundColor,
462 + color: Theme.of(context).colorScheme.surfaceContainer,
463 ),
464 child: filterIcon,
465 ),
@@ -480,50 +470,45 @@ class _ContactListBodyState extends State<ContactListBody> {
470 ),
471 );
472 }
483 -
473 }
474
475 class DialogService {
476 static Future<bool> showAlertDialog(BuildContext context) async {
477 return await showPopUp<bool>(
489 - context: context,
490 - builder: (BuildContext context) {
491 - return AlertWithTwoActions(
492 - alertTitle: S.of(context).address_remove_contact,
493 - alertContent: S.of(context).address_remove_content,
494 - rightButtonText: S.of(context).remove,
495 - leftButtonText: S.of(context).cancel,
496 - actionRightButton: () => Navigator.of(context).pop(true),
497 - actionLeftButton: () => Navigator.of(context).pop(false));
498 - }) ??
478 + context: context,
479 + builder: (BuildContext context) {
480 + return AlertWithTwoActions(
481 + alertTitle: S.of(context).address_remove_contact,
482 + alertContent: S.of(context).address_remove_content,
483 + rightButtonText: S.of(context).remove,
484 + leftButtonText: S.of(context).cancel,
485 + actionRightButton: () => Navigator.of(context).pop(true),
486 + actionLeftButton: () => Navigator.of(context).pop(false));
487 + }) ??
488 false;
489 }
490
502 - static Future<bool> showNameAndAddressDialog(BuildContext context,ContactBase contact) async {
491 + static Future<bool> showNameAndAddressDialog(BuildContext context, ContactBase contact) async {
492 return await showPopUp<bool>(
504 - context: context,
505 - builder: (BuildContext context) {
506 - return AlertWithTwoActions(
507 - alertTitle: contact.name,
508 - alertContent: contact.address,
509 - alertContentTextWidget: AddressFormatter.buildSegmentedAddress(
510 - address: contact.address,
511 - textAlign: TextAlign.center,
512 - walletType: cryptoCurrencyToWalletType(contact.type),
513 - evenTextStyle: TextStyle(
514 - fontSize: 16,
515 - fontWeight: FontWeight.normal,
516 - fontFamily: 'Lato',
517 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
518 - decoration: TextDecoration.none,
519 - ),
520 - ),
521 - rightButtonText: S.of(context).copy,
522 - leftButtonText: S.of(context).cancel,
523 - actionRightButton: () => Navigator.of(context).pop(true),
524 - actionLeftButton: () => Navigator.of(context).pop(false));
525 - }) ??
493 + context: context,
494 + builder: (BuildContext context) {
495 + return AlertWithTwoActions(
496 + alertTitle: contact.name,
497 + alertContent: contact.address,
498 + alertContentTextWidget: AddressFormatter.buildSegmentedAddress(
499 + address: contact.address,
500 + textAlign: TextAlign.center,
501 + walletType: cryptoCurrencyToWalletType(contact.type),
502 + evenTextStyle: Theme.of(context).textTheme.bodyMedium!.copyWith(
503 + fontSize: 16,
504 + decoration: TextDecoration.none,
505 + ),
506 + ),
507 + rightButtonText: S.of(context).copy,
508 + leftButtonText: S.of(context).cancel,
509 + actionRightButton: () => Navigator.of(context).pop(true),
510 + actionLeftButton: () => Navigator.of(context).pop(false));
511 + }) ??
512 false;
513 }
514 }
529 -
lib/src/screens/contact/contact_page.dart
+68 -69
@@ -1,6 +1,4 @@
1 import 'package:cake_wallet/core/address_validator.dart';
2 -import 'package:cake_wallet/palette.dart';
3 -import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart';
2 import 'package:cake_wallet/utils/show_pop_up.dart';
3 import 'package:cw_core/currency.dart';
4 import 'package:flutter/material.dart';
@@ -18,8 +16,6 @@ import 'package:cake_wallet/src/widgets/address_text_field.dart';
16 import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
17 import 'package:cake_wallet/src/widgets/base_text_form_field.dart';
18 import 'package:cake_wallet/src/screens/exchange/widgets/currency_picker.dart';
21 -import 'package:cake_wallet/themes/extensions/address_theme.dart';
22 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
19
20 class ContactPage extends BasePage {
21 ContactPage(this.contactViewModel)
@@ -29,13 +25,10 @@ class ContactPage extends BasePage {
25 _currencyTypeController = TextEditingController() {
26 _nameController.text = contactViewModel.name;
27 _addressController.text = contactViewModel.address;
32 - _nameController
33 - .addListener(() => contactViewModel.name = _nameController.text);
34 - _addressController
35 - .addListener(() => contactViewModel.address = _addressController.text);
28 + _nameController.addListener(() => contactViewModel.name = _nameController.text);
29 + _addressController.addListener(() => contactViewModel.address = _addressController.text);
30
37 - autorun((_) => _currencyTypeController.text =
38 - contactViewModel.currency?.toString() ?? '');
31 + autorun((_) => _currencyTypeController.text = contactViewModel.currency?.toString() ?? '');
32 }
33
34 @override
@@ -50,9 +43,11 @@ class ContactPage extends BasePage {
43
44 @override
45 Widget body(BuildContext context) {
53 - final downArrow = Image.asset('assets/images/arrow_bottom_purple_icon.png',
54 - color: Theme.of(context).extension<TransactionTradeTheme>()!.detailsTitlesColor,
55 - height: 8);
46 + final downArrow = Image.asset(
47 + 'assets/images/arrow_bottom_purple_icon.png',
48 + color: Theme.of(context).colorScheme.primary,
49 + height: 8,
50 + );
51
52 _setEffects(context);
53
@@ -65,24 +60,29 @@ class ContactPage extends BasePage {
60 mainAxisSize: MainAxisSize.min,
61 children: <Widget>[
62 BaseTextFormField(
68 - controller: _nameController,
69 - hintText: S.of(context).contact_name,
70 - validator: ContactNameValidator()),
63 + controller: _nameController,
64 + hintText: S.of(context).contact_name,
65 + validator: ContactNameValidator(),
66 + ),
67 Padding(
68 padding: EdgeInsets.only(top: 20),
69 child: Container(
70 child: InkWell(
71 onTap: () => _presentCurrencyPicker(context),
72 child: IgnorePointer(
77 - child: BaseTextFormField(
78 - controller: _currencyTypeController,
79 - hintText: S.of(context).settings_currency,
80 - suffixIcon: Row(
81 - mainAxisSize: MainAxisSize.min,
82 - mainAxisAlignment: MainAxisAlignment.end,
83 - children: <Widget>[downArrow],
73 + child: BaseTextFormField(
74 + controller: _currencyTypeController,
75 + hintText: S.of(context).settings_currency,
76 + suffixIcon: Row(
77 + mainAxisSize: MainAxisSize.min,
78 + mainAxisAlignment: MainAxisAlignment.end,
79 + children: <Widget>[
80 + downArrow,
81 + SizedBox(width: 16),
82 + ],
83 + ),
84 ),
85 - )),
85 + ),
86 ),
87 ),
88 ),
@@ -95,47 +95,47 @@ class ContactPage extends BasePage {
95 AddressTextFieldOption.paste,
96 AddressTextFieldOption.qrCode,
97 ],
98 - buttonColor: Theme.of(context).extension<AddressTheme>()!.actionButtonColor,
99 - iconColor: PaletteDark.gray,
100 - borderColor: Theme.of(context).extension<CakeTextTheme>()!.textfieldUnderlineColor,
101 - validator:
102 - AddressValidator(type: contactViewModel.currency!),
98 + buttonColor: Theme.of(context).colorScheme.surfaceContainerHighest,
99 + iconColor: Theme.of(context).colorScheme.onSurfaceVariant,
100 + validator: AddressValidator(type: contactViewModel.currency!),
101 ),
102 )
103 ],
104 ),
105 ),
108 - bottomSectionPadding:
109 - EdgeInsets.only(left: 24, right: 24, bottom: 24),
106 + bottomSectionPadding: EdgeInsets.only(left: 24, right: 24, bottom: 24),
107 bottomSection: Row(
108 children: <Widget>[
109 Expanded(
110 child: PrimaryButton(
114 - onPressed: () {
115 - contactViewModel.reset();
116 - _nameController.text = '';
117 - _addressController.text = '';
118 - },
119 - text: S.of(context).reset,
120 - color: Colors.orange,
121 - textColor: Colors.white),
111 + onPressed: () {
112 + contactViewModel.reset();
113 + _nameController.text = '';
114 + _addressController.text = '';
115 + },
116 + text: S.of(context).reset,
117 + color: Theme.of(context).colorScheme.surfaceContainer,
118 + textColor: Theme.of(context).colorScheme.onSecondaryContainer,
119 + ),
120 ),
121 SizedBox(width: 20),
122 Expanded(
125 - child: Observer(
126 - builder: (_) => PrimaryButton(
127 - onPressed: () async {
128 - if (_formKey.currentState != null &&
129 - !_formKey.currentState!.validate()) {
130 - return;
131 - }
123 + child: Observer(
124 + builder: (_) => PrimaryButton(
125 + onPressed: () async {
126 + if (_formKey.currentState != null && !_formKey.currentState!.validate()) {
127 + return;
128 + }
129
133 - await contactViewModel.save();
134 - },
135 - text: S.of(context).save,
136 - color: Theme.of(context).primaryColor,
137 - textColor: Colors.white,
138 - isDisabled: !contactViewModel.isReady)))
130 + await contactViewModel.save();
131 + },
132 + text: S.of(context).save,
133 + color: Theme.of(context).colorScheme.primary,
134 + textColor: Theme.of(context).colorScheme.onPrimary,
135 + isDisabled: !contactViewModel.isReady,
136 + ),
137 + ),
138 + )
139 ],
140 )),
141 );
@@ -143,17 +143,16 @@ class ContactPage extends BasePage {
143
144 void _presentCurrencyPicker(BuildContext context) {
145 showPopUp<void>(
146 - builder: (_) => CurrencyPicker(
147 - selectedAtIndex: contactViewModel.currency != null
148 - ? contactViewModel.currencies
149 - .indexOf(contactViewModel.currency!)
150 - : -1,
151 - items: contactViewModel.currencies,
152 - title: S.of(context).please_select,
153 - hintText: S.of(context).search_currency,
154 - onItemSelected: (Currency item) =>
155 - contactViewModel.currency = item as CryptoCurrency),
156 - context: context);
146 + builder: (_) => CurrencyPicker(
147 + selectedAtIndex: contactViewModel.currency != null
148 + ? contactViewModel.currencies.indexOf(contactViewModel.currency!)
149 + : -1,
150 + items: contactViewModel.currencies,
151 + title: S.of(context).please_select,
152 + hintText: S.of(context).search_currency,
153 + onItemSelected: (Currency item) => contactViewModel.currency = item as CryptoCurrency),
154 + context: context,
155 + );
156 }
157
158 void _onContactSavingFailure(BuildContext context, String error) {
@@ -161,15 +160,15 @@ class ContactPage extends BasePage {
160 context: context,
161 builder: (BuildContext context) {
162 return AlertWithOneAction(
164 - alertTitle: S.current.contact,
165 - alertContent: error,
166 - buttonText: S.of(context).ok,
167 - buttonAction: () => Navigator.of(context).pop());
163 + alertTitle: S.current.contact,
164 + alertContent: error,
165 + buttonText: S.of(context).ok,
166 + buttonAction: () => Navigator.of(context).pop(),
167 + );
168 });
169 }
170
171 - void _onContactSavedSuccessfully(BuildContext context) =>
172 - Navigator.of(context).pop();
171 + void _onContactSavedSuccessfully(BuildContext context) => Navigator.of(context).pop();
172
173 void _setEffects(BuildContext context) {
174 if (_isEffectsApplied) {
lib/src/screens/dashboard/dashboard_page.dart
+15 -18
@@ -27,12 +27,12 @@ import 'package:cake_wallet/src/screens/dashboard/pages/transactions_page.dart';
27 import 'package:cake_wallet/src/screens/dashboard/widgets/sync_indicator.dart';
28 import 'package:cake_wallet/view_model/wallet_address_list/wallet_address_list_view_model.dart';
29 import 'package:flutter_mobx/flutter_mobx.dart';
30 +import 'package:flutter_svg/flutter_svg.dart';
31 import 'package:mobx/mobx.dart';
32 import 'package:shared_preferences/shared_preferences.dart';
33 import 'package:smooth_page_indicator/smooth_page_indicator.dart';
34 import 'package:cake_wallet/main.dart';
35 import 'package:cake_wallet/src/screens/release_notes/release_notes_screen.dart';
35 -import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
36
37 class DashboardPage extends StatefulWidget {
38 DashboardPage({
@@ -164,18 +164,19 @@ class _DashboardPageView extends BasePage {
164
165 @override
166 Widget trailing(BuildContext context) {
167 - final menuButton = Image.asset(
168 - 'assets/images/menu.png',
169 - color: Theme.of(context).extension<DashboardPageTheme>()!.pageTitleTextColor,
170 - );
171 -
167 return Container(
168 alignment: Alignment.centerRight,
174 - width: 40,
169 + width: 42,
170 child: TextButton(
171 key: ValueKey('dashboard_page_wallet_menu_button_key'),
172 onPressed: () => onOpenEndDrawer(),
178 - child: Semantics(label: S.of(context).wallet_menu, child: menuButton),
173 + child: Semantics(
174 + label: S.of(context).wallet_menu,
175 + child: SvgPicture.asset(
176 + 'assets/images/menu.svg',
177 + color: Theme.of(context).colorScheme.onSurface,
178 + ),
179 + ),
180 ),
181 );
182 }
@@ -250,14 +251,8 @@ class _DashboardPageView extends BasePage {
251 radius: 6.0,
252 dotWidth: 6.0,
253 dotHeight: 6.0,
253 - dotColor: Theme.of(context)
254 - .extension<DashboardPageTheme>()!
255 - .indicatorDotTheme
256 - .indicatorColor,
257 - activeDotColor: Theme.of(context)
258 - .extension<DashboardPageTheme>()!
259 - .indicatorDotTheme
260 - .activeIndicatorColor,
254 + dotColor: Theme.of(context).colorScheme.primary.withOpacity(0.4),
255 + activeDotColor: Theme.of(context).colorScheme.primary,
256 ),
257 ),
258 );
@@ -265,7 +260,10 @@ class _DashboardPageView extends BasePage {
260 ),
261 ),
262 ),
268 - NavigationDock(dashboardViewModel: dashboardViewModel)
263 + NavigationDock(
264 + dashboardViewModel: dashboardViewModel,
265 + currentTheme: currentTheme,
266 + )
267 ],
268 ),
269 ),
@@ -307,7 +305,6 @@ class _DashboardPageView extends BasePage {
305
306 rootKey.currentState?.isInactive.listen(
307 (inactive) {
310 -
308 if (needToPresentYat) {
309 Future<void>.delayed(Duration(milliseconds: 500)).then(
310 (_) {
lib/src/screens/dashboard/desktop_dashboard_page.dart
+1 -1
@@ -35,7 +35,7 @@ class DesktopDashboardPage extends StatelessWidget {
35 _setEffects(context);
36
37 return Container(
38 - color: Theme.of(context).colorScheme.background,
38 + color: Theme.of(context).colorScheme.surface,
39 child: Row(
40 crossAxisAlignment: CrossAxisAlignment.start,
41 children: [
lib/src/screens/dashboard/desktop_widgets/desktop_action_button.dart
+6 -13
@@ -1,10 +1,4 @@
1 import 'package:auto_size_text/auto_size_text.dart';
2 -import 'package:cake_wallet/themes/extensions/balance_page_theme.dart';
3 -import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
4 -import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart';
5 -import 'package:cake_wallet/themes/extensions/balance_page_theme.dart';
6 -import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
7 -import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart';
2 import 'package:flutter/material.dart';
3
4 class DesktopActionButton extends StatelessWidget {
@@ -38,7 +32,7 @@ class DesktopActionButton extends StatelessWidget {
32 width: double.infinity,
33 decoration: BoxDecoration(
34 borderRadius: BorderRadius.circular(15.0),
41 - color: Theme.of(context).extension<SyncIndicatorTheme>()!.syncedBackgroundColor,
35 + color: Theme.of(context).colorScheme.surfaceContainer,
36 ),
37 child: Center(
38 child: Row(
@@ -49,19 +43,18 @@ class DesktopActionButton extends StatelessWidget {
43 height: 30,
44 width: 30,
45 color: isEnabled
52 - ? Theme.of(context).extension<DashboardPageTheme>()!.textColor
53 - : Theme.of(context).extension<BalancePageTheme>()!.labelTextColor,
46 + ? Theme.of(context).colorScheme.onPrimaryContainer
47 + : Theme.of(context).colorScheme.onSurfaceVariant,
48 ),
49 const SizedBox(width: 10),
50 AutoSizeText(
51 title,
58 - style: TextStyle(
52 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
53 fontSize: 24,
60 - fontFamily: 'Lato',
54 fontWeight: FontWeight.bold,
55 color: isEnabled
63 - ? Theme.of(context).extension<DashboardPageTheme>()!.textColor
64 - : null,
56 + ? Theme.of(context).colorScheme.onPrimaryContainer
57 + : Theme.of(context).colorScheme.onSurfaceVariant,
58 height: 1,
59 ),
60 maxLines: 1,
lib/src/screens/dashboard/desktop_widgets/desktop_dashboard_actions.dart
+1 -1
@@ -15,7 +15,7 @@ class DesktopDashboardActions extends StatelessWidget {
15 @override
16 Widget build(BuildContext context) {
17 return Container(
18 - color: Theme.of(context).colorScheme.background,
18 + color: Theme.of(context).colorScheme.surface,
19 child: Observer(
20 builder: (_) {
21 return Column(
lib/src/screens/dashboard/desktop_widgets/desktop_dashboard_navbar.dart
+4 -6
@@ -1,6 +1,6 @@
1 import 'package:cake_wallet/di.dart';
2 -import 'package:cake_wallet/store/settings_store.dart';
3 -import 'package:cake_wallet/themes/theme_base.dart';
2 +import 'package:cake_wallet/themes/core/material_base_theme.dart';
3 +import 'package:cake_wallet/themes/core/theme_store.dart';
4 import 'package:flutter/cupertino.dart';
5 import 'package:flutter/material.dart';
6
@@ -16,16 +16,14 @@ class DesktopDashboardNavbar extends StatelessWidget implements ObstructingPrefe
16 required this.trailing,
17 });
18
19 - ThemeBase get currentTheme => getIt.get<SettingsStore>().currentTheme;
19 + MaterialThemeBase get currentTheme => getIt.get<ThemeStore>().currentTheme;
20
21 @override
22 Widget build(BuildContext context) {
23 - final appBarColor =
24 - currentTheme.type == ThemeType.dark ? Colors.black.withOpacity(0.1) : Colors.white;
23
24 return Container(
25 padding: const EdgeInsetsDirectional.only(end: 24),
28 - color: appBarColor,
26 + color: Theme.of(context).colorScheme.surfaceContainerLowest.withOpacity(0.1),
27 child: Center(
28 child: Row(
29 mainAxisSize: MainAxisSize.max,
lib/src/screens/dashboard/desktop_widgets/desktop_sidebar/side_menu.dart
+1 -1
@@ -16,7 +16,7 @@ class SideMenu extends StatelessWidget {
16 @override
17 Widget build(BuildContext context) {
18 return Container(
19 - color: Colors.black.withOpacity(0.1),
19 + color: Theme.of(context).colorScheme.surfaceContainerLowest.withOpacity(0.1),
20 width: width,
21 height: MediaQuery.of(context).size.height,
22 child: Column(
lib/src/screens/dashboard/desktop_widgets/desktop_sidebar/side_menu_item.dart
+2 -3
@@ -1,5 +1,4 @@
1 import 'package:flutter/material.dart';
2 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
2
3 class SideMenuItem extends StatelessWidget {
4 const SideMenuItem({
@@ -19,9 +18,9 @@ class SideMenuItem extends StatelessWidget {
18
19 Color _setColor(BuildContext context) {
20 if (isSelected) {
22 - return Theme.of(context).extension<CakeTextTheme>()!.titleColor;
21 + return Theme.of(context).colorScheme.primary;
22 } else {
24 - return Theme.of(context).highlightColor;
23 + return Theme.of(context).colorScheme.onSurfaceVariant;
24 }
25 }
26
lib/src/screens/dashboard/desktop_widgets/desktop_sidebar_wrapper.dart
+1 -1
@@ -137,7 +137,7 @@ class DesktopSidebarWrapper extends BasePage {
137 children: [
138 child,
139 Container(
140 - color: Theme.of(context).colorScheme.background,
140 + color: Theme.of(context).colorScheme.surface,
141 padding: EdgeInsets.all(20),
142 child: Navigator(
143 initialRoute: Routes.support,
lib/src/screens/dashboard/desktop_widgets/desktop_wallet_selection_dropdown.dart
+5 -8
@@ -1,6 +1,5 @@
1 import 'package:another_flushbar/flushbar.dart';
2 import 'package:cake_wallet/core/new_wallet_arguments.dart';
3 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
3 import 'package:cake_wallet/core/auth_service.dart';
4 import 'package:cake_wallet/entities/desktop_dropdown_item.dart';
5 import 'package:cake_wallet/generated/i18n.dart';
@@ -10,8 +9,6 @@ import 'package:cake_wallet/src/screens/dashboard/desktop_widgets/dropdown_item_
9 import 'package:cake_wallet/src/screens/wallet_unlock/wallet_unlock_arguments.dart';
10 import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
11 import 'package:cake_wallet/store/settings_store.dart';
13 -import 'package:cake_wallet/themes/extensions/menu_theme.dart';
14 -import 'package:cake_wallet/utils/exception_handler.dart';
12 import 'package:cake_wallet/utils/show_bar.dart';
13 import 'package:cake_wallet/utils/show_pop_up.dart';
14 import 'package:cake_wallet/view_model/wallet_list/wallet_list_item.dart';
@@ -54,14 +51,14 @@ class _DesktopWalletSelectionDropDownState extends State<DesktopWalletSelectionD
51 'assets/images/new_wallet.png',
52 height: 12,
53 width: 12,
57 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
54 + color: Theme.of(context).colorScheme.onSurface,
55 );
56
57 Image _restoreWalletImage(BuildContext context) => Image.asset(
58 'assets/images/restore_wallet.png',
59 height: 12,
60 width: 12,
64 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
61 + color: Theme.of(context).colorScheme.onSurface,
62 );
63
64 Flushbar<void>? _progressBar;
@@ -119,8 +116,8 @@ class _DesktopWalletSelectionDropDownState extends State<DesktopWalletSelectionD
116 onChanged: (item) {
117 item?.onSelected();
118 },
122 - dropdownColor: themeData.extension<CakeMenuTheme>()!.backgroundColor,
123 - style: TextStyle(color: themeData.extension<CakeTextTheme>()!.titleColor),
119 + dropdownColor: themeData.colorScheme.surface,
120 + style: themeData.textTheme.bodyMedium,
121 selectedItemBuilder: (context) => dropDownItems.map((item) => item.child).toList(),
122 value: selectedItem,
123 underline: const SizedBox(),
@@ -256,7 +253,7 @@ class _DesktopWalletSelectionDropDownState extends State<DesktopWalletSelectionD
253 }
254
255 void changeProcessText(String text) {
259 - _progressBar = createBar<void>(text, duration: null)..show(context);
256 + _progressBar = createBar<void>(text,context, duration: null)..show(context);
257 }
258
259 void hideProgressText() {
lib/src/screens/dashboard/desktop_widgets/dropdown_item_widget.dart
+1 -6
@@ -1,4 +1,3 @@
1 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
1 import 'package:flutter/material.dart';
2
3 class DropDownItemWidget extends StatelessWidget {
@@ -21,11 +20,7 @@ class DropDownItemWidget extends StatelessWidget {
20 Flexible(
21 child: Text(
22 title,
24 - style: TextStyle(
25 - fontSize: 18,
26 - fontWeight: FontWeight.w500,
27 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
28 - ),
23 + style: Theme.of(context).textTheme.bodyMedium,
24 overflow: TextOverflow.ellipsis,
25 maxLines: 1,
26 ),
lib/src/screens/dashboard/edit_token_page.dart
+17 -24
@@ -8,8 +8,6 @@ import 'package:cake_wallet/src/widgets/base_text_form_field.dart';
8 import 'package:cake_wallet/src/widgets/checkbox_widget.dart';
9 import 'package:cake_wallet/src/widgets/primary_button.dart';
10 import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
11 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
12 -import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart';
11 import 'package:cake_wallet/utils/show_pop_up.dart';
12 import 'package:cake_wallet/view_model/dashboard/home_settings_view_model.dart';
13 import 'package:cw_core/crypto_currency.dart';
@@ -124,7 +122,7 @@ class _EditTokenPageBodyState extends State<EditTokenPageBody> {
122 Container(
123 padding: EdgeInsets.symmetric(vertical: 16, horizontal: 28),
124 decoration: BoxDecoration(
127 - color: Theme.of(context).cardColor,
125 + color: Theme.of(context).colorScheme.surfaceContainerHighest,
126 borderRadius: BorderRadius.circular(12),
127 ),
128 child: Row(
@@ -138,23 +136,18 @@ class _EditTokenPageBodyState extends State<EditTokenPageBody> {
136 children: [
137 Text(
138 S.of(context).warning,
141 - style: TextStyle(
142 - fontSize: 16,
143 - fontWeight: FontWeight.bold,
144 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
145 - ),
139 + style: Theme.of(context).textTheme.bodyLarge?.copyWith(
140 + fontWeight: FontWeight.w500,
141 + ),
142 ),
143 Padding(
144 padding: EdgeInsets.only(top: 5),
145 child: Text(
146 S.of(context).add_token_warning,
151 - style: TextStyle(
152 - fontSize: 14,
153 - fontWeight: FontWeight.bold,
154 - color: Theme.of(context)
155 - .extension<TransactionTradeTheme>()!
156 - .detailsTitlesColor,
157 - ),
147 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
148 + color: Theme.of(context).colorScheme.onSurfaceVariant,
149 + height: 1.6,
150 + ),
151 ),
152 ),
153 ],
@@ -195,8 +188,8 @@ class _EditTokenPageBodyState extends State<EditTokenPageBody> {
188 Navigator.pop(context);
189 },
190 text: widget.token != null ? S.of(context).delete : S.of(context).cancel,
198 - color: Colors.red,
199 - textColor: Colors.white,
191 + color: Theme.of(context).colorScheme.errorContainer,
192 + textColor: Theme.of(context).colorScheme.onErrorContainer,
193 ),
194 ),
195 SizedBox(width: 20),
@@ -210,10 +203,11 @@ class _EditTokenPageBodyState extends State<EditTokenPageBody> {
203 final isWhitelisted = await widget.homeSettingsViewModel
204 .checkIfTokenIsWhitelisted(_contractAddressController.text);
205
213 - final hasPotentialError = !isWhitelisted && await widget.homeSettingsViewModel
214 - .checkIfERC20TokenContractAddressIsAPotentialScamAddress(
215 - _contractAddressController.text,
216 - );
206 + final hasPotentialError = !isWhitelisted &&
207 + await widget.homeSettingsViewModel
208 + .checkIfERC20TokenContractAddressIsAPotentialScamAddress(
209 + _contractAddressController.text,
210 + );
211
212 bool isPotentialScam = hasPotentialError && !isWhitelisted;
213 final tokenSymbol = _tokenSymbolController.text.toUpperCase();
@@ -298,8 +292,8 @@ class _EditTokenPageBodyState extends State<EditTokenPageBody> {
292 }
293 },
294 text: S.of(context).save,
301 - color: Theme.of(context).primaryColor,
302 - textColor: Colors.white,
295 + color: Theme.of(context).colorScheme.primary,
296 + textColor: Theme.of(context).colorScheme.onPrimary,
297 ),
298 ),
299 ],
@@ -354,7 +348,6 @@ class _EditTokenPageBodyState extends State<EditTokenPageBody> {
348 focusNode: _contractAddressFocusNode,
349 placeholder: S.of(context).token_contract_address,
350 options: [AddressTextFieldOption.paste],
357 - buttonColor: Theme.of(context).hintColor,
351 validator: widget.homeSettingsViewModel.walletType == WalletType.zano
352 ? null
353 : AddressValidator(type: widget.homeSettingsViewModel.nativeToken).call,
lib/src/screens/dashboard/home_settings_page.dart
+34 -38
@@ -5,16 +5,13 @@ import 'package:cake_wallet/entities/sort_balance_types.dart';
5 import 'package:cake_wallet/generated/i18n.dart';
6 import 'package:cake_wallet/routes.dart';
7 import 'package:cake_wallet/src/screens/base_page.dart';
8 +import 'package:cake_wallet/src/widgets/base_text_form_field.dart';
9 import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
10 import 'package:cake_wallet/src/screens/settings/widgets/settings_picker_cell.dart';
11 import 'package:cake_wallet/src/screens/settings/widgets/settings_switcher_cell.dart';
11 -import 'package:cake_wallet/themes/extensions/address_theme.dart';
12 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
13 -import 'package:cake_wallet/themes/extensions/menu_theme.dart';
14 -import 'package:cake_wallet/themes/extensions/picker_theme.dart';
15 -import 'package:cake_wallet/view_model/dashboard/home_settings_view_model.dart';
12 import 'package:flutter/material.dart';
13 import 'package:flutter_mobx/flutter_mobx.dart';
14 +import 'package:cake_wallet/view_model/dashboard/home_settings_view_model.dart';
15
16 class HomeSettingsPage extends BasePage {
17 HomeSettingsPage(this._homeSettingsViewModel);
@@ -39,7 +36,7 @@ class HomeSettingsPage extends BasePage {
36 onItemSelected: _homeSettingsViewModel.setSortBalanceBy,
37 ),
38 ),
42 - Divider(color: Theme.of(context).extension<CakeMenuTheme>()!.dividerColor),
39 + Divider(color: Theme.of(context).colorScheme.outlineVariant),
40 Observer(
41 builder: (_) => SettingsSwitcherCell(
42 title: S.of(context).pin_at_top(_homeSettingsViewModel.nativeToken.title),
@@ -49,56 +46,52 @@ class HomeSettingsPage extends BasePage {
46 },
47 ),
48 ),
52 - Divider(color: Theme.of(context).extension<CakeMenuTheme>()!.dividerColor),
49 + Divider(color: Theme.of(context).colorScheme.outlineVariant),
50 const SizedBox(height: 20),
51 Row(
52 children: [
53 Expanded(
54 child: Padding(
55 padding: const EdgeInsetsDirectional.only(start: 16),
59 - child: TextFormField(
56 + child: BaseTextFormField(
57 controller: _searchController,
61 - style: TextStyle(
62 - color: Theme.of(context).extension<PickerTheme>()!.searchHintColor),
63 - decoration: InputDecoration(
64 - hintText: S.of(context).search_add_token,
65 - prefixIcon: Image.asset("assets/images/search_icon.png"),
66 - filled: true,
67 - fillColor: Theme.of(context).extension<AddressTheme>()!.actionButtonColor,
68 - alignLabelWithHint: false,
69 - contentPadding: const EdgeInsets.symmetric(vertical: 4, horizontal: 16),
70 - enabledBorder: OutlineInputBorder(
71 - borderRadius: BorderRadius.circular(30),
72 - borderSide: const BorderSide(color: Colors.transparent),
73 - ),
74 - focusedBorder: OutlineInputBorder(
75 - borderRadius: BorderRadius.circular(30),
76 - borderSide: const BorderSide(color: Colors.transparent),
77 - ),
58 + textStyle: Theme.of(context).textTheme.bodyMedium?.copyWith(
59 + color: Theme.of(context).colorScheme.onSurfaceVariant,
60 + ),
61 + hintText: S.of(context).search_add_token,
62 + prefixIcon: Image.asset(
63 + "assets/images/search_icon.png",
64 + color: Theme.of(context).colorScheme.onSurfaceVariant,
65 ),
66 + alignLabelWithHint: false,
67 + contentPadding: const EdgeInsets.symmetric(vertical: 4, horizontal: 16),
68 onChanged: (String text) => _homeSettingsViewModel.changeSearchText(text),
69 ),
70 ),
71 ),
72 RawMaterialButton(
73 onPressed: () async {
85 - Navigator.pushNamed(context, Routes.editToken, arguments: {
86 - 'homeSettingsViewModel': _homeSettingsViewModel,
87 - if (AddressValidator(type: _homeSettingsViewModel.nativeToken)
88 - .isValid(_searchController.text))
89 - 'contractAddress': _searchController.text,
90 - });
74 + Navigator.pushNamed(
75 + context,
76 + Routes.editToken,
77 + arguments: {
78 + 'homeSettingsViewModel': _homeSettingsViewModel,
79 + if (AddressValidator(type: _homeSettingsViewModel.nativeToken)
80 + .isValid(_searchController.text))
81 + 'contractAddress': _searchController.text,
82 + },
83 + );
84 },
85 elevation: 0,
93 - fillColor: Theme.of(context).cardColor,
86 + fillColor: Theme.of(context).colorScheme.surfaceContainer,
87 child: Icon(
88 Icons.add,
96 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
89 + color: Theme.of(context).colorScheme.onSurfaceVariant,
90 size: 22.0,
91 ),
92 padding: EdgeInsets.all(12),
93 shape: CircleBorder(),
101 - splashColor: Theme.of(context).cardColor,
94 + splashColor: Theme.of(context).colorScheme.surfaceContainer,
95 ),
96 ],
97 ),
@@ -136,24 +129,27 @@ class HomeSettingsPage extends BasePage {
129 imageUrl: token.iconPath,
130 height: 40,
131 width: 40,
139 - displayOnError: Container(
132 + errorWidget: Container(
133 height: 30.0,
134 width: 30.0,
135 child: Center(
136 child: Text(
137 token.title.substring(0, min(token.title.length, 2)),
145 - style: TextStyle(fontSize: 11),
138 + style: Theme.of(context).textTheme.bodySmall?.copyWith(
139 + fontSize: 11,
140 + color: Theme.of(context).colorScheme.onSurfaceVariant,
141 + ),
142 ),
143 ),
144 decoration: BoxDecoration(
145 shape: BoxShape.circle,
150 - color: Colors.grey.shade400,
146 + color: Theme.of(context).colorScheme.surfaceContainerHighest,
147 ),
148 ),
149 ),
150 ),
151 decoration: BoxDecoration(
156 - color: Theme.of(context).cardColor,
152 + color: Theme.of(context).colorScheme.surfaceContainer,
153 borderRadius: BorderRadius.circular(30),
154 ),
155 );
lib/src/screens/dashboard/pages/address_page.dart
+45 -43
@@ -1,6 +1,5 @@
1 import 'package:cake_wallet/bitcoin/bitcoin.dart';
2 import 'package:cake_wallet/src/screens/new_wallet/widgets/select_button.dart';
3 -import 'package:cake_wallet/themes/extensions/keyboard_theme.dart';
3 import 'package:cake_wallet/di.dart';
4 import 'package:cake_wallet/src/screens/base_page.dart';
5 import 'package:cake_wallet/anonpay/anonpay_donation_link_info.dart';
@@ -9,8 +8,7 @@ import 'package:cw_core/receive_page_option.dart';
8 import 'package:cake_wallet/src/screens/dashboard/widgets/present_receive_option_picker.dart';
9 import 'package:cake_wallet/src/widgets/gradient_background.dart';
10 import 'package:cake_wallet/src/widgets/keyboard_done_button.dart';
12 -import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart';
13 -import 'package:cake_wallet/themes/theme_base.dart';
11 +import 'package:cake_wallet/themes/core/material_base_theme.dart';
12 import 'package:cake_wallet/utils/responsive_layout_util.dart';
13 import 'package:cake_wallet/utils/share_util.dart';
14 import 'package:cake_wallet/view_model/dashboard/receive_option_view_model.dart';
@@ -25,7 +23,6 @@ import 'package:flutter_mobx/flutter_mobx.dart';
23 import 'package:keyboard_actions/keyboard_actions.dart';
24 import 'package:mobx/mobx.dart';
25 import 'package:shared_preferences/shared_preferences.dart';
28 -import 'package:cake_wallet/themes/extensions/balance_page_theme.dart';
26
27 class AddressPage extends BasePage {
28 AddressPage({
@@ -68,7 +65,7 @@ class AddressPage extends BasePage {
65 size: 16,
66 );
67 final _closeButton =
71 - currentTheme.type == ThemeType.dark ? closeButtonImageDarkTheme : closeButtonImage;
68 + currentTheme.isDark ? closeButtonImageDarkTheme : closeButtonImage;
69
70 bool isMobileView = responsiveLayoutUtil.shouldRenderMobileUI;
71
@@ -130,53 +127,57 @@ class AddressPage extends BasePage {
127 _setEffects(context);
128
129 return KeyboardActions(
133 - autoScroll: false,
134 - disableScroll: true,
135 - tapOutsideBehavior: TapOutsideBehavior.translucentDismiss,
136 - config: KeyboardActionsConfig(
137 - keyboardActionsPlatform: KeyboardActionsPlatform.IOS,
138 - keyboardBarColor: Theme.of(context).extension<KeyboardTheme>()!.keyboardBarColor,
139 - nextFocus: false,
140 - actions: [
141 - KeyboardActionsItem(
142 - focusNode: _cryptoAmountFocus,
143 - toolbarButtons: [(_) => KeyboardDoneButton()],
144 - )
145 - ]),
146 - child: Container(
147 - padding: EdgeInsets.fromLTRB(24, 0, 24, 32),
148 - child: Column(
149 - children: <Widget>[
150 - Expanded(
151 - child: Observer(
152 - builder: (_) => QRWidget(
153 - formKey: _formKey,
154 - addressListViewModel: addressListViewModel,
155 - amountTextFieldFocusNode: _cryptoAmountFocus,
156 - amountController: _amountController,
157 - currentTheme:
158 - dashboardViewModel.settingsStore.currentTheme,
159 - ))),
160 - SizedBox(height: 16),
161 - Observer(builder: (_) {
130 + autoScroll: false,
131 + disableScroll: true,
132 + tapOutsideBehavior: TapOutsideBehavior.translucentDismiss,
133 + config: KeyboardActionsConfig(
134 + keyboardActionsPlatform: KeyboardActionsPlatform.IOS,
135 + keyboardBarColor: Theme.of(context).colorScheme.surface,
136 + nextFocus: false,
137 + actions: [
138 + KeyboardActionsItem(
139 + focusNode: _cryptoAmountFocus,
140 + toolbarButtons: [(_) => KeyboardDoneButton()],
141 + )
142 + ],
143 + ),
144 + child: Container(
145 + padding: EdgeInsets.fromLTRB(24, 0, 24, 32),
146 + child: Column(
147 + children: <Widget>[
148 + Expanded(
149 + child: Observer(
150 + builder: (_) => QRWidget(
151 + formKey: _formKey,
152 + addressListViewModel: addressListViewModel,
153 + amountTextFieldFocusNode: _cryptoAmountFocus,
154 + amountController: _amountController,
155 + currentTheme: dashboardViewModel.appStore.themeStore.currentTheme,
156 + ),
157 + ),
158 + ),
159 + SizedBox(height: 16),
160 + Observer(
161 + builder: (_) {
162 if (addressListViewModel.hasAddressList) {
163 return SelectButton(
164 text: addressListViewModel.buttonTitle,
165 onTap: () => Navigator.of(context).pushNamed(Routes.receive),
166 - textColor: Theme.of(context).extension<SyncIndicatorTheme>()!.textColor,
167 - color: Theme.of(context).extension<SyncIndicatorTheme>()!.syncedBackgroundColor,
168 - borderColor: Theme.of(context).extension<BalancePageTheme>()!.cardBorderColor,
169 - arrowColor: Theme.of(context).extension<SyncIndicatorTheme>()!.textColor,
166 + textColor: Theme.of(context).colorScheme.onSecondaryContainer,
167 + color: Theme.of(context).colorScheme.surfaceContainer,
168 + arrowColor: Theme.of(context).colorScheme.onSurfaceVariant,
169 textSize: 14,
170 height: 50,
171 );
172 } else {
173 return const SizedBox();
174 }
176 - }),
177 - ],
178 - ),
179 - ));
175 + },
176 + ),
177 + ],
178 + ),
179 + ),
180 + );
181 }
182
183 void _setEffects(BuildContext context) {
@@ -185,7 +186,8 @@ class AddressPage extends BasePage {
186 }
187
188 reaction((_) => receiveOptionViewModel.selectedReceiveOption, (ReceivePageOption option) {
188 - if (dashboardViewModel.type == WalletType.bitcoin && bitcoin!.isBitcoinReceivePageOption(option)) {
189 + if (dashboardViewModel.type == WalletType.bitcoin &&
190 + bitcoin!.isBitcoinReceivePageOption(option)) {
191 addressListViewModel.setAddressType(bitcoin!.getOptionToType(option));
192 return;
193 }
lib/src/screens/dashboard/pages/balance/balance_page.dart
+19 -28
@@ -2,7 +2,6 @@ import 'package:cake_wallet/reactions/wallet_connect.dart';
2 import 'package:cake_wallet/src/screens/dashboard/pages/balance/crypto_balance_widget.dart';
3 import 'package:cake_wallet/src/screens/dashboard/pages/nft_listing_page.dart';
4 import 'package:cake_wallet/store/settings_store.dart';
5 -import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
5 import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart';
6 import 'package:cake_wallet/view_model/dashboard/nft_view_model.dart';
7 import 'package:flutter/material.dart';
@@ -37,34 +36,26 @@ class BalancePage extends StatelessWidget {
36 child: TabBar(
37 indicatorSize: TabBarIndicatorSize.label,
38 isScrollable: true,
40 - physics: NeverScrollableScrollPhysics(),
41 - labelStyle: TextStyle(
42 - fontSize: 18,
43 - fontFamily: 'Lato',
44 - fontWeight: FontWeight.w600,
45 - color:
46 - Theme.of(context).extension<DashboardPageTheme>()!.pageTitleTextColor,
47 - height: 1,
48 - ),
49 - unselectedLabelStyle: TextStyle(
50 - fontSize: 18,
51 - fontFamily: 'Lato',
52 - fontWeight: FontWeight.w600,
53 - color:
54 - Theme.of(context).extension<DashboardPageTheme>()!.pageTitleTextColor,
55 - height: 1,
56 - ),
57 - labelColor:
58 - Theme.of(context).extension<DashboardPageTheme>()!.pageTitleTextColor,
39 + physics: const NeverScrollableScrollPhysics(),
40 + labelStyle: Theme.of(context).textTheme.titleMedium?.copyWith(
41 + fontWeight: FontWeight.w600,
42 + fontSize: 18,
43 + height: 1,
44 + color: Theme.of(context).colorScheme.primary,
45 + ),
46 + unselectedLabelStyle: Theme.of(context).textTheme.titleMedium?.copyWith(
47 + fontWeight: FontWeight.w600,
48 + fontSize: 18,
49 + height: 1,
50 + color: Theme.of(context).colorScheme.primary,
51 + ),
52 + labelColor: Theme.of(context).colorScheme.primary,
53 dividerColor: Colors.transparent,
60 - indicatorColor:
61 - Theme.of(context).extension<DashboardPageTheme>()!.pageTitleTextColor,
62 - unselectedLabelColor: Theme.of(context)
63 - .extension<DashboardPageTheme>()!
64 - .pageTitleTextColor
65 - .withOpacity(0.5),
54 + indicatorColor: Theme.of(context).colorScheme.primary,
55 + unselectedLabelColor:
56 + Theme.of(context).colorScheme.secondary.withOpacity(0.7),
57 tabAlignment: TabAlignment.start,
67 - tabs: [
58 + tabs: const [
59 Tab(text: 'My Crypto'),
60 Tab(text: 'My NFTs'),
61 ],
@@ -73,7 +64,7 @@ class BalancePage extends StatelessWidget {
64 ),
65 Expanded(
66 child: TabBarView(
76 - physics: NeverScrollableScrollPhysics(),
67 + physics: const NeverScrollableScrollPhysics(),
68 children: [
69 CryptoBalanceWidget(dashboardViewModel: dashboardViewModel),
70 if (isNFTActivated) NFTListingPage(nftViewModel: nftViewModel)
lib/src/screens/dashboard/pages/balance/balance_row_widget.dart
+181 -230
@@ -6,8 +6,7 @@ import 'package:cake_wallet/generated/i18n.dart';
6 import 'package:cake_wallet/routes.dart';
7 import 'package:cake_wallet/src/screens/exchange_trade/information_page.dart';
8 import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
9 -import 'package:cake_wallet/themes/extensions/balance_page_theme.dart';
10 -import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart';
9 +import 'package:cake_wallet/themes/utils/custom_theme_colors.dart';
10 import 'package:cake_wallet/utils/payment_request.dart';
11 import 'package:cake_wallet/utils/show_pop_up.dart';
12 import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart';
@@ -70,30 +69,33 @@ class BalanceRowWidget extends StatelessWidget {
69 Container(
70 margin: const EdgeInsets.only(left: 16, right: 16),
71 decoration: BoxDecoration(
73 - borderRadius: BorderRadius.circular(30.0),
74 - border: Border.all(
75 - color: Theme.of(context).extension<BalancePageTheme>()!.cardBorderColor,
76 - width: 1,
77 - ),
78 - color: Theme.of(context).extension<SyncIndicatorTheme>()!.syncedBackgroundColor,
79 - // boxShadow: [
80 - // BoxShadow(
81 - // color: Theme.of(context)
82 - // .extension<BalancePageTheme>()!
83 - // .cardBorderColor
84 - // .withAlpha(50),
85 - // spreadRadius: dashboardViewModel.getShadowSpread(),
86 - // blurRadius: dashboardViewModel.getShadowBlur())
87 - // ],
72 + borderRadius: BorderRadius.circular(15.0),
73 + gradient: LinearGradient(
74 + colors: [
75 + dashboardViewModel.isDarkTheme
76 + ? CustomThemeColors.cardGradientColorPrimaryDark
77 + : CustomThemeColors.cardGradientColorPrimaryLight,
78 + dashboardViewModel.isDarkTheme
79 + ? CustomThemeColors.cardGradientColorSecondaryDark
80 + : CustomThemeColors.cardGradientColorSecondaryLight,
81 + ],
82 + begin: Alignment.topCenter,
83 + end: Alignment.bottomCenter,
84 + ),
85 ),
86 child: TextButton(
87 onPressed: _showToast,
88 onLongPress: () => dashboardViewModel.balanceViewModel.switchBalanceValue(),
89 style: TextButton.styleFrom(
93 - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(30)),
90 + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15)),
91 ),
92 child: Container(
96 - margin: const EdgeInsets.only(top: 10, left: 12, right: 12, bottom: 10),
93 + margin: const EdgeInsets.only(
94 + top: 10,
95 + left: 12,
96 + right: 12,
97 + bottom: 10,
98 + ),
99 child: Column(
100 crossAxisAlignment: CrossAxisAlignment.start,
101 children: [
@@ -115,61 +117,58 @@ class BalanceRowWidget extends StatelessWidget {
117 Semantics(
118 hint: 'Double tap to see more information',
119 container: true,
118 - child: Text('${availableBalanceLabel}',
119 - style: TextStyle(
120 - fontSize: 12,
121 - fontFamily: 'Lato',
122 - fontWeight: FontWeight.w400,
123 - color: Theme.of(context)
124 - .extension<BalancePageTheme>()!
125 - .labelTextColor,
126 - height: 1)),
120 + child: Text(
121 + '${availableBalanceLabel}',
122 + style: Theme.of(context).textTheme.bodySmall?.copyWith(
123 + color: Theme.of(context).colorScheme.onSurfaceVariant,
124 + height: 1,
125 + ),
126 + ),
127 ),
128 if (hasAdditionalBalance)
129 Padding(
130 padding: const EdgeInsets.symmetric(horizontal: 4),
131 - child: Icon(Icons.help_outline,
132 - size: 16,
133 - color: Theme.of(context)
134 - .extension<BalancePageTheme>()!
135 - .labelTextColor),
131 + child: Icon(
132 + Icons.help_outline,
133 + size: 16,
134 + color: Theme.of(context).colorScheme.onSurfaceVariant,
135 + ),
136 ),
137 ],
138 ),
139 ),
140 SizedBox(height: 6),
141 - AutoSizeText(availableBalance,
142 - style: TextStyle(
143 - fontSize: 24,
144 - fontFamily: 'Lato',
141 + AutoSizeText(
142 + availableBalance,
143 + style: Theme.of(context).textTheme.titleLarge?.copyWith(
144 + color: Theme.of(context).colorScheme.onSurface,
145 fontWeight: FontWeight.w900,
146 - color: Theme.of(context)
147 - .extension<BalancePageTheme>()!
148 - .balanceAmountColor,
149 - height: 1),
150 - maxLines: 1,
151 - textAlign: TextAlign.start),
146 + fontSize: 24,
147 + height: 1,
148 + ),
149 + maxLines: 1,
150 + textAlign: TextAlign.start,
151 + ),
152 SizedBox(height: 6),
153 if (isTestnet)
154 - Text(S.of(context).testnet_coins_no_value,
155 - textAlign: TextAlign.center,
156 - style: TextStyle(
157 - fontSize: 14,
158 - fontFamily: 'Lato',
159 - fontWeight: FontWeight.w400,
160 - color:
161 - Theme.of(context).extension<BalancePageTheme>()!.textColor,
162 - height: 1)),
154 + Text(
155 + S.of(context).testnet_coins_no_value,
156 + textAlign: TextAlign.center,
157 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
158 + height: 1,
159 + ),
160 + ),
161 if (!isTestnet)
164 - Text('${availableFiatBalance}',
165 - textAlign: TextAlign.center,
166 - style: TextStyle(
162 + Text(
163 + '${availableFiatBalance}',
164 + textAlign: TextAlign.center,
165 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
166 fontSize: 16,
168 - fontFamily: 'Lato',
167 fontWeight: FontWeight.w500,
170 - color:
171 - Theme.of(context).extension<BalancePageTheme>()!.textColor,
172 - height: 1)),
168 + color: Theme.of(context).colorScheme.onSurfaceVariant,
169 + height: 1,
170 + ),
171 + ),
172 ],
173 ),
174 SizedBox(
@@ -181,33 +180,33 @@ class BalanceRowWidget extends StatelessWidget {
180 imageUrl: currency.iconPath,
181 height: 40,
182 width: 40,
184 - displayOnError: Container(
183 + errorWidget: Container(
184 height: 30.0,
185 width: 30.0,
186 child: Center(
187 child: Text(
188 currency.title.substring(0, min(currency.title.length, 2)),
190 - style: TextStyle(fontSize: 11),
189 + style: Theme.of(context).textTheme.bodySmall?.copyWith(
190 + fontSize: 11,
191 + color: Theme.of(context).colorScheme.onSurfaceVariant,
192 + ),
193 ),
194 ),
195 decoration: BoxDecoration(
196 shape: BoxShape.circle,
195 - color: Colors.grey.shade400,
197 + color: Theme.of(context).colorScheme.surfaceContainer,
198 ),
199 ),
200 ),
201 const SizedBox(height: 10),
202 Text(
203 currency.title,
202 - style: TextStyle(
203 - fontSize: 15,
204 - fontFamily: 'Lato',
205 - fontWeight: FontWeight.w800,
206 - color: Theme.of(context)
207 - .extension<BalancePageTheme>()!
208 - .assetTitleColor,
209 - height: 1,
210 - ),
204 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
205 + fontSize: 16,
206 + fontWeight: FontWeight.w700,
207 + color: Theme.of(context).colorScheme.onSurface,
208 + height: 1,
209 + ),
210 ),
211 ],
212 ),
@@ -220,7 +219,7 @@ class BalanceRowWidget extends StatelessWidget {
219 padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 2),
220 margin: EdgeInsets.only(top: 4),
221 decoration: BoxDecoration(
223 - color: Colors.red[800],
222 + color: Theme.of(context).colorScheme.errorContainer,
223 borderRadius: BorderRadius.circular(8),
224 ),
225 child: Row(
@@ -229,15 +228,15 @@ class BalanceRowWidget extends StatelessWidget {
228 Icon(
229 Icons.warning_amber_outlined,
230 size: 16,
232 - color: Colors.white,
231 + color: Theme.of(context).colorScheme.onErrorContainer,
232 ),
233 const SizedBox(width: 4),
234 Text(
235 S.of(context).potential_scam,
237 - style: TextStyle(
238 - color: Colors.white,
239 - fontWeight: FontWeight.w700,
240 - ),
236 + style: Theme.of(context).textTheme.bodySmall?.copyWith(
237 + color: Theme.of(context).colorScheme.onErrorContainer,
238 + fontWeight: FontWeight.w700,
239 + ),
240 ),
241 ],
242 ),
@@ -252,28 +251,21 @@ class BalanceRowWidget extends StatelessWidget {
251 Text(
252 S.of(context).frozen_balance,
253 textAlign: TextAlign.center,
255 - style: TextStyle(
256 - fontSize: 12,
257 - fontFamily: 'Lato',
258 - fontWeight: FontWeight.w400,
259 - color:
260 - Theme.of(context).extension<BalancePageTheme>()!.labelTextColor,
261 - height: 1,
262 - ),
254 + style: Theme.of(context).textTheme.bodySmall!.copyWith(
255 + color: Theme.of(context).colorScheme.onSurfaceVariant,
256 + height: 1,
257 + ),
258 ),
259 ],
260 ),
261 SizedBox(height: 8),
262 AutoSizeText(
263 frozenBalance,
269 - style: TextStyle(
270 - fontSize: 20,
271 - fontFamily: 'Lato',
272 - fontWeight: FontWeight.w400,
273 - color:
274 - Theme.of(context).extension<BalancePageTheme>()!.balanceAmountColor,
275 - height: 1,
276 - ),
264 + style: Theme.of(context).textTheme.bodyLarge!.copyWith(
265 + fontSize: 20,
266 + color: Theme.of(context).colorScheme.primary,
267 + height: 1,
268 + ),
269 maxLines: 1,
270 textAlign: TextAlign.center,
271 ),
@@ -282,13 +274,9 @@ class BalanceRowWidget extends StatelessWidget {
274 Text(
275 frozenFiatBalance,
276 textAlign: TextAlign.center,
285 - style: TextStyle(
286 - fontSize: 12,
287 - fontFamily: 'Lato',
288 - fontWeight: FontWeight.w400,
289 - color: Theme.of(context).extension<BalancePageTheme>()!.textColor,
290 - height: 1,
291 - ),
277 + style: Theme.of(context).textTheme.bodySmall!.copyWith(
278 + height: 1,
279 + ),
280 ),
281 ],
282 ),
@@ -300,24 +288,19 @@ class BalanceRowWidget extends StatelessWidget {
288 Text(
289 '${additionalBalanceLabel}',
290 textAlign: TextAlign.center,
303 - style: TextStyle(
304 - fontSize: 12,
305 - fontFamily: 'Lato',
306 - fontWeight: FontWeight.w400,
307 - color: Theme.of(context).extension<BalancePageTheme>()!.labelTextColor,
308 - height: 1,
309 - ),
291 + style: Theme.of(context).textTheme.bodySmall!.copyWith(
292 + color: Theme.of(context).colorScheme.onSurfaceVariant,
293 + height: 1,
294 + ),
295 ),
296 SizedBox(height: 8),
297 AutoSizeText(
298 additionalBalance,
314 - style: TextStyle(
315 - fontSize: 20,
316 - fontFamily: 'Lato',
317 - fontWeight: FontWeight.w400,
318 - color: Theme.of(context).extension<BalancePageTheme>()!.assetTitleColor,
319 - height: 1,
320 - ),
299 + style: Theme.of(context).textTheme.bodyLarge!.copyWith(
300 + fontSize: 20,
301 + color: Theme.of(context).colorScheme.secondary,
302 + height: 1,
303 + ),
304 maxLines: 1,
305 textAlign: TextAlign.center,
306 ),
@@ -326,13 +309,9 @@ class BalanceRowWidget extends StatelessWidget {
309 Text(
310 '${additionalFiatBalance}',
311 textAlign: TextAlign.center,
329 - style: TextStyle(
330 - fontSize: 12,
331 - fontFamily: 'Lato',
332 - fontWeight: FontWeight.w400,
333 - color: Theme.of(context).extension<BalancePageTheme>()!.textColor,
334 - height: 1,
335 - ),
312 + style: Theme.of(context).textTheme.bodySmall!.copyWith(
313 + height: 1,
314 + ),
315 ),
316 ],
317 ),
@@ -342,16 +321,23 @@ class BalanceRowWidget extends StatelessWidget {
321 ),
322 ),
323 if (hasSecondAdditionalBalance || hasSecondAvailableBalance) ...[
345 - SizedBox(height: 16),
324 + SizedBox(height: 10),
325 Container(
326 margin: const EdgeInsets.only(left: 16, right: 16),
327 decoration: BoxDecoration(
349 - borderRadius: BorderRadius.circular(30.0),
350 - border: Border.all(
351 - color: Theme.of(context).extension<BalancePageTheme>()!.cardBorderColor,
352 - width: 1,
328 + borderRadius: BorderRadius.circular(15),
329 + gradient: LinearGradient(
330 + colors: [
331 + dashboardViewModel.isDarkTheme
332 + ? CustomThemeColors.cardGradientColorPrimaryDark
333 + : CustomThemeColors.cardGradientColorPrimaryLight,
334 + dashboardViewModel.isDarkTheme
335 + ? CustomThemeColors.cardGradientColorSecondaryDark
336 + : CustomThemeColors.cardGradientColorSecondaryLight,
337 + ],
338 + begin: Alignment.topCenter,
339 + end: Alignment.bottomCenter,
340 ),
354 - color: Theme.of(context).extension<SyncIndicatorTheme>()!.syncedBackgroundColor,
341 // boxShadow: [
342 // BoxShadow(
343 // color: Theme.of(context)
@@ -366,13 +352,13 @@ class BalanceRowWidget extends StatelessWidget {
352 onPressed: _showToast,
353 onLongPress: () => dashboardViewModel.balanceViewModel.switchBalanceValue(),
354 style: TextButton.styleFrom(
369 - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(30)),
355 + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15)),
356 ),
357 child: Column(
358 crossAxisAlignment: CrossAxisAlignment.start,
359 children: [
360 Container(
375 - margin: const EdgeInsets.only(top: 10, left: 12, right: 12, bottom: 10),
361 + margin: const EdgeInsets.only(top: 10, left: 12, right: 8, bottom: 10),
362 child: Stack(
363 children: [
364 if (currency == CryptoCurrency.ltc)
@@ -385,24 +371,18 @@ class BalanceRowWidget extends StatelessWidget {
371 Container(
372 child: ImageIcon(
373 AssetImage('assets/images/mweb_logo.png'),
388 - color: Theme.of(context)
389 - .extension<BalancePageTheme>()!
390 - .assetTitleColor,
374 size: 40,
375 ),
376 ),
377 const SizedBox(height: 10),
378 Text(
379 'MWEB',
397 - style: TextStyle(
398 - fontSize: 15,
399 - fontFamily: 'Lato',
400 - fontWeight: FontWeight.w800,
401 - color: Theme.of(context)
402 - .extension<BalancePageTheme>()!
403 - .assetTitleColor,
404 - height: 1,
405 - ),
380 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
381 + fontSize: 16,
382 + fontWeight: FontWeight.w700,
383 + color: Theme.of(context).colorScheme.onSurface,
384 + height: 1,
385 + ),
386 ),
387 ],
388 ),
@@ -427,23 +407,19 @@ class BalanceRowWidget extends StatelessWidget {
407 Text(
408 '${secondAvailableBalanceLabel}',
409 textAlign: TextAlign.center,
430 - style: TextStyle(
431 - fontSize: 12,
432 - fontFamily: 'Lato',
433 - fontWeight: FontWeight.w400,
434 - color: Theme.of(context)
435 - .extension<BalancePageTheme>()!
436 - .labelTextColor,
437 - height: 1,
438 - ),
410 + style: Theme.of(context).textTheme.bodySmall?.copyWith(
411 + color:
412 + Theme.of(context).colorScheme.onSurfaceVariant,
413 + height: 1,
414 + ),
415 ),
416 Padding(
417 padding: const EdgeInsets.symmetric(horizontal: 4),
442 - child: Icon(Icons.help_outline,
443 - size: 16,
444 - color: Theme.of(context)
445 - .extension<BalancePageTheme>()!
446 - .labelTextColor),
418 + child: Icon(
419 + Icons.help_outline,
420 + size: 16,
421 + color: Theme.of(context).colorScheme.onSurfaceVariant,
422 + ),
423 )
424 ],
425 ),
@@ -451,15 +427,12 @@ class BalanceRowWidget extends StatelessWidget {
427 SizedBox(height: 8),
428 AutoSizeText(
429 secondAvailableBalance,
454 - style: TextStyle(
455 - fontSize: 24,
456 - fontFamily: 'Lato',
457 - fontWeight: FontWeight.w900,
458 - color: Theme.of(context)
459 - .extension<BalancePageTheme>()!
460 - .assetTitleColor,
461 - height: 1,
462 - ),
430 + style: Theme.of(context).textTheme.bodyLarge?.copyWith(
431 + fontSize: 24,
432 + fontWeight: FontWeight.w800,
433 + color: Theme.of(context).colorScheme.onSurface,
434 + height: 1,
435 + ),
436 maxLines: 1,
437 textAlign: TextAlign.center,
438 ),
@@ -468,15 +441,12 @@ class BalanceRowWidget extends StatelessWidget {
441 Text(
442 '${secondAvailableFiatBalance}',
443 textAlign: TextAlign.center,
471 - style: TextStyle(
472 - fontSize: 16,
473 - fontFamily: 'Lato',
474 - fontWeight: FontWeight.w500,
475 - color: Theme.of(context)
476 - .extension<BalancePageTheme>()!
477 - .textColor,
478 - height: 1,
479 - ),
444 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
445 + fontSize: 16,
446 + fontWeight: FontWeight.w500,
447 + color: Theme.of(context).colorScheme.onSurfaceVariant,
448 + height: 1,
449 + ),
450 ),
451 ],
452 ),
@@ -499,28 +469,19 @@ class BalanceRowWidget extends StatelessWidget {
469 Text(
470 '${secondAdditionalBalanceLabel}',
471 textAlign: TextAlign.center,
502 - style: TextStyle(
503 - fontSize: 12,
504 - fontFamily: 'Lato',
505 - fontWeight: FontWeight.w400,
506 - color: Theme.of(context)
507 - .extension<BalancePageTheme>()!
508 - .labelTextColor,
509 - height: 1,
510 - ),
472 + style: Theme.of(context).textTheme.bodySmall?.copyWith(
473 + color: Theme.of(context).colorScheme.onSurfaceVariant,
474 + height: 1,
475 + ),
476 ),
477 SizedBox(height: 8),
478 AutoSizeText(
479 secondAdditionalBalance,
515 - style: TextStyle(
516 - fontSize: 20,
517 - fontFamily: 'Lato',
518 - fontWeight: FontWeight.w400,
519 - color: Theme.of(context)
520 - .extension<BalancePageTheme>()!
521 - .assetTitleColor,
522 - height: 1,
523 - ),
480 + style: Theme.of(context).textTheme.bodyLarge?.copyWith(
481 + fontSize: 20,
482 + color: Theme.of(context).colorScheme.secondary,
483 + height: 1,
484 + ),
485 maxLines: 1,
486 textAlign: TextAlign.center,
487 ),
@@ -529,15 +490,9 @@ class BalanceRowWidget extends StatelessWidget {
490 Text(
491 '${secondAdditionalFiatBalance}',
492 textAlign: TextAlign.center,
532 - style: TextStyle(
533 - fontSize: 12,
534 - fontFamily: 'Lato',
535 - fontWeight: FontWeight.w400,
536 - color: Theme.of(context)
537 - .extension<BalancePageTheme>()!
538 - .textColor,
539 - height: 1,
540 - ),
493 + style: Theme.of(context).textTheme.bodySmall?.copyWith(
494 + height: 1,
495 + ),
496 ),
497 ],
498 ),
@@ -574,11 +529,13 @@ class BalanceRowWidget extends StatelessWidget {
529 );
530 },
531 style: OutlinedButton.styleFrom(
577 - backgroundColor: Colors.grey.shade400.withAlpha(50),
532 + backgroundColor: Theme.of(context).colorScheme.primary,
533 side: BorderSide(
579 - color: Colors.grey.shade400.withAlpha(50), width: 0),
534 + color: Theme.of(context).colorScheme.outlineVariant.withAlpha(0),
535 + width: 0,
536 + ),
537 shape: RoundedRectangleBorder(
581 - borderRadius: BorderRadius.circular(20),
538 + borderRadius: BorderRadius.circular(10),
539 ),
540 ),
541 child: Container(
@@ -590,18 +547,15 @@ class BalanceRowWidget extends StatelessWidget {
547 height: 30,
548 width: 30,
549 'assets/images/received.png',
593 - color: Theme.of(context)
594 - .extension<BalancePageTheme>()!
595 - .balanceAmountColor,
550 + color: Theme.of(context).colorScheme.onPrimary,
551 ),
552 const SizedBox(width: 8),
553 Text(
554 S.of(context).litecoin_mweb_pegin,
600 - style: TextStyle(
601 - color: Theme.of(context)
602 - .extension<BalancePageTheme>()!
603 - .textColor,
604 - ),
555 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
556 + color: Theme.of(context).colorScheme.onPrimary,
557 + fontWeight: FontWeight.w700,
558 + ),
559 ),
560 ],
561 ),
@@ -632,11 +586,13 @@ class BalanceRowWidget extends StatelessWidget {
586 );
587 },
588 style: OutlinedButton.styleFrom(
635 - backgroundColor: Colors.grey.shade400.withAlpha(50),
589 + backgroundColor: Theme.of(context).colorScheme.surface,
590 side: BorderSide(
637 - color: Colors.grey.shade400.withAlpha(50), width: 0),
591 + color: Theme.of(context).colorScheme.outlineVariant.withAlpha(0),
592 + width: 0,
593 + ),
594 shape: RoundedRectangleBorder(
639 - borderRadius: BorderRadius.circular(20),
595 + borderRadius: BorderRadius.circular(10),
596 ),
597 ),
598 child: Container(
@@ -648,18 +604,17 @@ class BalanceRowWidget extends StatelessWidget {
604 height: 30,
605 width: 30,
606 'assets/images/upload.png',
651 - color: Theme.of(context)
652 - .extension<BalancePageTheme>()!
653 - .balanceAmountColor,
607 + color: Theme.of(context).colorScheme.onSecondaryContainer,
608 ),
609 const SizedBox(width: 8),
610 Text(
611 S.of(context).litecoin_mweb_pegout,
658 - style: TextStyle(
659 - color: Theme.of(context)
660 - .extension<BalancePageTheme>()!
661 - .textColor,
662 - ),
612 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
613 + color: Theme.of(context)
614 + .colorScheme
615 + .onSecondaryContainer,
616 + fontWeight: FontWeight.w700,
617 + ),
618 ),
619 ],
620 ),
@@ -683,20 +638,16 @@ class BalanceRowWidget extends StatelessWidget {
638
639 // double getShadowSpread(){
640 // double spread = 3;
686 - // if (dashboardViewModel.settingsStore.currentTheme.type == ThemeType.bright) spread = 3;
687 - // else if (dashboardViewModel.settingsStore.currentTheme.type == ThemeType.light) spread = 3;
688 - // else if (dashboardViewModel.settingsStore.currentTheme.type == ThemeType.dark) spread = 1;
689 - // else if (dashboardViewModel.settingsStore.currentTheme.type == ThemeType.oled) spread = 3;
641 + // else if (!dashboardViewModel.settingsStore.currentTheme.isDark) spread = 3;
642 + // else if (dashboardViewModel.settingsStore.currentTheme.isDark) spread = 1;
643 // return spread;
644 // }
645 //
646 //
647 // double getShadowBlur(){
648 // double blur = 7;
696 - // if (dashboardViewModel.settingsStore.currentTheme.type == ThemeType.bright) blur = 7;
697 - // else if (dashboardViewModel.settingsStore.currentTheme.type == ThemeType.light) blur = 7;
698 - // else if (dashboardViewModel.settingsStore.currentTheme.type == ThemeType.dark) blur = 3;
699 - // else if (dashboardViewModel.settingsStore.currentTheme.type == ThemeType.oled) blur = 7;
649 + // else if (dashboardViewModel.settingsStore.currentTheme.isDark) blur = 7;
650 + // else if (dashboardViewModel.settingsStore.currentTheme.isDark) blur = 3;
651 // return blur;
652 // }
653
lib/src/screens/dashboard/pages/balance/crypto_balance_widget.dart
+71 -79
@@ -9,13 +9,12 @@ import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
9 import 'package:cake_wallet/src/widgets/dashboard_card_widget.dart';
10 import 'package:cake_wallet/src/widgets/introducing_card.dart';
11 import 'package:cake_wallet/src/widgets/standard_switch.dart';
12 -import 'package:cake_wallet/themes/extensions/balance_page_theme.dart';
13 -import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
12 import 'package:cake_wallet/utils/feature_flag.dart';
13 import 'package:cake_wallet/utils/show_pop_up.dart';
14 import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart';
15 import 'package:flutter/material.dart';
16 import 'package:flutter_mobx/flutter_mobx.dart';
17 +import 'package:flutter_svg/flutter_svg.dart';
18 import 'package:url_launcher/url_launcher.dart';
19
20 class CryptoBalanceWidget extends StatelessWidget {
@@ -25,6 +24,8 @@ class CryptoBalanceWidget extends StatelessWidget {
24 });
25
26 final DashboardViewModel dashboardViewModel;
27 + final btcLockLight = 'assets/images/btc_lock_light.png';
28 + final btcLockDark = 'assets/images/btc_lock_dark.png';
29
30 @override
31 Widget build(BuildContext context) {
@@ -38,6 +39,7 @@ class CryptoBalanceWidget extends StatelessWidget {
39 return Padding(
40 padding: const EdgeInsets.fromLTRB(16, 0, 16, 16),
41 child: DashBoardRoundedCardWidget(
42 + isDarkTheme: dashboardViewModel.isDarkTheme,
43 title: "Invalid monero bindings",
44 subTitle: dashboardViewModel.getMoneroError.toString(),
45 ),
@@ -50,11 +52,13 @@ class CryptoBalanceWidget extends StatelessWidget {
52 builder: (_) {
53 if (dashboardViewModel.getWowneroError != null) {
54 return Padding(
53 - padding: const EdgeInsets.fromLTRB(16, 0, 16, 16),
54 - child: DashBoardRoundedCardWidget(
55 - title: "Invalid wownero bindings",
56 - subTitle: dashboardViewModel.getWowneroError.toString(),
57 - ));
55 + padding: const EdgeInsets.fromLTRB(16, 0, 16, 16),
56 + child: DashBoardRoundedCardWidget(
57 + isDarkTheme: dashboardViewModel.isDarkTheme,
58 + title: "Invalid wownero bindings",
59 + subTitle: dashboardViewModel.getWowneroError.toString(),
60 + ),
61 + );
62 }
63 return Container();
64 },
@@ -74,42 +78,39 @@ class CryptoBalanceWidget extends StatelessWidget {
78 children: [
79 Text(
80 dashboardViewModel.balanceViewModel.asset,
77 - style: TextStyle(
78 - fontSize: 24,
79 - fontFamily: 'Lato',
80 - fontWeight: FontWeight.w600,
81 - color: Theme.of(context)
82 - .extension<DashboardPageTheme>()!
83 - .pageTitleTextColor,
84 - height: 1,
85 - ),
81 + style: Theme.of(context).textTheme.headlineSmall?.copyWith(
82 + fontWeight: FontWeight.w500,
83 + color: Theme.of(context).colorScheme.onSurface,
84 + height: 1,
85 + ),
86 maxLines: 1,
87 textAlign: TextAlign.center,
88 ),
89 if (dashboardViewModel.wallet.isHardwareWallet)
90 - Padding(
91 - padding: const EdgeInsets.all(8.0),
90 + Container(
91 child: Image.asset(
92 'assets/images/hardware_wallet/ledger_nano_x.png',
93 width: 24,
95 - color: Theme.of(context)
96 - .extension<DashboardPageTheme>()!
97 - .pageTitleTextColor,
94 + color: Theme.of(context).colorScheme.onSurface,
95 ),
96 ),
97 if (dashboardViewModel
98 .balanceViewModel.isHomeScreenSettingsEnabled)
102 - InkWell(
103 - onTap: () => Navigator.pushNamed(context, Routes.homeSettings,
104 - arguments: dashboardViewModel.balanceViewModel),
105 - child: Padding(
106 - padding: const EdgeInsets.all(8.0),
107 - child: Image.asset(
108 - 'assets/images/home_screen_settings_icon.png',
109 - color: Theme.of(context)
110 - .extension<DashboardPageTheme>()!
111 - .pageTitleTextColor,
112 - ),
99 + TextButton(
100 + style: TextButton.styleFrom(
101 + minimumSize: Size(50, 30),
102 + tapTargetSize: MaterialTapTargetSize.shrinkWrap,
103 + alignment: Alignment.centerLeft),
104 + onPressed: () => Navigator.pushNamed(
105 + context,
106 + Routes.homeSettings,
107 + arguments: dashboardViewModel.balanceViewModel,
108 + ),
109 + child: Container(
110 + child: SvgPicture.asset(
111 + 'assets/images/home_screen_setting_icon.svg',
112 + color: Theme.of(context).colorScheme.onSurfaceVariant,
113 + height: 30),
114 ),
115 ),
116 ],
@@ -125,7 +126,7 @@ class CryptoBalanceWidget extends StatelessWidget {
126 return IntroducingCard(
127 title: S.of(context).introducing_cake_pay,
128 subTitle: S.of(context).cake_pay_learn_more,
128 - borderColor: Theme.of(context).extension<BalancePageTheme>()!.cardBorderColor,
129 + borderColor: Theme.of(context).colorScheme.outline,
130 closeCard: dashboardViewModel.balanceViewModel.disableIntroCakePayCard);
131 }
132 return Container();
@@ -138,6 +139,7 @@ class CryptoBalanceWidget extends StatelessWidget {
139 return Padding(
140 padding: const EdgeInsets.fromLTRB(16, 0, 16, 8),
141 child: DashBoardRoundedCardWidget(
142 + isDarkTheme: dashboardViewModel.isDarkTheme,
143 title: S.of(context).rep_warning,
144 subTitle: S.of(context).rep_warning_sub,
145 onTap: () => Navigator.of(context).pushNamed(Routes.changeRep),
@@ -152,7 +154,7 @@ class CryptoBalanceWidget extends StatelessWidget {
154 return ListView.separated(
155 physics: NeverScrollableScrollPhysics(),
156 shrinkWrap: true,
155 - separatorBuilder: (_, __) => Container(padding: EdgeInsets.only(bottom: 16)),
157 + separatorBuilder: (_, __) => Container(padding: EdgeInsets.only(bottom: 10)),
158 itemCount: dashboardViewModel.balanceViewModel.formattedBalances.length,
159 itemBuilder: (__, index) {
160 final balance =
@@ -200,6 +202,7 @@ class CryptoBalanceWidget extends StatelessWidget {
202 Padding(
203 padding: const EdgeInsets.fromLTRB(16, 0, 16, 8),
204 child: DashBoardRoundedCardWidget(
205 + isDarkTheme: dashboardViewModel.isDarkTheme,
206 customBorder: 30,
207 title: "This wallet has encountered an issue",
208 subTitle: "Here are the things that you should note:\n - " +
@@ -208,10 +211,11 @@ class CryptoBalanceWidget extends StatelessWidget {
211 ))
212 ],
213 if (dashboardViewModel.showSilentPaymentsCard) ...[
211 - SizedBox(height: 16),
214 + SizedBox(height: 10),
215 Padding(
213 - padding: const EdgeInsets.fromLTRB(16, 0, 16, 8),
216 + padding: const EdgeInsets.fromLTRB(16, 0, 16, 0),
217 child: DashBoardRoundedCardWidget(
218 + isDarkTheme: dashboardViewModel.isDarkTheme,
219 shadowBlur: dashboardViewModel.getShadowBlur(),
220 shadowSpread: dashboardViewModel.getShadowSpread(),
221 marginV: 0,
@@ -235,24 +239,17 @@ class CryptoBalanceWidget extends StatelessWidget {
239 children: [
240 Text(
241 S.of(context).what_is_silent_payments,
238 - style: TextStyle(
239 - fontSize: 12,
240 - fontFamily: 'Lato',
241 - fontWeight: FontWeight.w400,
242 - color: Theme.of(context)
243 - .extension<BalancePageTheme>()!
244 - .labelTextColor,
245 - height: 1,
246 - ),
242 + style: Theme.of(context).textTheme.bodySmall?.copyWith(
243 + color: Theme.of(context).colorScheme.onSurfaceVariant,
244 + height: 1,
245 + ),
246 softWrap: true,
247 ),
248 Padding(
249 padding: const EdgeInsets.symmetric(horizontal: 4),
250 child: Icon(Icons.help_outline,
251 size: 16,
253 - color: Theme.of(context)
254 - .extension<BalancePageTheme>()!
255 - .labelTextColor),
252 + color: Theme.of(context).colorScheme.onSurfaceVariant),
253 )
254 ],
255 ),
@@ -268,20 +265,18 @@ class CryptoBalanceWidget extends StatelessWidget {
265 ],
266 ),
267 onTap: () => _toggleSilentPaymentsScanning(context),
271 - icon: Icon(
272 - Icons.lock,
273 - color:
274 - Theme.of(context).extension<DashboardPageTheme>()!.pageTitleTextColor,
275 - size: 50,
276 - ),
268 + image: !dashboardViewModel.appStore.themeStore.currentTheme.isDark
269 + ? Image.asset(btcLockLight, height: 48)
270 + : Image.asset(btcLockDark, height: 48),
271 ),
272 ),
273 ],
274 if (dashboardViewModel.showMwebCard) ...[
281 - SizedBox(height: 16),
275 + SizedBox(height: 10),
276 Padding(
277 padding: const EdgeInsets.fromLTRB(16, 0, 16, 8),
278 child: InfoCard(
279 + isDarkTheme: dashboardViewModel.isDarkTheme,
280 title: S.of(context).litecoin_mweb,
281 description: S.of(context).litecoin_mweb_description,
282 leftButtonTitle: S.of(context).litecoin_mweb_dismiss,
@@ -297,13 +292,10 @@ class CryptoBalanceWidget extends StatelessWidget {
292 ),
293 child: Text(
294 S.of(context).learn_more,
300 - style: TextStyle(
301 - fontSize: 12,
302 - fontFamily: 'Lato',
303 - fontWeight: FontWeight.w400,
304 - color: Theme.of(context).extension<BalancePageTheme>()!.labelTextColor,
305 - height: 1,
306 - ),
295 + style: Theme.of(context).textTheme.bodySmall?.copyWith(
296 + color: Theme.of(context).colorScheme.onSurfaceVariant,
297 + height: 1,
298 + ),
299 softWrap: true,
300 ),
301 ),
@@ -315,13 +307,15 @@ class CryptoBalanceWidget extends StatelessWidget {
307 Padding(
308 padding: const EdgeInsets.fromLTRB(16, 0, 16, 8),
309 child: InfoCard(
310 + isDarkTheme: dashboardViewModel.isDarkTheme,
311 title: S.of(context).synchronizing,
312 description: S.of(context).decred_info_card_details,
313 image: 'assets/images/dcr_icon.png',
314 leftButtonTitle: S.of(context).litecoin_mweb_dismiss,
315 rightButtonTitle: S.of(context).learn_more,
316 leftButtonAction: () => dashboardViewModel.dismissDecredInfoCard(),
324 - rightButtonAction: () => launchUrl(Uri.parse("https://docs.cakewallet.com/cryptos/decred/#spv-sync")),
317 + rightButtonAction: () => launchUrl(
318 + Uri.parse("https://docs.cakewallet.com/cryptos/decred/#spv-sync")),
319 ),
320 ),
321 ],
@@ -330,6 +324,7 @@ class CryptoBalanceWidget extends StatelessWidget {
324 Padding(
325 padding: const EdgeInsets.fromLTRB(16, 0, 16, 8),
326 child: InfoCard(
327 + isDarkTheme: dashboardViewModel.isDarkTheme,
328 title: "Payjoin",
329 description: S.of(context).payjoin_card_content,
330 hintWidget: GestureDetector(
@@ -340,13 +335,10 @@ class CryptoBalanceWidget extends StatelessWidget {
335 ),
336 child: Text(
337 S.of(context).learn_more,
343 - style: TextStyle(
344 - fontSize: 12,
345 - fontFamily: 'Lato',
346 - fontWeight: FontWeight.w400,
347 - color: Theme.of(context).extension<BalancePageTheme>()!.labelTextColor,
348 - height: 1,
349 - ),
338 + style: Theme.of(context).textTheme.bodySmall?.copyWith(
339 + color: Theme.of(context).colorScheme.onSurfaceVariant,
340 + height: 1,
341 + ),
342 softWrap: true,
343 ),
344 ),
@@ -396,19 +388,19 @@ class CryptoBalanceWidget extends StatelessWidget {
388 }
389
390 return dashboardViewModel.setSilentPaymentsScanning(newValue);
399 - }
400 -
391 + }
392 +
393 void _enablePayjoin(BuildContext context) {
394 showPopUp<void>(
395 context: context,
396 builder: (BuildContext context) => AlertWithOneAction(
405 - alertTitle: S.of(context).payjoin_enabling_popup_title,
406 - alertContent: S.of(context).payjoin_enabling_popup_content,
407 - buttonText: S.of(context).ok,
408 - buttonAction: () {
409 - Navigator.of(context).pop();
410 - },
411 - ));
397 + alertTitle: S.of(context).payjoin_enabling_popup_title,
398 + alertContent: S.of(context).payjoin_enabling_popup_content,
399 + buttonText: S.of(context).ok,
400 + buttonAction: () {
401 + Navigator.of(context).pop();
402 + },
403 + ));
404
405 dashboardViewModel.enablePayjoin();
406 }
lib/src/screens/dashboard/pages/cake_features_page.dart
+53 -54
@@ -4,14 +4,12 @@ import 'package:cake_wallet/generated/i18n.dart';
4 import 'package:cake_wallet/routes.dart';
5 import 'package:cake_wallet/src/widgets/alert_with_one_action.dart';
6 import 'package:cake_wallet/src/widgets/dashboard_card_widget.dart';
7 -import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
7 import 'package:cake_wallet/utils/show_pop_up.dart';
8 import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart';
9 import 'package:cw_core/utils/print_verbose.dart';
10 import 'package:cw_core/wallet_type.dart';
11 import 'package:cake_wallet/view_model/dashboard/cake_features_view_model.dart';
12 import 'package:flutter/material.dart';
14 -import 'package:flutter_mobx/flutter_mobx.dart';
13 import 'package:url_launcher/url_launcher.dart';
14
15 class CakeFeaturesPage extends StatelessWidget {
@@ -22,64 +20,65 @@ class CakeFeaturesPage extends StatelessWidget {
20
21 @override
22 Widget build(BuildContext context) {
25 - return Container(
26 - child: Column(
27 - crossAxisAlignment: CrossAxisAlignment.start,
28 - children: [
29 - Padding(
30 - padding: EdgeInsets.only(left: 24, top: 16),
23 + return Container(
24 + child: Column(
25 + crossAxisAlignment: CrossAxisAlignment.start,
26 + children: [
27 + Padding(
28 + padding: EdgeInsets.only(left: 24, top: 16),
29 child: Text(
30 'Cake ${S.of(context).features}',
33 - style: TextStyle(
34 - fontSize: 24,
35 - fontWeight: FontWeight.w500,
36 - color: Theme.of(context).extension<DashboardPageTheme>()!.pageTitleTextColor,
37 - ),
38 - ),
31 + style: Theme.of(context).textTheme.headlineSmall?.copyWith(
32 + fontWeight: FontWeight.w500,
33 + color: Theme.of(context).colorScheme.onSurface,
34 + ),
35 ),
40 - Expanded(
41 - child: ListView(
42 - children: <Widget>[
43 - SizedBox(height: 2),
44 - DashBoardRoundedCardWidget(
45 - shadowBlur: dashboardViewModel.getShadowBlur(),
46 - shadowSpread: dashboardViewModel.getShadowSpread(),
47 - onTap: () {
48 - if (Platform.isMacOS) {
49 - _launchUrl("buy.cakepay.com");
50 - } else {
51 - _navigatorToGiftCardsPage(context);
52 - }
53 - },
54 - title: 'Cake Pay',
55 - subTitle: S.of(context).cake_pay_subtitle,
56 - image: Image.asset(
57 - 'assets/images/cards.png',
58 - height: 100,
59 - width: 115,
60 - fit: BoxFit.cover,
61 - ),
36 + ),
37 + Expanded(
38 + child: ListView(
39 + children: <Widget>[
40 + SizedBox(height: 2),
41 + DashBoardRoundedCardWidget(
42 + isDarkTheme: dashboardViewModel.isDarkTheme,
43 + shadowBlur: dashboardViewModel.getShadowBlur(),
44 + shadowSpread: dashboardViewModel.getShadowSpread(),
45 + onTap: () {
46 + if (Platform.isMacOS) {
47 + _launchUrl("buy.cakepay.com");
48 + } else {
49 + _navigatorToGiftCardsPage(context);
50 + }
51 + },
52 + title: 'Cake Pay',
53 + subTitle: S.of(context).cake_pay_subtitle,
54 + image: Image.asset(
55 + 'assets/images/cards.png',
56 + height: 100,
57 + width: 115,
58 + fit: BoxFit.cover,
59 ),
63 - DashBoardRoundedCardWidget(
64 - shadowBlur: dashboardViewModel.getShadowBlur(),
65 - shadowSpread: dashboardViewModel.getShadowSpread(),
66 - onTap: () => _launchUrl("cake.nano-gpt.com"),
67 - title: "NanoGPT",
68 - subTitle: S.of(context).nanogpt_subtitle,
69 - image: Image.asset(
70 - 'assets/images/nanogpt.png',
71 - height: 80,
72 - width: 80,
73 - fit: BoxFit.cover,
74 - ),
60 + ),
61 + DashBoardRoundedCardWidget(
62 + isDarkTheme: dashboardViewModel.isDarkTheme,
63 + shadowBlur: dashboardViewModel.getShadowBlur(),
64 + shadowSpread: dashboardViewModel.getShadowSpread(),
65 + onTap: () => _launchUrl("cake.nano-gpt.com"),
66 + title: "NanoGPT",
67 + subTitle: S.of(context).nanogpt_subtitle,
68 + image: Image.asset(
69 + 'assets/images/nanogpt.png',
70 + height: 80,
71 + width: 80,
72 + fit: BoxFit.cover,
73 ),
76 - SizedBox(height: 125),
77 - ],
78 - ),
74 + ),
75 + SizedBox(height: 125),
76 + ],
77 ),
80 - ],
81 - ),
82 - );
78 + ),
79 + ],
80 + ),
81 + );
82 }
83
84 void _launchUrl(String url) {
lib/src/screens/dashboard/pages/navigation_dock.dart
+35 -64
@@ -1,20 +1,20 @@
1 import 'dart:ui';
2 import 'package:cake_wallet/entities/main_actions.dart';
3 -import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart';
3 +import 'package:cake_wallet/themes/core/material_base_theme.dart';
4 +import 'package:cake_wallet/themes/utils/custom_theme_colors.dart';
5 import 'package:flutter/material.dart';
6 import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart';
7 import 'package:cake_wallet/src/screens/dashboard/widgets/action_button.dart';
8 import 'package:flutter_mobx/flutter_mobx.dart';
8 -import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
9 -import 'package:cake_wallet/themes/extensions/balance_page_theme.dart';
10 -import '../../../../themes/theme_base.dart';
9
10 class NavigationDock extends StatelessWidget {
11 const NavigationDock({
12 required this.dashboardViewModel,
13 + required this.currentTheme,
14 });
15
16 final DashboardViewModel dashboardViewModel;
17 + final MaterialThemeBase currentTheme;
18
19 @override
20 Widget build(BuildContext context) {
@@ -28,10 +28,19 @@ class NavigationDock extends StatelessWidget {
28 gradient: LinearGradient(
29 begin: Alignment.topCenter,
30 end: Alignment.bottomCenter,
31 - colors: _getColors(context),
31 + colors: _getColors(context, !currentTheme.isDark),
32 ),
33 ),
34 + //color: Colors.transparent,
35 child: Container(
36 + decoration: BoxDecoration(
37 + borderRadius: BorderRadius.circular(50),
38 + gradient: LinearGradient(
39 + begin: Alignment.topCenter,
40 + end: Alignment.bottomCenter,
41 + colors: _getColors(context, !currentTheme.isDark),
42 + ),
43 + ),
44 margin: const EdgeInsets.only(left: 8, right: 8, bottom: 16),
45 child: ClipRRect(
46 borderRadius: BorderRadius.circular(50),
@@ -40,12 +49,7 @@ class NavigationDock extends StatelessWidget {
49 child: Container(
50 decoration: BoxDecoration(
51 borderRadius: BorderRadius.circular(50.0),
43 - border: Border.all(
44 - color: Theme.of(context).extension<BalancePageTheme>()!.cardBorderColor,
45 - width: 1,
46 - ),
47 - color:
48 - Theme.of(context).extension<SyncIndicatorTheme>()!.syncedBackgroundColor,
52 + color: Theme.of(context).colorScheme.surfaceContainer,
53 ),
54 child: Container(
55 padding: EdgeInsets.symmetric(horizontal: 8),
@@ -62,18 +66,10 @@ class NavigationDock extends StatelessWidget {
66 child: ActionButton(
67 key: ValueKey(
68 'dashboard_page_${action.name(context)}_action_button_key'),
65 - image: Image.asset(
66 - action.image,
67 - height: 24,
68 - width: 24,
69 - color: action.isEnabled?.call(dashboardViewModel) ?? true
70 - ? Theme.of(context)
71 - .extension<DashboardPageTheme>()!
72 - .mainActionsIconColor
73 - : Theme.of(context)
74 - .extension<BalancePageTheme>()!
75 - .labelTextColor,
76 - ),
69 + image: Image.asset(action.image,
70 + height: 24,
71 + width: 24,
72 + color: Theme.of(context).colorScheme.primary),
73 title: action.name(context),
74 onClick: (action.isEnabled?.call(dashboardViewModel) ?? true)
75 ? () async =>
@@ -81,9 +77,7 @@ class NavigationDock extends StatelessWidget {
77 : null,
78 textColor: action.isEnabled?.call(dashboardViewModel) ?? true
79 ? null
84 - : Theme.of(context)
85 - .extension<BalancePageTheme>()!
86 - .labelTextColor,
80 + : Theme.of(context).colorScheme.onSurface,
81 ),
82 ),
83 ),
@@ -102,48 +96,25 @@ class NavigationDock extends StatelessWidget {
96 );
97 }
98
105 - List<Color> _getColors(BuildContext context) {
106 - final isBright = dashboardViewModel.settingsStore.currentTheme.type == ThemeType.bright;
99 + List<Color> _getColors(BuildContext context, bool isBright) {
100 return isBright
101 ? <Color>[
109 - Theme.of(context)
110 - .extension<DashboardPageTheme>()!
111 - .thirdGradientBackgroundColor
112 - .withAlpha(10),
113 - Theme.of(context)
114 - .extension<DashboardPageTheme>()!
115 - .thirdGradientBackgroundColor
116 - .withAlpha(75),
117 - Theme.of(context)
118 - .extension<DashboardPageTheme>()!
119 - .thirdGradientBackgroundColor
120 - .withAlpha(150),
121 - Theme.of(context).extension<DashboardPageTheme>()!.thirdGradientBackgroundColor,
122 - Theme.of(context).extension<DashboardPageTheme>()!.thirdGradientBackgroundColor
102 + CustomThemeColors.backgroundGradientColorLight.withAlpha(5),
103 + CustomThemeColors.backgroundGradientColorLight.withAlpha(50),
104 + CustomThemeColors.backgroundGradientColorLight.withAlpha(125),
105 + CustomThemeColors.backgroundGradientColorLight.withAlpha(150),
106 + CustomThemeColors.backgroundGradientColorLight.withAlpha(200),
107 + CustomThemeColors.backgroundGradientColorLight,
108 + CustomThemeColors.backgroundGradientColorLight
109 ]
110 : <Color>[
125 - Theme.of(context)
126 - .extension<DashboardPageTheme>()!
127 - .thirdGradientBackgroundColor
128 - .withAlpha(5),
129 - Theme.of(context)
130 - .extension<DashboardPageTheme>()!
131 - .thirdGradientBackgroundColor
132 - .withAlpha(50),
133 - Theme.of(context)
134 - .extension<DashboardPageTheme>()!
135 - .thirdGradientBackgroundColor
136 - .withAlpha(125),
137 - Theme.of(context)
138 - .extension<DashboardPageTheme>()!
139 - .thirdGradientBackgroundColor
140 - .withAlpha(150),
141 - Theme.of(context)
142 - .extension<DashboardPageTheme>()!
143 - .thirdGradientBackgroundColor
144 - .withAlpha(200),
145 - Theme.of(context).extension<DashboardPageTheme>()!.thirdGradientBackgroundColor,
146 - Theme.of(context).extension<DashboardPageTheme>()!.thirdGradientBackgroundColor
111 + CustomThemeColors.backgroundGradientColorDark.withAlpha(5),
112 + CustomThemeColors.backgroundGradientColorDark.withAlpha(50),
113 + CustomThemeColors.backgroundGradientColorDark.withAlpha(125),
114 + CustomThemeColors.backgroundGradientColorDark.withAlpha(150),
115 + CustomThemeColors.backgroundGradientColorDark.withAlpha(200),
116 + CustomThemeColors.backgroundGradientColorDark,
117 + CustomThemeColors.backgroundGradientColorDark
118 ];
119 }
120 }
lib/src/screens/dashboard/pages/nft_details_page.dart
+12 -24
@@ -6,9 +6,6 @@ import 'package:cake_wallet/src/screens/base_page.dart';
6 import 'package:cake_wallet/src/screens/dashboard/widgets/menu_widget.dart';
7 import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
8 import 'package:cake_wallet/src/widgets/gradient_background.dart';
9 -import 'package:cake_wallet/themes/extensions/balance_page_theme.dart';
10 -import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
11 -import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart';
9 import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart';
10
11 class NFTDetailsPage extends BasePage {
@@ -41,7 +38,7 @@ class NFTDetailsPage extends BasePage {
38 Widget trailing(BuildContext context) {
39 final menuButton = Image.asset(
40 'assets/images/menu.png',
44 - color: Theme.of(context).extension<DashboardPageTheme>()!.pageTitleTextColor,
41 + color: Theme.of(context).colorScheme.onSurface,
42 );
43
44 return Container(
@@ -64,14 +61,13 @@ class NFTDetailsPage extends BasePage {
61 child: Container(
62 width: double.infinity,
63 margin: const EdgeInsets.all(16),
67 - padding: const EdgeInsets.symmetric(vertical: 16),
64 decoration: BoxDecoration(
69 - borderRadius: BorderRadius.circular(30.0),
65 + borderRadius: BorderRadius.circular(24.0),
66 border: Border.all(
71 - color: Theme.of(context).extension<BalancePageTheme>()!.cardBorderColor,
67 + color: Theme.of(context).colorScheme.outline,
68 width: 1,
69 ),
74 - color: Theme.of(context).extension<SyncIndicatorTheme>()!.syncedBackgroundColor,
70 + color: Theme.of(context).colorScheme.surface,
71 ),
72 child: arguments.isSolanaNFT
73 ? SolanaNFTDetailsWidget(
@@ -92,21 +88,18 @@ class _NFTImageWidget extends StatelessWidget {
88
89 @override
90 Widget build(BuildContext context) {
95 - final balanceTheme = Theme.of(context).extension<BalancePageTheme>()!;
96 - final syncTheme = Theme.of(context).extension<SyncIndicatorTheme>()!;
97 -
91 return Container(
92 height: MediaQuery.sizeOf(context).height / 2.5,
93 width: double.infinity,
94 margin: const EdgeInsets.all(8),
95 clipBehavior: Clip.hardEdge,
96 decoration: BoxDecoration(
104 - borderRadius: BorderRadius.circular(16.0),
97 + borderRadius: BorderRadius.circular(24.0),
98 border: Border.all(
106 - color: balanceTheme.cardBorderColor,
99 + color: Theme.of(context).colorScheme.outline,
100 width: 1,
101 ),
109 - color: syncTheme.syncedBackgroundColor,
102 + color: Theme.of(context).colorScheme.surface,
103 ),
104 child: CakeImageWidget(imageUrl: imageUrl),
105 );
@@ -231,7 +224,6 @@ class _NFTSingleInfoTile extends StatelessWidget {
224
225 @override
226 Widget build(BuildContext context) {
234 - final balanceTheme = Theme.of(context).extension<BalancePageTheme>()!;
227 return Padding(
228 padding: const EdgeInsets.symmetric(horizontal: 24),
229 child: Column(
@@ -239,22 +231,18 @@ class _NFTSingleInfoTile extends StatelessWidget {
231 children: [
232 Text(
233 infoType,
242 - style: TextStyle(
243 - fontSize: 12,
244 - fontFamily: 'Lato',
245 - fontWeight: FontWeight.w400,
246 - color: balanceTheme.labelTextColor,
234 + style: Theme.of(context).textTheme.bodySmall?.copyWith(
235 + color: Theme.of(context).colorScheme.onSurfaceVariant,
236 + fontWeight: FontWeight.w500,
237 height: 1,
238 ),
239 ),
240 const SizedBox(height: 8),
241 Text(
242 infoValue,
253 - style: TextStyle(
254 - fontSize: 16,
255 - fontFamily: 'Lato',
243 + style: Theme.of(context).textTheme.titleMedium?.copyWith(
244 fontWeight: FontWeight.w600,
257 - color: balanceTheme.assetTitleColor,
245 + color: Theme.of(context).colorScheme.onSurface,
246 height: 1,
247 ),
248 ),
lib/src/screens/dashboard/pages/nft_import_page.dart
+29 -43
@@ -1,10 +1,7 @@
1 import 'package:cake_wallet/generated/i18n.dart';
2 -import 'package:cake_wallet/palette.dart';
2 import 'package:cake_wallet/src/screens/base_page.dart';
3 import 'package:cake_wallet/src/widgets/address_text_field.dart';
4 import 'package:cake_wallet/src/widgets/primary_button.dart';
6 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
7 -import 'package:cake_wallet/themes/extensions/seed_widget_theme.dart';
5 import 'package:cake_wallet/view_model/dashboard/nft_view_model.dart';
6 import 'package:cw_core/wallet_type.dart';
7 import 'package:flutter/material.dart';
@@ -72,14 +69,13 @@ class _ImportNFTPage extends BasePage {
69 Text(
70 S.current.address,
71 textAlign: TextAlign.center,
75 - style: TextStyle(
76 - fontSize: 16,
77 - fontFamily: 'Lato',
78 - fontWeight: FontWeight.w800,
79 - color: Theme.of(context).extension<SeedWidgetTheme>()!.hintTextColor,
80 - height: 1,
81 - ),
72 + style: Theme.of(context).textTheme.titleMedium?.copyWith(
73 + fontWeight: FontWeight.w800,
74 + color: Theme.of(context).colorScheme.onSurfaceVariant,
75 + height: 1,
76 + ),
77 ),
78 + SizedBox(height: 8),
79 AddressTextField(
80 controller: tokenAddressController,
81 options: [AddressTextFieldOption.paste],
@@ -91,33 +87,28 @@ class _ImportNFTPage extends BasePage {
87 tokenAddressController.text = tokenAddress;
88 }
89 },
94 - borderColor: Theme.of(context).extension<CakeTextTheme>()!.textfieldUnderlineColor,
95 - iconColor: Theme.of(context).primaryColor,
90 + fillColor: Theme.of(context).colorScheme.surfaceContainer,
91 + iconColor: Theme.of(context).colorScheme.primary,
92 placeholder: '0x...',
97 - textStyle: TextStyle(
98 - fontSize: 16,
99 - fontWeight: FontWeight.w400,
100 - color: PaletteDark.darkCyanBlue,
101 - ),
102 - hintStyle: TextStyle(
103 - fontSize: 16,
104 - fontWeight: FontWeight.w400,
105 - color: PaletteDark.darkCyanBlue,
106 - ),
93 + textStyle: Theme.of(context).textTheme.bodyLarge?.copyWith(
94 + color: Theme.of(context).colorScheme.onSurface,
95 + ),
96 + hintStyle: Theme.of(context).textTheme.bodyLarge?.copyWith(
97 + color: Theme.of(context).colorScheme.onSurfaceVariant,
98 + ),
99 ),
100 if (nftViewModel.appStore.wallet!.type != WalletType.solana) ...[
101 SizedBox(height: 48),
102 Text(
103 S.current.tokenID,
104 textAlign: TextAlign.center,
113 - style: TextStyle(
114 - fontSize: 16,
115 - fontFamily: 'Lato',
116 - fontWeight: FontWeight.w800,
117 - color: Theme.of(context).extension<SeedWidgetTheme>()!.hintTextColor,
118 - height: 1,
119 - ),
105 + style: Theme.of(context).textTheme.titleMedium?.copyWith(
106 + fontWeight: FontWeight.w800,
107 + color: Theme.of(context).colorScheme.onSurfaceVariant,
108 + height: 1,
109 + ),
110 ),
111 + SizedBox(height: 8),
112 AddressTextField(
113 controller: tokenIDController,
114 options: [AddressTextFieldOption.paste],
@@ -129,19 +120,14 @@ class _ImportNFTPage extends BasePage {
120 tokenIDController.text = tokenID;
121 }
122 },
132 - borderColor: Theme.of(context).extension<CakeTextTheme>()!.textfieldUnderlineColor,
133 - iconColor: Theme.of(context).primaryColor,
123 + iconColor: Theme.of(context).colorScheme.primary,
124 placeholder: S.current.enterTokenID,
135 - textStyle: TextStyle(
136 - fontSize: 16,
137 - fontWeight: FontWeight.w400,
138 - color: PaletteDark.darkCyanBlue,
139 - ),
140 - hintStyle: TextStyle(
141 - fontSize: 16,
142 - fontWeight: FontWeight.w400,
143 - color: PaletteDark.darkCyanBlue,
144 - ),
125 + textStyle: Theme.of(context).textTheme.bodyLarge?.copyWith(
126 + color: Theme.of(context).colorScheme.onSurface,
127 + ),
128 + hintStyle: Theme.of(context).textTheme.bodyLarge?.copyWith(
129 + color: Theme.of(context).colorScheme.onSurfaceVariant,
130 + ),
131 ),
132 ],
133 Spacer(),
@@ -149,8 +135,8 @@ class _ImportNFTPage extends BasePage {
135 return LoadingPrimaryButton(
136 isLoading: nftViewModel.isImportNFTLoading,
137 text: S.current.import,
152 - color: Theme.of(context).primaryColor,
153 - textColor: Colors.white,
138 + color: Theme.of(context).colorScheme.primary,
139 + textColor: Theme.of(context).colorScheme.onPrimary,
140 onPressed: () async {
141 await nftViewModel.importNFT(tokenAddressController.text, tokenIDController.text);
142 Navigator.pop(context);
lib/src/screens/dashboard/pages/nft_listing_page.dart
+7 -18
@@ -5,9 +5,6 @@ import 'package:cake_wallet/routes.dart';
5 import 'package:cake_wallet/src/screens/dashboard/widgets/nft_tile_widget.dart';
6 import 'package:cake_wallet/src/screens/dashboard/widgets/solana_nft_tile_widget.dart';
7 import 'package:cake_wallet/src/widgets/primary_button.dart';
8 -import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
9 -import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart';
10 -import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart';
8 import 'package:cake_wallet/view_model/dashboard/nft_view_model.dart';
9 import 'package:cw_core/wallet_type.dart';
10
@@ -34,10 +31,6 @@ class _NFTListingPageState extends State<NFTListingPage> {
31
32 @override
33 Widget build(BuildContext context) {
37 - final dashboardTheme = Theme.of(context).extension<DashboardPageTheme>()!;
38 - final syncIndicatorTheme = Theme.of(context).extension<SyncIndicatorTheme>()!;
39 - final exchangeTheme = Theme.of(context).extension<ExchangePageTheme>()!;
40 -
34 return Observer(
35 builder: (context) {
36 return Column(
@@ -47,8 +40,8 @@ class _NFTListingPageState extends State<NFTListingPage> {
40 padding: const EdgeInsets.only(left: 16, right: 16, bottom: 16),
41 child: PrimaryButton(
42 text: S.current.import,
50 - color: syncIndicatorTheme.syncedBackgroundColor,
51 - textColor: Colors.white,
43 + color: Theme.of(context).colorScheme.surfaceContainer,
44 + textColor: Theme.of(context).colorScheme.onSecondaryContainer,
45 onPressed: () => Navigator.pushNamed(
46 context,
47 Routes.importNFTPage,
@@ -60,9 +53,9 @@ class _NFTListingPageState extends State<NFTListingPage> {
53 Expanded(
54 child: Center(
55 child: CircularProgressIndicator(
63 - backgroundColor: dashboardTheme.textColor,
56 + backgroundColor: Theme.of(context).colorScheme.surfaceContainerHighest,
57 valueColor: AlwaysStoppedAnimation<Color>(
65 - exchangeTheme.firstGradientBottomPanelColor,
58 + Theme.of(context).colorScheme.primary,
59 ),
60 ),
61 ),
@@ -93,13 +86,9 @@ class NFTListWidget extends StatelessWidget {
86 child: Text(
87 S.current.noNFTYet,
88 textAlign: TextAlign.center,
96 - style: TextStyle(
97 - fontSize: 20,
98 - fontFamily: 'Lato',
99 - fontWeight: FontWeight.w600,
100 - color: Theme.of(context).extension<DashboardPageTheme>()!.pageTitleTextColor,
101 - height: 1,
102 - ),
89 + style: Theme.of(context).textTheme.bodyLarge?.copyWith(
90 + color: Theme.of(context).colorScheme.onSurfaceVariant,
91 + ),
92 ),
93 );
94
lib/src/screens/dashboard/pages/transactions_page.dart
+23 -27
@@ -3,7 +3,6 @@ import 'package:cake_wallet/src/screens/dashboard/widgets/anonpay_transaction_ro
3 import 'package:cake_wallet/src/screens/dashboard/widgets/order_row.dart';
4 import 'package:cake_wallet/src/screens/dashboard/widgets/payjoin_transaction_row.dart';
5 import 'package:cake_wallet/src/screens/dashboard/widgets/trade_row.dart';
6 -import 'package:cake_wallet/themes/extensions/placeholder_theme.dart';
6 import 'package:cake_wallet/src/widgets/dashboard_card_widget.dart';
7 import 'package:cake_wallet/utils/responsive_layout_util.dart';
8 import 'package:cake_wallet/view_model/dashboard/anonpay_transaction_list_item.dart';
@@ -41,18 +40,18 @@ class TransactionsPage extends StatelessWidget {
40 child: Container(
41 color: responsiveLayoutUtil.shouldRenderMobileUI
42 ? null
44 - : Theme.of(context).colorScheme.background,
43 + : Theme.of(context).colorScheme.surface,
44 child: Column(
45 children: <Widget>[
46 Observer(builder: (_) {
47 final status = dashboardViewModel.status;
48 if (status is SyncingSyncStatus) {
49 return DashBoardRoundedCardWidget(
50 + isDarkTheme: dashboardViewModel.isDarkTheme,
51 key: ValueKey('transactions_page_syncing_alert_card_key'),
52 onTap: () {
53 try {
54 - final uri = Uri.parse(
55 - "https://docs.cakewallet.com/faq/funds-not-appearing");
54 + final uri = Uri.parse("https://docs.cakewallet.com/faq/funds-not-appearing");
55 launchUrl(uri, mode: LaunchMode.externalApplication);
56 } catch (_) {}
57 },
@@ -76,8 +75,7 @@ class TransactionsPage extends StatelessWidget {
75 key: ValueKey('transactions_page_list_view_builder_key'),
76 itemCount: items.length + 1,
77 itemBuilder: (context, index) {
79 -
80 - if(index == items.length) return SizedBox(height: 150);
78 + if (index == items.length) return SizedBox(height: 150);
79
80 final item = items[index];
81
@@ -156,10 +154,9 @@ class TransactionsPage extends StatelessWidget {
154 ),
155 currency: "BTC",
156 state: item.status,
159 - amount: bitcoin!.formatterBitcoinAmountToString(
160 - amount: session.amount.toInt()),
161 - createdAt: DateFormat('HH:mm')
162 - .format(session.inProgressSince!),
157 + amount: bitcoin!
158 + .formatterBitcoinAmountToString(amount: session.amount.toInt()),
159 + createdAt: DateFormat('HH:mm').format(session.inProgressSince!),
160 isSending: session.isSenderSession,
161 );
162 }
@@ -169,18 +166,17 @@ class TransactionsPage extends StatelessWidget {
166
167 return Observer(
168 builder: (_) => TradeRow(
172 - key: item.key,
173 - onTap: () => Navigator.of(context)
174 - .pushNamed(Routes.tradeDetails, arguments: trade),
175 - provider: trade.provider,
176 - from: trade.from,
177 - to: trade.to,
178 - createdAtFormattedDate: trade.createdAt != null
179 - ? DateFormat('HH:mm').format(trade.createdAt!)
180 - : null,
181 - formattedAmount: item.tradeFormattedAmount,
182 - formattedReceiveAmount: item.tradeFormattedReceiveAmount
183 - ),
169 + key: item.key,
170 + onTap: () => Navigator.of(context)
171 + .pushNamed(Routes.tradeDetails, arguments: trade),
172 + provider: trade.provider,
173 + from: trade.from,
174 + to: trade.to,
175 + createdAtFormattedDate: trade.createdAt != null
176 + ? DateFormat('HH:mm').format(trade.createdAt!)
177 + : null,
178 + formattedAmount: item.tradeFormattedAmount,
179 + formattedReceiveAmount: item.tradeFormattedReceiveAmount),
180 );
181 }
182 if (item is OrderListItem) {
@@ -201,15 +197,15 @@ class TransactionsPage extends StatelessWidget {
197 );
198 }
199 return Container(color: Colors.transparent, height: 1);
204 - })
200 + },
201 + )
202 : Center(
203 child: Text(
204 key: ValueKey('transactions_page_placeholder_transactions_text_key'),
205 S.of(context).placeholder_transactions,
209 - style: TextStyle(
210 - fontSize: 14,
211 - color: Theme.of(context).extension<PlaceholderTheme>()!.color,
212 - ),
206 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
207 + color: Theme.of(context).colorScheme.onSurfaceVariant,
208 + ),
209 ),
210 );
211 },
lib/src/screens/dashboard/sign_page.dart
+61 -70
@@ -6,9 +6,7 @@ import 'package:cake_wallet/src/screens/dashboard/widgets/verify_form.dart';
6 import 'package:cake_wallet/src/widgets/alert_with_one_action.dart';
7 import 'package:cake_wallet/src/widgets/keyboard_done_button.dart';
8 import 'package:cake_wallet/src/widgets/primary_button.dart';
9 -import 'package:cake_wallet/themes/extensions/keyboard_theme.dart';
10 -import 'package:cake_wallet/themes/extensions/wallet_list_theme.dart';
11 -import 'package:cake_wallet/utils/responsive_layout_util.dart';
9 +
10 import 'package:cake_wallet/utils/show_pop_up.dart';
11 import 'package:cake_wallet/view_model/dashboard/sign_view_model.dart';
12 import 'package:flutter/material.dart';
@@ -36,15 +34,16 @@ class SignPage extends BasePage {
34
35 @override
36 Widget middle(BuildContext context) => Observer(
39 - builder: (_) => Text(
37 + builder: (_) {
38 + return Text(
39 S.current.sign_verify_title,
41 - style: TextStyle(
42 - fontSize: 18.0,
43 - fontWeight: FontWeight.bold,
44 - fontFamily: 'Lato',
45 - color: titleColor(context),
46 - ),
47 - ));
40 + style: Theme.of(context).textTheme.bodyLarge?.copyWith(
41 + fontWeight: FontWeight.w600,
42 + fontSize: 18,
43 + ),
44 + );
45 + },
46 + );
47
48 final SignViewModel signViewModel;
49 final PageController _controller;
@@ -60,7 +59,7 @@ class SignPage extends BasePage {
59 return KeyboardActions(
60 config: KeyboardActionsConfig(
61 keyboardActionsPlatform: KeyboardActionsPlatform.IOS,
63 - keyboardBarColor: Theme.of(context).extension<KeyboardTheme>()!.keyboardBarColor,
62 + keyboardBarColor: Theme.of(context).colorScheme.surfaceVariant,
63 nextFocus: false,
64 actions: [
65 KeyboardActionsItem(
@@ -71,69 +70,61 @@ class SignPage extends BasePage {
70 ),
71 child: Container(
72 height: 0,
74 - color: Theme.of(context).colorScheme.background,
73 + color: Theme.of(context).colorScheme.surface,
74 child: Center(
76 - child: ConstrainedBox(
77 - constraints:
78 - BoxConstraints(maxWidth: ResponsiveLayoutUtilBase.kDesktopMaxWidthConstraint),
79 - child: Column(
80 - mainAxisAlignment: MainAxisAlignment.center,
81 - children: [
82 - Expanded(
83 - child: PageView.builder(
84 - onPageChanged: (page) {
85 - signViewModel.isSigning = page == 0;
86 - },
75 + child: Column(
76 + mainAxisAlignment: MainAxisAlignment.center,
77 + children: [
78 + Expanded(
79 + child: PageView.builder(
80 + onPageChanged: (page) {
81 + signViewModel.isSigning = page == 0;
82 + },
83 + controller: _controller,
84 + itemCount: _pages.length,
85 + itemBuilder: (_, index) => SingleChildScrollView(child: _pages[index]),
86 + ),
87 + ),
88 + if (_pages.length > 1)
89 + Padding(
90 + padding: EdgeInsets.only(top: 10),
91 + child: SmoothPageIndicator(
92 controller: _controller,
88 - itemCount: _pages.length,
89 - itemBuilder: (_, index) => SingleChildScrollView(child: _pages[index]),
93 + count: _pages.length,
94 + effect: ColorTransitionEffect(
95 + spacing: 6.0,
96 + radius: 6.0,
97 + dotWidth: 6.0,
98 + dotHeight: 6.0,
99 + dotColor: Theme.of(context).colorScheme.outline.withOpacity(0.5),
100 + activeDotColor: Theme.of(context).colorScheme.outline,
101 + ),
102 ),
103 ),
92 - if (_pages.length > 1)
93 - Padding(
94 - padding: EdgeInsets.only(top: 10),
95 - child: SmoothPageIndicator(
96 - controller: _controller,
97 - count: _pages.length,
98 - effect: ColorTransitionEffect(
99 - spacing: 6.0,
100 - radius: 6.0,
101 - dotWidth: 6.0,
102 - dotHeight: 6.0,
103 - dotColor: Theme.of(context).hintColor.withOpacity(0.5),
104 - activeDotColor: Theme.of(context).hintColor,
105 - ),
104 + Padding(
105 + padding: EdgeInsets.only(top: 20, bottom: 24, left: 24, right: 24),
106 + child: Column(
107 + children: [
108 + Observer(
109 + builder: (context) {
110 + return LoadingPrimaryButton(
111 + onPressed: () async {
112 + await _confirmForm(context);
113 + },
114 + text: signViewModel.isSigning
115 + ? S.current.sign_message
116 + : S.current.verify_message,
117 + color: Theme.of(context).colorScheme.primary,
118 + textColor: Theme.of(context).colorScheme.onPrimary,
119 + isLoading: signViewModel.state is IsExecutingState,
120 + isDisabled: signViewModel.state is IsExecutingState,
121 + );
122 + },
123 ),
107 - ),
108 - Padding(
109 - padding: EdgeInsets.only(top: 20, bottom: 24, left: 24, right: 24),
110 - child: Column(
111 - children: [
112 - Observer(
113 - builder: (context) {
114 - return LoadingPrimaryButton(
115 - onPressed: () async {
116 - await _confirmForm(context);
117 - },
118 - text: signViewModel.isSigning
119 - ? S.current.sign_message
120 - : S.current.verify_message,
121 - color: Theme.of(context)
122 - .extension<WalletListTheme>()!
123 - .createNewWalletButtonBackgroundColor,
124 - textColor: Theme.of(context)
125 - .extension<WalletListTheme>()!
126 - .restoreWalletButtonTextColor,
127 - isLoading: signViewModel.state is IsExecutingState,
128 - isDisabled: signViewModel.state is IsExecutingState,
129 - );
130 - },
131 - ),
132 - ],
133 - ),
134 - )
135 - ],
136 - ),
124 + ],
125 + ),
126 + )
127 + ],
128 ),
129 ),
130 ),
lib/src/screens/dashboard/widgets/action_button.dart
+2 -5
@@ -1,5 +1,4 @@
1 import 'package:flutter/material.dart';
2 -import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
2
3 class ActionButton extends StatelessWidget {
4 ActionButton({
@@ -49,10 +48,8 @@ class ActionButton extends StatelessWidget {
48 title,
49 maxLines: 1,
50 overflow: TextOverflow.visible,
52 - style: TextStyle(
53 - fontSize: 9,
54 - color: textColor ??
55 - Theme.of(context).extension<DashboardPageTheme>()!.cardTextColor),
51 + style: Theme.of(context).textTheme.labelSmall?.copyWith(
52 + color: textColor ?? Theme.of(context).colorScheme.onSurface),
53 textAlign: TextAlign.center,
54 )
55 ],
lib/src/screens/dashboard/widgets/anonpay_transaction_row.dart
+39 -32
@@ -1,6 +1,4 @@
1 import 'package:flutter/material.dart';
2 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
3 -import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
2
3 class AnonpayTransactionRow extends StatelessWidget {
4 AnonpayTransactionRow({
@@ -21,44 +19,53 @@ class AnonpayTransactionRow extends StatelessWidget {
19 @override
20 Widget build(BuildContext context) {
21 return InkWell(
24 - onTap: onTap,
25 - child: Container(
26 - padding: EdgeInsets.fromLTRB(24, 8, 24, 8),
27 - color: Colors.transparent,
28 - child: Row(
29 - mainAxisSize: MainAxisSize.max,
30 - crossAxisAlignment: CrossAxisAlignment.center,
31 - children: [
32 - _getImage(),
33 - SizedBox(width: 12),
34 - Expanded(
35 - child: Column(
22 + onTap: onTap,
23 + child: Container(
24 + padding: EdgeInsets.fromLTRB(24, 8, 24, 8),
25 + color: Colors.transparent,
26 + child: Row(
27 + mainAxisSize: MainAxisSize.max,
28 + crossAxisAlignment: CrossAxisAlignment.center,
29 + children: [
30 + _getImage(),
31 + SizedBox(width: 12),
32 + Expanded(
33 + child: Column(
34 mainAxisSize: MainAxisSize.min,
35 children: [
36 Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: <Widget>[
39 - Text(provider,
40 - style: TextStyle(
41 - fontSize: 16,
37 + Text(
38 + provider,
39 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
40 fontWeight: FontWeight.w500,
43 - color: Theme.of(context).extension<DashboardPageTheme>()!.textColor)),
44 - Text(amount + ' ' + currency,
45 - style: TextStyle(
46 - fontSize: 16,
41 + ),
42 + ),
43 + Text(
44 + amount + ' ' + currency,
45 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
46 fontWeight: FontWeight.w500,
48 - color: Theme.of(context).extension<DashboardPageTheme>()!.textColor))
47 + ),
48 + ),
49 ]),
50 SizedBox(height: 5),
51 - Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: <Widget>[
52 - Text(createdAt,
53 - style: TextStyle(
54 - fontSize: 14,
55 - color: Theme.of(context).extension<CakeTextTheme>()!.dateSectionRowColor))
56 - ])
51 + Row(
52 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
53 + children: <Widget>[
54 + Text(
55 + createdAt,
56 + style: Theme.of(context).textTheme.bodySmall?.copyWith(
57 + color: Theme.of(context).colorScheme.onSurfaceVariant,
58 + ),
59 + ),
60 + ],
61 + )
62 ],
58 - ))
59 - ],
60 - ),
61 - ));
63 + ),
64 + )
65 + ],
66 + ),
67 + ),
68 + );
69 }
70
71 Widget _getImage() => ClipRRect(
lib/src/screens/dashboard/widgets/date_section_raw.dart
+2 -4
@@ -1,5 +1,4 @@
1 import 'package:flutter/material.dart';
2 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
2 import 'package:cake_wallet/utils/date_formatter.dart';
3
4 class DateSectionRaw extends StatelessWidget {
@@ -17,9 +16,8 @@ class DateSectionRaw extends StatelessWidget {
16 color: Colors.transparent,
17 child: Text(
18 title,
20 - style: TextStyle(
21 - fontSize: 12,
22 - color: Theme.of(context).extension<CakeTextTheme>()!.dateSectionRowColor,
19 + style: Theme.of(context).textTheme.bodySmall?.copyWith(
20 + color: Theme.of(context).colorScheme.onSurfaceVariant,
21 ),
22 ),
23 );
lib/src/screens/dashboard/widgets/filter_list_widget.dart
+30 -40
@@ -1,15 +1,11 @@
1 import 'package:cake_wallet/entities/list_order_mode.dart';
2 import 'package:cake_wallet/entities/wallet_list_order_types.dart';
3 import 'package:cake_wallet/src/screens/settings/widgets/settings_choices_cell.dart';
4 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
4 import 'package:cake_wallet/src/widgets/section_divider.dart';
6 -import 'package:cake_wallet/themes/extensions/menu_theme.dart';
5 import 'package:cake_wallet/view_model/settings/choices_list_item.dart';
8 -import 'package:cake_wallet/view_model/wallet_list/wallet_list_view_model.dart';
6 import 'package:flutter/material.dart';
7 import 'package:cake_wallet/src/widgets/picker_wrapper_widget.dart';
8 import 'package:cake_wallet/generated/i18n.dart';
12 -import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart';
9
10 class FilterListWidget extends StatefulWidget {
11 FilterListWidget({
@@ -57,19 +53,17 @@ class FilterListWidgetState extends State<FilterListWidget> {
53 child: ClipRRect(
54 borderRadius: BorderRadius.all(Radius.circular(24)),
55 child: Container(
60 - color: Theme.of(context).extension<CakeMenuTheme>()!.backgroundColor,
56 + color: Theme.of(context).colorScheme.surface,
57 child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
58 Padding(
59 padding: EdgeInsets.all(24.0),
60 child: Text(
61 S.of(context).order_by,
66 - style: TextStyle(
67 - color:
68 - Theme.of(context).extension<TransactionTradeTheme>()!.detailsTitlesColor,
69 - fontSize: 16,
70 - fontFamily: 'Lato',
71 - decoration: TextDecoration.none,
72 - ),
62 + style: Theme.of(context).textTheme.titleMedium?.copyWith(
63 + color: Theme.of(context).colorScheme.onSurface,
64 + fontSize: 16,
65 + decoration: TextDecoration.none,
66 + ),
67 ),
68 ),
69 if (type != FilterListOrderType.Custom) ...[
@@ -93,60 +87,56 @@ class FilterListWidgetState extends State<FilterListWidget> {
87 groupValue: type,
88 title: Text(
89 FilterListOrderType.CreationDate.toString(),
96 - style: TextStyle(
97 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
98 - fontSize: 16,
99 - fontFamily: 'Lato',
100 - fontWeight: FontWeight.bold,
101 - decoration: TextDecoration.none),
90 + style: Theme.of(context).textTheme.titleMedium?.copyWith(
91 + color: Theme.of(context).colorScheme.onSurface,
92 + fontSize: 16,
93 + fontWeight: FontWeight.bold,
94 + ),
95 ),
96 onChanged: setSelectedOrderType,
104 - activeColor: Theme.of(context).primaryColor,
97 + activeColor: Theme.of(context).colorScheme.primary,
98 ),
99 RadioListTile(
100 value: FilterListOrderType.Alphabetical,
101 groupValue: type,
102 title: Text(
103 FilterListOrderType.Alphabetical.toString(),
111 - style: TextStyle(
112 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
113 - fontSize: 16,
114 - fontFamily: 'Lato',
115 - fontWeight: FontWeight.bold,
116 - decoration: TextDecoration.none),
104 + style: Theme.of(context).textTheme.titleMedium?.copyWith(
105 + color: Theme.of(context).colorScheme.onSurface,
106 + fontSize: 16,
107 + fontWeight: FontWeight.bold,
108 + ),
109 ),
110 onChanged: setSelectedOrderType,
119 - activeColor: Theme.of(context).primaryColor,
111 + activeColor: Theme.of(context).colorScheme.primary,
112 ),
113 RadioListTile(
114 value: FilterListOrderType.GroupByType,
115 groupValue: type,
116 title: Text(
117 FilterListOrderType.GroupByType.toString(),
126 - style: TextStyle(
127 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
128 - fontSize: 16,
129 - fontFamily: 'Lato',
130 - fontWeight: FontWeight.bold,
131 - decoration: TextDecoration.none),
118 + style: Theme.of(context).textTheme.titleMedium?.copyWith(
119 + color: Theme.of(context).colorScheme.onSurface,
120 + fontSize: 16,
121 + fontWeight: FontWeight.bold,
122 + ),
123 ),
124 onChanged: setSelectedOrderType,
134 - activeColor: Theme.of(context).primaryColor,
125 + activeColor: Theme.of(context).colorScheme.primary,
126 ),
127 RadioListTile(
128 value: FilterListOrderType.Custom,
129 groupValue: type,
130 title: Text(
131 FilterListOrderType.Custom.toString(),
141 - style: TextStyle(
142 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
143 - fontSize: 16,
144 - fontFamily: 'Lato',
145 - fontWeight: FontWeight.bold,
146 - decoration: TextDecoration.none),
132 + style: Theme.of(context).textTheme.titleMedium?.copyWith(
133 + color: Theme.of(context).colorScheme.onSurface,
134 + fontSize: 16,
135 + fontWeight: FontWeight.bold,
136 + ),
137 ),
138 onChanged: setSelectedOrderType,
149 - activeColor: Theme.of(context).primaryColor,
139 + activeColor: Theme.of(context).colorScheme.primary,
140 ),
141 ]),
142 ),
lib/src/screens/dashboard/widgets/filter_widget.dart
+8 -17
@@ -1,16 +1,13 @@
1 import 'package:cake_wallet/src/widgets/alert_background.dart';
2 import 'package:cake_wallet/src/widgets/alert_close_button.dart';
3 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
3 import 'package:cake_wallet/src/screens/dashboard/widgets/filter_tile.dart';
4 import 'package:cake_wallet/src/widgets/section_divider.dart';
5 import 'package:cake_wallet/src/widgets/standard_checkbox.dart';
7 -import 'package:cake_wallet/themes/extensions/menu_theme.dart';
6 import 'package:cake_wallet/utils/responsive_layout_util.dart';
7 import 'package:cake_wallet/view_model/dashboard/filter_item.dart';
8 import 'package:flutter/material.dart';
9 import 'package:cake_wallet/generated/i18n.dart';
10 import 'package:flutter_mobx/flutter_mobx.dart';
13 -import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart';
11
12 class FilterWidget extends StatefulWidget {
13 const FilterWidget({required this.filterItems, this.onClose, Key? key}) : super(key: key);
@@ -75,7 +72,7 @@ class _FilterWidgetState extends State<FilterWidget> {
72 child: ClipRRect(
73 borderRadius: BorderRadius.circular(24),
74 child: Container(
78 - color: Theme.of(context).extension<CakeMenuTheme>()!.backgroundColor,
75 + color: Theme.of(context).colorScheme.surface,
76 child: Column(
77 crossAxisAlignment: CrossAxisAlignment.start,
78 children: [
@@ -83,13 +80,9 @@ class _FilterWidgetState extends State<FilterWidget> {
80 padding: const EdgeInsets.all(24.0),
81 child: Text(
82 S.of(context).filter_by,
86 - style: TextStyle(
87 - color: Theme.of(context)
88 - .extension<TransactionTradeTheme>()!
89 - .detailsTitlesColor,
90 - fontSize: 16,
91 - fontFamily: 'Lato',
92 - decoration: TextDecoration.none,
83 + style: Theme.of(context).textTheme.titleMedium?.copyWith(
84 + color: Theme.of(context).colorScheme.onSurface,
85 + fontWeight: FontWeight.bold,
86 ),
87 ),
88 ),
@@ -125,8 +118,8 @@ class _FilterWidgetState extends State<FilterWidget> {
118 value: item.value(),
119 caption: item.caption,
120 gradientBackground: true,
128 - borderColor: Theme.of(context).dividerColor,
129 - iconColor: Colors.white,
121 + borderColor: Theme.of(context).colorScheme.outlineVariant,
122 + iconColor: Theme.of(context).colorScheme.onSurface,
123 onChanged: (value) => item.onChanged(),
124 ),
125 );
@@ -143,10 +136,8 @@ class _FilterWidgetState extends State<FilterWidget> {
136 padding: const EdgeInsets.only(top: 20, left: 24, right: 24),
137 child: Text(
138 title,
146 - style: TextStyle(
147 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
148 - fontSize: 16,
149 - fontFamily: 'Lato',
139 + style: Theme.of(context).textTheme.titleMedium?.copyWith(
140 + color: Theme.of(context).colorScheme.onSurface,
141 fontWeight: FontWeight.bold,
142 decoration: TextDecoration.none,
143 ),
lib/src/screens/dashboard/widgets/header_row.dart
+4 -7
@@ -1,10 +1,8 @@
1 import 'package:cake_wallet/src/screens/dashboard/widgets/filter_widget.dart';
2 -import 'package:cake_wallet/themes/extensions/filter_theme.dart';
2 import 'package:cake_wallet/utils/show_pop_up.dart';
3 import 'package:flutter/material.dart';
4 import 'package:cake_wallet/generated/i18n.dart';
5 import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart';
7 -import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
6
7 class HeaderRow extends StatelessWidget {
8 HeaderRow({required this.dashboardViewModel, super.key});
@@ -14,7 +12,7 @@ class HeaderRow extends StatelessWidget {
12 @override
13 Widget build(BuildContext context) {
14 final filterIcon = Image.asset('assets/images/filter_icon.png',
17 - color: Theme.of(context).extension<FilterTheme>()!.iconColor);
15 + color: Theme.of(context).colorScheme.onSurface);
16
17 return Container(
18 height: 52,
@@ -26,10 +24,9 @@ class HeaderRow extends StatelessWidget {
24 children: <Widget>[
25 Text(
26 S.of(context).transactions,
29 - style: TextStyle(
30 - fontSize: 20,
27 + style: Theme.of(context).textTheme.titleLarge?.copyWith(
28 fontWeight: FontWeight.w500,
32 - color: Theme.of(context).extension<DashboardPageTheme>()!.pageTitleTextColor),
29 + color: Theme.of(context).colorScheme.onSurface),
30 ),
31 Semantics(
32 container: true,
@@ -50,7 +47,7 @@ class HeaderRow extends StatelessWidget {
47 width: 36,
48 decoration: BoxDecoration(
49 shape: BoxShape.circle,
53 - color: Theme.of(context).extension<FilterTheme>()!.buttonColor,
50 + color: Theme.of(context).colorScheme.surfaceContainer,
51 ),
52 child: filterIcon,
53 ),
lib/src/screens/dashboard/widgets/home_screen_account_widget.dart
+5 -10
@@ -1,6 +1,5 @@
1 import 'package:cake_wallet/di.dart';
2 import 'package:cake_wallet/src/screens/monero_accounts/monero_account_list_page.dart';
3 -import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
3 import 'package:cake_wallet/utils/show_pop_up.dart';
4 import 'package:flutter/material.dart';
5
@@ -32,11 +31,9 @@ class HomeScreenAccountWidget extends StatelessWidget {
31 Container(
32 child: Text(
33 walletName ?? '',
35 - style: TextStyle(
36 - fontSize: 22.0,
34 + style: Theme.of(context).textTheme.headlineSmall?.copyWith(
35 fontWeight: FontWeight.bold,
38 - fontFamily: 'Lato',
39 - color: Theme.of(context).extension<DashboardPageTheme>()!.pageTitleTextColor,
36 + color: Theme.of(context).colorScheme.onSurface,
37 ),
38 ),
39 ),
@@ -46,11 +43,9 @@ class HomeScreenAccountWidget extends StatelessWidget {
43 Container(
44 child: Text(
45 accountName ?? '',
49 - style: TextStyle(
50 - fontSize: 14.0,
46 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
47 fontWeight: FontWeight.bold,
52 - fontFamily: 'Lato',
53 - color: Theme.of(context).extension<DashboardPageTheme>()!.pageTitleTextColor,
48 + color: Theme.of(context).colorScheme.onSurfaceVariant,
49 ),
50 ),
51 ),
@@ -59,7 +54,7 @@ class HomeScreenAccountWidget extends StatelessWidget {
54 Container(
55 child: Icon(
56 Icons.keyboard_arrow_down,
62 - color: Theme.of(context).extension<DashboardPageTheme>()!.pageTitleTextColor,
57 + color: Theme.of(context).colorScheme.onSurfaceVariant,
58 ),
59 ),
60 ],
lib/src/screens/dashboard/widgets/info_card.dart
+18 -6
@@ -8,7 +8,7 @@ class InfoCard extends StatelessWidget {
8 final String title;
9 final String description;
10 final String image;
11 -
11 + final bool isDarkTheme;
12 final Function() leftButtonAction;
13 final Function() rightButtonAction;
14
@@ -23,12 +23,14 @@ class InfoCard extends StatelessWidget {
23 required this.leftButtonAction,
24 required this.rightButtonAction,
25 required this.image,
26 + required this.isDarkTheme,
27 this.hintWidget,
28 }) : super(key: key);
29
30 @override
31 Widget build(BuildContext context) {
32 return DashBoardRoundedCardWidget(
33 + isDarkTheme: isDarkTheme,
34 marginH: 0,
35 marginV: 0,
36 customBorder: 30,
@@ -45,11 +47,16 @@ class InfoCard extends StatelessWidget {
47 child: ElevatedButton(
48 onPressed: leftButtonAction,
49 style: ElevatedButton.styleFrom(
48 - backgroundColor: Theme.of(context).primaryColor,
50 + backgroundColor: Theme.of(context).colorScheme.surface,
51 + shape: RoundedRectangleBorder(
52 + borderRadius: BorderRadius.circular(10),
53 + ),
54 ),
55 child: Text(
56 leftButtonTitle,
52 - style: TextStyle(color: Colors.white),
57 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
58 + color: Theme.of(context).colorScheme.onSecondaryContainer,
59 + ),
60 ),
61 ),
62 ),
@@ -58,12 +65,17 @@ class InfoCard extends StatelessWidget {
65 child: ElevatedButton(
66 onPressed: rightButtonAction,
67 style: ElevatedButton.styleFrom(
61 - backgroundColor: Colors.white,
62 - foregroundColor: Colors.black,
68 + backgroundColor: Theme.of(context).colorScheme.primary,
69 + shape: RoundedRectangleBorder(
70 + borderRadius: BorderRadius.circular(10),
71 + ),
72 ),
73 child: Text(
74 rightButtonTitle,
75 maxLines: 1,
76 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
77 + color: Theme.of(context).colorScheme.onPrimary,
78 + ),
79 ),
80 ),
81 ),
@@ -74,7 +86,7 @@ class InfoCard extends StatelessWidget {
86 onTap: () => {},
87 icon: Container(
88 decoration: BoxDecoration(
77 - color: Colors.white,
89 + color: Theme.of(context).colorScheme.surfaceContainer,
90 shape: BoxShape.circle,
91 ),
92 child: CakeImageWidget(
lib/src/screens/dashboard/widgets/menu_widget.dart
+28 -27
@@ -1,9 +1,7 @@
1 import 'package:cake_wallet/generated/i18n.dart';
2 import 'package:cake_wallet/src/widgets/setting_action_button.dart';
3 import 'package:cake_wallet/src/widgets/setting_actions.dart';
4 -import 'package:cake_wallet/themes/extensions/menu_theme.dart';
4 import 'package:flutter/material.dart';
6 -import 'package:cake_wallet/palette.dart';
5 import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart';
6 import 'package:cw_core/wallet_type.dart';
7 import 'package:flutter_mobx/flutter_mobx.dart';
@@ -103,7 +101,8 @@ class MenuWidgetState extends State<MenuWidget> {
101 Widget build(BuildContext context) {
102 List<SettingActions> items = List.of(SettingActions.all);
103 if (!widget.dashboardViewModel.hasSilentPayments) {
106 - items.removeWhere((element) => element.name(context) == S.of(context).silent_payments_settings);
104 + items.removeWhere(
105 + (element) => element.name(context) == S.of(context).silent_payments_settings);
106 }
107 if (!widget.dashboardViewModel.isMoneroViewOnly) {
108 items.removeWhere((element) => element.name(context) == S.of(context).export_outputs);
@@ -113,10 +112,10 @@ class MenuWidgetState extends State<MenuWidget> {
112 }
113 int itemCount = items.length;
114
116 - moneroIcon = Image.asset('assets/images/monero_menu.png',
117 - color: Theme.of(context).extension<CakeMenuTheme>()!.iconColor);
118 - bitcoinIcon = Image.asset('assets/images/bitcoin_menu.png',
119 - color: Theme.of(context).extension<CakeMenuTheme>()!.iconColor);
115 + moneroIcon =
116 + Image.asset('assets/images/monero_menu.png', color: Theme.of(context).colorScheme.primary);
117 + bitcoinIcon =
118 + Image.asset('assets/images/bitcoin_menu.png', color: Theme.of(context).colorScheme.primary);
119
120 return Row(
121 mainAxisSize: MainAxisSize.max,
@@ -128,16 +127,20 @@ class MenuWidgetState extends State<MenuWidget> {
127 height: 60,
128 width: 4,
129 decoration: BoxDecoration(
131 - borderRadius: BorderRadius.all(Radius.circular(2)), color: PaletteDark.gray),
130 + borderRadius: BorderRadius.all(Radius.circular(2)),
131 + color: Theme.of(context).colorScheme.outline,
132 + ),
133 ),
134 ),
135 SizedBox(width: 12),
136 Expanded(
137 child: ClipRRect(
137 - borderRadius:
138 - BorderRadius.only(topLeft: Radius.circular(24), bottomLeft: Radius.circular(24)),
138 + borderRadius: BorderRadius.only(
139 + topLeft: Radius.circular(24),
140 + bottomLeft: Radius.circular(24),
141 + ),
142 child: Container(
140 - color: Theme.of(context).extension<CakeMenuTheme>()!.backgroundColor,
143 + color: Theme.of(context).colorScheme.surface,
144 child: ListView.separated(
145 padding: EdgeInsets.only(top: 0),
146 itemBuilder: (_, index) {
@@ -146,13 +149,14 @@ class MenuWidgetState extends State<MenuWidget> {
149 height: headerHeight,
150 decoration: BoxDecoration(
151 borderRadius: BorderRadius.only(bottomLeft: Radius.circular(24)),
149 - gradient: LinearGradient(colors: [
150 - Theme.of(context).extension<CakeMenuTheme>()!.headerFirstGradientColor,
151 - Theme.of(context).extension<CakeMenuTheme>()!.headerSecondGradientColor,
152 - ], begin: Alignment.topLeft, end: Alignment.bottomRight),
152 + color: Theme.of(context).colorScheme.surface,
153 ),
154 padding: EdgeInsets.only(
155 - left: 24, top: fromTopEdge, right: 24, bottom: fromBottomEdge),
155 + left: 24,
156 + top: fromTopEdge,
157 + right: 24,
158 + bottom: fromBottomEdge,
159 + ),
160 child: Row(
161 mainAxisAlignment: MainAxisAlignment.start,
162 children: <Widget>[
@@ -168,21 +172,18 @@ class MenuWidgetState extends State<MenuWidget> {
172 children: <Widget>[
173 Text(
174 widget.dashboardViewModel.name,
171 - style: TextStyle(
172 - color: Colors.white,
173 - fontSize: 16,
174 - fontWeight: FontWeight.bold),
175 + style: Theme.of(context).textTheme.bodyLarge?.copyWith(
176 + fontWeight: FontWeight.w700,
177 + ),
178 ),
179 if (widget.dashboardViewModel.subname.isNotEmpty)
180 Observer(
181 builder: (_) => Text(
182 widget.dashboardViewModel.subname,
180 - style: TextStyle(
181 - color: Theme.of(context)
182 - .extension<CakeMenuTheme>()!
183 - .subnameTextColor,
184 - fontWeight: FontWeight.w500,
185 - fontSize: 12),
183 + style: Theme.of(context).textTheme.bodySmall?.copyWith(
184 + color: Theme.of(context).colorScheme.onSurfaceVariant,
185 + fontWeight: FontWeight.w500,
186 + ),
187 ),
188 ),
189 ],
@@ -213,7 +214,7 @@ class MenuWidgetState extends State<MenuWidget> {
214 },
215 separatorBuilder: (_, index) => Container(
216 height: 0,
216 - color: Theme.of(context).extension<CakeMenuTheme>()!.dividerColor,
217 + color: Theme.of(context).colorScheme.outline,
218 ),
219 itemCount: itemCount + 1,
220 ),
lib/src/screens/dashboard/widgets/nft_tile_widget.dart
+17 -22
@@ -2,8 +2,6 @@ import 'package:cake_wallet/entities/wallet_nft_response.dart';
2 import 'package:cake_wallet/routes.dart';
3 import 'package:cake_wallet/src/screens/dashboard/pages/nft_details_page.dart';
4 import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
5 -import 'package:cake_wallet/themes/extensions/balance_page_theme.dart';
6 -import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart';
5 import 'package:flutter/material.dart';
6
7 class NFTTileWidget extends StatelessWidget {
@@ -27,8 +25,10 @@ class NFTTileWidget extends StatelessWidget {
25 decoration: BoxDecoration(
26 borderRadius: BorderRadius.circular(30.0),
27 border: Border.all(
30 - color: Theme.of(context).extension<BalancePageTheme>()!.cardBorderColor, width: 1),
31 - color: Theme.of(context).extension<SyncIndicatorTheme>()!.syncedBackgroundColor,
28 + color: Theme.of(context).colorScheme.outline,
29 + width: 0.0,
30 + ),
31 + color: Theme.of(context).colorScheme.surfaceContainer,
32 ),
33 child: Row(
34 children: [
@@ -38,12 +38,12 @@ class NFTTileWidget extends StatelessWidget {
38 clipBehavior: Clip.hardEdge,
39 margin: const EdgeInsets.all(8),
40 decoration: BoxDecoration(
41 - borderRadius: BorderRadius.circular(16.0),
41 + borderRadius: BorderRadius.circular(24.0),
42 border: Border.all(
43 - color: Theme.of(context).extension<BalancePageTheme>()!.cardBorderColor,
44 - width: 1,
43 + color: Theme.of(context).colorScheme.outline,
44 + width: 0.0,
45 ),
46 - color: Theme.of(context).extension<SyncIndicatorTheme>()!.syncedBackgroundColor,
46 + color: Theme.of(context).colorScheme.surface,
47 ),
48 child: CakeImageWidget(
49 imageUrl: nftAsset.normalizedMetadata?.imageUrl,
@@ -56,24 +56,19 @@ class NFTTileWidget extends StatelessWidget {
56 children: [
57 Text(
58 '${nftAsset.name ?? '---'} - ${nftAsset.symbol ?? '---'}',
59 - style: TextStyle(
60 - fontSize: 12,
61 - fontFamily: 'Lato',
62 - fontWeight: FontWeight.w400,
63 - color: Theme.of(context).extension<BalancePageTheme>()!.labelTextColor,
64 - height: 1,
65 - ),
59 + style: Theme.of(context).textTheme.bodySmall?.copyWith(
60 + color: Theme.of(context).colorScheme.onSurfaceVariant,
61 + height: 1,
62 + ),
63 ),
64 SizedBox(height: 8),
65 Text(
66 nftAsset.normalizedMetadata?.name ?? nftAsset.name ?? "---",
70 - style: TextStyle(
71 - fontSize: 20,
72 - fontFamily: 'Lato',
73 - fontWeight: FontWeight.w900,
74 - color: Theme.of(context).extension<BalancePageTheme>()!.assetTitleColor,
75 - height: 1,
76 - ),
67 + style: Theme.of(context).textTheme.titleLarge?.copyWith(
68 + fontWeight: FontWeight.w900,
69 + color: Theme.of(context).colorScheme.onSurface,
70 + height: 1,
71 + ),
72 ),
73 ],
74 ),
lib/src/screens/dashboard/widgets/order_row.dart
+46 -40
@@ -1,9 +1,6 @@
1 import 'package:cake_wallet/buy/buy_provider_description.dart';
2 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
2 import 'package:cake_wallet/buy/get_buy_provider_icon.dart';
4 -import 'package:cake_wallet/themes/extensions/order_theme.dart';
3 import 'package:flutter/material.dart';
6 -import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
4
5 class OrderRow extends StatelessWidget {
6 OrderRow({
@@ -15,7 +12,7 @@ class OrderRow extends StatelessWidget {
12 this.formattedAmount,
13 super.key,
14 });
18 -
15 +
16 final VoidCallback? onTap;
17 final BuyProviderDescription provider;
18 final String from;
@@ -25,55 +22,64 @@ class OrderRow extends StatelessWidget {
22
23 @override
24 Widget build(BuildContext context) {
28 - final iconColor = Theme.of(context).extension<OrderTheme>()!.iconColor;
25 + final iconColor = Theme.of(context).colorScheme.onSurfaceVariant;
26
27 final providerIcon = getBuyProviderIcon(provider, iconColor: iconColor);
28
29 return InkWell(
33 - onTap: onTap,
34 - child: Container(
35 - padding: EdgeInsets.fromLTRB(24, 8, 24, 8),
36 - color: Colors.transparent,
37 - child: Row(
38 - mainAxisSize: MainAxisSize.max,
39 - crossAxisAlignment: CrossAxisAlignment.center,
40 - children: [
41 - if (providerIcon != null)
42 - Padding(
43 - padding: EdgeInsets.only(right: 12),
44 - child: providerIcon,
45 - ),
46 - Expanded(
47 - child: Column(
30 + onTap: onTap,
31 + child: Container(
32 + padding: EdgeInsets.fromLTRB(24, 8, 24, 8),
33 + color: Colors.transparent,
34 + child: Row(
35 + mainAxisSize: MainAxisSize.max,
36 + crossAxisAlignment: CrossAxisAlignment.center,
37 + children: [
38 + if (providerIcon != null)
39 + Padding(
40 + padding: EdgeInsets.only(right: 12),
41 + child: providerIcon,
42 + ),
43 + Expanded(
44 + child: Column(
45 mainAxisSize: MainAxisSize.min,
46 children: [
47 Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: <Widget>[
51 - Text('$from → $to',
52 - style: TextStyle(
48 + Text(
49 + '$from → $to',
50 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
51 fontSize: 16,
52 fontWeight: FontWeight.w500,
55 - color: Theme.of(context).extension<DashboardPageTheme>()!.textColor)),
53 + ),
54 + ),
55 formattedAmount != null
57 - ? Text(formattedAmount! + ' ' + to,
58 - style: TextStyle(
59 - fontSize: 16,
60 - fontWeight: FontWeight.w500,
61 - color:
62 - Theme.of(context).extension<DashboardPageTheme>()!.textColor))
56 + ? Text(
57 + formattedAmount! + ' ' + to,
58 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
59 + fontSize: 16,
60 + fontWeight: FontWeight.w500,
61 + ),
62 + )
63 : Container()
64 ]),
65 SizedBox(height: 5),
66 - Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: <Widget>[
67 - Text(createdAtFormattedDate,
68 - style: TextStyle(
69 - fontSize: 14,
70 - color:
71 - Theme.of(context).extension<CakeTextTheme>()!.dateSectionRowColor))
72 - ])
66 + Row(
67 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
68 + children: <Widget>[
69 + Text(
70 + createdAtFormattedDate,
71 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
72 + color: Theme.of(context).colorScheme.onSurfaceVariant,
73 + ),
74 + ),
75 + ],
76 + )
77 ],
74 - ))
75 - ],
76 - ),
77 - ));
78 + ),
79 + )
80 + ],
81 + ),
82 + ),
83 + );
84 }
85 }
lib/src/screens/dashboard/widgets/payjoin_transaction_row.dart
+31 -45
@@ -1,6 +1,4 @@
1 import 'package:cake_wallet/generated/i18n.dart';
2 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
3 -import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
2 import 'package:flutter/material.dart';
3
4 class PayjoinTransactionRow extends StatelessWidget {
@@ -38,53 +36,37 @@ class PayjoinTransactionRow extends StatelessWidget {
36 child: Column(
37 mainAxisSize: MainAxisSize.min,
38 children: [
41 - Row(
42 - mainAxisAlignment: MainAxisAlignment.spaceBetween,
43 - children: <Widget>[
44 - Text(
45 - "${isSending ? S.current.outgoing : S.current.incoming} Payjoin",
46 - style: TextStyle(
47 - fontSize: 16,
39 + Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: <Widget>[
40 + Text(
41 + "${isSending ? S.current.outgoing : S.current.incoming} Payjoin",
42 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
43 fontWeight: FontWeight.w500,
49 - color: Theme.of(context)
50 - .extension<DashboardPageTheme>()!
51 - .textColor,
44 + color: Theme.of(context).colorScheme.onSurface,
45 ),
53 - ),
54 - Text(
55 - amount + ' ' + currency,
56 - style: TextStyle(
57 - fontSize: 16,
46 + ),
47 + Text(
48 + amount + ' ' + currency,
49 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
50 fontWeight: FontWeight.w500,
59 - color: Theme.of(context)
60 - .extension<DashboardPageTheme>()!
61 - .textColor,
51 + color: Theme.of(context).colorScheme.onSurface,
52 ),
63 - )
64 - ]),
53 + )
54 + ]),
55 SizedBox(height: 5),
66 - Row(
67 - mainAxisAlignment: MainAxisAlignment.spaceBetween,
68 - children: <Widget>[
69 - Text(
70 - createdAt,
71 - style: TextStyle(
72 - fontSize: 14,
73 - color: Theme.of(context)
74 - .extension<CakeTextTheme>()!
75 - .dateSectionRowColor,
56 + Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: <Widget>[
57 + Text(
58 + createdAt,
59 + style: Theme.of(context).textTheme.bodySmall?.copyWith(
60 + color: Theme.of(context).colorScheme.onSurfaceVariant,
61 ),
77 - ),
78 - Text(
79 - state,
80 - style: TextStyle(
81 - fontSize: 14,
82 - color: Theme.of(context)
83 - .extension<CakeTextTheme>()!
84 - .dateSectionRowColor,
62 + ),
63 + Text(
64 + state,
65 + style: Theme.of(context).textTheme.bodySmall?.copyWith(
66 + color: Theme.of(context).colorScheme.onSurfaceVariant,
67 ),
86 - ),
87 - ])
68 + ),
69 + ])
70 ],
71 ))
72 ],
@@ -93,7 +75,11 @@ class PayjoinTransactionRow extends StatelessWidget {
75 }
76
77 Widget _getImage() => ClipRRect(
96 - borderRadius: BorderRadius.circular(50),
97 - child: Image.asset('assets/images/payjoin.png', width: 36, height: 36));
98 -
78 + borderRadius: BorderRadius.circular(50),
79 + child: Image.asset(
80 + 'assets/images/payjoin.png',
81 + width: 36,
82 + height: 36,
83 + ),
84 + );
85 }
lib/src/screens/dashboard/widgets/present_receive_option_picker.dart
+24 -18
@@ -1,5 +1,4 @@
1 import 'package:cake_wallet/src/widgets/alert_close_button.dart';
2 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
2 import 'package:cake_wallet/src/screens/cake_pay/widgets/rounded_checkbox.dart';
3 import 'package:cake_wallet/src/widgets/alert_background.dart';
4 import 'package:cake_wallet/typography.dart';
@@ -26,10 +25,10 @@ class PresentReceiveOptionPicker extends StatelessWidget {
25 return TextButton(
26 onPressed: () => _showPicker(context),
27 style: ButtonStyle(
29 - padding: MaterialStateProperty.all(EdgeInsets.zero),
28 + padding: WidgetStateProperty.all(EdgeInsets.zero),
29 splashFactory: NoSplash.splashFactory,
31 - foregroundColor: MaterialStateProperty.all(Colors.transparent),
32 - overlayColor: MaterialStateProperty.all(Colors.transparent),
30 + foregroundColor: WidgetStateProperty.all(Colors.transparent),
31 + overlayColor: WidgetStateProperty.all(Colors.transparent),
32 ),
33 child: Row(
34 mainAxisSize: MainAxisSize.min,
@@ -41,18 +40,27 @@ class PresentReceiveOptionPicker extends StatelessWidget {
40 children: <Widget>[
41 Text(
42 S.current.receive,
44 - style: TextStyle(
45 - fontSize: 18.0, fontWeight: FontWeight.bold, fontFamily: 'Lato', color: color),
43 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
44 + fontSize: 18.0,
45 + fontWeight: FontWeight.bold,
46 + color: color,
47 + ),
48 ),
49 Observer(
48 - builder: (_) => Text(
49 - receiveOptionViewModel.selectedReceiveOption
50 - .toString()
51 - .replaceAll(RegExp(r'silent payments', caseSensitive: false),
52 - S.current.silent_payments)
53 - .replaceAll(
54 - RegExp(r'default', caseSensitive: false), S.current.string_default),
55 - style: TextStyle(fontSize: 10.0, fontWeight: FontWeight.w500, color: color)))
50 + builder: (_) => Text(
51 + receiveOptionViewModel.selectedReceiveOption
52 + .toString()
53 + .replaceAll(RegExp(r'silent payments', caseSensitive: false),
54 + S.current.silent_payments)
55 + .replaceAll(
56 + RegExp(r'default', caseSensitive: false), S.current.string_default),
57 + style: Theme.of(context).textTheme.bodySmall!.copyWith(
58 + fontSize: 10.0,
59 + fontWeight: FontWeight.w500,
60 + color: color,
61 + ),
62 + ),
63 + )
64 ],
65 ),
66 SizedBox(width: 5),
@@ -83,7 +91,7 @@ class PresentReceiveOptionPicker extends StatelessWidget {
91 margin: EdgeInsets.symmetric(horizontal: 24),
92 decoration: BoxDecoration(
93 borderRadius: BorderRadius.circular(30),
86 - color: Theme.of(context).colorScheme.background,
94 + color: Theme.of(context).colorScheme.surface,
95 ),
96 child: Padding(
97 padding: const EdgeInsets.only(top: 24, bottom: 24),
@@ -117,9 +125,7 @@ class PresentReceiveOptionPicker extends StatelessWidget {
125 S.current.string_default),
126 textAlign: TextAlign.left,
127 style: textSmall(
120 - color: Theme.of(context)
121 - .extension<CakeTextTheme>()!
122 - .titleColor,
128 + color: Theme.of(context).colorScheme.onSurface,
129 ).copyWith(
130 fontWeight:
131 value == option ? FontWeight.w800 : FontWeight.w500,
lib/src/screens/dashboard/widgets/sign_form.dart
+5 -3
@@ -44,7 +44,7 @@ class SignFormState extends State<SignForm> with AutomaticKeepAliveClientMixin {
44
45 @override
46 bool get wantKeepAlive => true;
47 -
47 +
48 @override
49 Widget build(BuildContext context) {
50 super.build(context);
@@ -60,7 +60,8 @@ class SignFormState extends State<SignForm> with AutomaticKeepAliveClientMixin {
60 controller: messageController,
61 placeholder: S.current.message,
62 options: [AddressTextFieldOption.paste],
63 - buttonColor: Theme.of(context).hintColor,
63 + buttonColor: Theme.of(context).colorScheme.surfaceContainerHighest,
64 + fillColor: Theme.of(context).colorScheme.surface,
65 ),
66 if (widget.includeAddress) ...[
67 const SizedBox(height: 20),
@@ -70,11 +71,12 @@ class SignFormState extends State<SignForm> with AutomaticKeepAliveClientMixin {
71 AddressTextFieldOption.paste,
72 AddressTextFieldOption.walletAddresses
73 ],
73 - buttonColor: Theme.of(context).hintColor,
74 + buttonColor: Theme.of(context).colorScheme.surfaceContainerHighest,
75 onSelectedContact: (contact) {
76 addressController.text = contact.address;
77 },
78 selectedCurrency: walletTypeToCryptoCurrency(widget.type),
79 + fillColor: Theme.of(context).colorScheme.surface,
80 ),
81 ],
82 ],
lib/src/screens/dashboard/widgets/solana_nft_tile_widget.dart
+11 -21
@@ -3,8 +3,6 @@ import 'package:cake_wallet/entities/solana_nft_asset_model.dart';
3 import 'package:cake_wallet/routes.dart';
4 import 'package:cake_wallet/src/screens/dashboard/pages/nft_details_page.dart';
5 import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
6 -import 'package:cake_wallet/themes/extensions/balance_page_theme.dart';
7 -import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart';
6
7 class SolanaNFTTileWidget extends StatelessWidget {
8 const SolanaNFTTileWidget({super.key, required this.nftAsset});
@@ -13,9 +11,6 @@ class SolanaNFTTileWidget extends StatelessWidget {
11
12 @override
13 Widget build(BuildContext context) {
16 - final balanceTheme = Theme.of(context).extension<BalancePageTheme>()!;
17 - final syncTheme = Theme.of(context).extension<SyncIndicatorTheme>()!;
18 -
14 return InkWell(
15 onTap: () {
16 Navigator.pushNamed(
@@ -34,10 +29,10 @@ class SolanaNFTTileWidget extends StatelessWidget {
29 decoration: BoxDecoration(
30 borderRadius: BorderRadius.circular(16.0),
31 border: Border.all(
37 - color: balanceTheme.cardBorderColor,
38 - width: 1,
32 + color: Theme.of(context).colorScheme.outline,
33 + width: 0.0,
34 ),
40 - color: syncTheme.syncedBackgroundColor,
35 + color: Theme.of(context).colorScheme.surfaceContainer,
36 ),
37 child: Row(
38 children: [
@@ -47,12 +42,12 @@ class SolanaNFTTileWidget extends StatelessWidget {
42 margin: const EdgeInsets.all(8),
43 clipBehavior: Clip.hardEdge,
44 decoration: BoxDecoration(
50 - borderRadius: BorderRadius.circular(16.0),
45 + borderRadius: BorderRadius.circular(24.0),
46 border: Border.all(
52 - color: balanceTheme.cardBorderColor,
53 - width: 1,
47 + color: Theme.of(context).colorScheme.outline,
48 + width: 0.0,
49 ),
55 - color: syncTheme.syncedBackgroundColor,
50 + color: Theme.of(context).colorScheme.surface,
51 ),
52 child: CakeImageWidget(
53 imageUrl: nftAsset.imageOriginalUrl,
@@ -65,11 +60,8 @@ class SolanaNFTTileWidget extends StatelessWidget {
60 children: [
61 Text(
62 'Symbol: ${nftAsset.symbol ?? '---'}',
68 - style: TextStyle(
69 - fontSize: 12,
70 - fontFamily: 'Lato',
71 - fontWeight: FontWeight.w400,
72 - color: balanceTheme.labelTextColor,
63 + style: Theme.of(context).textTheme.bodySmall?.copyWith(
64 + color: Theme.of(context).colorScheme.onSurfaceVariant,
65 height: 1,
66 ),
67 ),
@@ -78,11 +70,9 @@ class SolanaNFTTileWidget extends StatelessWidget {
70 (nftAsset.name?.isNotEmpty ?? false)
71 ? nftAsset.name!
72 : (nftAsset.symbol ?? '---'),
81 - style: TextStyle(
82 - fontSize: 20,
83 - fontFamily: 'Lato',
73 + style: Theme.of(context).textTheme.titleLarge?.copyWith(
74 fontWeight: FontWeight.w900,
85 - color: balanceTheme.assetTitleColor,
75 + color: Theme.of(context).colorScheme.onSurface,
76 height: 1,
77 ),
78 ),
lib/src/screens/dashboard/widgets/sync_indicator.dart
+56 -63
@@ -1,4 +1,3 @@
1 -import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart';
1 import 'package:flutter/material.dart';
2 import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart';
3 import 'package:cake_wallet/core/sync_status_title.dart';
@@ -18,71 +17,65 @@ class SyncIndicator extends StatelessWidget {
17
18 @override
19 Widget build(BuildContext context) {
21 - return Observer(
22 - builder: (_) {
23 - final syncIndicatorWidth = 237.0;
24 - final status = dashboardViewModel.status;
25 - final statusText = syncStatusTitle(status);
26 - final progress = status.progress();
27 - final indicatorOffset = progress * syncIndicatorWidth;
28 - final indicatorWidth = progress < 1
29 - ? indicatorOffset > 0 ? indicatorOffset : 0.0
30 - : syncIndicatorWidth;
20 + return Observer(builder: (_) {
21 + final syncIndicatorWidth = 237.0;
22 + final status = dashboardViewModel.status;
23 + final statusText = syncStatusTitle(status);
24 + final progress = status.progress();
25 + final indicatorOffset = progress * syncIndicatorWidth;
26 + final indicatorWidth = progress < 1
27 + ? indicatorOffset > 0
28 + ? indicatorOffset
29 + : 0.0
30 + : syncIndicatorWidth;
31
32 -
33 - return ClipRRect(
32 + return ClipRRect(
33 borderRadius: BorderRadius.all(Radius.circular(15)),
35 - child: GestureDetector(
34 + child: GestureDetector(
35 onTap: onTap,
37 - child: Container(
38 - height: 30,
39 - width: syncIndicatorWidth,
40 - color: Theme.of(context).extension<SyncIndicatorTheme>()!.notSyncedBackgroundColor,
41 - child: Stack(
42 - alignment: Alignment.center,
43 - children: <Widget>[
44 - progress <= 1
45 - ? Positioned(
46 - left: 0,
47 - top: 0,
48 - bottom: 0,
49 - child: Container(
50 - width: indicatorWidth,
51 - height: 30,
52 - color: Theme.of(context).extension<SyncIndicatorTheme>()!.syncedBackgroundColor,
53 - )
54 - )
55 - : Offstage(),
56 - Padding(
57 - padding: EdgeInsets.only(
58 - left: 24,
59 - right: 24
60 - ),
61 - child: Row(
62 - mainAxisSize: MainAxisSize.max,
63 - mainAxisAlignment: MainAxisAlignment.center,
64 - crossAxisAlignment: CrossAxisAlignment.center,
65 - children: <Widget>[
66 - SyncIndicatorIcon(isSynced:status is SyncedSyncStatus),
67 - Padding(
68 - padding: EdgeInsets.only(left: 6),
69 - child: Text(
70 - statusText,
71 - style: TextStyle(
72 - fontSize: 12,
73 - fontWeight: FontWeight.w500,
74 - color: Theme.of(context).extension<SyncIndicatorTheme>()!.textColor
36 + child: Container(
37 + height: 30,
38 + width: syncIndicatorWidth,
39 + color: Theme.of(context).colorScheme.surfaceContainerLow,
40 + child: Stack(
41 + alignment: Alignment.center,
42 + children: <Widget>[
43 + progress <= 1
44 + ? Positioned(
45 + left: 0,
46 + top: 0,
47 + bottom: 0,
48 + child: Container(
49 + width: indicatorWidth,
50 + height: 30,
51 + color: Theme.of(context).colorScheme.surfaceContainer,
52 + ))
53 + : Offstage(),
54 + Padding(
55 + padding: EdgeInsets.only(left: 24, right: 24),
56 + child: Row(
57 + mainAxisSize: MainAxisSize.max,
58 + mainAxisAlignment: MainAxisAlignment.center,
59 + crossAxisAlignment: CrossAxisAlignment.center,
60 + children: <Widget>[
61 + SyncIndicatorIcon(isSynced: status is SyncedSyncStatus),
62 + Padding(
63 + padding: EdgeInsets.only(left: 6),
64 + child: Text(
65 + statusText,
66 + style: Theme.of(context).textTheme.bodySmall?.copyWith(
67 + fontWeight: FontWeight.w500,
68 + color: Theme.of(context).colorScheme.onSurface,
69 + ),
70 ),
76 - ),
77 - )
78 - ],
79 - ),
80 - )
81 - ],
71 + )
72 + ],
73 + ),
74 + )
75 + ],
76 + ),
77 ),
83 - ),
84 - ));
85 - }
86 - );
78 + ));
79 + });
80 }
88 -}
\ No newline at end of file
81 +}
lib/src/screens/dashboard/widgets/sync_indicator_icon.dart
+16 -25
@@ -1,14 +1,9 @@
1 -import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart';
2 -import 'package:cake_wallet/themes/extensions/receive_page_theme.dart';
1 +import 'package:cake_wallet/themes/utils/custom_theme_colors.dart';
2 import 'package:flutter/material.dart';
4 -import 'package:cake_wallet/palette.dart';
3
4 class SyncIndicatorIcon extends StatelessWidget {
5 SyncIndicatorIcon(
8 - {this.boolMode = true,
9 - this.isSynced = false,
10 - this.value = waiting,
11 - this.size = 6.0});
6 + {this.boolMode = true, this.isSynced = false, this.value = waiting, this.size = 6.0});
7
8 final bool boolMode;
9 final bool isSynced;
@@ -29,36 +24,32 @@ class SyncIndicatorIcon extends StatelessWidget {
24
25 if (boolMode) {
26 indicatorColor = isSynced
32 - ? PaletteDark.brightGreen
33 - : Theme.of(context).extension<SyncIndicatorTheme>()!.notSyncedIconColor;
27 + ? CustomThemeColors.syncGreen
28 + : CustomThemeColors.syncYellow;
29 } else {
30 switch (value.toLowerCase()) {
36 - case waiting:
37 - indicatorColor = Colors.red;
38 - break;
31 case actionRequired:
40 - indicatorColor =
41 - Theme.of(context).extension<ReceivePageTheme>()!.currentTileBackgroundColor;
32 + indicatorColor = Theme.of(context).colorScheme.surfaceContainer;
33 break;
34 case created:
44 - indicatorColor = PaletteDark.brightGreen;
45 - break;
46 - case fetching:
47 - indicatorColor = Colors.red;
48 - break;
35 case finished:
36 case success:
37 case complete:
52 - indicatorColor = PaletteDark.brightGreen;
38 + indicatorColor = CustomThemeColors.syncGreen;
39 break;
40 + case waiting:
41 + case fetching:
42 default:
55 - indicatorColor = Colors.red;
43 + indicatorColor = Theme.of(context).colorScheme.errorContainer;
44 }
45 }
46 return Container(
59 - height: size,
60 - width: size,
61 - decoration:
62 - BoxDecoration(shape: BoxShape.circle, color: indicatorColor));
47 + height: size,
48 + width: size,
49 + decoration: BoxDecoration(
50 + shape: BoxShape.circle,
51 + color: indicatorColor,
52 + ),
53 + );
54 }
55 }
lib/src/screens/dashboard/widgets/trade_row.dart
+66 -48
@@ -1,9 +1,7 @@
1 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
1 import 'package:cake_wallet/utils/image_utill.dart';
2 import 'package:flutter/material.dart';
3 import 'package:cw_core/crypto_currency.dart';
4 import 'package:cake_wallet/exchange/exchange_provider_description.dart';
6 -import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
5
6 class TradeRow extends StatelessWidget {
7 TradeRow({
@@ -31,59 +29,79 @@ class TradeRow extends StatelessWidget {
29 final receiveAmountCrypto = to.toString();
30
31 return InkWell(
34 - onTap: onTap,
35 - child: Container(
36 - padding: EdgeInsets.fromLTRB(24, 8, 24, 8),
37 - color: Colors.transparent,
38 - child: Row(
39 - mainAxisSize: MainAxisSize.max,
40 - crossAxisAlignment: CrossAxisAlignment.center,
41 - children: [
42 - ClipRRect(
43 - borderRadius: BorderRadius.circular(50),
44 - child: ImageUtil.getImageFromPath(
45 - imagePath: provider.image, height: 36, width: 36)),
46 - SizedBox(width: 12),
47 - Expanded(
48 - child: Column(
32 + onTap: onTap,
33 + child: Container(
34 + padding: EdgeInsets.fromLTRB(24, 8, 24, 8),
35 + color: Colors.transparent,
36 + child: Row(
37 + mainAxisSize: MainAxisSize.max,
38 + crossAxisAlignment: CrossAxisAlignment.center,
39 + children: [
40 + ClipRRect(
41 + borderRadius: BorderRadius.circular(50),
42 + child: ImageUtil.getImageFromPath(
43 + imagePath: provider.image,
44 + height: 36,
45 + width: 36,
46 + ),
47 + ),
48 + SizedBox(width: 12),
49 + Expanded(
50 + child: Column(
51 mainAxisSize: MainAxisSize.min,
52 children: [
51 - Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: <Widget>[
52 - Text('${from.toString()} → ${to.toString()}',
53 - style: TextStyle(
53 + Row(
54 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
55 + children: <Widget>[
56 + Text(
57 + '${from.toString()} → ${to.toString()}',
58 + style: Theme.of(context).textTheme.bodyLarge?.copyWith(
59 fontSize: 16,
55 - fontWeight: FontWeight.w500,
56 - color: Theme.of(context).extension<DashboardPageTheme>()!.textColor)),
57 - formattedAmount != null
58 - ? Text(formattedAmount! + ' ' + amountCrypto,
59 - style: TextStyle(
60 - fontSize: 16,
61 - fontWeight: FontWeight.w500,
62 - color:
63 - Theme.of(context).extension<DashboardPageTheme>()!.textColor))
64 - : Container()
65 - ]),
60 + fontWeight: FontWeight.w600,
61 + color: Theme.of(context).colorScheme.primary),
62 + ),
63 + formattedAmount != null
64 + ? Text(
65 + formattedAmount! + ' ' + amountCrypto,
66 + style: Theme.of(context).textTheme.bodyLarge?.copyWith(
67 + fontSize: 16,
68 + fontWeight: FontWeight.w500,
69 + color: Theme.of(context).colorScheme.onSurface,
70 + ),
71 + )
72 + : Container()
73 + ],
74 + ),
75 SizedBox(height: 5),
76 Row(
68 - mainAxisAlignment: MainAxisAlignment.spaceBetween,
69 - children: <Widget>[
70 - createdAtFormattedDate != null
71 - ? Text(createdAtFormattedDate!,
72 - style: TextStyle(
73 - fontSize: 14,
74 - color: Theme.of(context).extension<CakeTextTheme>()!.dateSectionRowColor))
77 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
78 + children: <Widget>[
79 + createdAtFormattedDate != null
80 + ? Text(
81 + createdAtFormattedDate!,
82 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
83 + fontWeight: FontWeight.w500,
84 + color: Theme.of(context).colorScheme.onSurfaceVariant,
85 + ),
86 + )
87 : Container(),
76 - formattedReceiveAmount != null
77 - ? Text(formattedReceiveAmount! + ' ' + receiveAmountCrypto,
78 - style: TextStyle(
79 - fontSize: 14,
80 - color: Theme.of(context).extension<CakeTextTheme>()!.dateSectionRowColor))
88 + formattedReceiveAmount != null
89 + ? Text(
90 + formattedReceiveAmount! + ' ' + receiveAmountCrypto,
91 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
92 + fontWeight: FontWeight.w500,
93 + color: Theme.of(context).colorScheme.onSurfaceVariant,
94 + ),
95 + )
96 : Container(),
82 - ])
97 + ],
98 + )
99 ],
84 - ))
85 - ],
86 - ),
87 - ));
100 + ),
101 + )
102 + ],
103 + ),
104 + ),
105 + );
106 }
107 }
lib/src/screens/dashboard/widgets/transaction_raw.dart
+33 -35
@@ -1,8 +1,5 @@
1 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
1 import 'package:flutter/material.dart';
2 import 'package:cw_core/transaction_direction.dart';
4 -import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
5 -import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart';
3
4 class TransactionRow extends StatelessWidget {
5 TransactionRow({
@@ -39,8 +36,9 @@ class TransactionRow extends StatelessWidget {
36 height: 36,
37 width: 36,
38 decoration: BoxDecoration(
42 - shape: BoxShape.circle,
43 - color: Theme.of(context).extension<TransactionTradeTheme>()!.rowsColor),
39 + shape: BoxShape.circle,
40 + color: Theme.of(context).colorScheme.surfaceContainerHighest,
41 + ),
42 child: Image.asset(direction == TransactionDirection.incoming
43 ? 'assets/images/down_arrow.png'
44 : 'assets/images/up_arrow.png'),
@@ -57,20 +55,19 @@ class TransactionRow extends StatelessWidget {
55 children: [
56 Text(
57 title,
60 - style: TextStyle(
61 - fontSize: 16,
62 - fontWeight: FontWeight.w500,
63 - color: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
64 - )),
65 - ...tags.map((tag) => Row(children: [SizedBox(width: 8), TxTag(tag: tag)])),
66 - ],
67 - ),
68 - Text(formattedAmount,
69 - style: TextStyle(
70 - fontSize: 16,
71 - fontWeight: FontWeight.w500,
72 - color: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
73 - ),
58 + style: Theme.of(context).textTheme.bodyLarge?.copyWith(
59 + fontWeight: FontWeight.w600,
60 + ),
61 + ),
62 + ...tags
63 + .map((tag) => Row(children: [SizedBox(width: 8), TxTag(tag: tag)])),
64 + ],
65 + ),
66 + Text(
67 + formattedAmount,
68 + style: Theme.of(context).textTheme.bodyLarge?.copyWith(
69 + fontWeight: FontWeight.w600,
70 + ),
71 )
72 ],
73 ),
@@ -78,18 +75,19 @@ class TransactionRow extends StatelessWidget {
75 Row(
76 mainAxisAlignment: MainAxisAlignment.spaceBetween,
77 children: <Widget>[
81 - Text(formattedDate,
82 - style: TextStyle(
83 - fontSize: 14,
84 - color: Theme.of(context)
85 - .extension<CakeTextTheme>()!
86 - .dateSectionRowColor)),
78 + Text(
79 + formattedDate,
80 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
81 + fontWeight: FontWeight.w500,
82 + color: Theme.of(context).colorScheme.onSurfaceVariant,
83 + ),
84 + ),
85 Text(
86 formattedFiatAmount,
89 - style: TextStyle(
90 - fontSize: 14,
91 - color: Theme.of(context).extension<CakeTextTheme>()!.dateSectionRowColor,
92 - ),
87 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
88 + fontWeight: FontWeight.w500,
89 + color: Theme.of(context).colorScheme.onSurfaceVariant,
90 + ),
91 )
92 ],
93 ),
@@ -117,16 +115,16 @@ class TxTag extends StatelessWidget {
115 padding: EdgeInsets.only(left: 6, right: 6),
116 decoration: BoxDecoration(
117 borderRadius: BorderRadius.all(Radius.circular(8.5)),
120 - color: Theme.of(context).extension<TransactionTradeTheme>()!.rowsColor,
118 + color: Theme.of(context).colorScheme.surfaceContainerHighest,
119 ),
120 alignment: Alignment.center,
121 child: Text(
122 tag.toLowerCase(),
125 - style: TextStyle(
126 - color: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
127 - fontSize: 9,
128 - fontWeight: FontWeight.w600,
129 - ),
123 + style: Theme.of(context).textTheme.bodySmall?.copyWith(
124 + color: Theme.of(context).colorScheme.onSurfaceVariant,
125 + fontSize: 9,
126 + fontWeight: FontWeight.w600,
127 + ),
128 ),
129 );
130 }
lib/src/screens/dashboard/widgets/verify_form.dart
+7 -4
@@ -36,7 +36,7 @@ class VerifyFormState extends State<VerifyForm> with AutomaticKeepAliveClientMix
36 void dispose() {
37 super.dispose();
38 }
39 -
39 +
40 @override
41 bool get wantKeepAlive => true;
42
@@ -53,13 +53,15 @@ class VerifyFormState extends State<VerifyForm> with AutomaticKeepAliveClientMix
53 controller: messageController,
54 placeholder: S.current.message,
55 options: [AddressTextFieldOption.paste],
56 - buttonColor: Theme.of(context).hintColor,
56 + buttonColor: Theme.of(context).colorScheme.surfaceContainerHighest,
57 + fillColor: Theme.of(context).colorScheme.surface,
58 ),
59 const SizedBox(height: 20),
60 AddressTextField(
61 controller: addressController,
62 options: [AddressTextFieldOption.paste, AddressTextFieldOption.walletAddresses],
62 - buttonColor: Theme.of(context).hintColor,
63 + buttonColor: Theme.of(context).colorScheme.surfaceContainerHighest,
64 + fillColor: Theme.of(context).colorScheme.surface,
65 onSelectedContact: (contact) {
66 addressController.text = contact.address;
67 },
@@ -70,7 +72,8 @@ class VerifyFormState extends State<VerifyForm> with AutomaticKeepAliveClientMix
72 controller: signatureController,
73 placeholder: S.current.signature,
74 options: [AddressTextFieldOption.paste],
73 - buttonColor: Theme.of(context).hintColor,
75 + buttonColor: Theme.of(context).colorScheme.surfaceContainerHighest,
76 + fillColor: Theme.of(context).colorScheme.surface,
77 ),
78 ],
79 ),
lib/src/screens/dev/background_sync_logs_page.dart
+32 -34
@@ -84,7 +84,7 @@ class DevBackgroundSyncLogsPage extends BasePage {
84 }
85
86 final dateFormat = DateFormat('yyyy-MM-dd HH:mm:ss.SSS');
87 -
87 +
88 return ListView.builder(
89 itemCount: logs.length,
90 itemBuilder: (context, index) {
@@ -92,18 +92,16 @@ class DevBackgroundSyncLogsPage extends BasePage {
92 return ListTile(
93 title: Text(
94 log.message,
95 - style: TextStyle(
96 - fontSize: 14,
97 - fontFamily: 'Monospace',
98 - ),
95 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
96 + fontFamily: 'Monospace',
97 + ),
98 ),
99 subtitle: Text(
100 '${dateFormat.format(log.timestamp)} | ${log.level}' +
101 (log.sessionId != null ? ' | Session: ${log.sessionId}' : ''),
103 - style: TextStyle(
104 - fontSize: 12,
105 - color: _getLevelColor(log.level),
106 - ),
102 + style: Theme.of(context).textTheme.bodySmall!.copyWith(
103 + color: _getLevelColor(log.level),
104 + ),
105 ),
106 dense: true,
107 onTap: () {
@@ -132,24 +130,24 @@ class DevBackgroundSyncLogsPage extends BasePage {
130 }
131
132 final dateFormat = DateFormat('yyyy-MM-dd HH:mm:ss');
135 -
133 +
134 return ListView.builder(
135 itemCount: sessions.length,
136 itemBuilder: (context, index) {
137 final session = sessions[index];
138 final isActive = session.endTime == null;
141 -
139 +
140 return ExpansionTile(
141 title: Text(
142 session.name,
145 - style: TextStyle(
146 - fontWeight: FontWeight.bold,
147 - color: isActive ? Colors.green : null,
148 - ),
143 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
144 + fontWeight: FontWeight.bold,
145 + color: isActive ? Colors.green : null,
146 + ),
147 ),
148 subtitle: Text(
149 'ID: ${session.id} | Started: ${dateFormat.format(session.startTime)}',
152 - style: TextStyle(fontSize: 12),
150 + style: Theme.of(context).textTheme.bodySmall!,
151 ),
152 children: [
153 Padding(
@@ -158,8 +156,7 @@ class DevBackgroundSyncLogsPage extends BasePage {
156 crossAxisAlignment: CrossAxisAlignment.start,
157 children: [
158 Text('Start: ${session.startTime.toString()}'),
161 - if (session.endTime != null)
162 - Text('End: ${session.endTime.toString()}'),
159 + if (session.endTime != null) Text('End: ${session.endTime.toString()}'),
160 if (session.duration != null)
161 Text('Duration: ${_formatDuration(session.duration!)}'),
162 SizedBox(height: 8),
@@ -174,19 +171,21 @@ class DevBackgroundSyncLogsPage extends BasePage {
171 }
172
173 Widget _buildSessionLogs(BuildContext context, int sessionId) {
177 - final sessionLogs = viewModel.logs
178 - .where((log) => log.sessionId == sessionId)
179 - .toList();
180 -
174 + final sessionLogs = viewModel.logs.where((log) => log.sessionId == sessionId).toList();
175 +
176 if (sessionLogs.isEmpty) {
177 return Text('No logs for this session');
178 }
184 -
179 +
180 return Column(
181 crossAxisAlignment: CrossAxisAlignment.start,
182 children: [
188 - Text('Session Logs (${sessionLogs.length}):',
189 - style: TextStyle(fontWeight: FontWeight.bold)),
183 + Text(
184 + 'Session Logs (${sessionLogs.length}):',
185 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
186 + fontWeight: FontWeight.bold,
187 + ),
188 + ),
189 SizedBox(height: 8),
190 Container(
191 height: 200,
@@ -202,11 +201,10 @@ class DevBackgroundSyncLogsPage extends BasePage {
201 padding: const EdgeInsets.symmetric(horizontal: 8.0, vertical: 4.0),
202 child: Text(
203 '[${log.level}] ${log.message}',
205 - style: TextStyle(
206 - fontSize: 12,
207 - fontFamily: 'Monospace',
208 - color: _getLevelColor(log.level),
209 - ),
204 + style: Theme.of(context).textTheme.bodySmall!.copyWith(
205 + fontFamily: 'Monospace',
206 + color: _getLevelColor(log.level),
207 + ),
208 ),
209 );
210 },
@@ -248,14 +246,14 @@ class DevBackgroundSyncLogsPage extends BasePage {
246
247 void _copyAllLogs(BuildContext context) {
248 if (viewModel.logData == null) return;
251 -
249 +
250 final buffer = StringBuffer();
251 final dateFormat = DateFormat('yyyy-MM-dd HH:mm:ss.SSS');
254 -
252 +
253 for (final log in viewModel.logs) {
254 buffer.writeln('${dateFormat.format(log.timestamp)} [${log.level}] ${log.message}');
255 }
258 -
256 +
257 Clipboard.setData(ClipboardData(text: buffer.toString()));
258 ScaffoldMessenger.of(context).showSnackBar(
259 SnackBar(content: Text('All logs copied to clipboard')),
@@ -311,4 +309,4 @@ class DevBackgroundSyncLogsPage extends BasePage {
309 String twoDigitSeconds = twoDigits(duration.inSeconds.remainder(60));
310 return '${twoDigits(duration.inHours)}:$twoDigitMinutes:$twoDigitSeconds';
311 }
314 -}
\ No newline at end of file
312 +}
lib/src/screens/dev/monero_background_sync.dart
+33 -27
@@ -12,7 +12,7 @@ class DevMoneroBackgroundSyncPage extends BasePage {
12 @override
13 String? get title => "[dev] xmr background sync";
14
15 - Widget _buildSingleCell(String title, String value) {
15 + Widget _buildSingleCell(String title, String value, BuildContext context) {
16 return Container(
17 decoration: BoxDecoration(
18 border: Border.all(color: Colors.grey),
@@ -22,7 +22,12 @@ class DevMoneroBackgroundSyncPage extends BasePage {
22 child: Column(
23 mainAxisAlignment: MainAxisAlignment.center,
24 children: [
25 - Text(title, style: TextStyle(fontWeight: FontWeight.bold)),
25 + Text(
26 + title,
27 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
28 + fontWeight: FontWeight.bold,
29 + ),
30 + ),
31 Text(value, maxLines: 1, overflow: TextOverflow.ellipsis),
32 ],
33 ),
@@ -36,59 +41,60 @@ class DevMoneroBackgroundSyncPage extends BasePage {
41 return GridView.count(
42 padding: const EdgeInsets.all(16),
43 crossAxisCount: 2,
39 - childAspectRatio: 25/9,
44 + childAspectRatio: 25 / 9,
45 crossAxisSpacing: 16,
46 mainAxisSpacing: 16,
47 children: [
43 - _buildSingleCell('Height (local)', viewModel.localBlockHeight ?? ''),
44 - _buildSingleCell('Height (node)', viewModel.nodeBlockHeight ?? ''),
45 - _buildSingleCell('Time', viewModel.tick.toString()),
46 - _buildSingleCell('Background Sync', viewModel.isBackgroundSyncing ? 'Enabled' : 'Disabled'),
47 - _buildSingleCell('Public View Key', viewModel.publicViewKey ?? ''),
48 - _buildSingleCell('Private View Key', viewModel.privateViewKey ?? ''),
49 - _buildSingleCell('Public Spend Key', viewModel.publicSpendKey ?? ''),
50 - _buildSingleCell('Private Spend Key', viewModel.privateSpendKey ?? ''),
51 - _buildSingleCell('Primary Address', viewModel.primaryAddress ?? ''),
52 - _buildSingleCell('Passphrase', viewModel.passphrase ?? ''),
53 - _buildSingleCell('Seed', viewModel.seed ?? ''),
54 - _buildSingleCell('Seed Legacy', viewModel.seedLegacy ?? ''),
55 - _enableBackgroundSyncButton(),
56 - _disableBackgroundSyncButton(),
57 - _refreshButton(),
58 - _manualRescanButton(),
48 + _buildSingleCell('Height (local)', viewModel.localBlockHeight ?? '', context),
49 + _buildSingleCell('Height (node)', viewModel.nodeBlockHeight ?? '', context),
50 + _buildSingleCell('Time', viewModel.tick.toString(), context),
51 + _buildSingleCell(
52 + 'Background Sync', viewModel.isBackgroundSyncing ? 'Enabled' : 'Disabled', context),
53 + _buildSingleCell('Public View Key', viewModel.publicViewKey ?? '', context),
54 + _buildSingleCell('Private View Key', viewModel.privateViewKey ?? '', context),
55 + _buildSingleCell('Public Spend Key', viewModel.publicSpendKey ?? '', context),
56 + _buildSingleCell('Private Spend Key', viewModel.privateSpendKey ?? '', context),
57 + _buildSingleCell('Primary Address', viewModel.primaryAddress ?? '', context),
58 + _buildSingleCell('Passphrase', viewModel.passphrase ?? '', context),
59 + _buildSingleCell('Seed', viewModel.seed ?? '', context),
60 + _buildSingleCell('Seed Legacy', viewModel.seedLegacy ?? '', context),
61 + _enableBackgroundSyncButton(context),
62 + _disableBackgroundSyncButton(context),
63 + _refreshButton(context),
64 + _manualRescanButton(context),
65 ],
66 );
67 },
68 );
69 }
70
65 - PrimaryButton _enableBackgroundSyncButton() {
71 + PrimaryButton _enableBackgroundSyncButton(BuildContext context) {
72 return PrimaryButton(
73 text: "Enable background sync",
74 color: Colors.purple,
69 - textColor: Colors.white,
75 + textColor: Theme.of(context).colorScheme.onPrimary,
76 onPressed: () {
77 viewModel.startBackgroundSync();
78 },
79 );
80 }
81
76 - PrimaryButton _disableBackgroundSyncButton() {
82 + PrimaryButton _disableBackgroundSyncButton(BuildContext context) {
83 return PrimaryButton(
84 text: "Disable background sync",
85 color: Colors.purple,
80 - textColor: Colors.white,
86 + textColor: Theme.of(context).colorScheme.onPrimary,
87 onPressed: () {
88 viewModel.stopBackgroundSync();
89 },
90 );
91 }
92
87 - PrimaryButton _refreshButton() {
93 + PrimaryButton _refreshButton(BuildContext context) {
94 return PrimaryButton(
95 text: viewModel.refreshTimer == null ? "Enable refresh" : "Disable refresh",
96 color: Colors.purple,
91 - textColor: Colors.white,
97 + textColor: Theme.of(context).colorScheme.onPrimary,
98 onPressed: () {
99 if (viewModel.refreshTimer == null) {
100 viewModel.startRefreshTimer();
@@ -99,11 +105,11 @@ class DevMoneroBackgroundSyncPage extends BasePage {
105 );
106 }
107
102 - PrimaryButton _manualRescanButton() {
108 + PrimaryButton _manualRescanButton(BuildContext context) {
109 return PrimaryButton(
110 text: "Manual rescan",
111 color: Colors.purple,
106 - textColor: Colors.white,
112 + textColor: Theme.of(context).colorScheme.onPrimary,
113 onPressed: () {
114 viewModel.manualRescan();
115 },
lib/src/screens/dev/moneroc_call_profiler.dart
+2 -2
@@ -123,7 +123,7 @@ max: slowest execution (% of frame)
123 SelectableText cw(String text, Color? color) {
124 return SelectableText(
125 text,
126 - style: TextStyle(color: color),
126 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(color: color),
127 );
128 }
129
@@ -160,7 +160,7 @@ max: slowest execution (% of frame)
160 child: ListTile(
161 title: Text(
162 key,
163 - style: TextStyle(color: perfc(np)),
163 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(color: perfc(np)),
164 ),
165 subtitle: Column(
166 mainAxisSize: MainAxisSize.min,
lib/src/screens/dev/secure_preferences_page.dart
+4 -4
@@ -38,10 +38,10 @@ class DevSecurePreferencesPage extends BasePage {
38 Clipboard.setData(ClipboardData(text: key + ": " + values[key].toString()));
39 },
40 title: switch (type) {
41 - PreferenceType.bool => Text(key, style: TextStyle(color: Colors.blue)),
42 - PreferenceType.int => Text(key, style: TextStyle(color: Colors.green)),
43 - PreferenceType.double => Text(key, style: TextStyle(color: Colors.yellow)),
44 - PreferenceType.listString => Text(key, style: TextStyle(color: Colors.purple)),
41 + PreferenceType.bool => Text(key, style: Theme.of(context).textTheme.bodyMedium!.copyWith(color: Colors.blue)),
42 + PreferenceType.int => Text(key, style: Theme.of(context).textTheme.bodyMedium!.copyWith(color: Colors.green)),
43 + PreferenceType.double => Text(key, style: Theme.of(context).textTheme.bodyMedium!.copyWith(color: Colors.yellow)),
44 + PreferenceType.listString => Text(key, style: Theme.of(context).textTheme.bodyMedium!.copyWith(color: Colors.purple)),
45 PreferenceType.string => Text(key),
46 PreferenceType.unknown => Text(key),
47 },
lib/src/screens/dev/shared_preferences_page.dart
+13 -12
@@ -1,4 +1,5 @@
1 import 'package:cake_wallet/src/screens/base_page.dart';
2 +import 'package:cake_wallet/src/widgets/base_text_form_field.dart';
3 import 'package:cake_wallet/view_model/dev/shared_preferences.dart';
4 import 'package:flutter/material.dart';
5 import 'package:flutter/services.dart';
@@ -49,10 +50,10 @@ class DevSharedPreferencesPage extends BasePage {
50 _showEditDialog(context, key, type, values[key]);
51 },
52 title: switch (type) {
52 - PreferenceType.bool => Text(key, style: TextStyle(color: Colors.blue)),
53 - PreferenceType.int => Text(key, style: TextStyle(color: Colors.green)),
54 - PreferenceType.double => Text(key, style: TextStyle(color: Colors.yellow)),
55 - PreferenceType.listString => Text(key, style: TextStyle(color: Colors.purple)),
53 + PreferenceType.bool => Text(key, style: Theme.of(context).textTheme.bodyMedium!.copyWith(color: Colors.blue)),
54 + PreferenceType.int => Text(key, style: Theme.of(context).textTheme.bodyMedium!.copyWith(color: Colors.green)),
55 + PreferenceType.double => Text(key, style: Theme.of(context).textTheme.bodyMedium!.copyWith(color: Colors.yellow)),
56 + PreferenceType.listString => Text(key, style: Theme.of(context).textTheme.bodyMedium!.copyWith(color: Colors.purple)),
57 PreferenceType.string => Text(key),
58 PreferenceType.unknown => Text(key),
59 },
@@ -193,9 +194,9 @@ class DevSharedPreferencesPage extends BasePage {
194 return Column(
195 mainAxisSize: MainAxisSize.min,
196 children: [
196 - TextField(
197 + BaseTextFormField(
198 controller: controller,
198 - decoration: InputDecoration(labelText: 'String value'),
199 + hintText: 'String value',
200 maxLines: null,
201 ),
202 ],
@@ -206,9 +207,9 @@ class DevSharedPreferencesPage extends BasePage {
207 return Column(
208 mainAxisSize: MainAxisSize.min,
209 children: [
209 - TextField(
210 + BaseTextFormField(
211 controller: controller,
211 - decoration: InputDecoration(labelText: label),
212 + hintText: label,
213 keyboardType: isInteger
214 ? TextInputType.number
215 : TextInputType.numberWithOptions(decimal: true),
@@ -261,9 +262,9 @@ class DevSharedPreferencesPage extends BasePage {
262 Row(
263 children: [
264 Expanded(
264 - child: TextField(
265 + child: BaseTextFormField(
266 controller: controller,
266 - decoration: InputDecoration(labelText: 'New item'),
267 + hintText: 'New item',
268 ),
269 ),
270 IconButton(
@@ -344,9 +345,9 @@ class DevSharedPreferencesPage extends BasePage {
345 child: Column(
346 mainAxisSize: MainAxisSize.min,
347 children: [
347 - TextField(
348 + BaseTextFormField(
349 controller: keyController,
349 - decoration: InputDecoration(labelText: 'Preference Key'),
350 + hintText: 'Preference Key',
351 ),
352 SizedBox(height: 16),
353 DropdownButtonFormField<PreferenceType>(
lib/src/screens/disclaimer/disclaimer_page.dart
+26 -51
@@ -1,17 +1,9 @@
1 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
1 import 'dart:ui';
3 -import 'package:cake_wallet/palette.dart';
2 import 'package:cake_wallet/routes.dart';
5 -import 'package:cake_wallet/themes/extensions/wallet_list_theme.dart';
6 -import 'package:cake_wallet/utils/show_pop_up.dart';
3 import 'package:flutter/material.dart';
8 -import 'package:flutter/cupertino.dart';
4 import 'package:flutter/services.dart';
10 -import 'package:url_launcher/url_launcher.dart';
5 import 'package:cake_wallet/src/screens/base_page.dart';
6 import 'package:cake_wallet/src/widgets/primary_button.dart';
13 -import 'package:cake_wallet/src/widgets/alert_with_one_action.dart';
14 -import 'package:cake_wallet/generated/i18n.dart';
7 import 'package:cake_wallet/wallet_type_utils.dart';
8
9 class DisclaimerPage extends BasePage {
@@ -23,12 +15,10 @@ class DisclaimerPage extends BasePage {
15 String get title => 'Terms of Use';
16
17 @override
26 - Widget? leading(BuildContext context) =>
27 - isReadOnly ? super.leading(context) : null;
18 + Widget? leading(BuildContext context) => isReadOnly ? super.leading(context) : null;
19
20 @override
30 - Widget body(BuildContext context) =>
31 - DisclaimerPageBody(isReadOnly: isReadOnly);
21 + Widget body(BuildContext context) => DisclaimerPageBody(isReadOnly: isReadOnly);
22 }
23
24 class DisclaimerPageBody extends StatefulWidget {
@@ -41,15 +31,12 @@ class DisclaimerPageBody extends StatefulWidget {
31 }
32
33 class DisclaimerBodyState extends State<DisclaimerPageBody> {
44 -
34 bool _checked = false;
35 String _fileText = '';
36
48 - Future getFileLines() async {
37 + Future<void> getFileLines() async {
38 _fileText = await rootBundle.loadString(
50 - isMoneroOnly
51 - ? 'assets/text/Monerocom_Terms_of_Use.txt'
52 - : 'assets/text/Terms_of_Use.txt' );
39 + isMoneroOnly ? 'assets/text/Monerocom_Terms_of_Use.txt' : 'assets/text/Terms_of_Use.txt');
40 setState(() {});
41 }
42
@@ -64,7 +51,7 @@ class DisclaimerBodyState extends State<DisclaimerPageBody> {
51 return WillPopScope(
52 onWillPop: () async => widget.isReadOnly,
53 child: Container(
67 - color: Theme.of(context).colorScheme.background,
54 + color: Theme.of(context).colorScheme.surface,
55 child: Column(
56 children: <Widget>[
57 SizedBox(height: 10.0),
@@ -81,10 +68,10 @@ class DisclaimerBodyState extends State<DisclaimerPageBody> {
68 child: Text(
69 'Terms and conditions',
70 textAlign: TextAlign.center,
84 - style: TextStyle(
71 + style: Theme.of(context).textTheme.titleLarge?.copyWith(
72 fontSize: 20.0,
73 fontWeight: FontWeight.bold,
87 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor),
74 + color: Theme.of(context).colorScheme.onSurface),
75 ),
76 )
77 ],
@@ -98,10 +85,9 @@ class DisclaimerBodyState extends State<DisclaimerPageBody> {
85 child: Text(
86 'Legal Disclaimer\nAnd\nTerms of Use',
87 textAlign: TextAlign.center,
101 - style: TextStyle(
102 - fontSize: 12.0,
103 - fontWeight: FontWeight.bold,
104 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor),
88 + style: Theme.of(context).textTheme.bodySmall?.copyWith(
89 + fontWeight: FontWeight.bold,
90 + ),
91 ),
92 )
93 ],
@@ -114,10 +100,7 @@ class DisclaimerBodyState extends State<DisclaimerPageBody> {
100 Expanded(
101 child: Text(
102 _fileText,
117 - style: TextStyle(
118 - fontSize: 12.0,
119 - fontWeight: FontWeight.normal,
120 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor),
103 + style: Theme.of(context).textTheme.bodySmall,
104 ))
105 ],
106 ),
@@ -138,11 +121,8 @@ class DisclaimerBodyState extends State<DisclaimerPageBody> {
121 decoration: BoxDecoration(
122 gradient: LinearGradient(
123 colors: [
141 - Theme.of(context)
142 - .colorScheme
143 - .background
144 - .withOpacity(0.0),
145 - Theme.of(context).colorScheme.background,
124 + Theme.of(context).colorScheme.surface.withOpacity(0.0),
125 + Theme.of(context).colorScheme.surface,
126 ],
127 begin: FractionalOffset.topCenter,
128 end: FractionalOffset.bottomCenter,
@@ -160,8 +140,8 @@ class DisclaimerBodyState extends State<DisclaimerPageBody> {
140 children: <Widget>[
141 Expanded(
142 child: Container(
163 - padding: EdgeInsets.only(
164 - left: 24.0, top: 10.0, right: 24.0, bottom: 10.0),
143 + padding:
144 + EdgeInsets.only(left: 24.0, top: 10.0, right: 24.0, bottom: 10.0),
145 child: InkWell(
146 key: ValueKey('disclaimer_check_key'),
147 onTap: () {
@@ -180,26 +160,23 @@ class DisclaimerBodyState extends State<DisclaimerPageBody> {
160 ),
161 decoration: BoxDecoration(
162 border: Border.all(
183 - color: Theme.of(context).extension<CakeTextTheme>()!.secondaryTextColor,
184 - width: 1.0),
185 - borderRadius: BorderRadius.all(
186 - Radius.circular(8.0)),
187 - color: Theme.of(context).colorScheme.background),
163 + color: Theme.of(context).colorScheme.outline, width: 1.0),
164 + borderRadius: BorderRadius.all(Radius.circular(8.0)),
165 + color: Theme.of(context).colorScheme.surface),
166 child: _checked
167 ? Icon(
168 key: ValueKey('disclaimer_check_icon_key'),
169 Icons.check,
192 - color: Colors.blue,
170 + color: Theme.of(context).colorScheme.primary,
171 size: 20.0,
172 )
173 : null,
174 ),
175 Text(
176 'I agree to Terms of Use',
199 - style: TextStyle(
200 - fontWeight: FontWeight.bold,
201 - fontSize: 14.0,
202 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor),
177 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
178 + fontWeight: FontWeight.bold,
179 + ),
180 )
181 ],
182 ),
@@ -208,17 +185,15 @@ class DisclaimerBodyState extends State<DisclaimerPageBody> {
185 ],
186 ),
187 Container(
211 - padding:
212 - EdgeInsets.only(left: 24.0, right: 24.0, bottom: 24.0),
188 + padding: EdgeInsets.only(left: 24.0, right: 24.0, bottom: 24.0),
189 child: PrimaryButton(
190 key: ValueKey('disclaimer_accept_button_key'),
191 onPressed: _checked
216 - ? () => Navigator.of(context)
217 - .popAndPushNamed(Routes.welcome)
192 + ? () => Navigator.of(context).popAndPushNamed(Routes.welcome)
193 : null,
194 text: 'Accept',
220 - color: Theme.of(context).extension<WalletListTheme>()!.createNewWalletButtonBackgroundColor,
221 - textColor: Theme.of(context).extension<WalletListTheme>()!.restoreWalletButtonTextColor),
195 + color: Theme.of(context).colorScheme.primary,
196 + textColor: Theme.of(context).colorScheme.onPrimary),
197 ),
198 ],
199 ],
lib/src/screens/exchange/exchange_page.dart
+263 -250
@@ -1,15 +1,12 @@
1 import 'package:cake_wallet/exchange/exchange_provider_description.dart';
2 import 'package:cake_wallet/exchange/provider/chainflip_exchange_provider.dart';
3 import 'package:cake_wallet/exchange/provider/thorchain_exchange.provider.dart';
4 -import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart';
5 -import 'package:cake_wallet/themes/extensions/keyboard_theme.dart';
4 import 'package:cake_wallet/core/auth_service.dart';
5 import 'package:cake_wallet/di.dart';
6 import 'package:cake_wallet/src/screens/exchange/widgets/desktop_exchange_cards_section.dart';
7 import 'package:cake_wallet/src/screens/exchange/widgets/mobile_exchange_cards_section.dart';
8 import 'package:cake_wallet/src/widgets/add_template_button.dart';
11 -import 'package:cake_wallet/themes/extensions/send_page_theme.dart';
12 -import 'package:cake_wallet/themes/theme_base.dart';
9 +import 'package:cake_wallet/themes/core/material_base_theme.dart';
10 import 'package:cake_wallet/utils/debounce.dart';
11 import 'package:cake_wallet/utils/payment_request.dart';
12 import 'package:cake_wallet/utils/responsive_layout_util.dart';
@@ -107,32 +104,34 @@ class ExchangePage extends BasePage {
104 mainAxisAlignment: MainAxisAlignment.center,
105 children: [
106 Padding(
110 - padding: const EdgeInsets.only(right: 6.0),
111 - child: Observer(
112 - builder: (_) =>
113 - SyncIndicatorIcon(isSynced: exchangeViewModel.status is SyncedSyncStatus),
114 - )),
107 + padding: const EdgeInsets.only(right: 6.0),
108 + child: Observer(
109 + builder: (_) =>
110 + SyncIndicatorIcon(isSynced: exchangeViewModel.status is SyncedSyncStatus),
111 + ),
112 + ),
113 PresentProviderPicker(exchangeViewModel: exchangeViewModel)
114 ],
115 );
116
117 @override
118 Widget trailing(BuildContext context) => TrailButton(
121 - caption: S.of(context).reset,
122 - onPressed: () {
123 - _formKey.currentState?.reset();
124 - exchangeViewModel.reset();
125 - });
119 + caption: S.of(context).reset,
120 + onPressed: () {
121 + _formKey.currentState?.reset();
122 + exchangeViewModel.reset();
123 + },
124 + );
125
126 @override
127 Widget? leading(BuildContext context) {
128 final _backButton = Icon(
129 Icons.arrow_back_ios,
131 - color: titleColor(context),
130 + color: Theme.of(context).colorScheme.primary,
131 size: 16,
132 );
133 final _closeButton =
135 - currentTheme.type == ThemeType.dark ? closeButtonImageDarkTheme : closeButtonImage;
134 + currentTheme.isDark ? closeButtonImageDarkTheme : closeButtonImage;
135
136 bool isMobileView = responsiveLayoutUtil.shouldRenderMobileUI;
137
@@ -146,7 +145,7 @@ class ExchangePage extends BasePage {
145 label: !isMobileView ? S.of(context).close : S.of(context).seed_alert_back,
146 child: TextButton(
147 style: ButtonStyle(
149 - overlayColor: MaterialStateColor.resolveWith((states) => Colors.transparent),
148 + overlayColor: WidgetStateColor.resolveWith((states) => Colors.transparent),
149 ),
150 onPressed: () => onClose(context),
151 child: !isMobileView ? _closeButton : _backButton,
@@ -162,55 +161,59 @@ class ExchangePage extends BasePage {
161 WidgetsBinding.instance.addPostFrameCallback((_) => _setReactions(context, exchangeViewModel));
162
163 return KeyboardActions(
165 - disableScroll: true,
166 - config: KeyboardActionsConfig(
167 - keyboardActionsPlatform: KeyboardActionsPlatform.IOS,
168 - keyboardBarColor: Theme.of(context).extension<KeyboardTheme>()!.keyboardBarColor,
169 - nextFocus: false,
170 - actions: [
171 - KeyboardActionsItem(
172 - focusNode: _depositAmountFocus, toolbarButtons: [(_) => KeyboardDoneButton()]),
173 - KeyboardActionsItem(
174 - focusNode: _receiveAmountFocus, toolbarButtons: [(_) => KeyboardDoneButton()])
175 - ]),
176 - child: Container(
177 - color: Theme.of(context).colorScheme.background,
178 - child: Form(
179 - key: _formKey,
180 - child: ScrollableWithBottomSection(
181 - contentPadding: EdgeInsets.only(bottom: 24),
182 - content: Observer(
183 - builder: (_) => Column(
184 - children: <Widget>[
185 - _exchangeCardsSection(context),
186 - Padding(
187 - padding: EdgeInsets.only(top: 12, left: 24),
188 - child: Row(
189 - mainAxisAlignment: MainAxisAlignment.start,
190 - children: [
191 - StandardCheckbox(
192 - value: exchangeViewModel.isFixedRateMode,
193 - caption: S.of(context).fixed_rate,
194 - onChanged: (value) {
195 - if (value) {
196 - exchangeViewModel.enableFixedRateMode();
197 - } else {
198 - exchangeViewModel.isFixedRateMode = false;
199 - }
200 - },
201 - ),
202 - ],
203 - )),
204 - SizedBox(height: 30),
205 - _buildTemplateSection(context)
206 - ],
207 - ),
208 - ),
209 - bottomSectionPadding: EdgeInsets.only(left: 24, right: 24, bottom: 24),
210 - bottomSection: Column(children: <Widget>[
164 + disableScroll: true,
165 + config: KeyboardActionsConfig(
166 + keyboardActionsPlatform: KeyboardActionsPlatform.IOS,
167 + keyboardBarColor: Theme.of(context).colorScheme.surfaceContainerHighest,
168 + nextFocus: false,
169 + actions: [
170 + KeyboardActionsItem(
171 + focusNode: _depositAmountFocus, toolbarButtons: [(_) => KeyboardDoneButton()]),
172 + KeyboardActionsItem(
173 + focusNode: _receiveAmountFocus, toolbarButtons: [(_) => KeyboardDoneButton()])
174 + ],
175 + ),
176 + child: Container(
177 + color: Theme.of(context).colorScheme.surface,
178 + child: Form(
179 + key: _formKey,
180 + child: ScrollableWithBottomSection(
181 + contentPadding: EdgeInsets.only(bottom: 24),
182 + content: Observer(
183 + builder: (_) => Column(
184 + children: <Widget>[
185 + _exchangeCardsSection(context),
186 Padding(
212 - padding: EdgeInsets.only(bottom: 15),
213 - child: Observer(builder: (_) {
187 + padding: EdgeInsets.only(top: 12, left: 24),
188 + child: Row(
189 + mainAxisAlignment: MainAxisAlignment.start,
190 + children: [
191 + StandardCheckbox(
192 + value: exchangeViewModel.isFixedRateMode,
193 + caption: S.of(context).fixed_rate,
194 + onChanged: (value) {
195 + if (value) {
196 + exchangeViewModel.enableFixedRateMode();
197 + } else {
198 + exchangeViewModel.isFixedRateMode = false;
199 + }
200 + },
201 + ),
202 + ],
203 + ),
204 + ),
205 + SizedBox(height: 30),
206 + _buildTemplateSection(context)
207 + ],
208 + ),
209 + ),
210 + bottomSectionPadding: EdgeInsets.only(left: 24, right: 24, bottom: 24),
211 + bottomSection: Column(
212 + children: <Widget>[
213 + Padding(
214 + padding: EdgeInsets.only(bottom: 15),
215 + child: Observer(
216 + builder: (_) {
217 final description = exchangeViewModel.isFixedRateMode
218 ? exchangeViewModel.isAvailableInSelected
219 ? S.of(context).amount_is_guaranteed
@@ -220,15 +223,14 @@ class ExchangePage extends BasePage {
223 : S.of(context).this_pair_is_not_supported_warning;
224 return Row(
225 children: [
223 - if(description == S.of(context).this_pair_is_not_supported_warning)
226 + if (description == S.of(context).this_pair_is_not_supported_warning)
227 Expanded(
225 - child: Container(
226 - alignment: Alignment.centerRight,
227 - child: Icon(Icons.warning_amber_rounded,
228 - color: Theme.of(context).extension<ExchangePageTheme>()!.receiveAmountColor,
229 - size: 26),
228 + child: Container(
229 + alignment: Alignment.centerRight,
230 + child: Icon(Icons.warning_amber_rounded,
231 + color: Theme.of(context).colorScheme.error, size: 26),
232 + ),
233 ),
231 - ),
234 Expanded(
235 flex: 8,
236 child: Text(
@@ -237,41 +239,42 @@ class ExchangePage extends BasePage {
239 softWrap: true,
240 overflow: TextOverflow.ellipsis,
241 maxLines: 3,
240 - style: TextStyle(
241 - color: Theme.of(context)
242 - .extension<ExchangePageTheme>()!
243 - .receiveAmountColor,
244 - fontWeight: FontWeight.w500,
245 - fontSize: 12,
246 - ),
242 + style: Theme.of(context).textTheme.bodySmall?.copyWith(
243 + color: Theme.of(context).colorScheme.onSurfaceVariant,
244 + fontWeight: FontWeight.w500,
245 + ),
246 ),
247 ),
248 ],
249 );
251 - }),
250 + },
251 ),
253 - Observer(
254 - builder: (_) => LoadingPrimaryButton(
255 - key: ValueKey('exchange_page_exchange_button_key'),
256 - text: exchangeViewModel.isAvailableInSelected ? S.of(context).swap : S.of(context).change_selected_exchanges,
257 - onPressed: exchangeViewModel.isAvailableInSelected ? () {
252 + ),
253 + Observer(
254 + builder: (_) => LoadingPrimaryButton(
255 + key: ValueKey('exchange_page_exchange_button_key'),
256 + text: exchangeViewModel.isAvailableInSelected
257 + ? S.of(context).swap
258 + : S.of(context).change_selected_exchanges,
259 + onPressed: exchangeViewModel.isAvailableInSelected
260 + ? () {
261 FocusScope.of(context).unfocus();
262
260 - if (_formKey.currentState != null &&
261 - _formKey.currentState!.validate()) {
262 - if (_shouldWaitTillSynced) {
263 - showPopUp<void>(
264 - context: context,
265 - builder: (BuildContext context) {
266 - return AlertWithOneAction(
267 - alertTitle: S.of(context).exchange,
268 - alertContent:
269 - S.of(context).exchange_sync_alert_content,
270 - buttonText: S.of(context).ok,
271 - buttonAction: () => Navigator.of(context).pop(),
272 - );
273 - });
274 - } else {
263 + if (_formKey.currentState != null &&
264 + _formKey.currentState!.validate()) {
265 + if (_shouldWaitTillSynced) {
266 + showPopUp<void>(
267 + context: context,
268 + builder: (BuildContext context) {
269 + return AlertWithOneAction(
270 + alertTitle: S.of(context).exchange,
271 + alertContent: S.of(context).exchange_sync_alert_content,
272 + buttonText: S.of(context).ok,
273 + buttonAction: () => Navigator.of(context).pop(),
274 + );
275 + },
276 + );
277 + } else {
278 final check = exchangeViewModel.shouldDisplayTOTP();
279 authService.authenticateAction(
280 context,
@@ -284,14 +287,21 @@ class ExchangePage extends BasePage {
287 );
288 }
289 }
287 - } : () => PresentProviderPicker(exchangeViewModel: exchangeViewModel).presentProviderPicker(context),
288 - color: Theme.of(context).primaryColor,
289 - textColor: Colors.white,
290 - isDisabled: exchangeViewModel.selectedProviders.isEmpty,
291 - isLoading: exchangeViewModel.tradeState is TradeIsCreating)),
292 - ]),
293 - )),
294 - ));
290 + }
291 + : () => PresentProviderPicker(exchangeViewModel: exchangeViewModel)
292 + .presentProviderPicker(context),
293 + color: Theme.of(context).colorScheme.primary,
294 + textColor: Theme.of(context).colorScheme.onPrimary,
295 + isDisabled: exchangeViewModel.selectedProviders.isEmpty,
296 + isLoading: exchangeViewModel.tradeState is TradeIsCreating,
297 + ),
298 + ),
299 + ],
300 + ),
301 + ),
302 + ),
303 + ),
304 + );
305 }
306
307 Widget _buildTemplateSection(BuildContext context) {
@@ -329,20 +339,22 @@ class ExchangePage extends BasePage {
339 },
340 onRemove: () {
341 showPopUp<void>(
332 - context: context,
333 - builder: (dialogContext) {
334 - return AlertWithTwoActions(
335 - alertTitle: S.of(context).template,
336 - alertContent: S.of(context).confirm_delete_template,
337 - rightButtonText: S.of(context).delete,
338 - leftButtonText: S.of(context).cancel,
339 - actionRightButton: () {
340 - Navigator.of(dialogContext).pop();
341 - exchangeViewModel.removeTemplate(template: template);
342 - exchangeViewModel.updateTemplate();
343 - },
344 - actionLeftButton: () => Navigator.of(dialogContext).pop());
345 - });
342 + context: context,
343 + builder: (dialogContext) {
344 + return AlertWithTwoActions(
345 + alertTitle: S.of(context).template,
346 + alertContent: S.of(context).confirm_delete_template,
347 + rightButtonText: S.of(context).delete,
348 + leftButtonText: S.of(context).cancel,
349 + actionRightButton: () {
350 + Navigator.of(dialogContext).pop();
351 + exchangeViewModel.removeTemplate(template: template);
352 + exchangeViewModel.updateTemplate();
353 + },
354 + actionLeftButton: () => Navigator.of(dialogContext).pop(),
355 + );
356 + },
357 + );
358 },
359 );
360 },
@@ -470,7 +482,8 @@ class ExchangePage extends BasePage {
482 if (state is TradeIsCreatedSuccessfully) {
483 exchangeViewModel.reset();
484 (exchangeViewModel.tradesStore.trade?.provider == ExchangeProviderDescription.thorChain ||
473 - exchangeViewModel.tradesStore.trade?.provider == ExchangeProviderDescription.chainflip)
485 + exchangeViewModel.tradesStore.trade?.provider ==
486 + ExchangeProviderDescription.chainflip)
487 ? Navigator.of(context).pushReplacementNamed(Routes.exchangeTrade)
488 : Navigator.of(context).pushReplacementNamed(Routes.exchangeConfirm);
489 }
@@ -605,7 +618,8 @@ class ExchangePage extends BasePage {
618 key.currentState!.changeWalletName(isCurrentTypeWallet ? exchangeViewModel.wallet.name : '');
619
620 key.currentState!.changeAddress(
608 - address: isCurrentTypeWallet ? exchangeViewModel.wallet.walletAddresses.addressForExchange : '');
621 + address:
622 + isCurrentTypeWallet ? exchangeViewModel.wallet.walletAddresses.addressForExchange : '');
623
624 key.currentState!.changeAmount(amount: '');
625 }
@@ -616,7 +630,8 @@ class ExchangePage extends BasePage {
630
631 if (isCurrentTypeWallet) {
632 key.currentState!.changeWalletName(exchangeViewModel.wallet.name);
619 - key.currentState!.addressController.text = exchangeViewModel.wallet.walletAddresses.addressForExchange;
633 + key.currentState!.addressController.text =
634 + exchangeViewModel.wallet.walletAddresses.addressForExchange;
635 } else if (key.currentState!.addressController.text ==
636 exchangeViewModel.wallet.walletAddresses.addressForExchange) {
637 key.currentState!.changeWalletName('');
@@ -646,7 +661,7 @@ class ExchangePage extends BasePage {
661 }) ??
662 false;
663 if (confirmed) {
649 - exchangeViewModel.feesViewModel .setDefaultTransactionPriority();
664 + exchangeViewModel.feesViewModel.setDefaultTransactionPriority();
665 }
666 }
667
@@ -654,132 +669,130 @@ class ExchangePage extends BasePage {
669
670 Widget _exchangeCardsSection(BuildContext context) {
671 final firstExchangeCard = Observer(
657 - builder: (_) => ExchangeCard(
658 - cardInstanceName: 'deposit_exchange_card',
659 - onDispose: disposeBestRateSync,
660 - hasAllAmount: exchangeViewModel.hasAllAmount,
661 - allAmount: exchangeViewModel.hasAllAmount
662 - ? () => exchangeViewModel.enableSendAllAmount()
663 - : null,
664 - isAllAmountEnabled: exchangeViewModel.isSendAllEnabled,
665 - amountFocusNode: _depositAmountFocus,
666 - addressFocusNode: _depositAddressFocus,
667 - key: depositKey,
668 - title: S.of(context).you_will_send,
669 - initialCurrency: exchangeViewModel.depositCurrency,
670 - initialWalletName: depositWalletName ?? '',
671 - initialAddress: exchangeViewModel.depositCurrency == exchangeViewModel.wallet.currency
672 - ? exchangeViewModel.wallet.walletAddresses.addressForExchange
673 - : exchangeViewModel.depositAddress,
674 - initialIsAmountEditable: true,
675 - initialIsAddressEditable: exchangeViewModel.isDepositAddressEnabled,
676 - isAmountEstimated: false,
677 - hasRefundAddress: true,
678 - isMoneroWallet: exchangeViewModel.isMoneroWallet,
679 - currencies: exchangeViewModel.depositCurrencies,
680 - onCurrencySelected: (currency) {
681 - // FIXME: need to move it into view model
682 - if (currency == CryptoCurrency.xmr &&
683 - exchangeViewModel.wallet.type != WalletType.monero) {
684 - showPopUp<void>(
685 - context: context,
686 - builder: (dialogContext) {
687 - return AlertWithOneAction(
688 - alertTitle: S.of(context).error,
689 - alertContent: S.of(context).exchange_incorrect_current_wallet_for_xmr,
690 - buttonText: S.of(context).ok,
691 - buttonAction: () => Navigator.of(dialogContext).pop());
692 - });
693 - return;
694 - }
695 -
696 - exchangeViewModel.changeDepositCurrency(currency: currency);
697 - },
698 - currencyButtonColor: Colors.transparent,
699 - addressButtonsColor:
700 - Theme.of(context).extension<SendPageTheme>()!.textFieldButtonColor,
701 - borderColor:
702 - Theme.of(context).extension<ExchangePageTheme>()!.textFieldBorderTopPanelColor,
703 - currencyValueValidator: (value) {
704 - return !exchangeViewModel.isFixedRateMode && value != S.of(context).all
705 - ? AmountValidator(
706 - isAutovalidate: true,
707 - currency: exchangeViewModel.depositCurrency,
708 - minValue: exchangeViewModel.limits.min.toString(),
709 - maxValue: exchangeViewModel.limits.max.toString(),
710 - ).call(value)
711 - : null;
712 - },
713 - addressTextFieldValidator: AddressValidator(type: exchangeViewModel.depositCurrency),
714 - onPushPasteButton: (context) async {
715 - final domain = exchangeViewModel.depositAddress;
716 - exchangeViewModel.depositAddress =
717 - await fetchParsedAddress(context, domain, exchangeViewModel.depositCurrency);
718 - },
719 - onPushAddressBookButton: (context) async {
720 - final domain = exchangeViewModel.depositAddress;
721 - exchangeViewModel.depositAddress =
722 - await fetchParsedAddress(context, domain, exchangeViewModel.depositCurrency);
723 - },
724 - ));
672 + builder: (_) => ExchangeCard(
673 + cardInstanceName: 'deposit_exchange_card',
674 + onDispose: disposeBestRateSync,
675 + hasAllAmount: exchangeViewModel.hasAllAmount,
676 + allAmount:
677 + exchangeViewModel.hasAllAmount ? () => exchangeViewModel.enableSendAllAmount() : null,
678 + isAllAmountEnabled: exchangeViewModel.isSendAllEnabled,
679 + amountFocusNode: _depositAmountFocus,
680 + addressFocusNode: _depositAddressFocus,
681 + key: depositKey,
682 + title: S.of(context).you_will_send,
683 + initialCurrency: exchangeViewModel.depositCurrency,
684 + initialWalletName: depositWalletName ?? '',
685 + initialAddress: exchangeViewModel.depositCurrency == exchangeViewModel.wallet.currency
686 + ? exchangeViewModel.wallet.walletAddresses.addressForExchange
687 + : exchangeViewModel.depositAddress,
688 + initialIsAmountEditable: true,
689 + initialIsAddressEditable: exchangeViewModel.isDepositAddressEnabled,
690 + isAmountEstimated: false,
691 + hasRefundAddress: true,
692 + isMoneroWallet: exchangeViewModel.isMoneroWallet,
693 + currencies: exchangeViewModel.depositCurrencies,
694 + onCurrencySelected: (currency) {
695 + // FIXME: need to move it into view model
696 + if (currency == CryptoCurrency.xmr &&
697 + exchangeViewModel.wallet.type != WalletType.monero) {
698 + showPopUp<void>(
699 + context: context,
700 + builder: (dialogContext) {
701 + return AlertWithOneAction(
702 + alertTitle: S.of(context).error,
703 + alertContent: S.of(context).exchange_incorrect_current_wallet_for_xmr,
704 + buttonText: S.of(context).ok,
705 + buttonAction: () => Navigator.of(dialogContext).pop(),
706 + );
707 + });
708 + return;
709 + }
710 +
711 + exchangeViewModel.changeDepositCurrency(currency: currency);
712 + },
713 + currencyButtonColor: Colors.transparent,
714 + addressButtonsColor: Colors.transparent,
715 + borderColor: Theme.of(context).colorScheme.outlineVariant,
716 + fillColor: Theme.of(context).colorScheme.surfaceContainer,
717 + currencyValueValidator: (value) {
718 + return !exchangeViewModel.isFixedRateMode && value != S.of(context).all
719 + ? AmountValidator(
720 + isAutovalidate: true,
721 + currency: exchangeViewModel.depositCurrency,
722 + minValue: exchangeViewModel.limits.min.toString(),
723 + maxValue: exchangeViewModel.limits.max.toString(),
724 + ).call(value)
725 + : null;
726 + },
727 + addressTextFieldValidator: AddressValidator(type: exchangeViewModel.depositCurrency),
728 + onPushPasteButton: (context) async {
729 + final domain = exchangeViewModel.depositAddress;
730 + exchangeViewModel.depositAddress =
731 + await fetchParsedAddress(context, domain, exchangeViewModel.depositCurrency);
732 + },
733 + onPushAddressBookButton: (context) async {
734 + final domain = exchangeViewModel.depositAddress;
735 + exchangeViewModel.depositAddress =
736 + await fetchParsedAddress(context, domain, exchangeViewModel.depositCurrency);
737 + },
738 + ),
739 + );
740
741 final secondExchangeCard = Observer(
727 - builder: (_) => ExchangeCard(
728 - cardInstanceName: 'receive_exchange_card',
729 - onDispose: disposeBestRateSync,
730 - amountFocusNode: _receiveAmountFocus,
731 - addressFocusNode: _receiveAddressFocus,
732 - key: receiveKey,
733 - title: S.of(context).you_will_get,
734 - initialCurrency: exchangeViewModel.receiveCurrency,
735 - initialWalletName: receiveWalletName ?? '',
736 - initialAddress: exchangeViewModel.receiveCurrency == exchangeViewModel.wallet.currency
737 - ? exchangeViewModel.wallet.walletAddresses.addressForExchange
738 - : exchangeViewModel.receiveAddress,
739 - initialIsAmountEditable: exchangeViewModel.isReceiveAmountEditable,
740 - isAmountEstimated: true,
741 - isMoneroWallet: exchangeViewModel.isMoneroWallet,
742 - currencies: exchangeViewModel.receiveCurrencies,
743 - onCurrencySelected: (currency) =>
744 - exchangeViewModel.changeReceiveCurrency(currency: currency),
745 - currencyButtonColor: Colors.transparent,
746 - addressButtonsColor:
747 - Theme.of(context).extension<SendPageTheme>()!.textFieldButtonColor,
748 - borderColor:
749 - Theme.of(context).extension<ExchangePageTheme>()!.textFieldBorderBottomPanelColor,
750 - currencyValueValidator: (value) {
751 - return exchangeViewModel.isFixedRateMode
752 - ? AmountValidator(
753 - isAutovalidate: true,
754 - currency: exchangeViewModel.receiveCurrency,
755 - minValue: exchangeViewModel.limits.min.toString(),
756 - maxValue: exchangeViewModel.limits.max.toString(),
757 - ).call(value)
758 - : null;
759 - },
760 - addressTextFieldValidator: AddressValidator(type: exchangeViewModel.receiveCurrency),
761 - onPushPasteButton: (context) async {
762 - final domain = exchangeViewModel.receiveAddress;
763 - exchangeViewModel.receiveAddress =
764 - await fetchParsedAddress(context, domain, exchangeViewModel.receiveCurrency);
765 - },
766 - onPushAddressBookButton: (context) async {
767 - final domain = exchangeViewModel.receiveAddress;
768 - exchangeViewModel.receiveAddress =
769 - await fetchParsedAddress(context, domain, exchangeViewModel.receiveCurrency);
770 - },
771 - ));
772 -
773 - if (responsiveLayoutUtil.shouldRenderMobileUI) {
774 - return MobileExchangeCardsSection(
775 - firstExchangeCard: firstExchangeCard,
776 - secondExchangeCard: secondExchangeCard,
777 - );
778 - }
779 -
780 - return DesktopExchangeCardsSection(
781 - firstExchangeCard: firstExchangeCard,
782 - secondExchangeCard: secondExchangeCard,
742 + builder: (_) => ExchangeCard(
743 + cardInstanceName: 'receive_exchange_card',
744 + onDispose: disposeBestRateSync,
745 + amountFocusNode: _receiveAmountFocus,
746 + addressFocusNode: _receiveAddressFocus,
747 + key: receiveKey,
748 + title: S.of(context).you_will_get,
749 + initialCurrency: exchangeViewModel.receiveCurrency,
750 + initialWalletName: receiveWalletName ?? '',
751 + initialAddress: exchangeViewModel.receiveCurrency == exchangeViewModel.wallet.currency
752 + ? exchangeViewModel.wallet.walletAddresses.addressForExchange
753 + : exchangeViewModel.receiveAddress,
754 + initialIsAmountEditable: exchangeViewModel.isReceiveAmountEditable,
755 + isAmountEstimated: true,
756 + isMoneroWallet: exchangeViewModel.isMoneroWallet,
757 + currencies: exchangeViewModel.receiveCurrencies,
758 + onCurrencySelected: (currency) =>
759 + exchangeViewModel.changeReceiveCurrency(currency: currency),
760 + currencyButtonColor: Colors.transparent,
761 + addressButtonsColor: Colors.transparent,
762 + borderColor: Theme.of(context).colorScheme.outlineVariant,
763 + fillColor: Theme.of(context).colorScheme.surfaceContainerLow,
764 + currencyValueValidator: (value) {
765 + return exchangeViewModel.isFixedRateMode
766 + ? AmountValidator(
767 + isAutovalidate: true,
768 + currency: exchangeViewModel.receiveCurrency,
769 + minValue: exchangeViewModel.limits.min.toString(),
770 + maxValue: exchangeViewModel.limits.max.toString(),
771 + ).call(value)
772 + : null;
773 + },
774 + addressTextFieldValidator: AddressValidator(type: exchangeViewModel.receiveCurrency),
775 + onPushPasteButton: (context) async {
776 + final domain = exchangeViewModel.receiveAddress;
777 + exchangeViewModel.receiveAddress =
778 + await fetchParsedAddress(context, domain, exchangeViewModel.receiveCurrency);
779 + },
780 + onPushAddressBookButton: (context) async {
781 + final domain = exchangeViewModel.receiveAddress;
782 + exchangeViewModel.receiveAddress =
783 + await fetchParsedAddress(context, domain, exchangeViewModel.receiveCurrency);
784 + },
785 + ),
786 );
787 +
788 + return responsiveLayoutUtil.shouldRenderMobileUI
789 + ? MobileExchangeCardsSection(
790 + firstExchangeCard: firstExchangeCard,
791 + secondExchangeCard: secondExchangeCard,
792 + )
793 + : DesktopExchangeCardsSection(
794 + firstExchangeCard: firstExchangeCard,
795 + secondExchangeCard: secondExchangeCard,
796 + );
797 }
798 }
lib/src/screens/exchange/exchange_template_page.dart
+55 -81
@@ -1,5 +1,3 @@
1 -import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart';
2 -import 'package:cake_wallet/themes/extensions/keyboard_theme.dart';
1 import 'package:cake_wallet/exchange/provider/exchange_provider.dart';
2 import 'package:cake_wallet/src/screens/base_page.dart';
3 import 'package:cake_wallet/src/widgets/keyboard_done_button.dart';
@@ -47,12 +45,12 @@ class ExchangeTemplatePage extends BasePage {
45 Widget body(BuildContext context) {
46 final arrowBottomPurple = Image.asset(
47 'assets/images/arrow_bottom_purple_icon.png',
50 - color: Colors.white,
48 + color: Theme.of(context).colorScheme.primary,
49 height: 8,
50 );
51 final arrowBottomCakeGreen = Image.asset(
52 'assets/images/arrow_bottom_cake_green.png',
55 - color: Colors.white,
53 + color: Theme.of(context).colorScheme.primary,
54 height: 8,
55 );
56
@@ -68,17 +66,18 @@ class ExchangeTemplatePage extends BasePage {
66 return KeyboardActions(
67 disableScroll: true,
68 config: KeyboardActionsConfig(
71 - keyboardActionsPlatform: KeyboardActionsPlatform.IOS,
72 - keyboardBarColor: Theme.of(context).extension<KeyboardTheme>()!.keyboardBarColor,
73 - nextFocus: false,
74 - actions: [
75 - KeyboardActionsItem(
76 - focusNode: _depositAmountFocus, toolbarButtons: [(_) => KeyboardDoneButton()]),
77 - KeyboardActionsItem(
78 - focusNode: _receiveAmountFocus, toolbarButtons: [(_) => KeyboardDoneButton()])
79 - ]),
69 + keyboardActionsPlatform: KeyboardActionsPlatform.IOS,
70 + keyboardBarColor: Theme.of(context).colorScheme.surfaceVariant,
71 + nextFocus: false,
72 + actions: [
73 + KeyboardActionsItem(
74 + focusNode: _depositAmountFocus, toolbarButtons: [(_) => KeyboardDoneButton()]),
75 + KeyboardActionsItem(
76 + focusNode: _receiveAmountFocus, toolbarButtons: [(_) => KeyboardDoneButton()])
77 + ],
78 + ),
79 child: Container(
81 - color: Theme.of(context).colorScheme.background,
80 + color: Theme.of(context).colorScheme.surface,
81 child: Form(
82 key: _formKey,
83 child: ScrollableWithBottomSection(
@@ -87,18 +86,10 @@ class ExchangeTemplatePage extends BasePage {
86 padding: EdgeInsets.only(bottom: 32),
87 decoration: BoxDecoration(
88 borderRadius: BorderRadius.only(
90 - bottomLeft: Radius.circular(24), bottomRight: Radius.circular(24)),
91 - gradient: LinearGradient(colors: [
92 - Theme.of(context)
93 - .extension<ExchangePageTheme>()!
94 - .firstGradientBottomPanelColor,
95 - Theme.of(context)
96 - .extension<ExchangePageTheme>()!
97 - .secondGradientBottomPanelColor,
98 - ], stops: [
99 - 0.35,
100 - 1.0
101 - ], begin: Alignment.topLeft, end: Alignment.bottomRight),
89 + bottomLeft: Radius.circular(24),
90 + bottomRight: Radius.circular(24),
91 + ),
92 + color: Theme.of(context).colorScheme.surfaceContainer,
93 ),
94 child: FocusTraversalGroup(
95 policy: OrderedTraversalPolicy(),
@@ -109,14 +100,7 @@ class ExchangeTemplatePage extends BasePage {
100 borderRadius: BorderRadius.only(
101 bottomLeft: Radius.circular(24),
102 bottomRight: Radius.circular(24)),
112 - gradient: LinearGradient(colors: [
113 - Theme.of(context)
114 - .extension<ExchangePageTheme>()!
115 - .firstGradientTopPanelColor,
116 - Theme.of(context)
117 - .extension<ExchangePageTheme>()!
118 - .secondGradientTopPanelColor,
119 - ], begin: Alignment.topLeft, end: Alignment.bottomRight),
103 + color: Theme.of(context).colorScheme.surfaceContainerLow,
104 ),
105 padding: EdgeInsets.fromLTRB(24, 100, 24, 32),
106 child: Observer(
@@ -141,52 +125,45 @@ class ExchangeTemplatePage extends BasePage {
125 exchangeViewModel.changeDepositCurrency(currency: currency),
126 imageArrow: arrowBottomPurple,
127 currencyButtonColor: Colors.transparent,
144 - addressButtonsColor: Theme.of(context)
145 - .extension<ExchangePageTheme>()!
146 - .textFieldButtonColor,
147 - borderColor: Theme.of(context)
148 - .extension<ExchangePageTheme>()!
149 - .textFieldBorderBottomPanelColor,
128 + addressButtonsColor:
129 + Theme.of(context).colorScheme.surfaceContainerHighest,
130 + borderColor: Theme.of(context).colorScheme.outlineVariant,
131 + fillColor: Theme.of(context).colorScheme.surfaceContainer,
132 currencyValueValidator:
133 AmountValidator(currency: exchangeViewModel.depositCurrency),
152 - //addressTextFieldValidator: AddressValidator(
153 - // type: exchangeViewModel.depositCurrency),
134 ),
135 ),
136 ),
137 Padding(
138 padding: EdgeInsets.only(top: 29, left: 24, right: 24),
139 child: Observer(
160 - builder: (_) => ExchangeCard(
161 - cardInstanceName: 'receive_exchange_template_card',
162 - amountFocusNode: _receiveAmountFocus,
163 - key: receiveKey,
164 - title: S.of(context).you_will_get,
165 - initialCurrency: exchangeViewModel.receiveCurrency,
166 - initialWalletName: receiveWalletName ?? '',
167 - initialAddress: exchangeViewModel.receiveCurrency ==
168 - exchangeViewModel.wallet.currency
169 - ? exchangeViewModel.wallet.walletAddresses.addressForExchange
170 - : exchangeViewModel.receiveAddress,
171 - initialIsAmountEditable: false,
172 - isAmountEstimated: true,
173 - isMoneroWallet: exchangeViewModel.isMoneroWallet,
174 - currencies: exchangeViewModel.receiveCurrencies,
175 - onCurrencySelected: (currency) => exchangeViewModel
176 - .changeReceiveCurrency(currency: currency),
177 - imageArrow: arrowBottomCakeGreen,
178 - currencyButtonColor: Colors.transparent,
179 - addressButtonsColor: Theme.of(context)
180 - .extension<ExchangePageTheme>()!
181 - .textFieldButtonColor,
182 - borderColor: Theme.of(context)
183 - .extension<ExchangePageTheme>()!
184 - .textFieldBorderBottomPanelColor,
185 - currencyValueValidator: AmountValidator(
186 - currency: exchangeViewModel.receiveCurrency),
187 - //addressTextFieldValidator: AddressValidator(
188 - // type: exchangeViewModel.receiveCurrency),
189 - )),
140 + builder: (_) => ExchangeCard(
141 + cardInstanceName: 'receive_exchange_template_card',
142 + amountFocusNode: _receiveAmountFocus,
143 + key: receiveKey,
144 + title: S.of(context).you_will_get,
145 + initialCurrency: exchangeViewModel.receiveCurrency,
146 + initialWalletName: receiveWalletName ?? '',
147 + initialAddress: exchangeViewModel.receiveCurrency ==
148 + exchangeViewModel.wallet.currency
149 + ? exchangeViewModel.wallet.walletAddresses.addressForExchange
150 + : exchangeViewModel.receiveAddress,
151 + initialIsAmountEditable: false,
152 + isAmountEstimated: true,
153 + isMoneroWallet: exchangeViewModel.isMoneroWallet,
154 + currencies: exchangeViewModel.receiveCurrencies,
155 + onCurrencySelected: (currency) =>
156 + exchangeViewModel.changeReceiveCurrency(currency: currency),
157 + imageArrow: arrowBottomCakeGreen,
158 + currencyButtonColor: Colors.transparent,
159 + addressButtonsColor:
160 + Theme.of(context).colorScheme.surfaceContainerHighest,
161 + borderColor: Theme.of(context).colorScheme.outlineVariant,
162 + fillColor: Theme.of(context).colorScheme.surfaceContainerLow,
163 + currencyValueValidator:
164 + AmountValidator(currency: exchangeViewModel.receiveCurrency),
165 + ),
166 + ),
167 )
168 ],
169 ),
@@ -201,13 +178,10 @@ class ExchangeTemplatePage extends BasePage {
178 child: Text(
179 S.of(context).amount_is_estimate,
180 textAlign: TextAlign.center,
204 - style: TextStyle(
205 - color: Theme.of(context)
206 - .extension<ExchangePageTheme>()!
207 - .receiveAmountColor,
208 - fontWeight: FontWeight.w500,
209 - fontSize: 12,
210 - ),
181 + style: Theme.of(context).textTheme.bodySmall?.copyWith(
182 + color: Theme.of(context).colorScheme.onSurfaceVariant,
183 + fontWeight: FontWeight.w500,
184 + ),
185 ),
186 ),
187 ),
@@ -231,8 +205,8 @@ class ExchangeTemplatePage extends BasePage {
205 }
206 },
207 text: S.of(context).save,
234 - color: Theme.of(context).primaryColor,
235 - textColor: Colors.white),
208 + color: Theme.of(context).colorScheme.primary,
209 + textColor: Theme.of(context).colorScheme.onPrimary),
210 ]),
211 ))));
212 }
lib/src/screens/exchange/widgets/currency_picker.dart
-6
@@ -31,18 +31,12 @@ class CurrencyPickerState extends State<CurrencyPicker> {
31 CurrencyPickerState(this.items)
32 : isSearchBarActive = false,
33 textFieldValue = '',
34 - appBarTextStyle = TextStyle(
35 - fontSize: 20,
36 - fontFamily: 'Lato',
37 - backgroundColor: Colors.transparent,
38 - color: Colors.white),
34 pickerItemsList = <PickerItem<CryptoCurrency>>[];
35
36 List<PickerItem<Currency>> pickerItemsList;
37 List<Currency> items;
38 bool isSearchBarActive;
39 String textFieldValue;
45 - TextStyle appBarTextStyle;
40
41 bool currencySearchBySubstring(Currency currency, String subString) {
42 return currency.name.toLowerCase().contains(subString.toLowerCase()) ||
lib/src/screens/exchange/widgets/currency_picker_item_widget.dart
+17 -25
@@ -1,15 +1,8 @@
1 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
2 -import 'package:cake_wallet/themes/extensions/cake_scrollbar_theme.dart';
1 import 'package:flutter/material.dart';
4 -import 'package:cake_wallet/palette.dart';
2
3 class PickerItemWidget extends StatelessWidget {
7 - const PickerItemWidget({
8 - required this.title,
9 - this.iconPath,
10 - this.isSelected = false,
11 - this.tag,
12 - this.onTap});
4 + const PickerItemWidget(
5 + {required this.title, this.iconPath, this.isSelected = false, this.tag, this.onTap});
6
7 final String? iconPath;
8 final String title;
@@ -22,7 +15,7 @@ class PickerItemWidget extends StatelessWidget {
15 return GestureDetector(
16 onTap: onTap,
17 child: Container(
25 - color: Theme.of(context).dialogTheme.backgroundColor,
18 + color: Theme.of(context).colorScheme.surface,
19 child: Padding(
20 padding: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 24),
21 child: Row(
@@ -40,14 +33,13 @@ class PickerItemWidget extends StatelessWidget {
33 children: [
34 Text(
35 title.toUpperCase(),
43 - style: TextStyle(
44 - color: isSelected
45 - ? Palette.blueCraiola
46 - : Theme.of(context).extension<CakeTextTheme>()!.titleColor,
47 - fontSize: isSelected ? 16 : 14.0,
48 - fontFamily: 'Lato',
49 - fontWeight: FontWeight.w600,
50 - ),
36 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
37 + color: isSelected
38 + ? Theme.of(context).colorScheme.primary
39 + : Theme.of(context).colorScheme.onSurface,
40 + fontSize: isSelected ? 16 : 14.0,
41 + fontWeight: FontWeight.w600,
42 + ),
43 ),
44 if (tag != null)
45 Align(
@@ -58,16 +50,14 @@ class PickerItemWidget extends StatelessWidget {
50 child: Center(
51 child: Text(
52 tag!,
61 - style: TextStyle(
62 - fontSize: 7.0,
63 - fontFamily: 'Lato',
64 - color: Theme.of(context).extension<CakeScrollbarTheme>()!.thumbColor),
53 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
54 + fontSize: 7.0, color: Theme.of(context).colorScheme.primary),
55 ),
56 ),
57 decoration: BoxDecoration(
58 borderRadius: BorderRadius.circular(6.0),
59 //border: Border.all(color: ),
70 - color: Theme.of(context).extension<CakeScrollbarTheme>()!.trackColor,
60 + color: Theme.of(context).colorScheme.surfaceContainerHighest,
61 ),
62 ),
63 ),
@@ -75,8 +65,10 @@ class PickerItemWidget extends StatelessWidget {
65 ),
66 ),
67 if (isSelected)
78 - Icon(Icons.check_circle,
79 - color: Theme.of(context).primaryColor)
68 + Icon(
69 + Icons.check,
70 + color: Theme.of(context).colorScheme.primary,
71 + ),
72 ],
73 ),
74 ),
lib/src/screens/exchange/widgets/currency_picker_widget.dart
+1 -2
@@ -1,4 +1,3 @@
1 -import 'package:cake_wallet/themes/extensions/picker_theme.dart';
1 import 'package:cw_core/currency.dart';
2 import 'package:flutter/material.dart';
3 import 'currency_picker_item_widget.dart';
@@ -21,7 +20,7 @@ class CurrencyPickerWidget extends StatelessWidget {
20 @override
21 Widget build(BuildContext context) {
22 return Container(
24 - color: Theme.of(context).extension<PickerTheme>()!.dividerColor,
23 + color: Theme.of(context).colorScheme.outlineVariant,
24 child: Scrollbar(
25 controller: _scrollController,
26 child: GridView.builder(
lib/src/screens/exchange/widgets/exchange_card.dart
+249 -215
@@ -1,10 +1,8 @@
1 import 'package:cake_wallet/core/amount_validator.dart';
2 import 'package:cake_wallet/entities/contact_base.dart';
3 import 'package:cake_wallet/src/screens/receive/widgets/currency_input_field.dart';
4 -import 'package:cake_wallet/themes/extensions/qr_code_theme.dart';
4 import 'package:cake_wallet/routes.dart';
5 import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
7 -import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart';
6 import 'package:cake_wallet/utils/show_bar.dart';
7 import 'package:cake_wallet/utils/show_pop_up.dart';
8 import 'package:cake_wallet/utils/payment_request.dart';
@@ -12,11 +10,9 @@ import 'package:cw_core/currency.dart';
10 import 'package:flutter/services.dart';
11 import 'package:flutter/material.dart';
12 import 'package:cake_wallet/generated/i18n.dart';
15 -import 'package:cw_core/crypto_currency.dart';
13 import 'package:cake_wallet/src/widgets/address_text_field.dart';
14 import 'package:cake_wallet/src/widgets/base_text_form_field.dart';
15 import 'package:cake_wallet/src/screens/exchange/widgets/currency_picker.dart';
19 -import 'package:cake_wallet/themes/extensions/send_page_theme.dart';
16
17 class ExchangeCard<T extends Currency> extends StatefulWidget {
18 ExchangeCard({
@@ -28,6 +24,7 @@ class ExchangeCard<T extends Currency> extends StatefulWidget {
24 required this.isAmountEstimated,
25 required this.currencies,
26 required this.onCurrencySelected,
27 + required this.fillColor,
28 this.imageArrow,
29 this.currencyValueValidator,
30 this.addressTextFieldValidator,
@@ -84,6 +81,7 @@ class ExchangeCard<T extends Currency> extends StatefulWidget {
81 final void Function(BuildContext context)? onPushAddressBookButton;
82 final Function()? onDispose;
83 final String cardInstanceName;
84 + final Color fillColor;
85
86 @override
87 ExchangeCardState<T> createState() => ExchangeCardState<T>();
@@ -184,226 +182,263 @@ class ExchangeCardState<T extends Currency> extends State<ExchangeCard<T>> {
182 });
183 }
184
187 - final copyImage = Image.asset('assets/images/copy_content.png',
188 - height: 16,
189 - width: 16,
190 - color: Theme.of(context).extension<SendPageTheme>()!.estimatedFeeColor);
185 + final copyImage = Image.asset(
186 + 'assets/images/copy_content.png',
187 + height: 16,
188 + width: 16,
189 + color: Theme.of(context).colorScheme.onSurface,
190 + );
191
192 return Container(
193 width: double.infinity,
194 color: Colors.transparent,
195 - child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
196 - SizedBox(height: 10),
197 - Row(
198 - mainAxisAlignment: MainAxisAlignment.start,
199 - children: <Widget>[
200 - SizedBox(height: 40),
201 - Text(
202 - key: ValueKey('${_cardInstanceName}_title_key'),
203 - _title,
204 - style: TextStyle(
205 - fontSize: 18,
206 - fontWeight: FontWeight.w600,
207 - color: Theme.of(context).extension<QRCodeTheme>()!.qrCodeColor),
208 - )
209 - ],
210 - ),
211 - CurrencyAmountTextField(
212 - padding: EdgeInsets.zero,
213 - currencyPickerButtonKey: ValueKey('${_cardInstanceName}_currency_picker_button_key'),
214 - selectedCurrencyTextKey: ValueKey('${_cardInstanceName}_selected_currency_text_key'),
215 - selectedCurrencyTagTextKey:
216 - ValueKey('${_cardInstanceName}_selected_currency_tag_text_key'),
217 - amountTextfieldKey: ValueKey('${_cardInstanceName}_amount_textfield_key'),
218 - sendAllButtonKey: ValueKey('${_cardInstanceName}_send_all_button_key'),
219 - currencyAmountTextFieldWidgetKey:
220 - ValueKey('${_cardInstanceName}_currency_amount_textfield_widget_key'),
221 - imageArrow: widget.imageArrow,
222 - selectedCurrency: _selectedCurrency.toString(),
223 - amountFocusNode: widget.amountFocusNode,
224 - amountController: amountController,
225 - onTapPicker: () => _presentPicker(context),
226 - isAmountEditable: _isAmountEditable,
227 - isPickerEnable: true,
228 - allAmountButton: widget.hasAllAmount,
229 - currencyValueValidator: widget.currencyValueValidator,
230 - tag: _selectedCurrency.tag,
231 - allAmountCallback: widget.allAmount,
232 - ),
233 - Divider(height: 1, color: Theme.of(context).extension<SendPageTheme>()!.textFieldHintColor),
234 - Padding(
235 - padding: EdgeInsets.only(top: 5),
236 - child: widget.showLimitsField ? Container(
237 - height: 15,
238 - child: Row(mainAxisAlignment: MainAxisAlignment.start, children: <Widget>[
239 - _min != null
240 - ? Text(
241 - key: ValueKey('${_cardInstanceName}_min_limit_text_key'),
242 - S.of(context).min_value(_min ?? '', _selectedCurrency.toString()),
243 - style: TextStyle(
244 - fontSize: 10,
245 - height: 1.2,
246 - color: Theme.of(context).extension<ExchangePageTheme>()!.hintTextColor),
247 - )
248 - : Offstage(),
249 - _min != null ? SizedBox(width: 10) : Offstage(),
250 - _max != null
251 - ? Text(
252 - key: ValueKey('${_cardInstanceName}_max_limit_text_key'),
253 - S.of(context).max_value(_max ?? '', _selectedCurrency.toString()),
254 - style: TextStyle(
255 - fontSize: 10,
256 - height: 1.2,
257 - color: Theme.of(context).extension<ExchangePageTheme>()!.hintTextColor,
195 + child: Column(
196 + crossAxisAlignment: CrossAxisAlignment.start,
197 + children: <Widget>[
198 + SizedBox(height: 10),
199 + Row(
200 + mainAxisAlignment: MainAxisAlignment.start,
201 + children: <Widget>[
202 + SizedBox(height: 40),
203 + Text(
204 + key: ValueKey('${_cardInstanceName}_title_key'),
205 + _title,
206 + style: Theme.of(context).textTheme.titleLarge!.copyWith(
207 + fontSize: 18,
208 + fontWeight: FontWeight.w600,
209 + color: Theme.of(context).colorScheme.onSurfaceVariant
210 + ),
211 + )
212 + ],
213 + ),
214 + CurrencyAmountTextField(
215 + hasUnderlineBorder: true,
216 + borderWidth: 0.0,
217 + padding: EdgeInsets.zero,
218 + currencyPickerButtonKey: ValueKey('${_cardInstanceName}_currency_picker_button_key'),
219 + selectedCurrencyTextKey: ValueKey('${_cardInstanceName}_selected_currency_text_key'),
220 + selectedCurrencyTagTextKey:
221 + ValueKey('${_cardInstanceName}_selected_currency_tag_text_key'),
222 + amountTextfieldKey: ValueKey('${_cardInstanceName}_amount_textfield_key'),
223 + sendAllButtonKey: ValueKey('${_cardInstanceName}_send_all_button_key'),
224 + currencyAmountTextFieldWidgetKey:
225 + ValueKey('${_cardInstanceName}_currency_amount_textfield_widget_key'),
226 + imageArrow: widget.imageArrow,
227 + selectedCurrency: _selectedCurrency.toString(),
228 + amountFocusNode: widget.amountFocusNode,
229 + amountController: amountController,
230 + onTapPicker: () => _presentPicker(context),
231 + isAmountEditable: _isAmountEditable,
232 + isPickerEnable: true,
233 + allAmountButton: widget.hasAllAmount,
234 + currencyValueValidator: widget.currencyValueValidator,
235 + tag: _selectedCurrency.tag,
236 + allAmountCallback: widget.allAmount,
237 + fillColor: widget.fillColor,
238 + ),
239 + Divider(height: 1, color: Theme.of(context).colorScheme.outlineVariant),
240 + Padding(
241 + padding: EdgeInsets.only(top: 5),
242 + child: widget.showLimitsField
243 + ? Container(
244 + height: 15,
245 + child: Row(
246 + mainAxisAlignment: MainAxisAlignment.start,
247 + children: <Widget>[
248 + _min != null
249 + ? Text(
250 + key: ValueKey('${_cardInstanceName}_min_limit_text_key'),
251 + S.of(context).min_value(_min ?? '', _selectedCurrency.toString()),
252 + style: Theme.of(context).textTheme.bodySmall!.copyWith(
253 + fontSize: 10,
254 + height: 1.2,
255 + color: Theme.of(context).colorScheme.onSurfaceVariant,
256 + ),
257 + )
258 + : Offstage(),
259 + _min != null ? SizedBox(width: 10) : Offstage(),
260 + _max != null
261 + ? Text(
262 + key: ValueKey('${_cardInstanceName}_max_limit_text_key'),
263 + S.of(context).max_value(_max ?? '', _selectedCurrency.toString()),
264 + style: Theme.of(context).textTheme.bodySmall!.copyWith(
265 + fontSize: 10,
266 + height: 1.2,
267 + color: Theme.of(context).colorScheme.onSurfaceVariant,
268 + ),
269 + )
270 + : Offstage(),
271 + ],
272 + ),
273 + )
274 + : Offstage(),
275 + ),
276 + !_isAddressEditable && widget.hasRefundAddress
277 + ? Padding(
278 + padding: EdgeInsets.only(top: 20),
279 + child: Text(
280 + S.of(context).refund_address,
281 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
282 + fontWeight: FontWeight.w500,
283 + color: Theme.of(context).colorScheme.onSurfaceVariant
284 ),
259 - )
260 - : Offstage(),
261 - ])) : Offstage(),
262 - ),
263 - !_isAddressEditable && widget.hasRefundAddress
264 - ? Padding(
265 - padding: EdgeInsets.only(top: 20),
266 - child: Text(
267 - S.of(context).refund_address,
268 - style: TextStyle(
269 - fontSize: 14,
270 - fontWeight: FontWeight.w500,
271 - color: Theme.of(context).extension<ExchangePageTheme>()!.hintTextColor),
272 - ))
273 - : Offstage(),
274 - _isAddressEditable
275 - ? widget.showAddressField
276 - ? FocusTraversalOrder(
277 - order: NumericFocusOrder(2),
278 - child: Padding(
279 - padding: widget.addressRowPadding ?? EdgeInsets.only(top: 12),
280 - child: AddressTextField(
281 - addressKey: ValueKey('${_cardInstanceName}_editable_address_textfield_key'),
282 - focusNode: widget.addressFocusNode,
283 - controller: addressController,
284 - onURIScanned: (uri) {
285 - final paymentRequest = PaymentRequest.fromUri(uri);
286 - addressController.text = paymentRequest.address;
285 + ),
286 + )
287 + : Offstage(),
288 + _isAddressEditable
289 + ? widget.showAddressField
290 + ? FocusTraversalOrder(
291 + order: NumericFocusOrder(2),
292 + child: Padding(
293 + padding: widget.addressRowPadding ?? EdgeInsets.only(top: 12),
294 + child: AddressTextField(
295 + hasUnderlineBorder: true,
296 + borderWidth: 0.0,
297 + addressKey:
298 + ValueKey('${_cardInstanceName}_editable_address_textfield_key'),
299 + focusNode: widget.addressFocusNode,
300 + controller: addressController,
301 + onURIScanned: (uri) {
302 + final paymentRequest = PaymentRequest.fromUri(uri);
303 + addressController.text = paymentRequest.address;
304
288 - if (amountController.text.isNotEmpty) {
289 - _showAmountPopup(context, paymentRequest);
290 - return;
291 - }
292 - widget.amountFocusNode?.requestFocus();
293 - amountController.text = paymentRequest.amount;
294 - },
295 - placeholder:
296 - widget.hasRefundAddress ? S.of(context).refund_address : null,
297 - options: [
298 - AddressTextFieldOption.paste,
299 - AddressTextFieldOption.qrCode,
300 - AddressTextFieldOption.addressBook,
301 - ],
302 - isBorderExist: false,
303 - textStyle: TextStyle(
304 - fontSize: 16, fontWeight: FontWeight.w600, color: Colors.white),
305 - hintStyle: TextStyle(
306 - fontSize: 16,
307 - fontWeight: FontWeight.w600,
308 - color:
309 - Theme.of(context).extension<ExchangePageTheme>()!.hintTextColor),
310 - buttonColor: widget.addressButtonsColor,
311 - validator: widget.addressTextFieldValidator,
312 - onPushPasteButton: widget.onPushPasteButton,
313 - onPushAddressBookButton: widget.onPushAddressBookButton,
314 - selectedCurrency: _selectedCurrency),
315 - ),
316 - )
317 - : Offstage()
318 - : Padding(
319 - padding: EdgeInsets.only(top: 0),
320 - child: Builder(
321 - builder: (context) => Stack(children: <Widget>[
322 - FocusTraversalOrder(
323 - order: NumericFocusOrder(3),
324 - child: BaseTextFormField(
325 - key: ValueKey(
326 - '${_cardInstanceName}_non_editable_address_textfield_key'),
327 - controller: addressController,
328 - borderColor: Colors.transparent,
329 - suffixIcon: SizedBox(width: _isMoneroWallet ? 80 : 36),
330 - textStyle: TextStyle(
331 - fontSize: 16, fontWeight: FontWeight.w600, color: Colors.white),
332 - validator: widget.addressTextFieldValidator),
305 + if (amountController.text.isNotEmpty) {
306 + _showAmountPopup(context, paymentRequest);
307 + return;
308 + }
309 + widget.amountFocusNode?.requestFocus();
310 + amountController.text = paymentRequest.amount;
311 + },
312 + placeholder:
313 + widget.hasRefundAddress ? S.of(context).refund_address : null,
314 + options: [
315 + AddressTextFieldOption.paste,
316 + AddressTextFieldOption.qrCode,
317 + AddressTextFieldOption.addressBook,
318 + ],
319 + textStyle: Theme.of(context).textTheme.bodyMedium!.copyWith(
320 + fontSize: 16,
321 + fontWeight: FontWeight.w600,
322 + color: Theme.of(context).colorScheme.onSurface,
323 + ),
324 + hintStyle: Theme.of(context).textTheme.bodyMedium!.copyWith(
325 + fontSize: 16,
326 + fontWeight: FontWeight.w600,
327 + color: Theme.of(context).colorScheme.onSurfaceVariant,
328 + ),
329 + buttonColor: widget.addressButtonsColor,
330 + validator: widget.addressTextFieldValidator,
331 + onPushPasteButton: widget.onPushPasteButton,
332 + onPushAddressBookButton: widget.onPushAddressBookButton,
333 + selectedCurrency: _selectedCurrency,
334 + fillColor: widget.fillColor,
335 + iconColor: Theme.of(context).colorScheme.onSurfaceVariant,
336 + ),
337 + ),
338 + )
339 + : Offstage()
340 + : Padding(
341 + padding: EdgeInsets.only(top: 0),
342 + child: Builder(
343 + builder: (context) => Stack(
344 + children: <Widget>[
345 + FocusTraversalOrder(
346 + order: NumericFocusOrder(3),
347 + child: BaseTextFormField(
348 + hasUnderlineBorder: true,
349 + borderWidth: 0.0,
350 + key:
351 + ValueKey('${_cardInstanceName}_non_editable_address_textfield_key'),
352 + controller: addressController,
353 + suffixIcon: SizedBox(width: _isMoneroWallet ? 80 : 36),
354 + textStyle: Theme.of(context).textTheme.bodyMedium!.copyWith(
355 + fontSize: 16,
356 + fontWeight: FontWeight.w600,
357 + ),
358 + validator: widget.addressTextFieldValidator,
359 + fillColor: widget.fillColor,
360 ),
334 - Positioned(
335 - top: 2,
336 - right: 0,
337 - child: SizedBox(
338 - width: _isMoneroWallet ? 80 : 36,
339 - child: Row(children: <Widget>[
340 - if (_isMoneroWallet)
341 - Padding(
342 - padding: EdgeInsets.only(left: 10),
343 - child: Container(
344 - width: 34,
345 - height: 34,
346 - padding: EdgeInsets.only(top: 0),
347 - child: Semantics(
348 - label: S.of(context).address_book,
349 - child: InkWell(
350 - key: ValueKey(
351 - '${_cardInstanceName}_address_book_button_key'),
352 - onTap: () async {
353 - final contact =
354 - await Navigator.of(context).pushNamed(
355 - Routes.pickerAddressBook,
356 - arguments: widget.initialCurrency,
357 - );
361 + ),
362 + Positioned(
363 + top: 2,
364 + right: 0,
365 + child: SizedBox(
366 + width: _isMoneroWallet ? 80 : 36,
367 + child: Row(
368 + children: <Widget>[
369 + if (_isMoneroWallet)
370 + Padding(
371 + padding: EdgeInsets.only(left: 10),
372 + child: Container(
373 + width: 34,
374 + height: 34,
375 + padding: EdgeInsets.only(top: 0),
376 + child: Semantics(
377 + label: S.of(context).address_book,
378 + child: InkWell(
379 + key: ValueKey(
380 + '${_cardInstanceName}_address_book_button_key'),
381 + onTap: () async {
382 + final contact = await Navigator.of(context).pushNamed(
383 + Routes.pickerAddressBook,
384 + arguments: widget.initialCurrency,
385 + );
386
359 - if (contact is ContactBase) {
360 - setState(() =>
361 - addressController.text = contact.address);
362 - widget.onPushAddressBookButton?.call(context);
363 - }
364 - },
365 - child: Container(
366 - padding: EdgeInsets.all(8),
367 - decoration: BoxDecoration(
368 - color: widget.addressButtonsColor,
369 - borderRadius:
370 - BorderRadius.all(Radius.circular(6))),
371 - child: Image.asset(
372 - 'assets/images/open_book.png',
373 - color: Theme.of(context)
374 - .extension<SendPageTheme>()!
375 - .textFieldButtonIconColor,
376 - )),
377 - ),
378 - )),
387 + if (contact is ContactBase) {
388 + setState(
389 + () => addressController.text = contact.address);
390 + widget.onPushAddressBookButton?.call(context);
391 + }
392 + },
393 + child: Container(
394 + padding: EdgeInsets.all(8),
395 + decoration: BoxDecoration(
396 + color: widget.addressButtonsColor,
397 + borderRadius: BorderRadius.all(Radius.circular(6))),
398 + child: Image.asset(
399 + 'assets/images/open_book.png',
400 + color: Theme.of(context).colorScheme.onSurface,
401 + ),
402 + ),
403 + ),
404 ),
380 - Padding(
381 - padding: EdgeInsets.only(left: 2),
405 + ),
406 + ),
407 + Padding(
408 + padding: EdgeInsets.only(left: 2),
409 + child: Container(
410 + width: 34,
411 + height: 34,
412 + padding: EdgeInsets.only(top: 0),
413 + child: Semantics(
414 + label: S.of(context).copy_address,
415 + child: InkWell(
416 + key: ValueKey(
417 + '${_cardInstanceName}_copy_refund_address_button_key'),
418 + onTap: () {
419 + Clipboard.setData(
420 + ClipboardData(text: addressController.text));
421 + showBar<void>(context, S.of(context).copied_to_clipboard);
422 + },
423 child: Container(
383 - width: 34,
384 - height: 34,
385 - padding: EdgeInsets.only(top: 0),
386 - child: Semantics(
387 - label: S.of(context).copy_address,
388 - child: InkWell(
389 - key: ValueKey(
390 - '${_cardInstanceName}_copy_refund_address_button_key'),
391 - onTap: () {
392 - Clipboard.setData(
393 - ClipboardData(text: addressController.text));
394 - showBar<void>(
395 - context, S.of(context).copied_to_clipboard);
396 - },
397 - child: Container(
398 - padding: EdgeInsets.fromLTRB(8, 8, 0, 8),
399 - color: Colors.transparent,
400 - child: copyImage),
401 - ),
402 - )))
403 - ])))
404 - ])),
405 - ),
406 - ]),
424 + padding: EdgeInsets.fromLTRB(8, 8, 0, 8),
425 + color: Colors.transparent,
426 + child: copyImage,
427 + ),
428 + ),
429 + ),
430 + ),
431 + )
432 + ],
433 + ),
434 + ),
435 + )
436 + ],
437 + ),
438 + ),
439 + ),
440 + ],
441 + ),
442 );
443 }
444
@@ -445,4 +480,3 @@ class ExchangeCardState<T extends Currency> extends State<ExchangeCard<T>> {
480 return address;
481 }
482 }
448 -
lib/src/screens/exchange/widgets/mobile_exchange_cards_section.dart
+38 -34
@@ -1,7 +1,5 @@
1 import 'package:cake_wallet/generated/i18n.dart';
2 import 'package:cake_wallet/src/screens/new_wallet/widgets/select_button.dart';
3 -import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart';
4 -import 'package:cake_wallet/themes/extensions/send_page_theme.dart';
3 import 'package:flutter/material.dart';
4
5 class MobileExchangeCardsSection extends StatelessWidget {
@@ -29,40 +27,28 @@ class MobileExchangeCardsSection extends StatelessWidget {
27 bottomLeft: Radius.circular(24),
28 bottomRight: Radius.circular(24),
29 ),
32 - gradient: LinearGradient(
33 - colors: [
34 - Theme.of(context).extension<ExchangePageTheme>()!.firstGradientBottomPanelColor,
35 - Theme.of(context).extension<ExchangePageTheme>()!.secondGradientBottomPanelColor,
36 - ],
37 - stops: [0.35, 1.0],
38 - begin: Alignment.topLeft,
39 - end: Alignment.bottomRight,
40 - ),
30 + color: Theme.of(context).colorScheme.surfaceContainer,
31 ),
32 child: Column(
33 children: <Widget>[
34 Container(
35 decoration: BoxDecoration(
36 borderRadius: BorderRadius.only(
47 - bottomLeft: Radius.circular(24), bottomRight: Radius.circular(24)),
48 - gradient: LinearGradient(
49 - colors: [
50 - Theme.of(context).extension<ExchangePageTheme>()!.firstGradientTopPanelColor,
51 - Theme.of(context).extension<ExchangePageTheme>()!.secondGradientTopPanelColor,
52 - ],
53 - begin: Alignment.topLeft,
54 - end: Alignment.bottomRight,
37 + bottomLeft: Radius.circular(24),
38 + bottomRight: Radius.circular(24),
39 ),
40 + color: Theme.of(context).colorScheme.surfaceContainerLow,
41 ),
57 - padding: EdgeInsets.fromLTRB(24, 90, 24, isBuySellOption ? 24 : 16),
42 + padding: EdgeInsets.fromLTRB(24, 105, 24, 24),
43 child: Column(
44 children: [
60 - if (isBuySellOption) Column(
61 - children: [
62 - const SizedBox(height: 16),
63 - BuySellOptionButtons(onBuyTap: onBuyTap, onSellTap: onSellTap),
64 - ],
65 - ),
45 + if (isBuySellOption)
46 + Column(
47 + children: [
48 + const SizedBox(height: 16),
49 + BuySellOptionButtons(onBuyTap: onBuyTap, onSellTap: onSellTap),
50 + ],
51 + ),
52 firstExchangeCard,
53 ],
54 ),
@@ -104,12 +90,21 @@ class _BuySellOptionButtonsState extends State<BuySellOptionButtons> {
90 text: S.of(context).buy,
91 isSelected: isBuySelected,
92 showTrailingIcon: false,
107 - textColor: Colors.white,
108 - image: Image.asset('assets/images/buy.png', height: 25, width: 25),
93 + textColor: isBuySelected
94 + ? Theme.of(context).colorScheme.onPrimary
95 + : Theme.of(context).colorScheme.onSecondaryContainer,
96 + image: Image.asset(
97 + 'assets/images/buy.png',
98 + height: 25,
99 + width: 25,
100 + color: isBuySelected
101 + ? Theme.of(context).colorScheme.onPrimary
102 + : Theme.of(context).colorScheme.onSecondaryContainer,
103 + ),
104 padding: EdgeInsets.only(left: 10, right: 30),
105 color: isBuySelected
111 - ? null
112 - : Theme.of(context).extension<SendPageTheme>()!.textFieldButtonColor,
106 + ? Theme.of(context).colorScheme.primary
107 + : Theme.of(context).colorScheme.surfaceContainer,
108 onTap: () {
109 setState(() => isBuySelected = true);
110 if (widget.onBuyTap != null) widget.onBuyTap!();
@@ -124,12 +119,21 @@ class _BuySellOptionButtonsState extends State<BuySellOptionButtons> {
119 text: S.of(context).sell,
120 isSelected: !isBuySelected,
121 showTrailingIcon: false,
127 - textColor: Colors.white,
128 - image: Image.asset('assets/images/sell.png', height: 25, width: 25),
122 + textColor: !isBuySelected
123 + ? Theme.of(context).colorScheme.onPrimary
124 + : Theme.of(context).colorScheme.onSecondaryContainer,
125 + image: Image.asset(
126 + 'assets/images/sell.png',
127 + height: 25,
128 + width: 25,
129 + color: !isBuySelected
130 + ? Theme.of(context).colorScheme.onPrimary
131 + : Theme.of(context).colorScheme.onSecondaryContainer,
132 + ),
133 padding: EdgeInsets.only(left: 10, right: 30),
134 color: !isBuySelected
131 - ? null
132 - : Theme.of(context).extension<SendPageTheme>()!.textFieldButtonColor,
135 + ? Theme.of(context).colorScheme.primary
136 + : Theme.of(context).colorScheme.surfaceContainer,
137 onTap: () {
138 setState(() => isBuySelected = false);
139 if (widget.onSellTap != null) widget.onSellTap!();
lib/src/screens/exchange/widgets/present_provider_picker.dart
+81 -72
@@ -1,5 +1,4 @@
1 import 'package:cake_wallet/src/widgets/alert_with_one_action.dart';
2 -import 'package:cake_wallet/themes/extensions/qr_code_theme.dart';
2 import 'package:cake_wallet/src/widgets/check_box_picker.dart';
3 import 'package:cake_wallet/utils/show_pop_up.dart';
4 import 'package:flutter/material.dart';
@@ -15,83 +14,93 @@ class PresentProviderPicker extends StatelessWidget {
14 @override
15 Widget build(BuildContext context) {
16 final arrowBottom = Image.asset(
18 - 'assets/images/arrow_bottom_purple_icon.png',
19 - color: Colors.white,
20 - height: 6);
17 + 'assets/images/arrow_bottom_purple_icon.png',
18 + color: Theme.of(context).colorScheme.onSurface,
19 + height: 6,
20 + );
21
22 return TextButton(
23 - onPressed: () => presentProviderPicker(context),
24 - style: ButtonStyle(
25 - padding: MaterialStateProperty.all(EdgeInsets.zero),
26 - splashFactory: NoSplash.splashFactory,
27 - foregroundColor: MaterialStateProperty.all(Colors.transparent),
28 - overlayColor: MaterialStateProperty.all(Colors.transparent),
29 - ),
30 - child: Row(
31 - mainAxisSize: MainAxisSize.min,
32 - crossAxisAlignment: CrossAxisAlignment.start,
33 - children: <Widget>[
34 - Column(
35 - crossAxisAlignment: CrossAxisAlignment.center,
36 - mainAxisSize: MainAxisSize.min,
37 - children: <Widget>[
38 - Text(S.of(context).swap,
39 - style: TextStyle(
40 - fontSize: 16.0,
41 - fontWeight: FontWeight.w600,
42 -
43 - color: Colors.white)),
44 - Observer(
45 - builder: (_) => Text(
46 - exchangeViewModel.selectedProviders.isEmpty
47 - ? S.of(context).choose_one
48 - : exchangeViewModel.selectedProviders.length > 1
49 - ? S.of(context).automatic
50 - : exchangeViewModel.selectedProviders.first.title,
51 - style: TextStyle(
52 - fontSize: 10.0,
53 - fontWeight: FontWeight.w500,
54 - color: Theme.of(context).extension<QRCodeTheme>()!.qrCodeColor)))
55 - ],
56 - ),
57 - SizedBox(width: 5),
58 - Padding(
59 - padding: EdgeInsets.only(top: 12),
60 - child: arrowBottom,
61 - )
62 - ],
63 - ));
23 + onPressed: () => presentProviderPicker(context),
24 + style: ButtonStyle(
25 + padding: WidgetStateProperty.all(EdgeInsets.zero),
26 + splashFactory: NoSplash.splashFactory,
27 + foregroundColor: WidgetStateProperty.all(Colors.transparent),
28 + overlayColor: WidgetStateProperty.all(Colors.transparent),
29 + ),
30 + child: Row(
31 + mainAxisSize: MainAxisSize.min,
32 + crossAxisAlignment: CrossAxisAlignment.start,
33 + children: <Widget>[
34 + Column(
35 + crossAxisAlignment: CrossAxisAlignment.center,
36 + mainAxisSize: MainAxisSize.min,
37 + children: <Widget>[
38 + Text(
39 + S.of(context).swap,
40 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
41 + fontSize: 16.0,
42 + fontWeight: FontWeight.w600,
43 + ),
44 + ),
45 + Observer(
46 + builder: (_) => Text(
47 + exchangeViewModel.selectedProviders.isEmpty
48 + ? S.of(context).choose_one
49 + : exchangeViewModel.selectedProviders.length > 1
50 + ? S.of(context).automatic
51 + : exchangeViewModel.selectedProviders.first.title,
52 + style: Theme.of(context).textTheme.bodySmall?.copyWith(
53 + fontSize: 10.0,
54 + fontWeight: FontWeight.w500,
55 + color: Theme.of(context).colorScheme.onSurfaceVariant,
56 + ),
57 + ),
58 + )
59 + ],
60 + ),
61 + SizedBox(width: 5),
62 + Padding(
63 + padding: EdgeInsets.only(top: 12),
64 + child: arrowBottom,
65 + )
66 + ],
67 + ),
68 + );
69 }
70
71 void presentProviderPicker(BuildContext context) async {
72 await showPopUp<void>(
68 - builder: (BuildContext popUpContext) => CheckBoxPicker(
69 - items: exchangeViewModel.providerList
70 - .map((e) => CheckBoxItem(
71 - e.title,
72 - exchangeViewModel.selectedProviders.contains(e),
73 - isDisabled: !exchangeViewModel.providersForCurrentPair().contains(e),
74 - ))
75 - .toList(),
76 - title: S.of(context).change_exchange_provider,
77 - onChanged: (int index, bool value) {
78 - if (!exchangeViewModel.providerList[index].isAvailable) {
79 - showPopUp<void>(
80 - builder: (BuildContext popUpContext) => AlertWithOneAction(
81 - alertTitle: 'Error',
82 - alertContent: 'The exchange is blocked in your region.',
83 - buttonText: S.of(context).ok,
84 - buttonAction: () => Navigator.of(context).pop()),
85 - context: context);
86 - return;
87 - }
88 - if (value) {
89 - exchangeViewModel.addExchangeProvider(exchangeViewModel.providerList[index]);
90 - } else {
91 - exchangeViewModel.removeExchangeProvider(exchangeViewModel.providerList[index]);
92 - }
93 - }),
94 - context: context);
73 + builder: (BuildContext popUpContext) => CheckBoxPicker(
74 + items: exchangeViewModel.providerList
75 + .map(
76 + (e) => CheckBoxItem(
77 + e.title,
78 + exchangeViewModel.selectedProviders.contains(e),
79 + isDisabled: !exchangeViewModel.providersForCurrentPair().contains(e),
80 + ),
81 + )
82 + .toList(),
83 + title: S.of(context).change_exchange_provider,
84 + onChanged: (int index, bool value) {
85 + if (!exchangeViewModel.providerList[index].isAvailable) {
86 + showPopUp<void>(
87 + builder: (BuildContext popUpContext) => AlertWithOneAction(
88 + alertTitle: 'Error',
89 + alertContent: 'The exchange is blocked in your region.',
90 + buttonText: S.of(context).ok,
91 + buttonAction: () => Navigator.of(context).pop()),
92 + context: context);
93 + return;
94 + }
95 + if (value) {
96 + exchangeViewModel.addExchangeProvider(exchangeViewModel.providerList[index]);
97 + } else {
98 + exchangeViewModel.removeExchangeProvider(exchangeViewModel.providerList[index]);
99 + }
100 + },
101 + ),
102 + context: context,
103 + );
104
105 exchangeViewModel.saveSelectedProviders();
106 }
lib/src/screens/exchange_trade/exchange_confirm_page.dart
+100 -98
@@ -1,18 +1,14 @@
1 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
1 import 'package:cake_wallet/exchange/exchange_provider_description.dart';
2 import 'package:cake_wallet/store/dashboard/trades_store.dart';
4 -import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart';
3 import 'package:cake_wallet/utils/image_utill.dart';
4 import 'package:cake_wallet/utils/show_bar.dart';
5 import 'package:flutter/material.dart';
8 -import 'package:flutter/cupertino.dart';
6 import 'package:flutter/services.dart';
7 import 'package:cake_wallet/routes.dart';
8 import 'package:cake_wallet/generated/i18n.dart';
9 import 'package:cake_wallet/src/widgets/primary_button.dart';
10 import 'package:cake_wallet/src/screens/base_page.dart';
11 import 'package:cake_wallet/exchange/trade.dart';
15 -import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart';
12
13 class ExchangeConfirmPage extends BasePage {
14 ExchangeConfirmPage({required this.tradesStore}) : trade = tradesStore.trade!;
@@ -30,117 +26,123 @@ class ExchangeConfirmPage extends BasePage {
26 child: Column(
27 children: <Widget>[
28 Expanded(
33 - child: Column(
34 - children: <Widget>[
35 - Flexible(
29 + child: Column(
30 + children: <Widget>[
31 + Flexible(
32 child: Center(
37 - child: Text(
38 - S.of(context).exchange_result_write_down_trade_id,
39 - textAlign: TextAlign.center,
40 - style: TextStyle(
41 - fontSize: 18.0,
42 - fontWeight: FontWeight.w500,
43 - color: Theme.of(context).extension<TransactionTradeTheme>()!.detailsTitlesColor),
33 + child: Text(
34 + S.of(context).exchange_result_write_down_trade_id,
35 + textAlign: TextAlign.center,
36 + style: Theme.of(context).textTheme.bodyLarge?.copyWith(
37 + fontSize: 18.0,
38 + fontWeight: FontWeight.w500,
39 + ),
40 + ),
41 + ),
42 ),
45 - )),
46 - Container(
47 - height: 178,
48 - decoration: BoxDecoration(
43 + Container(
44 + height: 178,
45 + decoration: BoxDecoration(
46 borderRadius: BorderRadius.all(Radius.circular(30)),
47 border: Border.all(
51 - width: 1,
52 - color: Theme.of(context).cardColor),
53 - color: Theme.of(context).dialogTheme.backgroundColor),
54 - child: Column(
55 - children: <Widget>[
56 - Expanded(
48 + width: 0.0,
49 + color: Theme.of(context).colorScheme.outlineVariant,
50 + ),
51 + color: Theme.of(context).colorScheme.surfaceContainer,
52 + ),
53 + child: Column(
54 + children: <Widget>[
55 + Expanded(
56 child: Padding(
58 - padding: EdgeInsets.all(24),
59 - child: Column(
60 - mainAxisAlignment: MainAxisAlignment.spaceBetween,
61 - crossAxisAlignment: CrossAxisAlignment.center,
62 - children: <Widget>[
63 - Text(
64 - "${trade.provider.title} ${S.of(context).trade_id}",
65 - style: TextStyle(
66 - fontSize: 12.0,
67 - fontWeight: FontWeight.w500,
68 - color: Theme.of(context).extension<TransactionTradeTheme>()!.detailsTitlesColor),
69 - ),
70 - Text(
71 - trade.id,
72 - maxLines: 1,
73 - overflow: TextOverflow.ellipsis,
74 - style: TextStyle(
75 - fontSize: 20,
76 - fontWeight: FontWeight.w600,
77 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor),
57 + padding: EdgeInsets.all(24),
58 + child: Column(
59 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
60 + crossAxisAlignment: CrossAxisAlignment.center,
61 + children: <Widget>[
62 + Text(
63 + "${trade.provider.title} ${S.of(context).trade_id}",
64 + style: Theme.of(context).textTheme.bodySmall?.copyWith(
65 + fontWeight: FontWeight.w500,
66 + ),
67 + ),
68 + Text(
69 + trade.id,
70 + maxLines: 1,
71 + overflow: TextOverflow.ellipsis,
72 + style: Theme.of(context).textTheme.titleLarge?.copyWith(
73 + fontSize: 20,
74 + fontWeight: FontWeight.w600,
75 + color: Theme.of(context).colorScheme.onSurface,
76 + ),
77 + ),
78 + ],
79 ),
79 - ],
80 + ),
81 ),
81 - )),
82 - Padding(
83 - padding: EdgeInsets.fromLTRB(10, 0, 10, 10),
84 - child: Builder(
85 - builder: (context) => PrimaryButton(
86 - key: ValueKey('exchange_confirm_page_copy_to_clipboard_button_key'),
82 + Padding(
83 + padding: EdgeInsets.fromLTRB(10, 0, 10, 10),
84 + child: Builder(
85 + builder: (context) => PrimaryButton(
86 + key: ValueKey('exchange_confirm_page_copy_to_clipboard_button_key'),
87 onPressed: () {
88 Clipboard.setData(ClipboardData(text: trade.id));
89 - showBar<void>(
90 - context, S.of(context).copied_to_clipboard);
89 + showBar<void>(context, S.of(context).copied_to_clipboard);
90 },
91 text: S.of(context).copy_id,
93 - color: Theme.of(context).extension<ExchangePageTheme>()!.buttonBackgroundColor,
94 - textColor: Theme.of(context).extension<CakeTextTheme>()!.titleColor),
95 - ),
96 - )
97 - ],
92 + color: Theme.of(context).colorScheme.surfaceContainerLow,
93 + textColor: Theme.of(context).colorScheme.onSurface,
94 + borderRadius: BorderRadius.circular(30.0),
95 + ),
96 + ),
97 + )
98 + ],
99 + ),
100 ),
99 - ),
100 - Expanded(
101 - child: Column(
102 - children: [
103 - if (trade.provider == ExchangeProviderDescription.trocador)
104 - Padding(
105 - padding: const EdgeInsets.only(top: 8.0),
106 - child: Text(
107 - S.of(context).selected_trocador_provider +':${trade.providerName}',
108 - textAlign: TextAlign.center,
109 - style: TextStyle(
110 - fontSize: 12.0,
111 - fontWeight: FontWeight.w500,
112 - color: Theme.of(context).extension<TransactionTradeTheme>()!.detailsTitlesColor),
113 - ),
114 - ),
115 - Flexible(
116 - child: Center(
117 - child: Row(
118 - mainAxisAlignment: MainAxisAlignment.center,
119 - children: [
120 - (trade.provider.image?.isNotEmpty ?? false)
121 - ? ImageUtil.getImageFromPath(imagePath: trade.provider.image, height: 50, width: 50)
122 - : const SizedBox(),
123 - if (!trade.provider.horizontalLogo)
124 - Padding(
125 - padding: const EdgeInsets.symmetric(horizontal: 8.0),
126 - child: Text(trade.provider.title),
127 - ),
128 - ],
101 + Expanded(
102 + child: Column(
103 + children: [
104 + if (trade.provider == ExchangeProviderDescription.trocador)
105 + Padding(
106 + padding: const EdgeInsets.only(top: 8.0),
107 + child: Text(
108 + S.of(context).selected_trocador_provider + ':${trade.providerName}',
109 + textAlign: TextAlign.center,
110 + style: Theme.of(context).textTheme.bodySmall?.copyWith(
111 + fontWeight: FontWeight.w500,
112 + ),
113 + ),
114 + ),
115 + Flexible(
116 + child: Center(
117 + child: Row(
118 + mainAxisAlignment: MainAxisAlignment.center,
119 + children: [
120 + (trade.provider.image.isNotEmpty)
121 + ? ImageUtil.getImageFromPath(
122 + imagePath: trade.provider.image, height: 50, width: 50)
123 + : const SizedBox(),
124 + if (!trade.provider.horizontalLogo)
125 + Padding(
126 + padding: const EdgeInsets.symmetric(horizontal: 8.0),
127 + child: Text(trade.provider.title),
128 + ),
129 + ],
130 + ),
131 ),
132 ),
131 - ),
132 - ],
133 + ],
134 + ),
135 ),
134 - ),
135 - ],
136 - )),
136 + ],
137 + ),
138 + ),
139 PrimaryButton(
140 key: ValueKey('exchange_confirm_page_saved_id_button_key'),
139 - onPressed: () => Navigator.of(context)
140 - .pushReplacementNamed(Routes.exchangeTrade),
141 - text: S.of(context).saved_the_trade_id,
142 - color: Theme.of(context).primaryColor,
143 - textColor: Colors.white)
141 + onPressed: () => Navigator.of(context).pushReplacementNamed(Routes.exchangeTrade),
142 + text: S.of(context).saved_the_trade_id,
143 + color: Theme.of(context).colorScheme.primary,
144 + textColor: Theme.of(context).colorScheme.onPrimary,
145 + )
146 ],
147 ),
148 );
lib/src/screens/exchange_trade/exchange_trade_external_send_page.dart
+5 -16
@@ -1,7 +1,5 @@
1 import 'package:cake_wallet/src/screens/exchange_trade/widgets/exchange_trade_card_item_widget.dart';
2 import 'package:cake_wallet/src/screens/receive/widgets/qr_image.dart';
3 -import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart';
4 -import 'package:cake_wallet/themes/extensions/send_page_theme.dart';
3 import 'package:flutter_mobx/flutter_mobx.dart';
4 import 'package:flutter/material.dart';
5 import 'package:cake_wallet/generated/i18n.dart';
@@ -39,7 +37,7 @@ class ExchangeTradeExternalSendPage extends BasePage {
37 'assets/images/copy_content.png',
38 height: 16,
39 width: 16,
42 - color: Theme.of(context).extension<SendPageTheme>()!.estimatedFeeColor,
40 + color: Theme.of(context).colorScheme.primary,
41 );
42 return Container(
43 child: ScrollableWithBottomSection(
@@ -52,14 +50,7 @@ class ExchangeTradeExternalSendPage extends BasePage {
50 decoration: BoxDecoration(
51 borderRadius: BorderRadius.only(
52 bottomLeft: Radius.circular(24), bottomRight: Radius.circular(24)),
55 - gradient: LinearGradient(
56 - colors: [
57 - Theme.of(context).extension<SendPageTheme>()!.firstGradientColor,
58 - Theme.of(context).extension<SendPageTheme>()!.secondGradientColor,
59 - ],
60 - begin: Alignment.topLeft,
61 - end: Alignment.bottomRight,
62 - ),
53 + color: Theme.of(context).colorScheme.surfaceContainerLow,
54 ),
55 padding: EdgeInsets.fromLTRB(24, 110, 24, 32),
56 child: Column(
@@ -78,9 +69,7 @@ class ExchangeTradeExternalSendPage extends BasePage {
69 decoration: BoxDecoration(
70 border: Border.all(
71 width: 3,
81 - color: Theme.of(context)
82 - .extension<ExchangePageTheme>()!
83 - .qrCodeColor,
72 + color: Theme.of(context).colorScheme.primary,
73 ),
74 ),
75 child: QrImage(
@@ -128,8 +117,8 @@ class ExchangeTradeExternalSendPage extends BasePage {
117 Navigator.of(context).popUntil((route) => route.isFirst);
118 },
119 text: S.current.continue_text,
131 - color: Theme.of(context).primaryColor,
132 - textColor: Colors.white,
120 + color: Theme.of(context).colorScheme.primary,
121 + textColor: Theme.of(context).colorScheme.onPrimary,
122 )
123 : Offstage();
124 },
lib/src/screens/exchange_trade/exchange_trade_page.dart
+21 -24
@@ -5,8 +5,7 @@ import 'package:cake_wallet/src/screens/exchange/widgets/mobile_exchange_cards_s
5 import 'package:cake_wallet/src/screens/exchange_trade/widgets/exchange_trade_card_item_widget.dart';
6 import 'package:cake_wallet/src/widgets/bottom_sheet/confirm_sending_bottom_sheet_widget.dart';
7 import 'package:cake_wallet/src/widgets/bottom_sheet/info_bottom_sheet_widget.dart';
8 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
9 -import 'package:cake_wallet/themes/theme_base.dart';
8 +import 'package:cake_wallet/themes/core/material_base_theme.dart';
9 import 'package:cake_wallet/utils/request_review_handler.dart';
10 import 'package:cake_wallet/utils/responsive_layout_util.dart';
11 import 'package:mobx/mobx.dart';
@@ -23,7 +22,6 @@ import 'package:cake_wallet/src/screens/exchange_trade/widgets/timer_widget.dart
22 import 'package:cake_wallet/src/widgets/primary_button.dart';
23 import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
24 import 'package:cake_wallet/src/widgets/alert_with_one_action.dart';
26 -import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart';
25
26 void showInformation(ExchangeTradeViewModel exchangeTradeViewModel, BuildContext context) {
27 final trade = exchangeTradeViewModel.trade;
@@ -36,9 +34,12 @@ void showInformation(ExchangeTradeViewModel exchangeTradeViewModel, BuildContext
34 exchangeTradeViewModel.extraInfo;
35
36 showPopUp<void>(
39 - context: context,
40 - builder: (_) =>
41 - InformationPage(key: ValueKey('information_page_dialog_key'), information: information));
37 + context: context,
38 + builder: (_) => InformationPage(
39 + key: ValueKey('information_page_dialog_key'),
40 + information: information,
41 + ),
42 + );
43 }
44
45 class ExchangeTradePage extends BasePage {
@@ -64,7 +65,7 @@ class ExchangeTradePage extends BasePage {
65 @override
66 Widget trailing(BuildContext context) {
67 final questionImage = Image.asset('assets/images/question_mark.png',
67 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor);
68 + color: Theme.of(context).colorScheme.onSurface);
69
70 return SizedBox(
71 height: 20.0,
@@ -96,7 +97,7 @@ class ExchangeTradeForm extends StatefulWidget {
97 );
98
99 final ExchangeTradeViewModel exchangeTradeViewModel;
99 - final ThemeBase currentTheme;
100 + final MaterialThemeBase currentTheme;
101
102 @override
103 ExchangeTradeState createState() => ExchangeTradeState();
@@ -147,16 +148,13 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
148 children: <Widget>[
149 Text(
150 S.of(context).offer_expires_in,
150 - style: TextStyle(
151 - fontSize: 14.0,
152 - fontWeight: FontWeight.w500,
153 - color: Theme.of(context)
154 - .extension<TransactionTradeTheme>()!
155 - .detailsTitlesColor),
151 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
152 + fontWeight: FontWeight.w500,
153 + ),
154 ),
155 if (trade.expiredAt != null)
156 TimerWidget(trade.expiredAt!,
159 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor)
157 + color: Theme.of(context).colorScheme.onSurface)
158 ])
159 : Offstage(),
160 _ExchangeTradeItemsCardSection(
@@ -175,8 +173,8 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
173 onPressed: () async {
174 Navigator.of(context).pushNamed(Routes.exchangeTradeExternalSendPage);
175 },
178 - color: Theme.of(context).cardColor,
179 - textColor: Theme.of(context).extension<CakeTextTheme>()!.buttonTextColor,
176 + color: Theme.of(context).colorScheme.surfaceContainer,
177 + textColor: Theme.of(context).colorScheme.onSecondaryContainer,
178 ),
179 SizedBox(height: 16),
180 Observer(
@@ -192,8 +190,8 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
190 isLoading: sendingState is IsExecutingState,
191 onPressed: () => widget.exchangeTradeViewModel.confirmSending(),
192 text: S.current.send_from_cake_wallet,
195 - color: Theme.of(context).primaryColor,
196 - textColor: Colors.white,
193 + color: Theme.of(context).colorScheme.primary,
194 + textColor: Theme.of(context).colorScheme.onPrimary,
195 )
196 : Offstage();
197 },
@@ -214,10 +212,9 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
212
213 _exchangeStateReaction = reaction((_) => this.widget.exchangeTradeViewModel.sendViewModel.state,
214 (ExecutionState state) async {
217 -
218 - if (dialogContext != null && dialogContext?.mounted == true) {
219 - Navigator.of(dialogContext!).pop();
220 - }
215 + if (dialogContext != null && dialogContext?.mounted == true) {
216 + Navigator.of(dialogContext!).pop();
217 + }
218
219 if (state is! IsExecutingState &&
220 loadingBottomSheetContext != null &&
@@ -346,7 +343,7 @@ class _ExchangeTradeItemsCardSection extends StatelessWidget {
343 });
344
345 final ExchangeTradeViewModel viewModel;
349 - final ThemeBase currentTheme;
346 + final MaterialThemeBase currentTheme;
347
348 @override
349 Widget build(BuildContext context) {
lib/src/screens/exchange_trade/information_page.dart
+30 -46
@@ -1,13 +1,7 @@
1 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
2 -import 'dart:ui';
1 import 'package:cake_wallet/generated/i18n.dart';
2 import 'package:cake_wallet/src/widgets/primary_button.dart';
5 -import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart';
6 -import 'package:cake_wallet/themes/extensions/info_theme.dart';
7 -import 'package:flutter/cupertino.dart';
3 import 'package:flutter/material.dart';
4 import 'package:cake_wallet/src/widgets/alert_background.dart';
10 -import 'package:cake_wallet/themes/extensions/menu_theme.dart';
5
6 class InformationPage extends StatelessWidget {
7 InformationPage({required this.information, super.key});
@@ -17,47 +11,37 @@ class InformationPage extends StatelessWidget {
11 @override
12 Widget build(BuildContext context) {
13 return AlertBackground(
20 - child: Center(
21 - child: Container(
22 - margin: EdgeInsets.only(
23 - left: 24,
24 - right: 24
25 - ),
26 - decoration: BoxDecoration(
27 - borderRadius: BorderRadius.all(Radius.circular(30)),
28 - color: Theme.of(context).extension<CakeMenuTheme>()!.backgroundColor
29 - ),
30 - child: Column(
31 - mainAxisSize: MainAxisSize.min,
32 - children: <Widget>[
33 - Container(
34 - padding: EdgeInsets.fromLTRB(24, 28, 24, 24),
35 - child: Text(
36 - information,
37 - textAlign: TextAlign.center,
38 - style: TextStyle(
39 - fontSize: 14,
40 - fontWeight: FontWeight.normal,
41 - fontFamily: 'Lato',
42 - decoration: TextDecoration.none,
43 - color: Theme.of(context).extension<InfoTheme>()!.textColor
44 - ),
45 - ),
14 + child: Center(
15 + child: Container(
16 + margin: EdgeInsets.only(left: 24, right: 24),
17 + decoration: BoxDecoration(
18 + borderRadius: BorderRadius.all(Radius.circular(30)),
19 + color: Theme.of(context).colorScheme.surface,
20 + ),
21 + child: Column(
22 + mainAxisSize: MainAxisSize.min,
23 + children: <Widget>[
24 + Container(
25 + padding: EdgeInsets.fromLTRB(24, 28, 24, 24),
26 + child: Text(
27 + information,
28 + textAlign: TextAlign.center,
29 + style: Theme.of(context).textTheme.bodyMedium,
30 + ),
31 + ),
32 + Padding(
33 + padding: EdgeInsets.fromLTRB(10, 0, 10, 10),
34 + child: PrimaryButton(
35 + key: ValueKey('information_page_got_it_button_key'),
36 + onPressed: () => Navigator.of(context).pop(),
37 + text: S.of(context).got_it,
38 + color: Theme.of(context).colorScheme.surfaceContainer,
39 + textColor: Theme.of(context).colorScheme.onSurface,
40 ),
47 - Padding(
48 - padding: EdgeInsets.fromLTRB(10, 0, 10, 10),
49 - child: PrimaryButton(
50 - key: ValueKey('information_page_got_it_button_key'),
51 - onPressed: () => Navigator.of(context).pop(),
52 - text: S.of(context).got_it,
53 - color: Theme.of(context).extension<ExchangePageTheme>()!.buttonBackgroundColor,
54 - textColor: Theme.of(context).extension<CakeTextTheme>()!.titleColor
55 - ),
56 - )
57 - ],
58 - ),
41 + )
42 + ],
43 ),
60 - )
61 - );
44 + ),
45 + ));
46 }
47 }
lib/src/screens/exchange_trade/widgets/exchange_trade_card_item_widget.dart
+24 -41
@@ -4,6 +4,7 @@ import 'package:cake_wallet/routes.dart';
4 import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
5 import 'package:cake_wallet/src/widgets/list_row.dart';
6 import 'package:cake_wallet/src/widgets/picker.dart';
7 +import 'package:cake_wallet/themes/core/material_base_theme.dart';
8 import 'package:cake_wallet/utils/show_bar.dart';
9 import 'package:cake_wallet/utils/show_pop_up.dart';
10 import 'package:cake_wallet/view_model/exchange/exchange_trade_view_model.dart';
@@ -12,12 +13,8 @@ import 'package:cake_wallet/view_model/send/output.dart';
13 import 'package:cw_core/transaction_priority.dart';
14 import 'package:cw_core/wallet_type.dart';
15 import 'package:flutter/material.dart';
15 -import 'package:cake_wallet/themes/extensions/send_page_theme.dart';
16 import 'package:flutter/services.dart';
17 import 'package:flutter_mobx/flutter_mobx.dart';
18 -import '../../../../themes/extensions/cake_text_theme.dart';
19 -import '../../../../themes/extensions/transaction_trade_theme.dart';
20 -import '../../../../themes/theme_base.dart';
18
19 class ExchangeTradeCardItemWidget extends StatelessWidget {
20 ExchangeTradeCardItemWidget({
@@ -32,7 +29,7 @@ class ExchangeTradeCardItemWidget extends StatelessWidget {
29 final bool isReceiveDetailsCard;
30 final FeesViewModel feesViewModel;
31 final ExchangeTradeViewModel exchangeTradeViewModel;
35 - final ThemeBase currentTheme;
32 + final MaterialThemeBase currentTheme;
33
34 @override
35 Widget build(BuildContext context) {
@@ -40,7 +37,7 @@ class ExchangeTradeCardItemWidget extends StatelessWidget {
37 'assets/images/copy_content.png',
38 height: 16,
39 width: 16,
43 - color: Theme.of(context).extension<SendPageTheme>()!.estimatedFeeColor,
40 + color: Theme.of(context).colorScheme.onSurfaceVariant,
41 );
42
43 return Container(
@@ -154,7 +151,7 @@ class TradeItemRowWidget extends StatelessWidget {
151 final String value;
152 final bool isCopied;
153 final Image copyImage;
157 - final ThemeBase currentTheme;
154 + final MaterialThemeBase currentTheme;
155
156 const TradeItemRowWidget({
157 required this.title,
@@ -166,15 +163,6 @@ class TradeItemRowWidget extends StatelessWidget {
163
164 @override
165 Widget build(BuildContext context) {
169 -
170 - final hintTextColor = currentTheme == ThemeType.bright
171 - ? Theme.of(context).extension<TransactionTradeTheme>()!.detailsTitlesColor
172 - : Colors.white.withAlpha(175);
173 -
174 - final mainTextColor = currentTheme == ThemeType.bright
175 - ? Theme.of(context).extension<CakeTextTheme>()!.titleColor
176 - : Colors.white;
177 -
166 return Padding(
167 padding: const EdgeInsets.symmetric(vertical: 8),
168 child: GestureDetector(
@@ -189,8 +177,8 @@ class TradeItemRowWidget extends StatelessWidget {
177 value: value,
178 image: isCopied ? copyImage : null,
179 color: Colors.transparent,
192 - hintTextColor: hintTextColor,
193 - mainTextColor: mainTextColor,
180 + hintTextColor: Theme.of(context).colorScheme.onSurfaceVariant,
181 + mainTextColor: Theme.of(context).colorScheme.onSurface,
182 ),
183 ),
184 );
@@ -222,11 +210,10 @@ class FeeSelectionWidget extends StatelessWidget {
210 children: <Widget>[
211 Text(
212 S.of(context).send_estimated_fee,
225 - style: TextStyle(
226 - fontSize: 12,
227 - fontWeight: FontWeight.w500,
228 - color: Colors.white,
229 - ),
213 + style: Theme.of(context).textTheme.bodySmall?.copyWith(
214 + fontWeight: FontWeight.w500,
215 + color: Theme.of(context).colorScheme.onSurfaceVariant,
216 + ),
217 ),
218 Row(
219 crossAxisAlignment: CrossAxisAlignment.start,
@@ -236,23 +223,20 @@ class FeeSelectionWidget extends StatelessWidget {
223 children: [
224 Text(
225 '${output.estimatedFee} ${feesViewModel.currency}',
239 - style: TextStyle(
240 - fontSize: 12,
241 - fontWeight: FontWeight.w600,
242 - color: Colors.white,
243 - ),
226 + style: Theme.of(context).textTheme.bodySmall?.copyWith(
227 + fontWeight: FontWeight.w600,
228 + color: Theme.of(context).colorScheme.onSurface,
229 + ),
230 ),
231 if (!feesViewModel.isFiatDisabled)
232 Padding(
233 padding: EdgeInsets.only(top: 5),
234 child: Text(
235 '${output.estimatedFeeFiatAmount} ${feesViewModel.fiat.title}',
250 - style: TextStyle(
251 - fontSize: 12,
252 - fontWeight: FontWeight.w600,
253 - color:
254 - Theme.of(context).extension<SendPageTheme>()!.textFieldHintColor,
255 - ),
236 + style: Theme.of(context).textTheme.bodySmall?.copyWith(
237 + fontWeight: FontWeight.w600,
238 + color: Theme.of(context).colorScheme.onSurfaceVariant,
239 + ),
240 ),
241 ),
242 ],
@@ -262,7 +246,7 @@ class FeeSelectionWidget extends StatelessWidget {
246 child: Icon(
247 Icons.arrow_forward_ios,
248 size: 12,
265 - color: Colors.white,
249 + color: Theme.of(context).colorScheme.onSurfaceVariant,
250 ),
251 ),
252 ],
@@ -293,16 +277,15 @@ class CoinControlWidget extends StatelessWidget {
277 children: [
278 Text(
279 S.of(context).coin_control,
296 - style: TextStyle(
297 - fontSize: 12,
298 - fontWeight: FontWeight.w600,
299 - color: Colors.white,
300 - ),
280 + style: Theme.of(context).textTheme.bodySmall?.copyWith(
281 + fontWeight: FontWeight.w600,
282 + color: Theme.of(context).colorScheme.onSurfaceVariant,
283 + ),
284 ),
285 Icon(
286 Icons.arrow_forward_ios,
287 size: 12,
305 - color: Colors.white,
288 + color: Theme.of(context).colorScheme.onSurfaceVariant,
289 ),
290 ],
291 ),
lib/src/screens/exchange_trade/widgets/timer_widget.dart
+15 -13
@@ -14,10 +14,10 @@ class TimerWidget extends StatefulWidget {
14
15 class TimerWidgetState extends State<TimerWidget> {
16 TimerWidgetState()
17 - : _leftSeconds = 0,
18 - _minutes = 0,
19 - _seconds = 0,
20 - _isExpired = false;
17 + : _leftSeconds = 0,
18 + _minutes = 0,
19 + _seconds = 0,
20 + _isExpired = false;
21
22 int _leftSeconds;
23 int _minutes;
@@ -56,17 +56,19 @@ class TimerWidgetState extends State<TimerWidget> {
56 @override
57 Widget build(BuildContext context) {
58 return _isExpired
59 - ? Text(S.of(context).expired,
60 - style: TextStyle(
61 - fontSize: 14.0,
62 - fontWeight: FontWeight.w500,
63 - color: Colors.red))
59 + ? Text(
60 + S.of(context).expired,
61 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
62 + fontWeight: FontWeight.w500,
63 + color: Theme.of(context).colorScheme.errorContainer,
64 + ),
65 + )
66 : Text(
67 S.of(context).time(_minutes.toString(), _seconds.toString()),
66 - style: TextStyle(
67 - fontSize: 14.0,
68 - fontWeight: FontWeight.w500,
69 - color: widget.color),
68 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
69 + fontWeight: FontWeight.w500,
70 + color: widget.color,
71 + ),
72 );
73 }
74
lib/src/screens/faq/faq_item.dart
+27 -28
@@ -1,6 +1,4 @@
1 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
1 import 'package:flutter/material.dart';
3 -import 'package:cake_wallet/palette.dart';
2
3 class FAQItem extends StatefulWidget {
4 FAQItem(this.title, this.text);
@@ -13,8 +11,7 @@ class FAQItem extends StatefulWidget {
11 }
12
13 class FAQItemState extends State<FAQItem> {
16 - FAQItemState()
17 - : isActive = false;
14 + FAQItemState() : isActive = false;
15
16 bool isActive;
17
@@ -26,39 +23,41 @@ class FAQItemState extends State<FAQItem> {
23
24 @override
25 Widget build(BuildContext context) {
29 - final addIcon = Icon(Icons.add,
30 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor);
31 - final removeIcon = Icon(Icons.remove, color: Palette.blueCraiola);
26 + final addIcon = Icon(Icons.add, color: Theme.of(context).colorScheme.onSurface);
27 + final removeIcon = Icon(Icons.remove, color: Theme.of(context).colorScheme.primary);
28 final icon = isActive ? removeIcon : addIcon;
33 - final color = isActive
34 - ? Palette.blueCraiola
35 - : Theme.of(context).extension<CakeTextTheme>()!.titleColor;
29 + final color =
30 + isActive ? Theme.of(context).colorScheme.primary : Theme.of(context).colorScheme.onSurface;
31
32 return ListTileTheme(
33 contentPadding: EdgeInsets.fromLTRB(0, 6, 24, 6),
34 child: ExpansionTile(
40 - title: Text(widget.title,
41 - style: TextStyle(
42 - fontSize: 14, fontWeight: FontWeight.w500, color: color)),
35 + title: Text(
36 + widget.title,
37 + style: Theme.of(context).textTheme.bodyLarge?.copyWith(
38 + fontWeight: FontWeight.w500,
39 + color: color,
40 + ),
41 + ),
42 trailing: icon,
43 onExpansionChanged: (value) => setState(() => isActive = value),
44 children: <Widget>[
46 - Row(mainAxisAlignment: MainAxisAlignment.start, children: <Widget>[
47 - Expanded(
45 + Row(
46 + mainAxisAlignment: MainAxisAlignment.start,
47 + children: <Widget>[
48 + Expanded(
49 child: Container(
49 - padding: EdgeInsets.only(
50 - right: 24.0,
51 - ),
52 - child: Text(
53 - widget.text,
54 - style: TextStyle(
55 - fontSize: 14,
56 - fontWeight: FontWeight.normal,
57 - color:
58 - Theme.of(context).extension<CakeTextTheme>()!.titleColor),
59 - ),
60 - ))
61 - ])
50 + padding: EdgeInsets.only(
51 + right: 24.0,
52 + ),
53 + child: Text(
54 + widget.text,
55 + style: Theme.of(context).textTheme.bodyMedium,
56 + ),
57 + ),
58 + )
59 + ],
60 + ),
61 ],
62 ),
63 );
lib/src/screens/monero_accounts/monero_account_edit_or_create_page.dart
+30 -33
@@ -1,6 +1,5 @@
1 import 'package:cake_wallet/core/execution_state.dart';
2 import 'package:flutter/material.dart';
3 -import 'package:flutter/cupertino.dart';
3 import 'package:flutter_mobx/flutter_mobx.dart';
4 import 'package:cake_wallet/generated/i18n.dart';
5 import 'package:cake_wallet/core/monero_account_label_validator.dart';
@@ -13,8 +12,7 @@ class MoneroAccountEditOrCreatePage extends BasePage {
12 MoneroAccountEditOrCreatePage({required this.moneroAccountCreationViewModel})
13 : _formKey = GlobalKey<FormState>(),
14 _textController = TextEditingController() {
16 - _textController.addListener(
17 - () => moneroAccountCreationViewModel.label = _textController.text);
15 + _textController.addListener(() => moneroAccountCreationViewModel.label = _textController.text);
16 _textController.text = moneroAccountCreationViewModel.label;
17 }
18
@@ -27,46 +25,45 @@ class MoneroAccountEditOrCreatePage extends BasePage {
25 final TextEditingController _textController;
26
27 @override
30 - Widget body(BuildContext context) =>
31 - Form(
28 + Widget body(BuildContext context) => Form(
29 key: _formKey,
30 child: Container(
31 padding: EdgeInsets.all(24.0),
32 child: Column(
33 children: <Widget>[
34 Expanded(
38 - child: Center(
39 - child: BaseTextFormField(
40 - controller: _textController,
41 - hintText: S.of(context).account,
42 - validator: MoneroLabelValidator(),
43 - ))),
35 + child: Center(
36 + child: BaseTextFormField(
37 + controller: _textController,
38 + hintText: S.of(context).account,
39 + validator: MoneroLabelValidator(),
40 + ),
41 + ),
42 + ),
43 Observer(
45 - builder: (_) =>
46 - LoadingPrimaryButton(
47 - onPressed: () async {
48 - if (_formKey.currentState != null && !_formKey.currentState!.validate()) {
49 - return;
50 - }
44 + builder: (_) => LoadingPrimaryButton(
45 + onPressed: () async {
46 + if (_formKey.currentState != null && !_formKey.currentState!.validate()) {
47 + return;
48 + }
49
52 - await moneroAccountCreationViewModel.save();
50 + await moneroAccountCreationViewModel.save();
51
54 - if (context.mounted) {
55 - Navigator.of(context).pop(_textController.text);
56 - }
57 - },
58 - text: moneroAccountCreationViewModel.isEdit
59 - ? S.of(context).rename
60 - : S.of(context).add,
61 - color: Theme.of(context).primaryColor,
62 - textColor: Colors.white,
63 - isLoading: moneroAccountCreationViewModel.state
64 - is IsExecutingState,
65 - isDisabled:
66 - moneroAccountCreationViewModel.label?.isEmpty ?? true,
67 - ))
52 + if (context.mounted) {
53 + Navigator.of(context).pop(_textController.text);
54 + }
55 + },
56 + text: moneroAccountCreationViewModel.isEdit
57 + ? S.of(context).rename
58 + : S.of(context).add,
59 + color: Theme.of(context).colorScheme.primary,
60 + textColor: Theme.of(context).colorScheme.onPrimary,
61 + isLoading: moneroAccountCreationViewModel.state is IsExecutingState,
62 + isDisabled: moneroAccountCreationViewModel.label?.isEmpty ?? true,
63 + ),
64 + )
65 ],
66 ),
67 ),
68 );
72 -}
\ No newline at end of file
69 +}
lib/src/screens/monero_accounts/monero_account_list_page.dart
+25 -24
@@ -37,29 +37,31 @@ class MoneroAccountListPage extends StatelessWidget {
37 final account = accounts[index];
38
39 return AccountTile(
40 - isCurrent: account.isSelected,
41 - accountName: account.label,
42 - accountBalance: account.balance ?? '0.00',
43 - currency: accountListViewModel.currency.toString(),
44 - onTap: () {
45 - if (account.isSelected) {
46 - return;
47 - }
40 + isCurrent: account.isSelected,
41 + accountName: account.label,
42 + accountBalance: account.balance ?? '0.00',
43 + currency: accountListViewModel.currency.toString(),
44 + onTap: () {
45 + if (account.isSelected) {
46 + return;
47 + }
48
49 - accountListViewModel.select(account);
50 - Navigator.of(context).pop();
51 - },
52 - onEdit: () async => await Navigator.of(context)
53 - .pushNamed(Routes.accountCreation, arguments: account));
49 + accountListViewModel.select(account);
50 + Navigator.of(context).pop();
51 + },
52 + onEdit: () async => await Navigator.of(context).pushNamed(
53 + Routes.accountCreation,
54 + arguments: account,
55 + ),
56 + );
57 },
58 ),
59 )),
60 GestureDetector(
58 - onTap: () async =>
59 - await Navigator.of(context).pushNamed(Routes.accountCreation),
61 + onTap: () async => await Navigator.of(context).pushNamed(Routes.accountCreation),
62 child: Container(
63 height: buttonHeight,
62 - color: Theme.of(context).primaryColor,
64 + color: Theme.of(context).colorScheme.primary,
65 padding: EdgeInsets.symmetric(horizontal: 24),
66 child: Center(
67 child: Row(
@@ -67,19 +69,18 @@ class MoneroAccountListPage extends StatelessWidget {
69 children: <Widget>[
70 Icon(
71 Icons.add,
70 - color: Colors.white,
72 + color: Theme.of(context).colorScheme.onPrimary,
73 ),
74 Padding(
75 padding: EdgeInsets.only(left: 5),
76 child: Text(
77 S.of(context).create_new_account,
76 - style: TextStyle(
77 - fontSize: 15,
78 - fontWeight: FontWeight.w600,
79 - fontFamily: 'Lato',
80 - color: Colors.white,
81 - decoration: TextDecoration.none,
82 - ),
78 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
79 + fontSize: 15,
80 + fontWeight: FontWeight.w600,
81 + color: Theme.of(context).colorScheme.onPrimary,
82 + decoration: TextDecoration.none,
83 + ),
84 ),
85 )
86 ],
lib/src/screens/monero_accounts/widgets/account_tile.dart
+24 -23
@@ -1,4 +1,3 @@
1 -import 'package:cake_wallet/themes/extensions/account_list_theme.dart';
1 import 'package:flutter/material.dart';
2 import 'package:flutter_slidable/flutter_slidable.dart';
3 import 'package:cake_wallet/generated/i18n.dart';
@@ -23,11 +22,11 @@ class AccountTile extends StatelessWidget {
22 @override
23 Widget build(BuildContext context) {
24 final color = isCurrent
26 - ? Theme.of(context).extension<AccountListTheme>()!.currentAccountBackgroundColor
27 - : Theme.of(context).extension<AccountListTheme>()!.tilesBackgroundColor;
25 + ? Theme.of(context).colorScheme.surfaceContainer
26 + : Theme.of(context).colorScheme.surfaceContainerHighest;
27 final textColor = isCurrent
29 - ? Theme.of(context).extension<AccountListTheme>()!.currentAccountTextColor
30 - : Theme.of(context).extension<AccountListTheme>()!.tilesTextColor;
28 + ? Theme.of(context).colorScheme.onSurface
29 + : Theme.of(context).colorScheme.onSurfaceVariant;
30
31 final Widget cell = GestureDetector(
32 onTap: onTap,
@@ -45,13 +44,12 @@ class AccountTile extends StatelessWidget {
44 Container(
45 child: Text(
46 accountName,
48 - style: TextStyle(
49 - fontSize: 18,
50 - fontWeight: FontWeight.w600,
51 - fontFamily: 'Lato',
52 - color: textColor,
53 - decoration: TextDecoration.none,
54 - ),
47 + style: Theme.of(context).textTheme.titleMedium!.copyWith(
48 + fontSize: 18,
49 + fontWeight: FontWeight.w600,
50 + color: textColor,
51 + decoration: TextDecoration.none,
52 + ),
53 ),
54 ),
55 if (accountBalance != null)
@@ -59,14 +57,13 @@ class AccountTile extends StatelessWidget {
57 child: Text(
58 '${accountBalance.toString()} $currency',
59 textAlign: TextAlign.end,
62 - style: TextStyle(
63 - fontSize: 15,
64 - fontWeight: FontWeight.w600,
65 - fontFamily: 'Lato',
66 - color: isCurrent
67 - ? Theme.of(context).extension<AccountListTheme>()!.currentAccountAmountColor
68 - : Theme.of(context).extension<AccountListTheme>()!.tilesAmountColor,
69 - decoration: TextDecoration.none,
60 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
61 + fontSize: 15,
62 + fontWeight: FontWeight.w600,
63 + color: isCurrent
64 + ? Theme.of(context).colorScheme.onSurface
65 + : Theme.of(context).colorScheme.onSurfaceVariant,
66 + decoration: TextDecoration.none,
67 ),
68 ),
69 ),
@@ -76,7 +73,11 @@ class AccountTile extends StatelessWidget {
73 );
74
75 // return cell;
79 - return Slidable(key: Key(accountName), child: cell, endActionPane: _actionPane(context));
76 + return Slidable(
77 + key: Key(accountName),
78 + child: cell,
79 + endActionPane: _actionPane(context),
80 + );
81 }
82
83 ActionPane _actionPane(BuildContext context) => ActionPane(
@@ -85,8 +86,8 @@ class AccountTile extends StatelessWidget {
86 children: [
87 SlidableAction(
88 onPressed: (_) => onEdit.call(),
88 - backgroundColor: Colors.blue,
89 - foregroundColor: Colors.white,
89 + backgroundColor: Theme.of(context).colorScheme.primaryContainer,
90 + foregroundColor: Theme.of(context).colorScheme.onPrimaryContainer,
91 icon: Icons.edit,
92 label: S.of(context).edit,
93 ),
lib/src/screens/nano/nano_change_rep_page.dart
+33 -46
@@ -4,8 +4,6 @@ import 'package:cake_wallet/src/widgets/address_text_field.dart';
4 import 'package:cake_wallet/src/widgets/alert_with_one_action.dart';
5 import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
6 import 'package:cake_wallet/store/settings_store.dart';
7 -import 'package:cake_wallet/themes/extensions/address_theme.dart';
8 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
7 import 'package:cake_wallet/utils/payment_request.dart';
8 import 'package:cake_wallet/utils/show_pop_up.dart';
9 import 'package:cw_core/crypto_currency.dart';
@@ -76,8 +74,7 @@ class NanoChangeRepPage extends BasePage {
74 AddressTextFieldOption.paste,
75 AddressTextFieldOption.qrCode,
76 ],
79 - buttonColor:
80 - Theme.of(context).extension<AddressTheme>()!.actionButtonColor,
77 + buttonColor: Theme.of(context).colorScheme.surfaceContainerHighest,
78 validator: AddressValidator(type: CryptoCurrency.nano),
79 ),
80 )
@@ -89,10 +86,10 @@ class NanoChangeRepPage extends BasePage {
86 margin: EdgeInsets.only(top: 12),
87 child: Text(
88 S.current.nano_current_rep,
92 - style: TextStyle(
93 - fontSize: 16,
94 - fontWeight: FontWeight.w700,
95 - ),
89 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
90 + fontSize: 16,
91 + fontWeight: FontWeight.w700,
92 + ),
93 ),
94 ),
95 _buildSingleRepresentative(
@@ -107,10 +104,10 @@ class NanoChangeRepPage extends BasePage {
104 margin: EdgeInsets.only(top: 12),
105 child: Text(
106 S.current.nano_pick_new_rep,
110 - style: TextStyle(
111 - fontSize: 16,
112 - fontWeight: FontWeight.w700,
113 - ),
107 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
108 + fontSize: 16,
109 + fontWeight: FontWeight.w700,
110 + ),
111 ),
112 ),
113 Divider(height: 20),
@@ -138,8 +135,8 @@ class NanoChangeRepPage extends BasePage {
135 child: LoadingPrimaryButton(
136 onPressed: () => _onSubmit(context),
137 text: S.of(context).change,
141 - color: Theme.of(context).primaryColor,
142 - textColor: Colors.white,
138 + color: Theme.of(context).colorScheme.primary,
139 + textColor: Theme.of(context).colorScheme.onPrimary,
140 ),
141 )),
142 ],
@@ -250,23 +247,21 @@ class NanoChangeRepPage extends BasePage {
247 children: <Widget>[
248 Text(
249 rep.alias ?? rep.account!,
253 - style: TextStyle(
254 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
255 - fontWeight: FontWeight.w700,
256 - fontSize: rep.alias == null ? 14 : 18,
257 - ),
250 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
251 + color: Theme.of(context).colorScheme.onSurface,
252 + fontWeight: FontWeight.w700,
253 + fontSize: rep.alias == null ? 14 : 18,
254 + ),
255 ),
256 Container(
257 margin: const EdgeInsets.only(top: 7),
258 child: RichText(
259 text: TextSpan(
260 text: "${S.current.voting_weight}: ${rep.weight.toString()}%",
264 - style: TextStyle(
265 - color:
266 - Theme.of(context).extension<CakeTextTheme>()!.secondaryTextColor,
267 - fontWeight: FontWeight.w700,
268 - fontSize: 14.0,
269 - ),
261 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
262 + color: Theme.of(context).colorScheme.onSurfaceVariant,
263 + fontWeight: FontWeight.w700,
264 + ),
265 ),
266 ),
267 ),
@@ -278,23 +273,17 @@ class NanoChangeRepPage extends BasePage {
273 children: [
274 TextSpan(
275 text: "${S.current.uptime}: ",
281 - style: TextStyle(
282 - color: Theme.of(context)
283 - .extension<CakeTextTheme>()!
284 - .secondaryTextColor,
285 - fontWeight: FontWeight.w700,
286 - fontSize: 14,
287 - ),
276 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
277 + color: Theme.of(context).colorScheme.onSurfaceVariant,
278 + fontWeight: FontWeight.w700,
279 + ),
280 ),
281 TextSpan(
282 text: rep.uptime,
291 - style: TextStyle(
292 - color: Theme.of(context)
293 - .extension<CakeTextTheme>()!
294 - .secondaryTextColor,
295 - fontWeight: FontWeight.w900,
296 - fontSize: 14,
297 - ),
283 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
284 + color: Theme.of(context).colorScheme.onSurfaceVariant,
285 + fontWeight: FontWeight.w900,
286 + ),
287 ),
288 ],
289 ),
@@ -309,13 +298,13 @@ class NanoChangeRepPage extends BasePage {
298 children: <Widget>[
299 Icon(
300 Icons.verified,
312 - color: Theme.of(context).primaryColor,
301 + color: Theme.of(context).colorScheme.primary,
302 size: 50,
303 ),
304 Positioned.fill(
305 child: Container(
306 margin: EdgeInsets.all(13),
318 - color: Theme.of(context).primaryColor,
307 + color: Theme.of(context).colorScheme.primary,
308 ),
309 ),
310 Container(
@@ -325,11 +314,9 @@ class NanoChangeRepPage extends BasePage {
314 child: Text(
315 (rep.score).toString(),
316 textAlign: TextAlign.center,
328 - style: TextStyle(
329 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
330 - fontSize: 13,
331 - fontWeight: FontWeight.w800,
332 - ),
317 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
318 + fontWeight: FontWeight.w800,
319 + ),
320 ),
321 ),
322 ],
lib/src/screens/nano_accounts/nano_account_edit_or_create_page.dart
+25 -22
@@ -34,31 +34,34 @@ class NanoAccountEditOrCreatePage extends BasePage {
34 child: Column(
35 children: <Widget>[
36 Expanded(
37 - child: Center(
38 - child: BaseTextFormField(
39 - controller: _textController,
40 - hintText: S.of(context).account,
41 - validator: MoneroLabelValidator(),
42 - ))),
37 + child: Center(
38 + child: BaseTextFormField(
39 + controller: _textController,
40 + hintText: S.of(context).account,
41 + validator: MoneroLabelValidator(),
42 + ),
43 + ),
44 + ),
45 Observer(
44 - builder: (_) => LoadingPrimaryButton(
45 - onPressed: () async {
46 - if (_formKey.currentState != null && !_formKey.currentState!.validate()) {
47 - return;
48 - }
46 + builder: (_) => LoadingPrimaryButton(
47 + onPressed: () async {
48 + if (_formKey.currentState != null && !_formKey.currentState!.validate()) {
49 + return;
50 + }
51
50 - await nanoAccountCreationViewModel.save();
52 + await nanoAccountCreationViewModel.save();
53
52 - Navigator.of(context).pop(_textController.text);
53 - },
54 - text: nanoAccountCreationViewModel.isEdit
55 - ? S.of(context).rename
56 - : S.of(context).add,
57 - color: Theme.of(context).primaryColor,
58 - textColor: Colors.white,
59 - isLoading: nanoAccountCreationViewModel.state is IsExecutingState,
60 - isDisabled: nanoAccountCreationViewModel.label?.isEmpty ?? true,
61 - ))
54 + Navigator.of(context).pop(_textController.text);
55 + },
56 + text: nanoAccountCreationViewModel.isEdit
57 + ? S.of(context).rename
58 + : S.of(context).add,
59 + color: Theme.of(context).colorScheme.primary,
60 + textColor: Theme.of(context).colorScheme.onPrimary,
61 + isLoading: nanoAccountCreationViewModel.state is IsExecutingState,
62 + isDisabled: nanoAccountCreationViewModel.label?.isEmpty ?? true,
63 + ),
64 + ),
65 ],
66 ),
67 ),
lib/src/screens/nano_accounts/nano_account_list_page.dart
+22 -22
@@ -36,20 +36,21 @@ class NanoAccountListPage extends StatelessWidget {
36 final account = accounts[index];
37
38 return AccountTile(
39 - isCurrent: account.isSelected,
40 - accountName: account.label,
41 - accountBalance: account.balance ?? '0.00',
42 - currency: accountListViewModel.currency.toString(),
43 - onTap: () {
44 - if (account.isSelected) {
45 - return;
46 - }
39 + isCurrent: account.isSelected,
40 + accountName: account.label,
41 + accountBalance: account.balance ?? '0.00',
42 + currency: accountListViewModel.currency.toString(),
43 + onTap: () {
44 + if (account.isSelected) {
45 + return;
46 + }
47
48 - accountListViewModel.select(account);
49 - Navigator.of(context).pop();
50 - },
51 - onEdit: () async => await Navigator.of(context)
52 - .pushNamed(Routes.nanoAccountCreation, arguments: account));
48 + accountListViewModel.select(account);
49 + Navigator.of(context).pop();
50 + },
51 + onEdit: () async => await Navigator.of(context)
52 + .pushNamed(Routes.nanoAccountCreation, arguments: account),
53 + );
54 },
55 ),
56 )),
@@ -57,7 +58,7 @@ class NanoAccountListPage extends StatelessWidget {
58 onTap: () async => await Navigator.of(context).pushNamed(Routes.nanoAccountCreation),
59 child: Container(
60 height: buttonHeight,
60 - color: Theme.of(context).cardColor,
61 + color: Theme.of(context).colorScheme.primary,
62 padding: EdgeInsets.symmetric(horizontal: 24),
63 child: Center(
64 child: Row(
@@ -65,19 +66,18 @@ class NanoAccountListPage extends StatelessWidget {
66 children: <Widget>[
67 Icon(
68 Icons.add,
68 - color: Colors.white,
69 + color: Theme.of(context).colorScheme.onPrimary,
70 ),
71 Padding(
72 padding: EdgeInsets.only(left: 5),
73 child: Text(
74 S.of(context).create_new_account,
74 - style: TextStyle(
75 - fontSize: 15,
76 - fontWeight: FontWeight.w600,
77 - fontFamily: 'Lato',
78 - color: Colors.white,
79 - decoration: TextDecoration.none,
80 - ),
75 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
76 + color: Theme.of(context).colorScheme.onPrimary,
77 + fontSize: 15,
78 + fontWeight: FontWeight.w600,
79 + decoration: TextDecoration.none,
80 + ),
81 ),
82 )
83 ],
lib/src/screens/nano_accounts/widgets/account_tile.dart
+29 -36
@@ -1,4 +1,3 @@
1 -import 'package:cake_wallet/themes/extensions/account_list_theme.dart';
1 import 'package:flutter/material.dart';
2 import 'package:flutter_slidable/flutter_slidable.dart';
3 import 'package:cake_wallet/generated/i18n.dart';
@@ -22,11 +21,11 @@ class AccountTile extends StatelessWidget {
21 @override
22 Widget build(BuildContext context) {
23 final color = isCurrent
25 - ? Theme.of(context).extension<AccountListTheme>()!.currentAccountBackgroundColor
26 - : Theme.of(context).extension<AccountListTheme>()!.tilesBackgroundColor;
24 + ? Theme.of(context).colorScheme.primaryContainer
25 + : Theme.of(context).colorScheme.surfaceContainerHighest;
26 final textColor = isCurrent
28 - ? Theme.of(context).extension<AccountListTheme>()!.currentAccountTextColor
29 - : Theme.of(context).extension<AccountListTheme>()!.tilesTextColor;
27 + ? Theme.of(context).colorScheme.onPrimaryContainer
28 + : Theme.of(context).colorScheme.onSurfaceVariant;
29
30 final Widget cell = GestureDetector(
31 onTap: onTap,
@@ -44,13 +43,12 @@ class AccountTile extends StatelessWidget {
43 Container(
44 child: Text(
45 accountName,
47 - style: TextStyle(
48 - fontSize: 18,
49 - fontWeight: FontWeight.w600,
50 - fontFamily: 'Lato',
51 - color: textColor,
52 - decoration: TextDecoration.none,
53 - ),
46 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
47 + fontSize: 18,
48 + fontWeight: FontWeight.w600,
49 + color: textColor,
50 + decoration: TextDecoration.none,
51 + ),
52 ),
53 ),
54 if (accountBalance != null)
@@ -58,13 +56,12 @@ class AccountTile extends StatelessWidget {
56 child: Text(
57 '${accountBalance.toString()} $currency',
58 textAlign: TextAlign.end,
61 - style: TextStyle(
62 - fontSize: 15,
63 - fontWeight: FontWeight.w600,
64 - fontFamily: 'Lato',
65 - color: Theme.of(context).textTheme.headlineMedium!.color!,
66 - decoration: TextDecoration.none,
67 - ),
59 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
60 + fontSize: 15,
61 + fontWeight: FontWeight.w600,
62 + color: Theme.of(context).textTheme.headlineMedium!.color!,
63 + decoration: TextDecoration.none,
64 + ),
65 ),
66 ),
67 ],
@@ -73,24 +70,20 @@ class AccountTile extends StatelessWidget {
70 );
71
72 // return cell;
76 - return Slidable(
77 - key: Key(accountName),
78 - child: cell,
79 - endActionPane: _actionPane(context)
80 - );
73 + return Slidable(key: Key(accountName), child: cell, endActionPane: _actionPane(context));
74 }
75
76 ActionPane _actionPane(BuildContext context) => ActionPane(
84 - motion: const ScrollMotion(),
85 - extentRatio: 0.3,
86 - children: [
87 - SlidableAction(
88 - onPressed: (_) => onEdit.call(),
89 - backgroundColor: Colors.blue,
90 - foregroundColor: Colors.white,
91 - icon: Icons.edit,
92 - label: S.of(context).edit,
93 - ),
94 - ],
95 - );
77 + motion: const ScrollMotion(),
78 + extentRatio: 0.3,
79 + children: [
80 + SlidableAction(
81 + onPressed: (_) => onEdit.call(),
82 + backgroundColor: Theme.of(context).colorScheme.primaryContainer,
83 + foregroundColor: Theme.of(context).colorScheme.onPrimaryContainer,
84 + icon: Icons.edit,
85 + label: S.of(context).edit,
86 + ),
87 + ],
88 + );
89 }
lib/src/screens/new_wallet/advanced_privacy_settings_page.dart
+26 -28
@@ -13,7 +13,6 @@ import 'package:cake_wallet/src/widgets/alert_with_one_action.dart';
13 import 'package:cake_wallet/src/widgets/base_text_form_field.dart';
14 import 'package:cake_wallet/src/widgets/primary_button.dart';
15 import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
16 -import 'package:cake_wallet/themes/extensions/new_wallet_theme.dart';
16 import 'package:cake_wallet/utils/show_pop_up.dart';
17 import 'package:cake_wallet/view_model/advanced_privacy_settings_view_model.dart';
18 import 'package:cake_wallet/view_model/node_list/node_create_or_edit_view_model.dart';
@@ -136,7 +135,7 @@ class _AdvancedPrivacySettingsBodyState extends State<_AdvancedPrivacySettingsBo
135 Observer(builder: (_) {
136 return SettingsChoicesCell(
137 ChoicesListItem<ExchangeApiMode>(
139 - title: S.current.exchange,
138 + title: S.current.swap,
139 items: ExchangeApiMode.all,
140 selectedItem: widget.privacySettingsViewModel.exchangeStatus,
141 onItemSelected: (ExchangeApiMode mode) =>
@@ -144,8 +143,7 @@ class _AdvancedPrivacySettingsBodyState extends State<_AdvancedPrivacySettingsBo
143 ),
144 );
145 }),
147 - if (widget
148 - .privacySettingsViewModel.isMoneroSeedTypeOptionsEnabled &&
146 + if (widget.privacySettingsViewModel.isMoneroSeedTypeOptionsEnabled &&
147 !widget.isChildWallet)
148 Observer(builder: (_) {
149 return SettingsChoicesCell(
@@ -222,7 +220,6 @@ class _AdvancedPrivacySettingsBodyState extends State<_AdvancedPrivacySettingsBo
220 }),
221 child: Icon(
222 Icons.remove_red_eye,
225 - // color: obscurePassphrase ? Colors.black54 : Colors.black26,
223 ),
224 ),
225 ),
@@ -244,7 +241,6 @@ class _AdvancedPrivacySettingsBodyState extends State<_AdvancedPrivacySettingsBo
241 }),
242 child: Icon(
243 Icons.remove_red_eye,
247 - // color: obscurePassphrase ? Colors.black54 : Colors.black26,
244 ),
245 ),
246 ),
@@ -256,11 +252,12 @@ class _AdvancedPrivacySettingsBodyState extends State<_AdvancedPrivacySettingsBo
252 return Column(
253 children: [
254 SettingsSwitcherCell(
259 - title: S.current.disable_bulletin,
260 - value: widget.privacySettingsViewModel.disableBulletin,
261 - onValueChange: (BuildContext _, bool value) {
262 - widget.privacySettingsViewModel.setDisableBulletin(value);
263 - }),
255 + title: S.current.disable_bulletin,
256 + value: widget.privacySettingsViewModel.disableBulletin,
257 + onValueChange: (BuildContext _, bool value) {
258 + widget.privacySettingsViewModel.setDisableBulletin(value);
259 + },
260 + ),
261 SettingsSwitcherCell(
262 title: S.current.add_custom_node,
263 value: widget.privacySettingsViewModel.addCustomNode,
@@ -296,6 +293,20 @@ class _AdvancedPrivacySettingsBodyState extends State<_AdvancedPrivacySettingsBo
293 bottomSectionPadding: EdgeInsets.all(24),
294 bottomSection: Column(
295 children: [
296 + const SizedBox(height: 24),
297 + LayoutBuilder(
298 + builder: (_, constraints) => SizedBox(
299 + width: constraints.maxWidth * 0.8,
300 + child: Text(
301 + S.of(context).settings_can_be_changed_later,
302 + textAlign: TextAlign.center,
303 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
304 + color: Theme.of(context).colorScheme.onSurfaceVariant,
305 + ),
306 + ),
307 + ),
308 + ),
309 + const SizedBox(height: 24),
310 LoadingPrimaryButton(
311 onPressed: () {
312 if (widget.privacySettingsViewModel.addCustomNode) {
@@ -306,8 +317,7 @@ class _AdvancedPrivacySettingsBodyState extends State<_AdvancedPrivacySettingsBo
317 widget.nodeViewModel.save();
318 }
319 if (testnetValue == true &&
309 - widget.privacySettingsViewModel.type ==
310 - WalletType.bitcoin) {
320 + widget.privacySettingsViewModel.type == WalletType.bitcoin) {
321 // TODO: add type (mainnet/testnet) to Node class so when switching wallets the node can be switched to a matching type
322 // Currently this is so you can create a working testnet wallet but you need to keep switching back the node if you use multiple wallets at once
323 widget.nodeViewModel.address = publicBitcoinTestnetElectrumAddress;
@@ -327,22 +337,10 @@ class _AdvancedPrivacySettingsBodyState extends State<_AdvancedPrivacySettingsBo
337 Navigator.pop(context);
338 },
339 text: S.of(context).continue_text,
330 - color: Theme.of(context).primaryColor,
331 - textColor: Colors.white,
340 + color: Theme.of(context).colorScheme.primary,
341 + textColor: Theme.of(context).colorScheme.onPrimary,
342 ),
333 - const SizedBox(height: 25),
334 - LayoutBuilder(
335 - builder: (_, constraints) => SizedBox(
336 - width: constraints.maxWidth * 0.8,
337 - child: Text(
338 - S.of(context).settings_can_be_changed_later,
339 - textAlign: TextAlign.center,
340 - style: TextStyle(
341 - color: Theme.of(context).extension<NewWalletTheme>()!.hintTextColor,
342 - ),
343 - ),
344 - ),
345 - )
343 + SizedBox(height: 16),
344 ],
345 ),
346 ),
lib/src/screens/new_wallet/new_wallet_page.dart
+190 -230
@@ -8,15 +8,14 @@ import 'package:cake_wallet/routes.dart';
8 import 'package:cake_wallet/src/screens/base_page.dart';
9 import 'package:cake_wallet/src/screens/new_wallet/widgets/select_button.dart';
10 import 'package:cake_wallet/src/widgets/alert_with_one_action.dart';
11 +import 'package:cake_wallet/src/widgets/base_text_form_field.dart';
12 +import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
13 +import 'package:cake_wallet/src/widgets/gradient_background.dart';
14 import 'package:cake_wallet/src/widgets/picker.dart';
15 import 'package:cake_wallet/src/widgets/primary_button.dart';
16 import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
17 import 'package:cake_wallet/src/widgets/seed_language_picker.dart';
18 import 'package:cake_wallet/src/widgets/seed_language_selector.dart';
16 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
17 -import 'package:cake_wallet/themes/extensions/new_wallet_theme.dart';
18 -import 'package:cake_wallet/themes/extensions/send_page_theme.dart';
19 -import 'package:cake_wallet/themes/theme_base.dart';
19 import 'package:cake_wallet/utils/responsive_layout_util.dart';
20 import 'package:cake_wallet/utils/show_pop_up.dart';
21 import 'package:cake_wallet/view_model/seed_settings_view_model.dart';
@@ -37,9 +36,15 @@ class NewWalletPage extends BasePage {
36 final SeedSettingsViewModel _seedSettingsViewModel;
37 final bool isChildWallet;
38
40 - final walletNameImage = Image.asset('assets/images/wallet_name.png');
39 + final welcomeImageLight = 'assets/images/wallet_type_wallet_light.png';
40 + final welcomeImageDark = 'assets/images/wallet_type_wallet_dark.png';
41
42 - final walletNameLightImage = Image.asset('assets/images/wallet_name_light.png');
42 + @override
43 + bool get gradientBackground => true;
44 +
45 + @override
46 + Widget Function(BuildContext, Widget) get rootWrapper =>
47 + (BuildContext context, Widget scaffold) => GradientBackground(scaffold: scaffold);
48
49 @override
50 String get title => S.current.new_wallet;
@@ -55,7 +60,7 @@ class NewWalletPage extends BasePage {
60 @override
61 Widget body(BuildContext context) => WalletNameForm(
62 _walletNewVM,
58 - currentTheme.type == ThemeType.dark ? walletNameImage : walletNameLightImage,
63 + currentTheme.isDark ? welcomeImageDark : welcomeImageLight,
64 _seedSettingsViewModel,
65 isChildWallet,
66 );
@@ -71,7 +76,7 @@ class WalletNameForm extends StatefulWidget {
76
77 final WalletNewVM _walletNewVM;
78 final bool isChildWallet;
74 - final Image walletImage;
79 + final String walletImage;
80 final SeedSettingsViewModel _seedSettingsViewModel;
81
82 @override
@@ -87,7 +92,7 @@ class _WalletNameFormState extends State<WalletNameForm> {
92 _repeatedPasswordController =
93 _walletNewVM.hasWalletPassword ? TextEditingController() : null;
94
90 - static const aspectRatioImage = 1.22;
95 + static const aspectRatioImage = 1.5;
96 bool _formProcessing = false;
97
98 final GlobalKey<FormState> _formKey;
@@ -103,8 +108,8 @@ class _WalletNameFormState extends State<WalletNameForm> {
108 _stateReaction ??= reaction((_) => _walletNewVM.state, (ExecutionState state) async {
109 if (state is ExecutedSuccessfullyState) {
110 if (widget.isChildWallet) {
106 - Navigator.of(navigatorKey.currentContext ?? context).pushNamed(
107 - Routes.walletGroupExistingSeedDescriptionPage);
111 + Navigator.of(navigatorKey.currentContext ?? context)
112 + .pushNamed(Routes.walletGroupExistingSeedDescriptionPage);
113 } else {
114 Navigator.of(navigatorKey.currentContext ?? context).pushNamed(Routes.preSeedPage);
115 }
@@ -139,247 +144,202 @@ class _WalletNameFormState extends State<WalletNameForm> {
144 return Padding(
145 padding: EdgeInsets.only(top: 24),
146 child: ScrollableWithBottomSection(
142 - contentPadding: EdgeInsets.only(left: 24, right: 24, bottom: 24),
143 - content: Center(
144 - child: ConstrainedBox(
145 - constraints:
146 - BoxConstraints(maxWidth: ResponsiveLayoutUtilBase.kDesktopMaxWidthConstraint),
147 - child: Column(
148 - crossAxisAlignment: CrossAxisAlignment.center,
149 - children: [
150 - Padding(
151 - padding: EdgeInsets.only(left: 12, right: 12),
152 - child: AspectRatio(
153 - aspectRatio: aspectRatioImage,
154 - child: FittedBox(child: widget.walletImage, fit: BoxFit.fill)),
147 + contentPadding: EdgeInsets.only(left: 24, right: 24, bottom: 24),
148 + content: Center(
149 + child: ConstrainedBox(
150 + constraints:
151 + BoxConstraints(maxWidth: ResponsiveLayoutUtilBase.kDesktopMaxWidthConstraint),
152 + child: Column(
153 + crossAxisAlignment: CrossAxisAlignment.center,
154 + children: [
155 + Padding(
156 + padding: EdgeInsets.only(left: 24, right: 12),
157 + child: AspectRatio(
158 + aspectRatio: aspectRatioImage,
159 + child: FittedBox(
160 + child: CakeImageWidget(imageUrl: widget.walletImage),
161 + fit: BoxFit.contain,
162 + ),
163 ),
156 - Padding(
157 - padding: EdgeInsets.only(top: 24),
158 - child: Form(
159 - key: _formKey,
160 - child: Column(
161 - children: [
162 - TextFormField(
163 - key: ValueKey('new_wallet_page_wallet_name_textformfield_key'),
164 - onChanged: (value) => _walletNewVM.name = value,
165 - controller: _nameController,
166 - textAlign: TextAlign.center,
167 - style: TextStyle(
168 - fontSize: 20.0,
169 - fontWeight: FontWeight.w600,
170 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor),
171 - decoration: InputDecoration(
172 - hintStyle: TextStyle(
173 - fontSize: 18.0,
174 - fontWeight: FontWeight.w500,
175 - color:
176 - Theme.of(context).extension<NewWalletTheme>()!.hintTextColor),
177 - hintText: S.of(context).wallet_name,
178 - focusedBorder: UnderlineInputBorder(
179 - borderSide: BorderSide(
180 - color: Theme.of(context)
181 - .extension<NewWalletTheme>()!
182 - .underlineColor,
183 - width: 1.0)),
184 - enabledBorder: UnderlineInputBorder(
185 - borderSide: BorderSide(
186 - color: Theme.of(context)
187 - .extension<NewWalletTheme>()!
188 - .underlineColor,
189 - width: 1.0),
164 + ),
165 + SizedBox(height: 48),
166 + Padding(
167 + padding: EdgeInsets.only(top: 24),
168 + child: Form(
169 + key: _formKey,
170 + child: Column(
171 + children: [
172 + BaseTextFormField(
173 + key: ValueKey('new_wallet_page_wallet_name_textformfield_key'),
174 + onChanged: (value) => _walletNewVM.name = value,
175 + controller: _nameController,
176 + textStyle: Theme.of(context).textTheme.titleMedium?.copyWith(
177 + color: Theme.of(context).colorScheme.onSurface,
178 ),
191 - suffixIcon: Semantics(
192 - label: S.of(context).generate_name,
193 - child: IconButton(
194 - key: ValueKey(
195 - 'new_wallet_page_wallet_name_textformfield_generate_name_button_key'),
196 - onPressed: () async {
197 - final rName = await generateName();
198 - FocusManager.instance.primaryFocus?.unfocus();
199 -
200 - setState(() {
201 - _nameController.text = rName;
202 - _walletNewVM.name = rName;
203 - _nameController.selection = TextSelection.fromPosition(
204 - TextPosition(offset: _nameController.text.length));
205 - });
206 - },
207 - icon: Container(
208 - padding: const EdgeInsets.all(8),
209 - decoration: BoxDecoration(
210 - borderRadius: BorderRadius.circular(6.0),
211 - color: Theme.of(context).hintColor,
212 - ),
213 - width: 34,
214 - height: 34,
215 - child: Image.asset(
216 - 'assets/images/refresh_icon.png',
217 - color: Theme.of(context)
218 - .extension<SendPageTheme>()!
219 - .textFieldButtonIconColor,
220 - ),
221 - ),
222 - ),
179 + placeholderTextStyle: Theme.of(context).textTheme.bodyMedium?.copyWith(
180 + color: Theme.of(context).colorScheme.onSurfaceVariant,
181 + height: 1.4,
182 + fontSize: 16.0,
183 ),
224 - ),
225 - validator: WalletNameValidator(),
226 - ),
227 - if (_walletNewVM.hasWalletPassword) ...[
228 - TextFormField(
229 - key: ValueKey('password'),
230 - onChanged: (value) => _walletNewVM.walletPassword = value,
231 - controller: _passwordController,
232 - textAlign: TextAlign.center,
233 - obscureText: true,
234 - style: TextStyle(
235 - fontSize: 20.0,
236 - fontWeight: FontWeight.w600,
237 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
184 + hintText: S.of(context).wallet_name,
185 + suffixIcon: Semantics(
186 + label: S.of(context).generate_name,
187 + child: IconButton(
188 + key: ValueKey(
189 + 'new_wallet_page_wallet_name_textformfield_generate_name_button_key',
190 ),
239 - decoration: InputDecoration(
240 - hintStyle: TextStyle(
241 - fontSize: 18.0,
242 - fontWeight: FontWeight.w500,
243 - color:
244 - Theme.of(context).extension<NewWalletTheme>()!.hintTextColor,
245 - ),
246 - hintText: S.of(context).password,
247 - focusedBorder: UnderlineInputBorder(
248 - borderSide: BorderSide(
249 - color: Theme.of(context)
250 - .extension<NewWalletTheme>()!
251 - .underlineColor,
252 - width: 1.0,
253 - ),
254 - ),
255 - enabledBorder: UnderlineInputBorder(
256 - borderSide: BorderSide(
257 - color: Theme.of(context)
258 - .extension<NewWalletTheme>()!
259 - .underlineColor,
260 - width: 1.0,
261 - ),
191 + onPressed: () async {
192 + final rName = await generateName();
193 + FocusManager.instance.primaryFocus?.unfocus();
194 +
195 + setState(() {
196 + _nameController.text = rName;
197 + _walletNewVM.name = rName;
198 + _nameController.selection = TextSelection.fromPosition(
199 + TextPosition(offset: _nameController.text.length),
200 + );
201 + });
202 + },
203 + icon: Container(
204 + padding: const EdgeInsets.all(8),
205 + decoration: BoxDecoration(
206 + borderRadius: BorderRadius.circular(6.0),
207 + color: Theme.of(context).colorScheme.surface,
208 ),
209 + width: 34,
210 + height: 34,
211 + child: Image.asset('assets/images/refresh_icon.png',
212 + color: Theme.of(context).colorScheme.onSurfaceVariant),
213 ),
214 ),
265 - TextFormField(
266 - key: ValueKey('repeat_wallet_password'),
267 - onChanged: (value) => _walletNewVM.repeatedWalletPassword = value,
268 - controller: _repeatedPasswordController,
269 - textAlign: TextAlign.center,
270 - obscureText: true,
271 - style: TextStyle(
272 - fontSize: 20.0,
273 - fontWeight: FontWeight.w600,
274 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
275 - ),
276 - decoration: InputDecoration(
277 - hintStyle: TextStyle(
278 - fontSize: 18.0,
279 - fontWeight: FontWeight.w500,
280 - color:
281 - Theme.of(context).extension<NewWalletTheme>()!.hintTextColor,
215 + ),
216 + validator: WalletNameValidator(),
217 + ),
218 + if (_walletNewVM.hasWalletPassword) ...[
219 + BaseTextFormField(
220 + key: ValueKey('password'),
221 + onChanged: (value) => _walletNewVM.walletPassword = value,
222 + controller: _passwordController,
223 + textAlign: TextAlign.center,
224 + obscureText: true,
225 + textStyle: Theme.of(context).textTheme.bodyMedium!.copyWith(
226 + fontSize: 20.0,
227 + fontWeight: FontWeight.w600,
228 + color: Theme.of(context).colorScheme.onSurface,
229 ),
283 - hintText: S.of(context).repeat_wallet_password,
284 - focusedBorder: UnderlineInputBorder(
285 - borderSide: BorderSide(
286 - color: Theme.of(context)
287 - .extension<NewWalletTheme>()!
288 - .underlineColor,
289 - width: 1.0,
230 + placeholderTextStyle: Theme.of(context).textTheme.bodyMedium?.copyWith(
231 + color: Theme.of(context).colorScheme.onSurfaceVariant,
232 + height: 1.4,
233 + fontSize: 18.0,
234 + fontWeight: FontWeight.w500,
235 ),
236 + hintText: S.of(context).password,
237 + ),
238 + BaseTextFormField(
239 + key: ValueKey('repeat_wallet_password'),
240 + onChanged: (value) => _walletNewVM.repeatedWalletPassword = value,
241 + controller: _repeatedPasswordController,
242 + textAlign: TextAlign.center,
243 + obscureText: true,
244 + textStyle: Theme.of(context).textTheme.bodyMedium!.copyWith(
245 + fontSize: 20.0,
246 + fontWeight: FontWeight.w600,
247 + color: Theme.of(context).colorScheme.onSurface,
248 ),
292 - enabledBorder: UnderlineInputBorder(
293 - borderSide: BorderSide(
294 - color: Theme.of(context)
295 - .extension<NewWalletTheme>()!
296 - .underlineColor,
297 - width: 1.0,
249 + placeholderTextStyle: Theme.of(context).textTheme.bodyMedium?.copyWith(
250 + color: Theme.of(context).colorScheme.onSurfaceVariant,
251 + height: 1.4,
252 + fontSize: 18.0,
253 + fontWeight: FontWeight.w500,
254 ),
299 - ),
300 - ),
301 - ),
302 - ],
255 + hintText: S.of(context).repeat_wallet_password,
256 + ),
257 ],
304 - ),
258 + ],
259 ),
260 ),
307 - if (_walletNewVM.showLanguageSelector) ...[
308 - if (_walletNewVM.hasSeedType) ...[
309 - Observer(
310 - builder: (BuildContext build) => Padding(
311 - padding: EdgeInsets.only(top: 24),
312 - child: SelectButton(
313 - key: ValueKey('new_wallet_page_monero_seed_type_button_key'),
314 - text: widget._seedSettingsViewModel.moneroSeedType.title,
315 - onTap: () async {
316 - await showPopUp<void>(
317 - context: context,
318 - builder: (_) => Picker(
319 - items: MoneroSeedType.all
320 - .where((e) => // exclude bip39 in case of Wownero
321 - widget._walletNewVM.type != WalletType.wownero ||
322 - e.raw != MoneroSeedType.bip39.raw)
323 - .toList(),
324 - selectedAtIndex: isPolyseed ? 1 : 0,
325 - onItemSelected: _setSeedType,
326 - isSeparated: false,
327 - ),
328 - );
329 - },
330 - ),
331 - ),
332 - ),
333 - ],
261 + ),
262 + if (_walletNewVM.showLanguageSelector) ...[
263 + if (_walletNewVM.hasSeedType) ...[
264 Observer(
265 builder: (BuildContext build) => Padding(
336 - padding: EdgeInsets.only(top: 10),
337 - child: SeedLanguageSelector(
338 - key: _languageSelectorKey,
339 - buttonKey: ValueKey('new_wallet_page_seed_language_selector_button_key'),
340 - initialSelected: defaultSeedLanguage,
341 - seedType: _walletNewVM.hasSeedType
342 - ? widget._seedSettingsViewModel.moneroSeedType
343 - : MoneroSeedType.legacy,
266 + padding: EdgeInsets.only(top: 24),
267 + child: SelectButton(
268 + key: ValueKey('new_wallet_page_monero_seed_type_button_key'),
269 + text: widget._seedSettingsViewModel.moneroSeedType.title,
270 + borderRadius: BorderRadius.circular(10),
271 + onTap: () async {
272 + await showPopUp<void>(
273 + context: context,
274 + builder: (_) => Picker(
275 + items: MoneroSeedType.all
276 + .where((e) => // exclude bip39 in case of Wownero
277 + widget._walletNewVM.type != WalletType.wownero ||
278 + e.raw != MoneroSeedType.bip39.raw)
279 + .toList(),
280 + selectedAtIndex: isPolyseed ? 1 : 0,
281 + onItemSelected: _setSeedType,
282 + isSeparated: false,
283 + ),
284 + );
285 + },
286 ),
287 ),
346 - )
288 + ),
289 ],
290 + Observer(
291 + builder: (BuildContext build) => Padding(
292 + padding: EdgeInsets.only(top: 10),
293 + child: SeedLanguageSelector(
294 + borderRadius: BorderRadius.circular(10),
295 + key: _languageSelectorKey,
296 + buttonKey: ValueKey('new_wallet_page_seed_language_selector_button_key'),
297 + initialSelected: defaultSeedLanguage,
298 + seedType: _walletNewVM.hasSeedType
299 + ? widget._seedSettingsViewModel.moneroSeedType
300 + : MoneroSeedType.legacy,
301 + ),
302 + ),
303 + )
304 ],
349 - ),
305 + ],
306 ),
307 ),
352 - bottomSectionPadding: EdgeInsets.all(24),
353 - bottomSection: Column(
354 - children: [
355 - Observer(
356 - builder: (context) {
357 - return LoadingPrimaryButton(
358 - key: ValueKey('new_wallet_page_confirm_button_key'),
359 - onPressed: _confirmForm,
360 - text: S.of(context).seed_language_next,
361 - color: Theme.of(context).primaryColor,
362 - textColor: Colors.white,
363 - isLoading: _walletNewVM.state is IsExecutingState,
364 - isDisabled: _walletNewVM.name.isEmpty,
365 - );
366 - },
367 - ),
368 - const SizedBox(height: 25),
369 - GestureDetector(
370 - key: ValueKey('new_wallet_page_advanced_settings_button_key'),
371 - onTap: () {
372 - Navigator.of(context).pushNamed(Routes.advancedPrivacySettings, arguments: {
373 - "type": _walletNewVM.type,
374 - "useTestnet": _walletNewVM.useTestnet,
375 - "toggleTestnet": _walletNewVM.toggleUseTestnet,
376 - "isChildWallet": widget.isChildWallet,
377 - });
378 - },
379 - child: Text(S.of(context).advanced_settings),
380 - ),
381 - ],
382 - )),
308 + ),
309 + bottomSectionPadding: EdgeInsets.all(24),
310 + bottomSection: Column(
311 + children: [
312 + PrimaryButton(
313 + key: ValueKey('new_wallet_page_advanced_settings_button_key'),
314 + onPressed: () {
315 + Navigator.of(context).pushNamed(Routes.advancedPrivacySettings, arguments: {
316 + "type": _walletNewVM.type,
317 + "useTestnet": _walletNewVM.useTestnet,
318 + "toggleTestnet": _walletNewVM.toggleUseTestnet,
319 + "isChildWallet": widget.isChildWallet,
320 + });
321 + },
322 + text: S.of(context).advanced_settings,
323 + color: Theme.of(context).colorScheme.surfaceContainer,
324 + textColor: Theme.of(context).colorScheme.onSecondaryContainer,
325 + ),
326 + const SizedBox(height: 12),
327 + Observer(
328 + builder: (context) {
329 + return LoadingPrimaryButton(
330 + key: ValueKey('new_wallet_page_confirm_button_key'),
331 + onPressed: _confirmForm,
332 + text: S.of(context).seed_language_next,
333 + color: Theme.of(context).colorScheme.primary,
334 + textColor: Theme.of(context).colorScheme.onPrimary,
335 + isLoading: _walletNewVM.state is IsExecutingState,
336 + isDisabled: _walletNewVM.name.isEmpty,
337 + );
338 + },
339 + ),
340 + ],
341 + ),
342 + ),
343 );
344 }
345
lib/src/screens/new_wallet/new_wallet_type_page.dart
+13 -16
@@ -11,8 +11,7 @@ import 'package:cake_wallet/src/screens/setup_2fa/widgets/popup_cancellable_aler
11 import 'package:cake_wallet/src/widgets/primary_button.dart';
12 import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
13 import 'package:cake_wallet/src/widgets/search_bar_widget.dart';
14 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
15 -import 'package:cake_wallet/themes/theme_base.dart';
14 +import 'package:cake_wallet/themes/core/material_base_theme.dart';
15 import 'package:cake_wallet/utils/responsive_layout_util.dart';
16 import 'package:cake_wallet/utils/show_pop_up.dart';
17 import 'package:cake_wallet/view_model/new_wallet_type_view_model.dart';
@@ -40,15 +39,15 @@ class NewWalletTypePage extends BasePage {
39
40 @override
41 Function(BuildContext)? get pushToNextWidget => (context) {
43 - FocusScopeNode currentFocus = FocusScope.of(context);
44 - if (!currentFocus.hasPrimaryFocus) {
45 - currentFocus.focusedChild?.unfocus();
46 - }
47 - };
42 + FocusScopeNode currentFocus = FocusScope.of(context);
43 + if (!currentFocus.hasPrimaryFocus) {
44 + currentFocus.focusedChild?.unfocus();
45 + }
46 + };
47
48 @override
49 Widget body(BuildContext context) => WalletTypeForm(
51 - walletImage: currentTheme.type == ThemeType.dark ? walletTypeImage : walletTypeLightImage,
50 + walletImage: currentTheme.isDark ? walletTypeImage : walletTypeLightImage,
51 isCreate: newWalletTypeArguments.isCreate,
52 newWalletTypeViewModel: newWalletTypeViewModel,
53 onTypeSelected: newWalletTypeArguments.onTypeSelected,
@@ -117,16 +116,14 @@ class WalletTypeFormState extends State<WalletTypeForm> {
116 child: Text(
117 S.of(context).choose_wallet_currency,
118 textAlign: TextAlign.center,
120 - style: TextStyle(
121 - fontSize: 16,
122 - fontWeight: FontWeight.w500,
123 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
124 - ),
119 + style: Theme.of(context).textTheme.titleMedium?.copyWith(
120 + color: Theme.of(context).colorScheme.onSurfaceVariant,
121 + ),
122 ),
123 ),
124 Padding(
125 padding: EdgeInsets.fromLTRB(24, 24, 24, 12),
129 - child: SearchBarWidget(searchController: searchController, borderRadius: 24),
126 + child: SearchBarWidget(searchController: searchController),
127 ),
128 Expanded(
129 child: ScrollableWithBottomSection(
@@ -163,8 +160,8 @@ class WalletTypeFormState extends State<WalletTypeForm> {
160 key: ValueKey('new_wallet_type_next_button_key'),
161 onPressed: () => onTypeSelected(),
162 text: S.of(context).seed_language_next,
166 - color: Theme.of(context).primaryColor,
167 - textColor: Colors.white,
163 + color: Theme.of(context).colorScheme.primary,
164 + textColor: Theme.of(context).colorScheme.onPrimary,
165 isDisabled: selected == null,
166 ),
167 ),
lib/src/screens/new_wallet/wallet_group_description_page.dart
+40 -22
@@ -1,13 +1,12 @@
1 import 'package:cake_wallet/core/new_wallet_arguments.dart';
2 +import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
3 +import 'package:cake_wallet/src/widgets/gradient_background.dart';
4 import 'package:cake_wallet/src/widgets/primary_button.dart';
3 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
5 import 'package:cw_core/wallet_type.dart';
6 import 'package:flutter/material.dart';
6 -import 'package:cake_wallet/themes/theme_base.dart';
7 import 'package:cake_wallet/generated/i18n.dart';
8 import 'package:cake_wallet/routes.dart';
9 import 'package:cake_wallet/src/screens/base_page.dart';
10 -import 'package:cake_wallet/themes/extensions/theme_type_images.dart';
10
11 class WalletGroupDescriptionPage extends BasePage {
12 WalletGroupDescriptionPage({required this.selectedWalletType});
@@ -15,19 +14,30 @@ class WalletGroupDescriptionPage extends BasePage {
14 final WalletType selectedWalletType;
15
16 @override
18 - String get title => S.current.wallet_group;
17 + bool get gradientBackground => true;
18
19 + @override
20 + Widget Function(BuildContext, Widget) get rootWrapper =>
21 + (BuildContext context, Widget scaffold) => GradientBackground(scaffold: scaffold);
22
23 @override
22 - Widget body(BuildContext context) {
24 + String get title => S.current.wallet_group;
25
26 + @override
27 + Widget body(BuildContext context) {
28 return Container(
29 alignment: Alignment.center,
26 - padding: EdgeInsets.all(24),
30 + padding: EdgeInsets.symmetric(horizontal: 20),
31 child: Column(
32 children: [
29 - Image.asset(currentTheme.type.walletGroupImage, height: 200),
30 - SizedBox(height: 32),
33 + SizedBox(height: 48),
34 + CakeImageWidget(
35 + imageUrl: currentTheme.isDark
36 + ? 'assets/images/wallet_group_options_dark.png'
37 + : 'assets/images/wallet_group_options_light.png',
38 + height: 200,
39 + ),
40 + SizedBox(height: 40),
41 Expanded(
42 child: Scrollbar(
43 child: SingleChildScrollView(
@@ -37,32 +47,40 @@ class WalletGroupDescriptionPage extends BasePage {
47 TextSpan(text: '${S.of(context).wallet_group_description_one} '),
48 TextSpan(
49 text: '${S.of(context).wallet_group.toLowerCase()} ',
40 - style: TextStyle(fontWeight: FontWeight.w700),
50 + style: Theme.of(context)
51 + .textTheme
52 + .bodyMedium!
53 + .copyWith(fontWeight: FontWeight.w700),
54 ),
55 TextSpan(
56 text: '${S.of(context).wallet_group_description_two} ',
57 ),
58 TextSpan(
59 text: '${S.of(context).choose_wallet_group} ',
47 - style: TextStyle(fontWeight: FontWeight.w700),
60 + style: Theme.of(context)
61 + .textTheme
62 + .bodyMedium!
63 + .copyWith(fontWeight: FontWeight.w700),
64 ),
65 TextSpan(
66 text: '${S.of(context).wallet_group_description_three} ',
67 ),
68 TextSpan(
69 text: '${S.of(context).create_new_seed} ',
54 - style: TextStyle(fontWeight: FontWeight.w700),
70 + style: Theme.of(context)
71 + .textTheme
72 + .bodyMedium!
73 + .copyWith(fontWeight: FontWeight.w700),
74 ),
75 TextSpan(text: S.of(context).wallet_group_description_four),
76 ],
77 ),
78 textAlign: TextAlign.center,
60 - style: TextStyle(
61 - height: 1.5,
62 - fontSize: 16,
63 - fontWeight: FontWeight.w400,
64 - color: Theme.of(context).extension<CakeTextTheme>()!.secondaryTextColor,
65 - ),
79 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
80 + height: 1.5,
81 + fontSize: 16,
82 + color: Theme.of(context).colorScheme.onSurfaceVariant,
83 + ),
84 ),
85 ),
86 ),
@@ -74,8 +92,8 @@ class WalletGroupDescriptionPage extends BasePage {
92 arguments: NewWalletArguments(type: selectedWalletType),
93 ),
94 text: S.of(context).create_new_seed,
77 - color: Theme.of(context).cardColor,
78 - textColor: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
95 + color: Theme.of(context).colorScheme.surfaceContainer,
96 + textColor: Theme.of(context).colorScheme.onSecondaryContainer,
97 ),
98 SizedBox(height: 12),
99 PrimaryButton(
@@ -85,10 +103,10 @@ class WalletGroupDescriptionPage extends BasePage {
103 arguments: selectedWalletType,
104 ),
105 text: S.of(context).choose_wallet_group,
88 - color: Theme.of(context).primaryColor,
89 - textColor: Colors.white,
106 + color: Theme.of(context).colorScheme.primary,
107 + textColor: Theme.of(context).colorScheme.onPrimary,
108 ),
91 - SizedBox(height: 32),
109 + SizedBox(height: 24),
110 ],
111 ),
112 );
lib/src/screens/new_wallet/wallet_group_display_page.dart
+24 -18
@@ -3,10 +3,9 @@ import 'package:cake_wallet/generated/i18n.dart';
3 import 'package:cake_wallet/routes.dart';
4 import 'package:cake_wallet/src/screens/base_page.dart';
5 import 'package:cake_wallet/src/screens/new_wallet/widgets/grouped_wallet_expansion_tile.dart';
6 +import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
7 import 'package:cake_wallet/src/widgets/primary_button.dart';
7 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
8 -import 'package:cake_wallet/themes/extensions/theme_type_images.dart';
9 -import 'package:cake_wallet/themes/theme_base.dart';
8 +import 'package:cake_wallet/themes/core/material_base_theme.dart';
9 import 'package:cake_wallet/view_model/wallet_groups_display_view_model.dart';
10 import 'package:cw_core/wallet_type.dart';
11 import 'package:flutter/material.dart';
@@ -34,13 +33,13 @@ class WalletGroupsDisplayBody extends StatelessWidget {
33 });
34
35 final WalletGroupsDisplayViewModel walletGroupsDisplayViewModel;
37 - final ThemeBase currentTheme;
36 + final MaterialThemeBase currentTheme;
37
38 @override
39 Widget build(BuildContext context) {
40 return Center(
41 child: Padding(
43 - padding: EdgeInsets.all(24),
42 + padding: EdgeInsets.symmetric(horizontal: 20),
43 child: Column(
44 children: [
45 Expanded(
@@ -49,7 +48,9 @@ class WalletGroupsDisplayBody extends StatelessWidget {
48 builder: (context) {
49 return Column(
50 children: [
51 + SizedBox(height: 48),
52 if (walletGroupsDisplayViewModel.hasNoFilteredWallet) ...{
53 + SizedBox(height: 16),
54 WalletGroupEmptyStateWidget(
55 currentTheme: currentTheme,
56 ),
@@ -127,8 +128,8 @@ class WalletGroupsDisplayBody extends StatelessWidget {
128 text: walletGroupsDisplayViewModel.hasNoFilteredWallet
129 ? S.of(context).create_new_seed
130 : S.of(context).seed_language_next,
130 - color: Theme.of(context).primaryColor,
131 - textColor: Colors.white,
131 + color: Theme.of(context).colorScheme.primary,
132 + textColor: Theme.of(context).colorScheme.onPrimary,
133 isDisabled: !walletGroupsDisplayViewModel.hasNoFilteredWallet
134 ? (walletGroupsDisplayViewModel.selectedWalletGroup == null &&
135 walletGroupsDisplayViewModel.selectedSingleWallet == null)
@@ -136,7 +137,7 @@ class WalletGroupsDisplayBody extends StatelessWidget {
137 );
138 },
139 ),
139 - SizedBox(height: 32),
140 + SizedBox(height: 24),
141 ],
142 ),
143 ),
@@ -159,14 +160,19 @@ class WalletGroupsDisplayBody extends StatelessWidget {
160 class WalletGroupEmptyStateWidget extends StatelessWidget {
161 const WalletGroupEmptyStateWidget({required this.currentTheme, super.key});
162
162 - final ThemeBase currentTheme;
163 + final MaterialThemeBase currentTheme;
164
165 @override
166 Widget build(BuildContext context) {
167 return Column(
168 children: [
168 - Image.asset(currentTheme.type.walletGroupImage, scale: 1.8),
169 - SizedBox(height: 32),
169 + CakeImageWidget(
170 + imageUrl: currentTheme.isDark
171 + ? 'assets/images/wallet_group_empty_dark.png'
172 + : 'assets/images/wallet_group_empty_light.png',
173 + height: 200,
174 + ),
175 + SizedBox(height: 60),
176 Text.rich(
177 TextSpan(
178 children: [
@@ -175,18 +181,18 @@ class WalletGroupEmptyStateWidget extends StatelessWidget {
181 ),
182 TextSpan(
183 text: '${S.of(context).create_new_seed} ',
178 - style: TextStyle(fontWeight: FontWeight.w700),
184 + style:
185 + Theme.of(context).textTheme.bodyMedium!.copyWith(fontWeight: FontWeight.w700),
186 ),
187 TextSpan(text: S.of(context).wallet_group_empty_state_text_two),
188 ],
189 ),
190 textAlign: TextAlign.center,
184 - style: TextStyle(
185 - height: 1.5,
186 - fontSize: 16,
187 - fontWeight: FontWeight.w400,
188 - color: Theme.of(context).extension<CakeTextTheme>()!.secondaryTextColor,
189 - ),
191 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
192 + height: 1.5,
193 + fontSize: 16,
194 + color: Theme.of(context).colorScheme.onSurfaceVariant,
195 + ),
196 ),
197 ],
198 );
lib/src/screens/new_wallet/wallet_group_existing_seed_description_page.dart
+34 -29
@@ -1,33 +1,41 @@
1 import 'package:cake_wallet/generated/i18n.dart';
2 import 'package:cake_wallet/routes.dart';
3 import 'package:cake_wallet/src/screens/base_page.dart';
4 +import 'package:cake_wallet/src/widgets/gradient_background.dart';
5 import 'package:cake_wallet/src/widgets/primary_button.dart';
5 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
6 -import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
7 -import 'package:cake_wallet/themes/extensions/theme_type_images.dart';
8 -import 'package:cake_wallet/themes/theme_base.dart';
6 import 'package:flutter/material.dart';
7
8 class WalletGroupExistingSeedDescriptionPage extends BasePage {
9 WalletGroupExistingSeedDescriptionPage();
10
11 + @override
12 + bool get gradientBackground => true;
13 +
14 + @override
15 + Widget Function(BuildContext, Widget) get rootWrapper =>
16 + (BuildContext context, Widget scaffold) => GradientBackground(scaffold: scaffold);
17 +
18 @override
19 String get title => S.current.wallet_group;
20
21 + final walletGroupConfirmedImageLight = 'assets/images/wallet_group_confirmed_light.png';
22 + final walletGroupConfirmedImageDark = 'assets/images/wallet_group_confirmed_dark.png';
23 +
24 @override
25 Widget body(BuildContext context) {
19 - final textStyle = TextStyle(
20 - fontSize: 16,
21 - fontWeight: FontWeight.w400,
22 - color: Theme.of(context).extension<CakeTextTheme>()!.secondaryTextColor,
23 - );
26 + final textStyle = Theme.of(context).textTheme.bodyLarge?.copyWith(
27 + color: Theme.of(context).colorScheme.onSurfaceVariant,
28 + );
29
30 return Container(
31 alignment: Alignment.center,
32 padding: EdgeInsets.all(24),
33 child: Column(
34 children: [
30 - Image.asset(currentTheme.type.walletGroupImage, height: 200),
35 + Image.asset(
36 + currentTheme.isDark ? walletGroupConfirmedImageDark : walletGroupConfirmedImageLight,
37 + height: 200
38 + ),
39 SizedBox(height: 32),
40 Expanded(
41 child: SingleChildScrollView(
@@ -41,13 +49,14 @@ class WalletGroupExistingSeedDescriptionPage extends BasePage {
49 text: S.current.wallet_group_description_open_wallet + '\n\n',
50 style: textStyle),
51 TextSpan(
44 - text: S.current.wallet_group_description_view_seed + '\n', style: textStyle),
52 + text: S.current.wallet_group_description_view_seed + '\n',
53 + style: textStyle),
54 TextSpan(
55 text: S.current.seed_display_path,
47 - style: TextStyle(
56 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
57 fontSize: 16,
58 fontWeight: FontWeight.w800,
50 - color: Theme.of(context).extension<CakeTextTheme>()!.secondaryTextColor,
59 + color: Theme.of(context).colorScheme.onSurfaceVariant,
60 ),
61 ),
62 ],
@@ -69,30 +78,26 @@ class WalletGroupExistingSeedDescriptionPage extends BasePage {
78 'wallet_group_existing_seed_description_page_verify_seed_button_key'),
79 onPressed: () => Navigator.pushNamed(context, Routes.preSeedPage),
80 text: S.current.verify_seed,
72 - color: Theme.of(context).cardColor,
73 - textColor: currentTheme.type == ThemeType.dark
74 - ? Theme.of(context).extension<DashboardPageTheme>()!.textColor
75 - : Theme.of(context).extension<CakeTextTheme>()!.buttonTextColor,
81 + color: Theme.of(context).colorScheme.surfaceContainer,
82 + textColor: Theme.of(context).colorScheme.onSecondaryContainer,
83 ),
84 ),
85 ),
86 Flexible(
87 child: Container(
88 padding: const EdgeInsets.symmetric(horizontal: 8.0),
82 - child: Builder(
83 - builder: (context) => PrimaryButton(
84 - key: ValueKey(
85 - 'wallet_group_existing_seed_description_page_open_wallet_button_key'),
86 - onPressed: () {
87 - Navigator.of(context).popUntil((route) => route.isFirst);
88 - },
89 - text: S.current.open_wallet,
90 - color: Theme.of(context).primaryColor,
91 - textColor: Colors.white,
92 - ),
89 + child: PrimaryButton(
90 + key: ValueKey(
91 + 'wallet_group_existing_seed_description_page_open_wallet_button_key'),
92 + onPressed: () {
93 + Navigator.of(context).popUntil((route) => route.isFirst);
94 + },
95 + text: S.current.open_wallet,
96 + color: Theme.of(context).colorScheme.primary,
97 + textColor: Theme.of(context).colorScheme.onPrimary,
98 ),
99 ),
95 - )
100 + ),
101 ],
102 ),
103 SizedBox(height: 12),
lib/src/screens/new_wallet/widgets/grouped_wallet_expansion_tile.dart
+10 -15
@@ -1,9 +1,6 @@
1 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
2 -import 'package:cake_wallet/themes/extensions/filter_theme.dart';
3 -import 'package:cake_wallet/themes/extensions/wallet_list_theme.dart';
4 -import 'package:cake_wallet/view_model/wallet_list/wallet_list_item.dart';
1 import 'package:cw_core/wallet_type.dart';
2 import 'package:flutter/material.dart';
3 +import 'package:cake_wallet/view_model/wallet_list/wallet_list_item.dart';
4
5 class GroupedWalletExpansionTile extends StatelessWidget {
6 GroupedWalletExpansionTile({
@@ -54,16 +51,16 @@ class GroupedWalletExpansionTile extends StatelessWidget {
51
52 @override
53 Widget build(BuildContext context) {
57 - final backgroundColor = color ?? (isSelected ? Colors.green : Theme.of(context).cardColor);
54 + final backgroundColor = color ?? (isSelected ? Theme.of(context).colorScheme.primary : Theme.of(context).colorScheme.surfaceContainer);
55 final effectiveTextColor = textColor ??
56 (isSelected
60 - ? Theme.of(context).extension<WalletListTheme>()!.restoreWalletButtonTextColor
61 - : Theme.of(context).extension<CakeTextTheme>()!.buttonTextColor);
57 + ? Theme.of(context).colorScheme.onPrimary
58 + : Theme.of(context).colorScheme.onSecondaryContainer);
59
60 final effectiveArrowColor = arrowColor ??
61 (isSelected
65 - ? Theme.of(context).extension<WalletListTheme>()!.restoreWalletButtonTextColor
66 - : Theme.of(context).extension<FilterTheme>()!.titlesColor);
62 + ? Theme.of(context).colorScheme.onPrimary
63 + : Theme.of(context).colorScheme.onSecondaryContainer);
64 return Container(
65 decoration: BoxDecoration(
66 borderRadius: borderRadius ?? BorderRadius.all(Radius.circular(30)),
@@ -91,7 +88,7 @@ class GroupedWalletExpansionTile extends StatelessWidget {
88 onTap: onTitleTapped,
89 child: Text(
90 title,
94 - style: TextStyle(
91 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
92 fontSize: 18,
93 fontWeight: FontWeight.w500,
94 color: effectiveTextColor,
@@ -102,10 +99,8 @@ class GroupedWalletExpansionTile extends StatelessWidget {
99 children: childWallets.map(
100 (item) {
101 final currentColor = item.isCurrent
105 - ? Theme.of(context)
106 - .extension<WalletListTheme>()!
107 - .createNewWalletButtonBackgroundColor
108 - : Theme.of(context).colorScheme.background;
102 + ? Theme.of(context).colorScheme.primary
103 + : Theme.of(context).colorScheme.surface;
104 final walletTypeToCrypto = walletTypeToCryptoCurrency(item.type);
105 return ListTile(
106 contentPadding: EdgeInsets.zero,
@@ -141,7 +136,7 @@ class GroupedWalletExpansionTile extends StatelessWidget {
136 title: Text(
137 item.name,
138 maxLines: 2,
144 - style: TextStyle(
139 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
140 fontSize: 18,
141 fontWeight: FontWeight.w500,
142 color: effectiveTextColor,
lib/src/screens/new_wallet/widgets/select_button.dart
+8 -11
@@ -1,6 +1,3 @@
1 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
2 -import 'package:cake_wallet/themes/extensions/filter_theme.dart';
3 -import 'package:cake_wallet/themes/extensions/wallet_list_theme.dart';
1 import 'package:cw_core/hardware/device_connection_type.dart';
2 import 'package:flutter/material.dart';
3
@@ -40,15 +37,15 @@ class SelectButton extends StatelessWidget {
37
38 @override
39 Widget build(BuildContext context) {
43 - final backgroundColor = color ?? (isSelected ? Theme.of(context).primaryColor : Theme.of(context).cardColor);
40 + final backgroundColor = color ?? (isSelected ? Theme.of(context).colorScheme.primary : Theme.of(context).colorScheme.surfaceContainer);
41 final effectiveTextColor = textColor ??
42 (isSelected
46 - ? Theme.of(context).extension<WalletListTheme>()!.restoreWalletButtonTextColor
47 - : Theme.of(context).extension<CakeTextTheme>()!.buttonTextColor);
43 + ? Theme.of(context).colorScheme.onPrimary
44 + : Theme.of(context).colorScheme.onSurface);
45 final effectiveArrowColor = arrowColor ??
46 (isSelected
50 - ? Theme.of(context).extension<WalletListTheme>()!.restoreWalletButtonTextColor
51 - : Theme.of(context).extension<FilterTheme>()!.titlesColor);
47 + ? Theme.of(context).colorScheme.onPrimary
48 + : Theme.of(context).colorScheme.onSurface);
49
50 final trailingIcons = <Image>[];
51 final selectArrowImage =
@@ -70,9 +67,9 @@ class SelectButton extends StatelessWidget {
67 padding: padding ?? EdgeInsets.only(left: 30, right: 30),
68 alignment: Alignment.center,
69 decoration: BoxDecoration(
73 - borderRadius: borderRadius ?? BorderRadius.all(Radius.circular(30)),
70 + borderRadius: borderRadius ?? BorderRadius.all(Radius.circular(15)),
71 color: backgroundColor,
75 - border: borderColor != null ? Border.all(color: borderColor!) : null,
72 + border: borderColor != null ? Border.all(color: borderColor!, width: 2) : null,
73 ),
74 child: Row(
75 mainAxisSize: MainAxisSize.max,
@@ -89,7 +86,7 @@ class SelectButton extends StatelessWidget {
86 padding: image != null ? EdgeInsets.only(left: 15) : EdgeInsets.only(left: 0),
87 child: Text(
88 text,
92 - style: TextStyle(
89 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
90 fontSize: textSize,
91 fontWeight: FontWeight.w500,
92 color: effectiveTextColor,
lib/src/screens/nodes/node_create_or_edit_page.dart
+67 -60
@@ -1,5 +1,4 @@
1 import 'package:cake_wallet/core/execution_state.dart';
2 -import 'package:cake_wallet/palette.dart';
2 import 'package:cake_wallet/src/screens/nodes/widgets/node_form.dart';
3 import 'package:cake_wallet/src/widgets/alert_with_one_action.dart';
4 import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
@@ -16,7 +15,8 @@ import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
15 import 'package:cake_wallet/view_model/node_list/node_create_or_edit_view_model.dart';
16
17 class NodeCreateOrEditPage extends BasePage {
19 - NodeCreateOrEditPage({required this.nodeCreateOrEditViewModel,this.editingNode, this.isSelected, this.type})
18 + NodeCreateOrEditPage(
19 + {required this.nodeCreateOrEditViewModel, this.editingNode, this.isSelected, this.type})
20 : _formKey = GlobalKey<FormState>(),
21 _addressController = TextEditingController(),
22 _pathController = TextEditingController(),
@@ -49,16 +49,13 @@ class NodeCreateOrEditPage extends BasePage {
49 });
50 }
51
52 - _addressController.addListener(
53 - () => nodeCreateOrEditViewModel.address = _addressController.text);
54 - _pathController.addListener(
55 - () => nodeCreateOrEditViewModel.path = _pathController.text);
56 - _portController.addListener(
57 - () => nodeCreateOrEditViewModel.port = _portController.text);
58 - _loginController.addListener(
59 - () => nodeCreateOrEditViewModel.login = _loginController.text);
60 - _passwordController.addListener(
61 - () => nodeCreateOrEditViewModel.password = _passwordController.text);
52 + _addressController
53 + .addListener(() => nodeCreateOrEditViewModel.address = _addressController.text);
54 + _pathController.addListener(() => nodeCreateOrEditViewModel.path = _pathController.text);
55 + _portController.addListener(() => nodeCreateOrEditViewModel.port = _portController.text);
56 + _loginController.addListener(() => nodeCreateOrEditViewModel.login = _loginController.text);
57 + _passwordController
58 + .addListener(() => nodeCreateOrEditViewModel.password = _passwordController.text);
59 }
60
61 final GlobalKey<FormState> _formKey;
@@ -91,43 +88,51 @@ class NodeCreateOrEditPage extends BasePage {
88
89 @override
90 Widget body(BuildContext context) {
94 -
95 - reaction((_) => nodeCreateOrEditViewModel.connectionState,
96 - (ExecutionState state) {
97 - if (state is ExecutedSuccessfullyState) {
98 - WidgetsBinding.instance.addPostFrameCallback((_) {
91 + reaction(
92 + (_) => nodeCreateOrEditViewModel.connectionState,
93 + (ExecutionState state) {
94 + if (state is ExecutedSuccessfullyState) {
95 + WidgetsBinding.instance.addPostFrameCallback(
96 + (_) {
97 showPopUp<void>(
100 - context: context,
101 - builder: (BuildContext context) =>
102 - AlertWithOneAction(
103 - alertTitle: S.of(context).new_node_testing,
104 - alertContent: state.payload as bool
105 - ? S.of(context).node_connection_successful
106 - : S.of(context).node_connection_failed,
107 - buttonText: S.of(context).ok,
108 - buttonAction: () => Navigator.of(context).pop()));
109 - });
110 - }
98 + context: context,
99 + builder: (BuildContext context) => AlertWithOneAction(
100 + alertTitle: S.of(context).new_node_testing,
101 + alertContent: state.payload as bool
102 + ? S.of(context).node_connection_successful
103 + : S.of(context).node_connection_failed,
104 + buttonText: S.of(context).ok,
105 + buttonAction: () => Navigator.of(context).pop(),
106 + ),
107 + );
108 + },
109 + );
110 + }
111
112 - if (state is FailureState) {
113 - WidgetsBinding.instance.addPostFrameCallback((_) {
112 + if (state is FailureState) {
113 + WidgetsBinding.instance.addPostFrameCallback(
114 + (_) {
115 showPopUp<void>(
115 - context: context,
116 - builder: (BuildContext context) {
117 - return AlertWithOneAction(
118 - alertTitle: S.of(context).error,
119 - alertContent: state.error,
120 - buttonText: S.of(context).ok,
121 - buttonAction: () => Navigator.of(context).pop());
122 - });
123 - });
124 - }
125 - });
116 + context: context,
117 + builder: (BuildContext context) {
118 + return AlertWithOneAction(
119 + alertTitle: S.of(context).error,
120 + alertContent: state.error,
121 + buttonText: S.of(context).ok,
122 + buttonAction: () => Navigator.of(context).pop(),
123 + );
124 + },
125 + );
126 + },
127 + );
128 + }
129 + },
130 + );
131
132 return Container(
133 padding: EdgeInsets.only(left: 24, right: 24),
134 child: ScrollableWithBottomSection(
130 - contentPadding: EdgeInsets.only(bottom: 24.0),
135 + contentPadding: EdgeInsets.only(bottom: 24.0, top: 8),
136 content: NodeForm(
137 formKey: _formKey,
138 nodeViewModel: nodeCreateOrEditViewModel,
@@ -145,16 +150,18 @@ class NodeCreateOrEditPage extends BasePage {
150 child: LoadingPrimaryButton(
151 onPressed: () async {
152 final confirmed = await showPopUp<bool>(
148 - context: context,
149 - builder: (BuildContext context) {
150 - return AlertWithTwoActions(
151 - alertTitle: S.of(context).remove_node,
152 - alertContent: S.of(context).remove_node_message,
153 - rightButtonText: S.of(context).remove,
154 - leftButtonText: S.of(context).cancel,
155 - actionRightButton: () => Navigator.pop(context, true),
156 - actionLeftButton: () => Navigator.pop(context, false));
157 - }) ??
153 + context: context,
154 + builder: (BuildContext context) {
155 + return AlertWithTwoActions(
156 + alertTitle: S.of(context).remove_node,
157 + alertContent: S.of(context).remove_node_message,
158 + rightButtonText: S.of(context).remove,
159 + leftButtonText: S.of(context).cancel,
160 + actionRightButton: () => Navigator.pop(context, true),
161 + actionLeftButton: () => Navigator.pop(context, false),
162 + );
163 + },
164 + ) ??
165 false;
166
167 if (confirmed) {
@@ -166,8 +173,8 @@ class NodeCreateOrEditPage extends BasePage {
173 isDisabled: editingNode == null ||
174 !nodeCreateOrEditViewModel.isReady ||
175 (isSelected ?? false),
169 - color: Palette.red,
170 - textColor: Colors.white,
176 + color: Theme.of(context).colorScheme.errorContainer,
177 + textColor: Theme.of(context).colorScheme.onErrorContainer,
178 ),
179 ),
180 ),
@@ -176,7 +183,8 @@ class NodeCreateOrEditPage extends BasePage {
183 padding: EdgeInsets.only(left: 8.0),
184 child: PrimaryButton(
185 onPressed: () async {
179 - if (_formKey.currentState != null && !_formKey.currentState!.validate()) {
186 + if (_formKey.currentState != null &&
187 + !_formKey.currentState!.validate()) {
188 return;
189 }
190
@@ -187,11 +195,10 @@ class NodeCreateOrEditPage extends BasePage {
195 }
196 },
197 text: S.of(context).save,
190 - color: Theme.of(context).primaryColor,
191 - textColor: Colors.white,
192 - isDisabled: (!nodeCreateOrEditViewModel.isReady)||
193 - (nodeCreateOrEditViewModel
194 - .connectionState is IsExecutingState),
198 + color: Theme.of(context).colorScheme.primary,
199 + textColor: Theme.of(context).colorScheme.onPrimary,
200 + isDisabled: (!nodeCreateOrEditViewModel.isReady) ||
201 + (nodeCreateOrEditViewModel.connectionState is IsExecutingState),
202 ),
203 )),
204 ],
lib/src/screens/nodes/pow_node_create_or_edit_page.dart
+59 -70
@@ -1,5 +1,4 @@
1 import 'package:cake_wallet/core/execution_state.dart';
2 -import 'package:cake_wallet/palette.dart';
2 import 'package:cake_wallet/src/screens/nodes/widgets/node_form.dart';
3 import 'package:cake_wallet/src/widgets/alert_with_one_action.dart';
4 import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
@@ -15,7 +14,8 @@ import 'package:cake_wallet/src/screens/base_page.dart';
14 import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
15
16 class PowNodeCreateOrEditPage extends BasePage {
18 - PowNodeCreateOrEditPage({required this.nodeCreateOrEditViewModel,this.editingNode, this.isSelected})
17 + PowNodeCreateOrEditPage(
18 + {required this.nodeCreateOrEditViewModel, this.editingNode, this.isSelected})
19 : _formKey = GlobalKey<FormState>(),
20 _addressController = TextEditingController(),
21 _portController = TextEditingController(),
@@ -47,14 +47,12 @@ class PowNodeCreateOrEditPage extends BasePage {
47 });
48 }
49
50 - _addressController.addListener(
51 - () => nodeCreateOrEditViewModel.address = _addressController.text);
52 - _portController.addListener(
53 - () => nodeCreateOrEditViewModel.port = _portController.text);
54 - _loginController.addListener(
55 - () => nodeCreateOrEditViewModel.login = _loginController.text);
56 - _passwordController.addListener(
57 - () => nodeCreateOrEditViewModel.password = _passwordController.text);
50 + _addressController
51 + .addListener(() => nodeCreateOrEditViewModel.address = _addressController.text);
52 + _portController.addListener(() => nodeCreateOrEditViewModel.port = _portController.text);
53 + _loginController.addListener(() => nodeCreateOrEditViewModel.login = _loginController.text);
54 + _passwordController
55 + .addListener(() => nodeCreateOrEditViewModel.password = _passwordController.text);
56 }
57
58 final GlobalKey<FormState> _formKey;
@@ -78,50 +76,47 @@ class PowNodeCreateOrEditPage extends BasePage {
76 'assets/images/qr_code_icon.png',
77 ),
78 );
81 -
79 +
80 final NodeCreateOrEditViewModel nodeCreateOrEditViewModel;
81 final Node? editingNode;
82 final bool? isSelected;
83
84 @override
85 Widget body(BuildContext context) {
86 + reaction((_) => nodeCreateOrEditViewModel.connectionState, (ExecutionState state) {
87 + if (state is ExecutedSuccessfullyState) {
88 + WidgetsBinding.instance.addPostFrameCallback((_) {
89 + showPopUp<void>(
90 + context: context,
91 + builder: (BuildContext context) => AlertWithOneAction(
92 + alertTitle: S.of(context).new_node_testing,
93 + alertContent: state.payload as bool
94 + ? S.of(context).node_connection_successful
95 + : S.of(context).node_connection_failed,
96 + buttonText: S.of(context).ok,
97 + buttonAction: () => Navigator.of(context).pop()));
98 + });
99 + }
100
89 - reaction((_) => nodeCreateOrEditViewModel.connectionState,
90 - (ExecutionState state) {
91 - if (state is ExecutedSuccessfullyState) {
92 - WidgetsBinding.instance.addPostFrameCallback((_) {
93 - showPopUp<void>(
94 - context: context,
95 - builder: (BuildContext context) =>
96 - AlertWithOneAction(
97 - alertTitle: S.of(context).new_node_testing,
98 - alertContent: state.payload as bool
99 - ? S.of(context).node_connection_successful
100 - : S.of(context).node_connection_failed,
101 - buttonText: S.of(context).ok,
102 - buttonAction: () => Navigator.of(context).pop()));
103 - });
104 - }
105 -
106 - if (state is FailureState) {
107 - WidgetsBinding.instance.addPostFrameCallback((_) {
108 - showPopUp<void>(
109 - context: context,
110 - builder: (BuildContext context) {
111 - return AlertWithOneAction(
112 - alertTitle: S.of(context).error,
113 - alertContent: state.error,
114 - buttonText: S.of(context).ok,
115 - buttonAction: () => Navigator.of(context).pop());
116 - });
117 - });
118 - }
101 + if (state is FailureState) {
102 + WidgetsBinding.instance.addPostFrameCallback((_) {
103 + showPopUp<void>(
104 + context: context,
105 + builder: (BuildContext context) {
106 + return AlertWithOneAction(
107 + alertTitle: S.of(context).error,
108 + alertContent: state.error,
109 + buttonText: S.of(context).ok,
110 + buttonAction: () => Navigator.of(context).pop());
111 + });
112 });
113 + }
114 + });
115
116 return Container(
117 padding: EdgeInsets.only(left: 24, right: 24),
118 child: ScrollableWithBottomSection(
124 - contentPadding: EdgeInsets.only(bottom: 24.0),
119 + contentPadding: EdgeInsets.only(bottom: 24.0, top: 8),
120 content: NodeForm(
121 formKey: _formKey,
122 nodeViewModel: nodeCreateOrEditViewModel,
@@ -133,27 +128,20 @@ class PowNodeCreateOrEditPage extends BasePage {
128 mainAxisAlignment: MainAxisAlignment.center,
129 children: <Widget>[
130 Flexible(
136 - child: Container(
137 - padding: EdgeInsets.only(right: 8.0),
138 - child: LoadingPrimaryButton(
131 + child: Container(
132 + padding: EdgeInsets.only(right: 8.0),
133 + child: LoadingPrimaryButton(
134 onPressed: () async {
135 final confirmed = await showPopUp<bool>(
136 context: context,
137 builder: (BuildContext context) {
138 return AlertWithTwoActions(
144 - alertTitle:
145 - S.of(context).remove_node,
146 - alertContent: S
147 - .of(context)
148 - .remove_node_message,
149 - rightButtonText:
150 - S.of(context).remove,
151 - leftButtonText:
152 - S.of(context).cancel,
153 - actionRightButton: () =>
154 - Navigator.pop(context, true),
155 - actionLeftButton: () =>
156 - Navigator.pop(context, false));
139 + alertTitle: S.of(context).remove_node,
140 + alertContent: S.of(context).remove_node_message,
141 + rightButtonText: S.of(context).remove,
142 + leftButtonText: S.of(context).cancel,
143 + actionRightButton: () => Navigator.pop(context, true),
144 + actionLeftButton: () => Navigator.pop(context, false));
145 }) ??
146 false;
147
@@ -163,17 +151,19 @@ class PowNodeCreateOrEditPage extends BasePage {
151 }
152 },
153 text: S.of(context).delete,
166 - isDisabled: !nodeCreateOrEditViewModel.isReady ||
167 - (isSelected ?? false),
168 - color: Palette.red,
169 - textColor: Colors.white),
170 - )),
154 + isDisabled: !nodeCreateOrEditViewModel.isReady || (isSelected ?? false),
155 + color: Theme.of(context).colorScheme.errorContainer,
156 + textColor: Theme.of(context).colorScheme.onPrimary,
157 + ),
158 + ),
159 + ),
160 Flexible(
161 child: Container(
162 padding: EdgeInsets.only(left: 8.0),
163 child: PrimaryButton(
164 onPressed: () async {
176 - if (_formKey.currentState != null && !_formKey.currentState!.validate()) {
165 + if (_formKey.currentState != null &&
166 + !_formKey.currentState!.validate()) {
167 return;
168 }
169
@@ -182,15 +172,14 @@ class PowNodeCreateOrEditPage extends BasePage {
172 Navigator.of(context).pop();
173 },
174 text: S.of(context).save,
185 - color: Theme.of(context).primaryColor,
186 - textColor: Colors.white,
187 - isDisabled: (!nodeCreateOrEditViewModel.isReady)||
188 - (nodeCreateOrEditViewModel
189 - .connectionState is IsExecutingState),
175 + color: Theme.of(context).colorScheme.primary,
176 + textColor: Theme.of(context).colorScheme.onPrimary,
177 + isDisabled: (!nodeCreateOrEditViewModel.isReady) ||
178 + (nodeCreateOrEditViewModel.connectionState is IsExecutingState),
179 ),
180 )),
181 ],
182 )),
183 ));
184 }
196 -}
\ No newline at end of file
185 +}
lib/src/screens/nodes/widgets/node_form.dart
+26 -24
@@ -99,7 +99,9 @@ class NodeForm extends StatelessWidget {
99 child: BaseTextFormField(
100 controller: _addressController,
101 hintText: S.of(context).node_address,
102 - validator: type == WalletType.decred ? NodeAddressValidatorDecredBlankException() : NodeAddressValidator(),
102 + validator: type == WalletType.decred
103 + ? NodeAddressValidatorDecredBlankException()
104 + : NodeAddressValidator(),
105 ),
106 )
107 ],
@@ -122,12 +124,13 @@ class NodeForm extends StatelessWidget {
124 Row(
125 children: <Widget>[
126 Expanded(
125 - child: BaseTextFormField(
126 - controller: _portController,
127 - hintText: S.of(context).node_port,
128 - keyboardType: TextInputType.numberWithOptions(signed: false, decimal: false),
129 - validator: NodePortValidator(),
130 - ))
127 + child: BaseTextFormField(
128 + controller: _portController,
129 + hintText: S.of(context).node_port,
130 + keyboardType: TextInputType.numberWithOptions(signed: false, decimal: false),
131 + validator: NodePortValidator(),
132 + ),
133 + )
134 ],
135 ),
136 SizedBox(height: 10.0),
@@ -140,9 +143,8 @@ class NodeForm extends StatelessWidget {
143 Observer(
144 builder: (_) => StandardCheckbox(
145 value: nodeViewModel.useSSL,
143 - gradientBackground: true,
144 - borderColor: Theme.of(context).dividerColor,
145 - iconColor: Colors.white,
146 + borderColor: Theme.of(context).colorScheme.surfaceContainerHighest,
147 + iconColor: Theme.of(context).colorScheme.primary,
148 onChanged: (value) => nodeViewModel.useSSL = value,
149 caption: S.of(context).use_ssl,
150 ),
@@ -155,20 +157,22 @@ class NodeForm extends StatelessWidget {
157 Row(
158 children: <Widget>[
159 Expanded(
158 - child: BaseTextFormField(
159 - controller: _loginController,
160 - hintText: S.of(context).login,
161 - ))
160 + child: BaseTextFormField(
161 + controller: _loginController,
162 + hintText: S.of(context).login,
163 + ),
164 + )
165 ],
166 ),
167 SizedBox(height: 10.0),
168 Row(
169 children: <Widget>[
170 Expanded(
168 - child: BaseTextFormField(
169 - controller: _passwordController,
170 - hintText: S.of(context).password,
171 - ))
171 + child: BaseTextFormField(
172 + controller: _passwordController,
173 + hintText: S.of(context).password,
174 + ),
175 + )
176 ],
177 ),
178 Padding(
@@ -180,9 +184,8 @@ class NodeForm extends StatelessWidget {
184 Observer(
185 builder: (_) => StandardCheckbox(
186 value: nodeViewModel.trusted,
183 - gradientBackground: true,
184 - borderColor: Theme.of(context).dividerColor,
185 - iconColor: Colors.white,
187 + borderColor: Theme.of(context).colorScheme.surfaceContainerHighest,
188 + iconColor: Theme.of(context).colorScheme.primary,
189 onChanged: (value) => nodeViewModel.trusted = value,
190 caption: S.of(context).trusted,
191 ),
@@ -201,9 +204,8 @@ class NodeForm extends StatelessWidget {
204 children: [
205 StandardCheckbox(
206 value: nodeViewModel.useSocksProxy,
204 - gradientBackground: true,
205 - borderColor: Theme.of(context).dividerColor,
206 - iconColor: Colors.white,
207 + borderColor: Theme.of(context).colorScheme.surfaceContainerHighest,
208 + iconColor: Theme.of(context).colorScheme.primary,
209 onChanged: (value) {
210 if (!value) {
211 _socksAddressController.text = '';
lib/src/screens/nodes/widgets/node_indicator.dart
+4 -2
@@ -1,5 +1,5 @@
1 +import 'package:cake_wallet/themes/utils/custom_theme_colors.dart';
2 import 'package:flutter/material.dart';
2 -import 'package:cake_wallet/palette.dart';
3
4 class NodeIndicator extends StatelessWidget {
5 NodeIndicator({this.isLive = false});
@@ -12,7 +12,9 @@ class NodeIndicator extends StatelessWidget {
12 width: 12.0,
13 height: 12.0,
14 decoration: BoxDecoration(
15 - shape: BoxShape.circle, color: isLive ? Palette.green : Palette.red),
15 + shape: BoxShape.circle,
16 + color: isLive ? CustomThemeColors.syncGreen : Theme.of(context).colorScheme.errorContainer,
17 + ),
18 );
19 }
20 }
lib/src/screens/nodes/widgets/node_list_row.dart
+31 -34
@@ -1,10 +1,8 @@
1 import 'package:cake_wallet/routes.dart';
2 import 'package:cake_wallet/src/screens/nodes/widgets/node_indicator.dart';
3 import 'package:cake_wallet/src/widgets/standard_list.dart';
4 -import 'package:cake_wallet/themes/extensions/receive_page_theme.dart';
4 import 'package:cw_core/node.dart';
5 import 'package:flutter/material.dart';
7 -import 'package:cake_wallet/themes/extensions/filter_theme.dart';
6
7 class NodeListRow extends StandardListRow {
8 NodeListRow(
@@ -26,23 +24,20 @@ class NodeListRow extends StandardListRow {
24 height: 56,
25 padding: EdgeInsets.only(left: 12, right: 12, top: 2, bottom: 2),
26 margin: EdgeInsets.only(top: 2, bottom: 2),
29 - child: TextButton(
27 + child: FilledButton(
28 onPressed: () => onTap?.call(context),
31 - style: ButtonStyle(
32 - backgroundColor: MaterialStateProperty.all(Theme.of(context).cardColor),
33 - shape: MaterialStateProperty.all(
34 - RoundedRectangleBorder(
35 - borderRadius: BorderRadius.all(Radius.circular(10)
36 - ),
37 - ),
29 + style: FilledButton.styleFrom(
30 + backgroundColor: Theme.of(context).colorScheme.surfaceContainer,
31 + shape: RoundedRectangleBorder(
32 + borderRadius: BorderRadius.all(Radius.circular(10)),
33 ),
34 ),
35 child: Row(
36 mainAxisAlignment: MainAxisAlignment.spaceBetween,
37 children: <Widget>[
43 - if (leading != null) leading,
44 - buildCenter(context, hasLeftOffset: leading != null),
45 - if (trailing != null) trailing,
38 + leading,
39 + buildCenter(context, hasLeftOffset: true),
40 + trailing,
41 ],
42 ),
43 ),
@@ -56,7 +51,7 @@ class NodeListRow extends StandardListRow {
51 builder: (context, snapshot) {
52 switch (snapshot.connectionState) {
53 case ConnectionState.done:
59 - return NodeIndicator(isLive: (snapshot.data as bool?) ?? false);
54 + return NodeIndicator(isLive: snapshot.data ?? false);
55 default:
56 return NodeIndicator(isLive: false);
57 }
@@ -66,20 +61,23 @@ class NodeListRow extends StandardListRow {
61 @override
62 Widget buildTrailing(BuildContext context) {
63 return GestureDetector(
69 - onTap: () => Navigator.of(context).pushNamed(isPow ? Routes.newPowNode : Routes.newNode,
70 - arguments: {'editingNode': node, 'isSelected': isSelected}),
71 - child: Container(
72 - padding: EdgeInsets.all(10),
73 - decoration: BoxDecoration(
74 - shape: BoxShape.circle,
75 - color: Theme.of(context)
76 - .extension<ReceivePageTheme>()!
77 - .iconsBackgroundColor),
78 - child: Icon(Icons.edit,
79 - size: 14,
80 - color: Theme.of(context)
81 - .extension<ReceivePageTheme>()!
82 - .iconsColor)));
64 + onTap: () => Navigator.of(context).pushNamed(
65 + isPow ? Routes.newPowNode : Routes.newNode,
66 + arguments: {'editingNode': node, 'isSelected': isSelected},
67 + ),
68 + child: Container(
69 + padding: EdgeInsets.all(10),
70 + decoration: BoxDecoration(
71 + shape: BoxShape.circle,
72 + color: Theme.of(context).colorScheme.surface,
73 + ),
74 + child: Icon(
75 + Icons.edit,
76 + size: 14,
77 + color: Theme.of(context).colorScheme.onSurfaceVariant,
78 + ),
79 + ),
80 + );
81 }
82 }
83
@@ -97,11 +95,10 @@ class NodeHeaderListRow extends StandardListRow {
95 child: TextButton(
96 onPressed: () => onTap?.call(context),
97 style: ButtonStyle(
100 - backgroundColor: MaterialStateProperty.all(Theme.of(context).cardColor),
101 - shape: MaterialStateProperty.all(
98 + backgroundColor: WidgetStateProperty.all(Theme.of(context).colorScheme.surface),
99 + shape: WidgetStateProperty.all(
100 RoundedRectangleBorder(
103 - borderRadius: BorderRadius.all(Radius.circular(10)
104 - ),
101 + borderRadius: BorderRadius.all(Radius.circular(10)),
102 ),
103 ),
104 ),
@@ -110,7 +107,7 @@ class NodeHeaderListRow extends StandardListRow {
107 children: <Widget>[
108 if (leading != null) leading,
109 buildCenter(context, hasLeftOffset: leading != null),
113 - if (trailing != null) trailing,
110 + trailing,
111 ],
112 ),
113 ),
@@ -122,7 +119,7 @@ class NodeHeaderListRow extends StandardListRow {
119 return SizedBox(
120 width: 20,
121 child: Icon(Icons.add,
125 - color: Theme.of(context).extension<FilterTheme>()!.titlesColor,size: 24.0),
122 + color: Theme.of(context).colorScheme.onSurfaceVariant, size: 24.0),
123 );
124 }
125 }
lib/src/screens/payjoin_details/payjoin_details_page.dart
+6 -3
@@ -6,6 +6,7 @@ import 'package:cake_wallet/src/widgets/list_row.dart';
6 import 'package:cake_wallet/src/widgets/standard_list.dart';
7 import 'package:cake_wallet/src/widgets/standard_list_card.dart';
8 import 'package:cake_wallet/src/widgets/standard_list_status_row.dart';
9 +import 'package:cake_wallet/themes/core/material_base_theme.dart';
10 import 'package:cake_wallet/utils/show_bar.dart';
11 import 'package:cake_wallet/view_model/payjoin_details_view_model.dart';
12 import 'package:flutter/material.dart';
@@ -20,13 +21,15 @@ class PayjoinDetailsPage extends BasePage {
21 final PayjoinDetailsViewModel payjoinDetailsViewModel;
22
23 @override
23 - Widget body(BuildContext context) => PayjoinDetailsPageBody(payjoinDetailsViewModel);
24 + Widget body(BuildContext context) =>
25 + PayjoinDetailsPageBody(payjoinDetailsViewModel, currentTheme);
26 }
27
28 class PayjoinDetailsPageBody extends StatefulWidget {
27 - PayjoinDetailsPageBody(this.payjoinDetailsViewModel);
29 + PayjoinDetailsPageBody(this.payjoinDetailsViewModel, this.currentTheme);
30
31 final PayjoinDetailsViewModel payjoinDetailsViewModel;
32 + final MaterialThemeBase currentTheme;
33
34 @override
35 State<PayjoinDetailsPageBody> createState() => _PayjoinDetailsPageBodyState();
@@ -60,7 +63,7 @@ class _PayjoinDetailsPageBodyState extends State<PayjoinDetailsPageBody> {
63 id: item.id,
64 create: item.createdAt,
65 pair: item.pair,
63 - currentTheme: widget.payjoinDetailsViewModel.settingsStore.currentTheme.type,
66 + currentTheme: widget.currentTheme.type,
67 onTap: item.onTap,
68 );
69 }
lib/src/screens/pin_code/pin_code_widget.dart
+23 -32
@@ -1,5 +1,3 @@
1 -import 'package:cake_wallet/themes/extensions/pin_code_theme.dart';
2 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
1 import 'package:cake_wallet/utils/responsive_layout_util.dart';
2 import 'package:cake_wallet/utils/show_bar.dart';
3 import 'package:another_flushbar/flushbar.dart';
@@ -103,7 +101,7 @@ class PinCodeState<T extends PinCodeWidget> extends State<T> {
101
102 void changeProcessText(String text) {
103 hideProgressText();
106 - _progressBar = createBar<void>(text, duration: null)..show(_key.currentContext!);
104 + _progressBar = createBar<void>(text, context, duration: null)..show(_key.currentContext!);
105 }
106
107 void close() {
@@ -123,11 +121,7 @@ class PinCodeState<T extends PinCodeWidget> extends State<T> {
121 Widget body(BuildContext context) {
122 final deleteIconImage = Image.asset(
123 'assets/images/delete_icon.png',
126 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
127 - );
128 - final faceImage = Image.asset(
129 - 'assets/images/face.png',
130 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
124 + color: Theme.of(context).colorScheme.primary,
125 );
126
127 return KeyboardListener(
@@ -146,17 +140,20 @@ class PinCodeState<T extends PinCodeWidget> extends State<T> {
140 }
141 },
142 child: Container(
149 - color: Theme.of(context).colorScheme.background,
143 + color: Theme.of(context).colorScheme.surface,
144 padding: EdgeInsets.only(left: 40.0, right: 40.0, bottom: 60.0),
145 child: Column(
146 children: <Widget>[
147 Spacer(flex: 2),
154 - Text(title,
155 - style: TextStyle(
156 - fontSize: 20,
148 + Text(
149 + title,
150 + style: Theme.of(context).textTheme.titleLarge?.copyWith(
151 fontWeight: FontWeight.w500,
158 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor)),
159 - Spacer(flex: 8),
152 + fontSize: 20,
153 + color: Theme.of(context).colorScheme.onSurface,
154 + ),
155 + ),
156 + Spacer(flex: 3),
157 Container(
158 width: 180,
159 child: Row(
@@ -171,11 +168,8 @@ class PinCodeState<T extends PinCodeWidget> extends State<T> {
168 decoration: BoxDecoration(
169 shape: BoxShape.circle,
170 color: isFilled
174 - ? Theme.of(context).extension<CakeTextTheme>()!.titleColor
175 - : Theme.of(context)
176 - .extension<PinCodeTheme>()!
177 - .indicatorsColor
178 - .withOpacity(0.25),
171 + ? Theme.of(context).colorScheme.primary
172 + : Theme.of(context).colorScheme.primary.withValues(alpha: 0.25),
173 ));
174 }),
175 ),
@@ -190,10 +184,9 @@ class PinCodeState<T extends PinCodeWidget> extends State<T> {
184 },
185 child: Text(
186 _changePinLengthText(),
193 - style: TextStyle(
194 - fontSize: 14.0,
195 - fontWeight: FontWeight.normal,
196 - color: Theme.of(context).extension<PinCodeTheme>()!.switchColor),
187 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
188 + color: Theme.of(context).colorScheme.secondary,
189 + ),
190 ),
191 )
192 ],
@@ -237,8 +230,7 @@ class PinCodeState<T extends PinCodeWidget> extends State<T> {
230 child: TextButton(
231 onPressed: () => _pop(),
232 style: TextButton.styleFrom(
240 - backgroundColor:
241 - Theme.of(context).colorScheme.background,
233 + backgroundColor: Theme.of(context).colorScheme.surfaceContainer,
234 shape: CircleBorder(),
235 ),
236 child: deleteIconImage,
@@ -256,16 +248,15 @@ class PinCodeState<T extends PinCodeWidget> extends State<T> {
248 key: ValueKey('pin_code_button_${index}_key'),
249 onPressed: () => _push(index),
250 style: TextButton.styleFrom(
259 - backgroundColor: Theme.of(context).cardColor,
251 + backgroundColor: Theme.of(context).colorScheme.surfaceContainer,
252 shape: CircleBorder(),
253 ),
254 child: Text('$index',
263 - style: TextStyle(
264 - fontSize: 25.0,
265 - fontWeight: FontWeight.w600,
266 - color: Theme.of(context)
267 - .extension<CakeTextTheme>()!
268 - .titleColor)),
255 + style: Theme.of(context).textTheme.headlineMedium?.copyWith(
256 + fontWeight: FontWeight.w600,
257 + fontSize: 30,
258 + color: Theme.of(context).colorScheme.onSurfaceVariant,
259 + )),
260 ),
261 );
262 }),
lib/src/screens/receive/anonpay_invoice_page.dart
+20 -32
@@ -1,5 +1,3 @@
1 -import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart';
2 -import 'package:cake_wallet/themes/extensions/keyboard_theme.dart';
1 import 'package:cake_wallet/anonpay/anonpay_donation_link_info.dart';
2 import 'package:cake_wallet/core/execution_state.dart';
3 import 'package:cake_wallet/di.dart';
@@ -84,36 +82,28 @@ class AnonPayInvoicePage extends BasePage {
82 child: KeyboardActions(
83 disableScroll: true,
84 config: KeyboardActionsConfig(
87 - keyboardActionsPlatform: KeyboardActionsPlatform.IOS,
88 - keyboardBarColor: Theme.of(context).extension<KeyboardTheme>()!.keyboardBarColor,
89 - nextFocus: false,
90 - actions: [
91 - KeyboardActionsItem(
92 - focusNode: _amountFocusNode,
93 - toolbarButtons: [(_) => KeyboardDoneButton()],
94 - ),
95 - ]),
85 + keyboardActionsPlatform: KeyboardActionsPlatform.IOS,
86 + keyboardBarColor: Theme.of(context).colorScheme.surfaceVariant,
87 + nextFocus: false,
88 + actions: [
89 + KeyboardActionsItem(
90 + focusNode: _amountFocusNode,
91 + toolbarButtons: [(_) => KeyboardDoneButton()],
92 + ),
93 + ],
94 + ),
95 child: Container(
97 - color: Theme.of(context).colorScheme.background,
96 + color: Theme.of(context).colorScheme.surface,
97 child: ScrollableWithBottomSection(
98 contentPadding: EdgeInsets.only(bottom: 24),
99 content: Container(
100 decoration: responsiveLayoutUtil.shouldRenderMobileUI
101 ? BoxDecoration(
102 borderRadius: BorderRadius.only(
104 - bottomLeft: Radius.circular(24), bottomRight: Radius.circular(24)),
105 - gradient: LinearGradient(
106 - colors: [
107 - Theme.of(context)
108 - .extension<ExchangePageTheme>()!
109 - .firstGradientTopPanelColor,
110 - Theme.of(context)
111 - .extension<ExchangePageTheme>()!
112 - .secondGradientTopPanelColor,
113 - ],
114 - begin: Alignment.topLeft,
115 - end: Alignment.bottomRight,
103 + bottomLeft: Radius.circular(24),
104 + bottomRight: Radius.circular(24),
105 ),
106 + color: Theme.of(context).colorScheme.surfaceContainerLow,
107 )
108 : null,
109 child: Observer(builder: (_) {
@@ -147,12 +137,10 @@ class AnonPayInvoicePage extends BasePage {
137 ? S.of(context).anonpay_description("an invoice", "pay")
138 : S.of(context).anonpay_description("a donation link", "donate"),
139 textAlign: TextAlign.center,
150 - style: TextStyle(
151 - color: Theme.of(context)
152 - .extension<ExchangePageTheme>()!
153 - .receiveAmountColor,
154 - fontWeight: FontWeight.w500,
155 - fontSize: 12),
140 + style: Theme.of(context).textTheme.bodySmall?.copyWith(
141 + color: Theme.of(context).colorScheme.onSurfaceVariant,
142 + fontWeight: FontWeight.w500,
143 + ),
144 ),
145 ),
146 ),
@@ -179,8 +167,8 @@ class AnonPayInvoicePage extends BasePage {
167 anonInvoicePageViewModel.generateDonationLink();
168 }
169 },
182 - color: Theme.of(context).primaryColor,
183 - textColor: Colors.white,
170 + color: Theme.of(context).colorScheme.primary,
171 + textColor: Theme.of(context).colorScheme.onPrimary,
172 isLoading: anonInvoicePageViewModel.state is IsExecutingState,
173 ),
174 ],
lib/src/screens/receive/anonpay_receive_page.dart
+11 -12
@@ -9,11 +9,9 @@ import 'package:cake_wallet/src/widgets/gradient_background.dart';
9 import 'package:cake_wallet/src/screens/receive/widgets/anonpay_status_section.dart';
10 import 'package:cake_wallet/src/screens/receive/widgets/qr_image.dart';
11 import 'package:cake_wallet/src/screens/receive/widgets/copy_link_item.dart';
12 -import 'package:cake_wallet/themes/extensions/qr_code_theme.dart';
12 import 'package:cake_wallet/utils/brightness_util.dart';
13 import 'package:flutter/material.dart';
14 import 'package:qr_flutter/qr_flutter.dart' as qr;
16 -import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
15
16 class AnonPayReceivePage extends BasePage {
17 final AnonpayInfoBase invoiceInfo;
@@ -38,20 +36,21 @@ class AnonPayReceivePage extends BasePage {
36 children: [
37 Text(
38 title,
41 - style: TextStyle(
42 - fontSize: 18.0,
43 - fontWeight: FontWeight.bold,
44 - fontFamily: 'Lato',
45 - color: titleColor(context)),
39 + style: Theme.of(context).textTheme.bodyLarge!.copyWith(
40 + fontSize: 18.0,
41 + fontWeight: FontWeight.bold,
42 + color: Theme.of(context).colorScheme.onSurfaceVariant,
43 + ),
44 ),
45 Text(
46 invoiceInfo is AnonpayInvoiceInfo
47 ? ReceivePageOption.anonPayInvoice.toString()
48 : ReceivePageOption.anonPayDonationLink.toString(),
51 - style: TextStyle(
52 - fontSize: 10.0,
53 - fontWeight: FontWeight.w500,
54 - color: Theme.of(context).extension<QRCodeTheme>()!.qrCodeColor),
49 + style: Theme.of(context).textTheme.bodySmall!.copyWith(
50 + fontSize: 10.0,
51 + fontWeight: FontWeight.w500,
52 + color: Theme.of(context).colorScheme.onSurfaceVariant,
53 + ),
54 )
55 ],
56 );
@@ -118,7 +117,7 @@ class AnonPayReceivePage extends BasePage {
117 decoration: BoxDecoration(
118 border: Border.all(
119 width: 3,
121 - color: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
120 + color: Theme.of(context).colorScheme.onSurfaceVariant,
121 ),
122 ),
123 child: QrImage(
lib/src/screens/receive/fullscreen_qr_page.dart
+17 -10
@@ -3,7 +3,6 @@ import 'package:cake_wallet/src/widgets/gradient_background.dart';
3 import 'package:cake_wallet/src/screens/receive/widgets/qr_image.dart';
4 import 'package:flutter/material.dart';
5 import 'package:cake_wallet/src/screens/base_page.dart';
6 -import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
6
7 class FullscreenQRPage extends BasePage {
8 FullscreenQRPage({required this.qrViewData});
@@ -20,7 +19,7 @@ class FullscreenQRPage extends BasePage {
19 Widget leading(BuildContext context) {
20 final _backButton = Icon(
21 Icons.arrow_back_ios,
23 - color: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
22 + color: Theme.of(context).colorScheme.onSurface,
23 size: 16,
24 );
25
@@ -43,8 +42,7 @@ class FullscreenQRPage extends BasePage {
42
43 @override
44 Widget Function(BuildContext, Widget) get rootWrapper =>
46 - (BuildContext context, Widget scaffold) =>
47 - GradientBackground(scaffold: scaffold);
45 + (BuildContext context, Widget scaffold) => GradientBackground(scaffold: scaffold);
46
47 @override
48 Widget body(BuildContext context) {
@@ -58,13 +56,22 @@ class FullscreenQRPage extends BasePage {
56 child: Container(
57 padding: EdgeInsets.all(10),
58 decoration: BoxDecoration(
61 - border: Border.all(
62 - width: 3,
63 - color: Theme.of(context).extension<DashboardPageTheme>()!.textColor)),
59 + border: Border.all(
60 + width: 3,
61 + color: Theme.of(context).colorScheme.primary,
62 + ),
63 + borderRadius: BorderRadius.circular(16),
64 + color: Theme.of(context).colorScheme.surface,
65 + ),
66 child: Container(
65 - decoration: BoxDecoration(
66 - border: Border.all(width: 3, color: Colors.white)),
67 - child: QrImage(data: qrViewData.data, version: qrViewData.version)),
67 + decoration: BoxDecoration(
68 + border: Border.all(
69 + width: 3,
70 + color: Theme.of(context).colorScheme.surface,
71 + ),
72 + ),
73 + child: QrImage(data: qrViewData.data, version: qrViewData.version),
74 + ),
75 ),
76 ),
77 ),
lib/src/screens/receive/receive_page.dart
+50 -54
@@ -1,14 +1,12 @@
1 -import 'package:cake_wallet/generated/i18n.dart';
2 -import 'package:cake_wallet/src/screens/base_page.dart';
1 import 'package:cake_wallet/src/screens/receive/widgets/address_list.dart';
4 -import 'package:cake_wallet/src/screens/receive/widgets/qr_widget.dart';
2 import 'package:cake_wallet/src/widgets/gradient_background.dart';
3 import 'package:cake_wallet/src/widgets/keyboard_done_button.dart';
7 -import 'package:cake_wallet/themes/extensions/balance_page_theme.dart';
8 -import 'package:cake_wallet/themes/extensions/keyboard_theme.dart';
4 import 'package:cake_wallet/utils/share_util.dart';
10 -import 'package:cake_wallet/view_model/wallet_address_list/wallet_address_list_view_model.dart';
5 import 'package:flutter/material.dart';
6 +import 'package:cake_wallet/generated/i18n.dart';
7 +import 'package:cake_wallet/src/screens/base_page.dart';
8 +import 'package:cake_wallet/src/screens/receive/widgets/qr_widget.dart';
9 +import 'package:cake_wallet/view_model/wallet_address_list/wallet_address_list_view_model.dart';
10 import 'package:keyboard_actions/keyboard_actions.dart';
11
12 class ReceivePage extends BasePage {
@@ -40,51 +38,52 @@ class ReceivePage extends BasePage {
38 final FocusNode _cryptoAmountFocus;
39
40 @override
43 - Widget middle(BuildContext context) => Text(
44 - title,
45 - style: TextStyle(
46 - fontSize: 18.0,
47 - fontWeight: FontWeight.bold,
48 - fontFamily: 'Lato',
49 - color: pageIconColor(context),
50 - ),
51 - );
41 + Widget middle(BuildContext context) {
42 + return Text(
43 + title,
44 + style: Theme.of(context).textTheme.titleMedium?.copyWith(
45 + fontSize: 18.0,
46 + fontWeight: FontWeight.bold,
47 + color: pageIconColor(context),
48 + ),
49 + );
50 + }
51
52 @override
53 Widget Function(BuildContext, Widget) get rootWrapper =>
55 - (BuildContext context, Widget scaffold) =>
56 - GradientBackground(scaffold: scaffold);
54 + (BuildContext context, Widget scaffold) => GradientBackground(scaffold: scaffold);
55
56 @override
59 - Widget trailing(BuildContext context) => Material(
60 - color: Colors.transparent,
61 - child: Semantics(
62 - label: S.of(context).share,
63 - child: IconButton(
64 - padding: EdgeInsets.zero,
65 - constraints: BoxConstraints(),
66 - highlightColor: Colors.transparent,
67 - splashColor: Colors.transparent,
68 - iconSize: 25,
69 - onPressed: () => ShareUtil.share(
70 - text: addressListViewModel.uri.toString(),
71 - context: context,
72 - ),
73 - icon: Icon(
74 - Icons.share,
75 - size: 20,
76 - color: pageIconColor(context),
77 - ),
57 + Widget trailing(BuildContext context) {
58 + return Material(
59 + color: Colors.transparent,
60 + child: Semantics(
61 + label: S.of(context).share,
62 + child: IconButton(
63 + padding: EdgeInsets.zero,
64 + constraints: BoxConstraints(),
65 + highlightColor: Colors.transparent,
66 + splashColor: Colors.transparent,
67 + iconSize: 25,
68 + onPressed: () => ShareUtil.share(
69 + text: addressListViewModel.uri.toString(),
70 + context: context,
71 + ),
72 + icon: Icon(
73 + Icons.share,
74 + size: 20,
75 + color: pageIconColor(context),
76 ),
77 ),
80 - );
78 + ),
79 + );
80 + }
81
82 @override
83 Widget body(BuildContext context) => KeyboardActions(
84 config: KeyboardActionsConfig(
85 keyboardActionsPlatform: KeyboardActionsPlatform.IOS,
86 - keyboardBarColor:
87 - Theme.of(context).extension<KeyboardTheme>()!.keyboardBarColor,
86 + keyboardBarColor: Theme.of(context).colorScheme.surface,
87 nextFocus: false,
88 actions: [
89 KeyboardActionsItem(
@@ -98,16 +97,15 @@ class ReceivePage extends BasePage {
97 Padding(
98 padding: EdgeInsets.fromLTRB(24, 50, 24, 24),
99 child: QRWidget(
101 - addressListViewModel: addressListViewModel,
102 - formKey: _formKey,
103 - heroTag: _heroTag,
104 - amountTextFieldFocusNode: _cryptoAmountFocus,
105 - amountController: _amountController,
106 - currentTheme: currentTheme),
107 - ),
108 - AddressList(
100 addressListViewModel: addressListViewModel,
110 - currentTheme: currentTheme),
101 + formKey: _formKey,
102 + heroTag: _heroTag,
103 + amountTextFieldFocusNode: _cryptoAmountFocus,
104 + amountController: _amountController,
105 + currentTheme: currentTheme,
106 + ),
107 + ),
108 + AddressList(addressListViewModel: addressListViewModel, currentTheme: currentTheme),
109 Padding(
110 padding: EdgeInsets.fromLTRB(24, 24, 24, 32),
111 child: Text(
@@ -115,12 +113,10 @@ class ReceivePage extends BasePage {
113 ? S.of(context).silent_payments_disclaimer
114 : S.of(context).electrum_address_disclaimer,
115 textAlign: TextAlign.center,
118 - style: TextStyle(
119 - fontSize: 15,
120 - color: Theme.of(context)
121 - .extension<BalancePageTheme>()!
122 - .labelTextColor,
123 - ),
116 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
117 + fontSize: 15,
118 + color: Theme.of(context).colorScheme.onSurfaceVariant,
119 + ),
120 ),
121 ),
122 ],
lib/src/screens/receive/widgets/address_cell.dart
+83 -78
@@ -1,9 +1,6 @@
1 import 'package:cake_wallet/generated/i18n.dart';
2 -import 'package:cake_wallet/themes/extensions/qr_code_theme.dart';
3 -import 'package:cake_wallet/themes/extensions/receive_page_theme.dart';
4 -import 'package:cake_wallet/themes/theme_base.dart';
2 +import 'package:cake_wallet/themes/core/material_base_theme.dart';
3 import 'package:cake_wallet/utils/address_formatter.dart';
6 -import 'package:cake_wallet/utils/responsive_layout_util.dart';
4 import 'package:cake_wallet/view_model/wallet_address_list/wallet_address_list_item.dart';
5 import 'package:cw_core/wallet_type.dart';
6 import 'package:flutter/cupertino.dart';
@@ -11,25 +8,26 @@ import 'package:flutter/material.dart';
8 import 'package:flutter_slidable/flutter_slidable.dart';
9
10 class AddressCell extends StatelessWidget {
14 - AddressCell(
15 - {required this.address,
16 - required this.name,
17 - required this.isCurrent,
18 - required this.isPrimary,
19 - required this.backgroundColor,
20 - required this.textColor,
21 - required this.walletType,
22 - required this.currentTheme,
23 - this.onTap,
24 - this.onEdit,
25 - this.onHide,
26 - this.isHidden = false,
27 - this.onDelete,
28 - this.txCount,
29 - this.balance,
30 - this.isChange = false,
31 - this.hasBalance = false,
32 - this.hasReceived = false});
11 + AddressCell({
12 + required this.address,
13 + required this.name,
14 + required this.isCurrent,
15 + required this.isPrimary,
16 + required this.backgroundColor,
17 + required this.textColor,
18 + required this.walletType,
19 + required this.currentTheme,
20 + this.onTap,
21 + this.onEdit,
22 + this.onHide,
23 + this.isHidden = false,
24 + this.onDelete,
25 + this.txCount,
26 + this.balance,
27 + this.isChange = false,
28 + this.hasBalance = false,
29 + this.hasReceived = false,
30 + });
31
32 factory AddressCell.fromItem(
33 WalletAddressListItem item, {
@@ -37,7 +35,7 @@ class AddressCell extends StatelessWidget {
35 required Color backgroundColor,
36 required Color textColor,
37 required WalletType walletType,
40 - required ThemeBase currentTheme,
38 + required MaterialThemeBase currentTheme,
39 Function(String)? onTap,
40 bool hasBalance = false,
41 bool hasReceived = false,
@@ -47,24 +45,25 @@ class AddressCell extends StatelessWidget {
45 Function()? onDelete,
46 }) =>
47 AddressCell(
50 - address: item.address,
51 - name: item.name ?? '',
52 - isCurrent: isCurrent,
53 - isPrimary: item.isPrimary,
54 - backgroundColor: backgroundColor,
55 - textColor: textColor,
56 - walletType: walletType,
57 - currentTheme: currentTheme,
58 - onTap: onTap,
59 - onEdit: onEdit,
60 - onHide: onHide,
61 - isHidden: isHidden,
62 - onDelete: onDelete,
63 - txCount: item.txCount,
64 - balance: item.balance,
65 - isChange: item.isChange,
66 - hasBalance: hasBalance,
67 - hasReceived: hasReceived,);
48 + address: item.address,
49 + name: item.name ?? '',
50 + isCurrent: isCurrent,
51 + isPrimary: item.isPrimary,
52 + backgroundColor: backgroundColor,
53 + textColor: textColor,
54 + walletType: walletType,
55 + currentTheme: currentTheme,
56 + onTap: onTap,
57 + onEdit: onEdit,
58 + onHide: onHide,
59 + isHidden: isHidden,
60 + onDelete: onDelete,
61 + txCount: item.txCount,
62 + balance: item.balance,
63 + isChange: item.isChange,
64 + hasBalance: hasBalance,
65 + hasReceived: hasReceived,
66 + );
67
68 final String address;
69 final String name;
@@ -73,7 +72,7 @@ class AddressCell extends StatelessWidget {
72 final Color backgroundColor;
73 final Color textColor;
74 final WalletType walletType;
76 - final ThemeBase currentTheme;
75 + final MaterialThemeBase currentTheme;
76 final Function(String)? onTap;
77 final Function()? onEdit;
78 final Function()? onHide;
@@ -99,7 +98,9 @@ class AddressCell extends StatelessWidget {
98 child: Column(
99 children: [
100 Row(
102 - mainAxisAlignment: name.isNotEmpty ? MainAxisAlignment.spaceBetween : MainAxisAlignment.center,
101 + mainAxisAlignment: name.isNotEmpty
102 + ? MainAxisAlignment.spaceBetween
103 + : MainAxisAlignment.center,
104 mainAxisSize: MainAxisSize.max,
105 children: [
106 Row(
@@ -111,39 +112,41 @@ class AddressCell extends StatelessWidget {
112 height: 20,
113 padding: EdgeInsets.all(4),
114 decoration: BoxDecoration(
114 - borderRadius: BorderRadius.all(Radius.circular(8.5)),
115 - color: textColor),
115 + borderRadius: BorderRadius.all(Radius.circular(8.5)),
116 + color: textColor,
117 + ),
118 alignment: Alignment.center,
119 child: Text(
120 S.of(context).unspent_change,
119 - style: TextStyle(
120 - color: backgroundColor,
121 - fontSize: 10,
122 - fontWeight: FontWeight.w600,
123 - ),
121 + style: Theme.of(context).textTheme.bodySmall?.copyWith(
122 + color: backgroundColor,
123 + fontSize: 10,
124 + fontWeight: FontWeight.w600,
125 + ),
126 ),
127 ),
128 ),
129 if (name.isNotEmpty)
130 Text(
131 '$name',
130 - style: TextStyle(
131 - fontSize: 14,
132 - fontWeight: FontWeight.w600,
133 - color: textColor,
134 - ),
132 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
133 + fontWeight: FontWeight.w600,
134 + color: textColor,
135 + ),
136 ),
137 ],
138 ),
139 Flexible(
140 child: AddressFormatter.buildSegmentedAddress(
140 - address: address,
141 - walletType: walletType,
142 - shouldTruncate: name.isNotEmpty || address.length > 43 ,
143 - evenTextStyle: TextStyle(
141 + address: address,
142 + walletType: walletType,
143 + shouldTruncate: name.isNotEmpty || address.length > 43,
144 + evenTextStyle: Theme.of(context).textTheme.bodyMedium!.copyWith(
145 fontSize: isChange ? 10 : 14,
145 - color: textColor
146 - ))),
146 + color: textColor,
147 + ),
148 + ),
149 + ),
150 ],
151 ),
152 if (hasBalance || hasReceived)
@@ -155,19 +158,19 @@ class AddressCell extends StatelessWidget {
158 children: [
159 Text(
160 '${hasReceived ? S.of(context).received : S.of(context).balance}: $balance',
158 - style: TextStyle(
159 - fontSize: 16,
160 - fontWeight: FontWeight.w600,
161 - color: textColor,
162 - ),
161 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
162 + fontSize: 16,
163 + fontWeight: FontWeight.w600,
164 + color: textColor,
165 + ),
166 ),
167 Text(
168 '${S.of(context).transactions.toLowerCase()}: $txCount',
166 - style: TextStyle(
167 - fontSize: 16,
168 - fontWeight: FontWeight.w600,
169 - color: textColor,
170 - ),
169 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
170 + fontSize: 16,
171 + fontWeight: FontWeight.w600,
172 + color: textColor,
173 + ),
174 ),
175 ],
176 ),
@@ -199,8 +202,10 @@ class AddressCell extends StatelessWidget {
202 children: [
203 SlidableAction(
204 onPressed: (_) => onHide?.call(),
202 - backgroundColor: isHidden ? Colors.green : Colors.red,
203 - foregroundColor: Colors.white,
205 + backgroundColor: isHidden
206 + ? Theme.of(context).colorScheme.primaryContainer
207 + : Theme.of(context).colorScheme.errorContainer,
208 + foregroundColor: Theme.of(context).colorScheme.onPrimaryContainer,
209 icon: isHidden ? CupertinoIcons.arrow_left : CupertinoIcons.arrow_right,
210 label: isHidden ? S.of(context).show : S.of(context).hide,
211 ),
@@ -213,16 +218,16 @@ class AddressCell extends StatelessWidget {
218 children: [
219 SlidableAction(
220 onPressed: (_) => onEdit?.call(),
216 - backgroundColor: Colors.blue,
217 - foregroundColor: Colors.white,
221 + backgroundColor: Theme.of(context).colorScheme.primaryContainer,
222 + foregroundColor: Theme.of(context).colorScheme.onPrimaryContainer,
223 icon: Icons.edit,
224 label: S.of(context).edit,
225 ),
226 if (onDelete != null)
227 SlidableAction(
228 onPressed: (_) => onDelete!.call(),
224 - backgroundColor: Colors.red,
225 - foregroundColor: Colors.white,
229 + backgroundColor: Theme.of(context).colorScheme.errorContainer,
230 + foregroundColor: Theme.of(context).colorScheme.onErrorContainer,
231 icon: Icons.delete,
232 label: S.of(context).delete,
233 ),
lib/src/screens/receive/widgets/address_list.dart
+98 -93
@@ -6,8 +6,7 @@ import 'package:cake_wallet/src/screens/nano_accounts/nano_account_list_page.dar
6 import 'package:cake_wallet/src/screens/receive/widgets/address_cell.dart';
7 import 'package:cake_wallet/src/screens/receive/widgets/header_tile.dart';
8 import 'package:cake_wallet/src/widgets/section_divider.dart';
9 -import 'package:cake_wallet/themes/extensions/receive_page_theme.dart';
10 -import 'package:cake_wallet/themes/theme_base.dart';
9 +import 'package:cake_wallet/themes/core/material_base_theme.dart';
10 import 'package:cake_wallet/utils/list_item.dart';
11 import 'package:cake_wallet/utils/show_pop_up.dart';
12 import 'package:cake_wallet/view_model/wallet_address_list/wallet_account_list_header.dart';
@@ -16,7 +15,6 @@ import 'package:cake_wallet/view_model/wallet_address_list/wallet_address_list_h
15 import 'package:cake_wallet/view_model/wallet_address_list/wallet_address_list_item.dart';
16 import 'package:cake_wallet/view_model/wallet_address_list/wallet_address_list_view_model.dart';
17 import 'package:cw_core/wallet_type.dart';
19 -import 'package:flutter/foundation.dart';
18 import 'package:flutter/material.dart';
19 import 'package:flutter_mobx/flutter_mobx.dart';
20
@@ -29,7 +27,7 @@ class AddressList extends StatefulWidget {
27 });
28
29 final WalletAddressListViewModel addressListViewModel;
32 - final ThemeBase currentTheme;
30 + final MaterialThemeBase currentTheme;
31 final Function(String)? onSelect;
32
33 @override
@@ -87,59 +85,66 @@ class _AddressListState extends State<AddressList> {
85
86 if (item is WalletAccountListHeader) {
87 cell = HeaderTile(
90 - showTrailingButton: true,
91 - walletAddressListViewModel: widget.addressListViewModel,
92 - trailingButtonTap: () async {
93 - if (widget.addressListViewModel.type == WalletType.monero ||
94 - widget.addressListViewModel.type == WalletType.wownero ||
95 - widget.addressListViewModel.type == WalletType.haven) {
96 - await showPopUp<void>(
97 - context: context, builder: (_) => getIt.get<MoneroAccountListPage>());
98 - updateItems();
99 - } else {
100 - await showPopUp<void>(
101 - context: context, builder: (_) => getIt.get<NanoAccountListPage>());
102 - updateItems();
103 - }
104 - },
105 - title: S.of(context).accounts,
106 - trailingIcon: Icon(
107 - Icons.arrow_forward_ios,
108 - size: 14,
109 - color: Theme.of(context).extension<ReceivePageTheme>()!.iconsColor,
110 - ));
88 + showTrailingButton: true,
89 + walletAddressListViewModel: widget.addressListViewModel,
90 + trailingButtonTap: () async {
91 + if (widget.addressListViewModel.type == WalletType.monero ||
92 + widget.addressListViewModel.type == WalletType.wownero ||
93 + widget.addressListViewModel.type == WalletType.haven) {
94 + await showPopUp<void>(
95 + context: context,
96 + builder: (_) => getIt.get<MoneroAccountListPage>(),
97 + );
98 + updateItems();
99 + } else {
100 + await showPopUp<void>(
101 + context: context,
102 + builder: (_) => getIt.get<NanoAccountListPage>(),
103 + );
104 + updateItems();
105 + }
106 + },
107 + title: S.of(context).accounts,
108 + trailingIcon: Icon(
109 + Icons.arrow_forward_ios,
110 + size: 14,
111 + color: Theme.of(context).colorScheme.onSurfaceVariant,
112 + ),
113 + );
114 }
115
116 if (item is WalletAddressHiddenListHeader) {
117 cell = HeaderTile(
115 - title: S.of(context).hidden_addresses,
116 - walletAddressListViewModel: widget.addressListViewModel,
117 - showTrailingButton: true,
118 - showSearchButton: false,
119 - trailingButtonTap: _toggleHiddenAddresses,
120 - trailingIcon: Icon(
121 - showHiddenAddresses ? Icons.toggle_on : Icons.toggle_off,
122 - size: 20,
123 - color: Theme.of(context).extension<ReceivePageTheme>()!.iconsColor,
124 - ));
118 + title: S.of(context).hidden_addresses,
119 + walletAddressListViewModel: widget.addressListViewModel,
120 + showTrailingButton: true,
121 + showSearchButton: false,
122 + trailingButtonTap: _toggleHiddenAddresses,
123 + trailingIcon: Icon(
124 + showHiddenAddresses ? Icons.toggle_on : Icons.toggle_off,
125 + size: 20,
126 + color: Theme.of(context).colorScheme.onSurfaceVariant,
127 + ),
128 + );
129 }
130
131 if (item is WalletAddressListHeader) {
132 cell = HeaderTile(
129 - title: S.of(context).addresses,
130 - walletAddressListViewModel: widget.addressListViewModel,
131 - showTrailingButton: widget.addressListViewModel.showAddManualAddresses,
132 - showSearchButton: true,
133 - onSearchCallback: updateItems,
134 - trailingButtonTap: () =>
135 - Navigator.of(context).pushNamed(Routes.newSubaddress).then((value) {
136 - updateItems(); // refresh the new address
137 - }),
138 - trailingIcon: Icon(
139 - Icons.add,
140 - size: 20,
141 - color: Theme.of(context).extension<ReceivePageTheme>()!.iconsColor,
142 - ));
133 + title: S.of(context).addresses,
134 + walletAddressListViewModel: widget.addressListViewModel,
135 + showTrailingButton: widget.addressListViewModel.showAddManualAddresses,
136 + showSearchButton: true,
137 + onSearchCallback: updateItems,
138 + trailingButtonTap: () =>
139 + Navigator.of(context).pushNamed(Routes.newSubaddress).then((value) {
140 + updateItems(); // refresh the new address
141 + }),
142 + trailingIcon: Icon(
143 + Icons.add,
144 + size: 20,
145 + color: Theme.of(context).colorScheme.onSurfaceVariant,
146 + ),
147 + );
148 }
149
150 if (item is WalletAddressListItem) {
@@ -148,56 +153,56 @@ class _AddressListState extends State<AddressList> {
153 } else if (!item.isHidden && showHiddenAddresses) {
154 cell = Container();
155 } else {
151 - cell = Observer(builder: (_) {
152 - final isCurrent =
153 - item.address == widget.addressListViewModel.address.address && editable;
154 - final backgroundColor = isCurrent
155 - ? Theme.of(context).extension<ReceivePageTheme>()!.currentTileBackgroundColor
156 - : Theme.of(context).extension<ReceivePageTheme>()!.tilesBackgroundColor;
157 - final textColor = isCurrent
158 - ? Theme.of(context).extension<ReceivePageTheme>()!.currentTileTextColor
159 - : Theme.of(context).extension<ReceivePageTheme>()!.tilesTextColor;
160 -
161 - return AddressCell.fromItem(
162 - item,
163 - isCurrent: isCurrent,
164 - currentTheme: widget.currentTheme,
165 - walletType: widget.addressListViewModel.type,
166 - hasBalance: widget.addressListViewModel.isBalanceAvailable,
167 - hasReceived: widget.addressListViewModel.isReceivedAvailable,
168 - // hasReceived:
169 - backgroundColor: (kDebugMode && item.isHidden)
170 - ? Theme.of(context).colorScheme.error
171 - : (kDebugMode && item.isManual)
172 - ? Theme.of(context).colorScheme.error.withBlue(255)
173 - : backgroundColor,
174 - textColor: textColor,
175 - onTap: (_) {
176 - if (widget.onSelect != null) {
177 - widget.onSelect!(item.address);
178 - return;
179 - }
180 - widget.addressListViewModel.setAddress(item);
181 - },
182 - onEdit: editable
183 - ? () => Navigator.of(context)
184 - .pushNamed(Routes.newSubaddress, arguments: item)
185 - .then((value) {
186 - updateItems(); // refresh the new address
187 - })
188 - : null,
189 - isHidden: item.isHidden,
190 - onHide: () => _hideAddress(item),
191 - );
192 - });
156 + cell = Observer(
157 + builder: (_) {
158 + final isCurrent =
159 + item.address == widget.addressListViewModel.address.address && editable;
160 + final backgroundColor = isCurrent
161 + ? Theme.of(context).colorScheme.primary
162 + : Theme.of(context).colorScheme.surface;
163 + final textColor = isCurrent
164 + ? Theme.of(context).colorScheme.onPrimary
165 + : Theme.of(context).colorScheme.onSurface;
166 +
167 + return AddressCell.fromItem(
168 + item,
169 + isCurrent: isCurrent,
170 + currentTheme: widget.currentTheme,
171 + walletType: widget.addressListViewModel.type,
172 + hasBalance: widget.addressListViewModel.isBalanceAvailable,
173 + hasReceived: widget.addressListViewModel.isReceivedAvailable,
174 + // hasReceived:
175 + backgroundColor: backgroundColor,
176 + textColor: textColor,
177 + onTap: (_) {
178 + if (widget.onSelect != null) {
179 + widget.onSelect!(item.address);
180 + return;
181 + }
182 + widget.addressListViewModel.setAddress(item);
183 + },
184 + onEdit: editable
185 + ? () => Navigator.of(context)
186 + .pushNamed(Routes.newSubaddress, arguments: item)
187 + .then((value) {
188 + updateItems(); // refresh the new address
189 + })
190 + : null,
191 + isHidden: item.isHidden,
192 + onHide: () => _hideAddress(item),
193 + );
194 + },
195 + );
196 }
197 }
198
199 return index != 0
200 ? cell
201 : ClipRRect(
199 - borderRadius:
200 - BorderRadius.only(topLeft: Radius.circular(30), topRight: Radius.circular(30)),
202 + borderRadius: BorderRadius.only(
203 + topLeft: Radius.circular(30),
204 + topRight: Radius.circular(30),
205 + ),
206 child: cell,
207 );
208 },
lib/src/screens/receive/widgets/anonpay_currency_input_field.dart
+104 -100
@@ -1,10 +1,8 @@
1 import 'package:cake_wallet/generated/i18n.dart';
2 import 'package:cake_wallet/src/widgets/base_text_form_field.dart';
3 -import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart';
3 import 'package:cw_core/currency.dart';
4 import 'package:flutter/material.dart';
5 import 'package:flutter/services.dart';
7 -import 'package:cake_wallet/themes/extensions/send_page_theme.dart';
6
7 class AnonpayCurrencyInputField extends StatelessWidget {
8 const AnonpayCurrencyInputField(
@@ -21,111 +19,115 @@ class AnonpayCurrencyInputField extends StatelessWidget {
19 final TextEditingController controller;
20 final String minAmount;
21 final String maxAmount;
22 +
23 @override
24 Widget build(BuildContext context) {
25 final arrowBottomPurple = Image.asset(
26 'assets/images/arrow_bottom_purple_icon.png',
28 - color: Colors.white,
27 + color: Theme.of(context).colorScheme.primary,
28 height: 8,
29 );
30 +
31 return Column(
32 children: [
33 Container(
34 - decoration: BoxDecoration(
35 - border: Border(
36 - bottom: BorderSide(
37 - color:
38 - Theme.of(context).extension<ExchangePageTheme>()!.textFieldBorderBottomPanelColor,
39 - width: 1)),
40 - ),
41 - child: Padding(
42 - padding: EdgeInsets.only(top: 20),
43 - child: Row(
44 - children: [
45 - Container(
46 - padding: EdgeInsets.only(right: 8),
47 - height: 32,
48 - child: InkWell(
49 - onTap: onTapPicker,
50 - child: Row(
51 - mainAxisAlignment: MainAxisAlignment.spaceBetween,
52 - mainAxisSize: MainAxisSize.min,
53 - children: <Widget>[
54 - Padding(
55 - padding: EdgeInsets.only(right: 5),
56 - child: arrowBottomPurple,
57 - ),
58 - Text(selectedCurrency.name.toUpperCase(),
59 - style: TextStyle(
60 - fontWeight: FontWeight.w600, fontSize: 16, color: Colors.white))
61 - ]),
34 + child: Padding(
35 + padding: EdgeInsets.only(top: 20),
36 + child: Row(
37 + children: [
38 + Container(
39 + padding: EdgeInsets.only(right: 8),
40 + height: 32,
41 + child: InkWell(
42 + onTap: onTapPicker,
43 + child: Row(
44 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
45 + mainAxisSize: MainAxisSize.min,
46 + children: <Widget>[
47 + Padding(
48 + padding: EdgeInsets.only(right: 5),
49 + child: arrowBottomPurple,
50 + ),
51 + Text(
52 + selectedCurrency.name.toUpperCase(),
53 + style: Theme.of(context).textTheme.bodyLarge?.copyWith(
54 + fontWeight: FontWeight.w600,
55 + color: Theme.of(context).colorScheme.onSurface,
56 + ),
57 + ),
58 + ],
59 ),
60 ),
64 - selectedCurrency.tag != null
65 - ? Padding(
66 - padding: const EdgeInsets.only(right: 3.0),
67 - child: Container(
68 - height: 32,
69 - decoration: BoxDecoration(
70 - color: Theme.of(context).extension<SendPageTheme>()!.textFieldButtonColor,
71 - borderRadius: BorderRadius.all(Radius.circular(6))),
72 - child: Center(
73 - child: Padding(
74 - padding: const EdgeInsets.all(6.0),
75 - child: Text(
76 - selectedCurrency.tag!,
77 - style: TextStyle(
78 - fontSize: 12,
79 - fontWeight: FontWeight.bold,
80 - color: Theme.of(context).extension<SendPageTheme>()!.textFieldButtonIconColor,
81 - ),
82 - ),
83 - ),
84 - ),
85 - ),
86 - )
87 - : Container(),
61 + ),
62 + if (selectedCurrency.tag != null)
63 Padding(
89 - padding: const EdgeInsets.only(right: 4.0),
90 - child: Text(':',
91 - style: TextStyle(
92 - fontWeight: FontWeight.w600, fontSize: 16, color: Colors.white)),
93 - ),
94 - Expanded(
95 - child: Row(
96 - mainAxisAlignment: MainAxisAlignment.spaceBetween,
97 - children: [
98 - Flexible(
99 - child: BaseTextFormField(
100 - focusNode: focusNode,
101 - controller: controller,
102 - textInputAction: TextInputAction.next,
103 - enabled: true,
104 - textAlign: TextAlign.left,
105 - keyboardType:
106 - TextInputType.numberWithOptions(signed: false, decimal: true),
107 - inputFormatters: [
108 - FilteringTextInputFormatter.deny(RegExp('[\\-|\\ ]'))
109 - ],
110 - hintText: '0.0000',
111 - borderColor: Colors.transparent,
112 - //widget.borderColor,
113 - textStyle: TextStyle(
114 - fontSize: 16, fontWeight: FontWeight.w600, color: Colors.white),
115 - placeholderTextStyle: TextStyle(
116 - fontSize: 16,
117 - fontWeight: FontWeight.w600,
118 - color: Theme.of(context).extension<ExchangePageTheme>()!.hintTextColor,
119 - ),
120 - validator: null,
64 + padding: const EdgeInsets.only(right: 3.0),
65 + child: Container(
66 + height: 32,
67 + decoration: BoxDecoration(
68 + color: Theme.of(context).colorScheme.secondaryContainer,
69 + borderRadius: BorderRadius.all(Radius.circular(6)),
70 + ),
71 + child: Center(
72 + child: Padding(
73 + padding: const EdgeInsets.all(6.0),
74 + child: Text(
75 + selectedCurrency.tag!,
76 + style: Theme.of(context).textTheme.bodySmall?.copyWith(
77 + fontWeight: FontWeight.bold,
78 + color: Theme.of(context).colorScheme.onSecondaryContainer,
79 + ),
80 ),
81 ),
123 - ],
82 + ),
83 ),
84 ),
126 - ],
127 - ),
128 - )),
85 + Padding(
86 + padding: const EdgeInsets.only(right: 4.0),
87 + child: Text(
88 + ':',
89 + style: Theme.of(context).textTheme.bodyLarge?.copyWith(
90 + fontWeight: FontWeight.w600,
91 + color: Theme.of(context).colorScheme.onSurface,
92 + ),
93 + ),
94 + ),
95 + Expanded(
96 + child: Row(
97 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
98 + children: [
99 + Flexible(
100 + child: BaseTextFormField(
101 + hasUnderlineBorder: true,
102 + borderWidth: 0.0,
103 + focusNode: focusNode,
104 + controller: controller,
105 + textInputAction: TextInputAction.next,
106 + enabled: true,
107 + textAlign: TextAlign.left,
108 + keyboardType:
109 + TextInputType.numberWithOptions(signed: false, decimal: true),
110 + inputFormatters: [FilteringTextInputFormatter.deny(RegExp('[\\-|\\ ]'))],
111 + hintText: '0.0000',
112 + textStyle: Theme.of(context).textTheme.bodyLarge?.copyWith(
113 + fontWeight: FontWeight.w600,
114 + color: Theme.of(context).colorScheme.onSurface,
115 + ),
116 + placeholderTextStyle: Theme.of(context).textTheme.bodyLarge?.copyWith(
117 + fontWeight: FontWeight.w600,
118 + color: Theme.of(context).colorScheme.onSurfaceVariant,
119 + ),
120 + validator: null,
121 + ),
122 + ),
123 + ],
124 + ),
125 + ),
126 + ],
127 + ),
128 + ),
129 + ),
130 + Divider(height: 1, color: Theme.of(context).colorScheme.outlineVariant),
131 Container(
132 height: 15,
133 child: Row(
@@ -133,20 +135,22 @@ class AnonpayCurrencyInputField extends StatelessWidget {
135 children: <Widget>[
136 Text(
137 S.of(context).min_value(minAmount, selectedCurrency.toString()),
136 - style: TextStyle(
137 - fontSize: 10,
138 - height: 1.2,
139 - color: Theme.of(context).extension<ExchangePageTheme>()!.hintTextColor),
138 + style: Theme.of(context).textTheme.bodySmall?.copyWith(
139 + height: 1.2,
140 + color: Theme.of(context).colorScheme.onSurfaceVariant,
141 + ),
142 ),
143 SizedBox(width: 10),
142 - Text(S.of(context).max_value(maxAmount, selectedCurrency.toString()),
143 - style: TextStyle(
144 - fontSize: 10,
144 + Text(
145 + S.of(context).max_value(maxAmount, selectedCurrency.toString()),
146 + style: Theme.of(context).textTheme.bodySmall?.copyWith(
147 height: 1.2,
146 - color: Theme.of(context).extension<ExchangePageTheme>()!.hintTextColor)),
148 + color: Theme.of(context).colorScheme.onSurfaceVariant,
149 + ),
150 + ),
151 ],
152 ),
149 - )
153 + ),
154 ],
155 );
156 }
lib/src/screens/receive/widgets/anonpay_input_form.dart
+79 -76
@@ -3,8 +3,6 @@ import 'package:cake_wallet/generated/i18n.dart';
3 import 'package:cake_wallet/src/screens/exchange/widgets/currency_picker.dart';
4 import 'package:cake_wallet/src/screens/receive/widgets/anonpay_currency_input_field.dart';
5 import 'package:cake_wallet/src/widgets/base_text_form_field.dart';
6 -import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart';
7 -import 'package:cake_wallet/typography.dart';
6 import 'package:cake_wallet/utils/show_pop_up.dart';
7 import 'package:cake_wallet/view_model/anon_invoice_page_view_model.dart';
8 import 'package:flutter/material.dart';
@@ -23,12 +21,12 @@ class AnonInvoiceForm extends StatelessWidget {
21 required this.depositAmountFocus,
22 }) : _nameFocusNode = FocusNode(),
23 _emailFocusNode = FocusNode(),
26 - _descriptionFocusNode = FocusNode(){
27 - amountController.text = anonInvoicePageViewModel.amount;
28 - nameController.text = anonInvoicePageViewModel.receipientName;
29 - descriptionController.text = anonInvoicePageViewModel.description;
30 - emailController.text = anonInvoicePageViewModel.receipientEmail;
31 - }
24 + _descriptionFocusNode = FocusNode() {
25 + amountController.text = anonInvoicePageViewModel.amount;
26 + nameController.text = anonInvoicePageViewModel.receipientName;
27 + descriptionController.text = anonInvoicePageViewModel.description;
28 + emailController.text = anonInvoicePageViewModel.receipientEmail;
29 + }
30
31 final TextEditingController amountController;
32 final TextEditingController nameController;
@@ -45,16 +43,19 @@ class AnonInvoiceForm extends StatelessWidget {
43 @override
44 Widget build(BuildContext context) {
45 return Form(
48 - key: formKey,
49 - child: Column(
50 - crossAxisAlignment: CrossAxisAlignment.start,
51 - children: <Widget>[
52 - Text(
53 - isInvoice ? S.of(context).invoice_details : S.of(context).donation_link_details,
54 - style: textMediumSemiBold(),
55 - ),
56 - if (isInvoice)
57 - Observer(builder: (_) {
46 + key: formKey,
47 + child: Column(
48 + crossAxisAlignment: CrossAxisAlignment.start,
49 + children: <Widget>[
50 + Text(
51 + isInvoice ? S.of(context).invoice_details : S.of(context).donation_link_details,
52 + style: Theme.of(context).textTheme.titleMedium?.copyWith(
53 + fontWeight: FontWeight.w600,
54 + ),
55 + ),
56 + if (isInvoice)
57 + Observer(
58 + builder: (_) {
59 return AnonpayCurrencyInputField(
60 onTapPicker: () => _presentPicker(context),
61 controller: amountController,
@@ -63,65 +64,67 @@ class AnonInvoiceForm extends StatelessWidget {
64 minAmount: anonInvoicePageViewModel.minimum?.toString() ?? '...',
65 selectedCurrency: anonInvoicePageViewModel.selectedCurrency,
66 );
66 - }),
67 - SizedBox(
68 - height: 24,
69 - ),
70 - BaseTextFormField(
71 - controller: nameController,
72 - focusNode: _nameFocusNode,
73 - borderColor: Theme.of(context).extension<ExchangePageTheme>()!.textFieldBorderTopPanelColor,
74 - suffixIcon: SizedBox(width: 36),
75 - hintText: S.of(context).optional_name,
76 - textInputAction: TextInputAction.next,
77 - placeholderTextStyle: TextStyle(
78 - fontSize: 16,
79 - fontWeight: FontWeight.w600,
80 - color: Theme.of(context).extension<ExchangePageTheme>()!.hintTextColor,
81 - ),
82 - textStyle: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Colors.white),
83 - validator: null,
84 - ),
85 - SizedBox(
86 - height: 24,
87 - ),
88 - BaseTextFormField(
89 - controller: descriptionController,
90 - focusNode: _descriptionFocusNode,
91 - textInputAction: TextInputAction.next,
92 - borderColor: Theme.of(context).extension<ExchangePageTheme>()!.textFieldBorderTopPanelColor,
93 - suffixIcon: SizedBox(width: 36),
94 - hintText: S.of(context).optional_description,
95 - placeholderTextStyle: TextStyle(
96 - fontSize: 16,
97 - fontWeight: FontWeight.w600,
98 - color: Theme.of(context).extension<ExchangePageTheme>()!.hintTextColor,
99 - ),
100 - textStyle: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Colors.white),
101 - validator: null,
67 + },
68 ),
103 - SizedBox(height: 24),
104 - BaseTextFormField(
105 - controller: emailController,
106 - textInputAction: TextInputAction.next,
107 - focusNode: _emailFocusNode,
108 - borderColor: Theme.of(context).extension<ExchangePageTheme>()!.textFieldBorderTopPanelColor,
109 - suffixIcon: SizedBox(width: 36),
110 - keyboardType: TextInputType.emailAddress,
111 - hintText: S.of(context).optional_email_hint,
112 - placeholderTextStyle: TextStyle(
113 - fontSize: 16,
114 - fontWeight: FontWeight.w600,
115 - color: Theme.of(context).extension<ExchangePageTheme>()!.hintTextColor,
116 - ),
117 - textStyle: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Colors.white),
118 - validator: EmailValidator(),
119 - ),
120 - SizedBox(
121 - height: 52,
122 - ),
123 - ],
124 - ));
69 + SizedBox(height: 24),
70 + BaseTextFormField(
71 + hasUnderlineBorder: true,
72 + controller: nameController,
73 + focusNode: _nameFocusNode,
74 + suffixIcon: SizedBox(width: 36),
75 + hintText: S.of(context).optional_name,
76 + textInputAction: TextInputAction.next,
77 + placeholderTextStyle: Theme.of(context).textTheme.bodyLarge?.copyWith(
78 + fontWeight: FontWeight.w600,
79 + color: Theme.of(context).colorScheme.onSurfaceVariant,
80 + ),
81 + textStyle: Theme.of(context).textTheme.bodyLarge?.copyWith(
82 + fontWeight: FontWeight.w600,
83 + color: Theme.of(context).colorScheme.onSurface,
84 + ),
85 + validator: null,
86 + ),
87 + SizedBox(height: 24),
88 + BaseTextFormField(
89 + hasUnderlineBorder: true,
90 + controller: descriptionController,
91 + focusNode: _descriptionFocusNode,
92 + textInputAction: TextInputAction.next,
93 + suffixIcon: SizedBox(width: 36),
94 + hintText: S.of(context).optional_description,
95 + placeholderTextStyle: Theme.of(context).textTheme.bodyLarge?.copyWith(
96 + fontWeight: FontWeight.w600,
97 + color: Theme.of(context).colorScheme.onSurfaceVariant,
98 + ),
99 + textStyle: Theme.of(context).textTheme.bodyLarge?.copyWith(
100 + fontWeight: FontWeight.w600,
101 + color: Theme.of(context).colorScheme.onSurface,
102 + ),
103 + validator: null,
104 + ),
105 + SizedBox(height: 24),
106 + BaseTextFormField(
107 + hasUnderlineBorder: true,
108 + controller: emailController,
109 + textInputAction: TextInputAction.next,
110 + focusNode: _emailFocusNode,
111 + suffixIcon: SizedBox(width: 36),
112 + keyboardType: TextInputType.emailAddress,
113 + hintText: S.of(context).optional_email_hint,
114 + placeholderTextStyle: Theme.of(context).textTheme.bodyLarge?.copyWith(
115 + fontWeight: FontWeight.w600,
116 + color: Theme.of(context).colorScheme.onSurfaceVariant,
117 + ),
118 + textStyle: Theme.of(context).textTheme.bodyLarge?.copyWith(
119 + fontWeight: FontWeight.w600,
120 + color: Theme.of(context).colorScheme.onSurface,
121 + ),
122 + validator: EmailValidator(),
123 + ),
124 + SizedBox(height: 52),
125 + ],
126 + ),
127 + );
128 }
129
130 void _presentPicker(BuildContext context) {
lib/src/screens/receive/widgets/anonpay_status_section.dart
+17 -21
@@ -1,10 +1,6 @@
1 import 'package:cake_wallet/anonpay/anonpay_invoice_info.dart';
2 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
2 import 'package:cake_wallet/generated/i18n.dart';
3 import 'package:cake_wallet/src/screens/dashboard/widgets/sync_indicator_icon.dart';
5 -import 'package:cake_wallet/themes/extensions/address_theme.dart';
6 -import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart';
7 -import 'package:cake_wallet/typography.dart';
4 import 'package:flutter/material.dart';
5
6 class AnonInvoiceStatusSection extends StatelessWidget {
@@ -21,7 +17,7 @@ class AnonInvoiceStatusSection extends StatelessWidget {
17 width: 200,
18 padding: EdgeInsets.all(19),
19 decoration: BoxDecoration(
24 - color: Theme.of(context).colorScheme.background,
20 + color: Theme.of(context).colorScheme.surface,
21 borderRadius: BorderRadius.circular(30),
22 ),
23 child: Column(
@@ -31,16 +27,15 @@ class AnonInvoiceStatusSection extends StatelessWidget {
27 children: [
28 Text(
29 S.current.status,
34 - style: TextStyle(
35 - fontSize: 14,
30 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
31 fontWeight: FontWeight.w500,
37 - color: Theme.of(context).extension<ExchangePageTheme>()!.receiveAmountColor,
32 + color: Theme.of(context).colorScheme.onSurfaceVariant,
33 ),
34 ),
35 Container(
36 padding: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
37 decoration: BoxDecoration(
43 - color: Theme.of(context).extension<AddressTheme>()!.actionButtonColor,
38 + color: Theme.of(context).colorScheme.secondaryContainer,
39 borderRadius: BorderRadius.circular(10),
40 ),
41 child: Row(
@@ -48,19 +43,20 @@ class AnonInvoiceStatusSection extends StatelessWidget {
43 children: [
44 SyncIndicatorIcon(
45 boolMode: false,
51 - value: invoiceInfo.status ?? '',
46 + value: invoiceInfo.status,
47 size: 6,
48 ),
49 SizedBox(width: 5),
50 Text(
56 - invoiceInfo.status ?? '',
57 - style: textSmallSemiBold(
58 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
51 + invoiceInfo.status,
52 + style: Theme.of(context).textTheme.bodySmall?.copyWith(
53 + fontWeight: FontWeight.w600,
54 + color: Theme.of(context).colorScheme.onSecondaryContainer,
55 ),
60 - )
56 + ),
57 ],
58 ),
63 - )
59 + ),
60 ],
61 ),
62 SizedBox(height: 27),
@@ -69,16 +65,16 @@ class AnonInvoiceStatusSection extends StatelessWidget {
65 children: [
66 Text(
67 'ID',
72 - style: TextStyle(
73 - fontSize: 14,
68 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
69 fontWeight: FontWeight.w500,
75 - color: Theme.of(context).extension<ExchangePageTheme>()!.receiveAmountColor,
70 + color: Theme.of(context).colorScheme.onSurfaceVariant,
71 ),
72 ),
73 Text(
79 - invoiceInfo.invoiceId ?? '',
80 - style: textSmallSemiBold(
81 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
74 + invoiceInfo.invoiceId,
75 + style: Theme.of(context).textTheme.bodySmall?.copyWith(
76 + fontWeight: FontWeight.w600,
77 + color: Theme.of(context).colorScheme.onSurface,
78 ),
79 ),
80 ],
lib/src/screens/receive/widgets/copy_link_item.dart
+4 -7
@@ -1,11 +1,8 @@
1 -
1 import 'package:cake_wallet/generated/i18n.dart';
3 -import 'package:cake_wallet/typography.dart';
2 import 'package:cake_wallet/utils/show_bar.dart';
3 import 'package:flutter/material.dart';
4 import 'package:flutter/services.dart';
5 import 'package:share_plus/share_plus.dart';
8 -import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
6
7 class CopyLinkItem extends StatelessWidget {
8 const CopyLinkItem({super.key, required this.url, required this.title});
@@ -15,15 +12,15 @@ class CopyLinkItem extends StatelessWidget {
12 @override
13 Widget build(BuildContext context) {
14 final copyImage = Image.asset('assets/images/copy_address.png',
18 - color: Theme.of(context).extension<DashboardPageTheme>()!.textColor);
15 + color: Theme.of(context).colorScheme.onSurface);
16
17 return Row(
18 mainAxisAlignment: MainAxisAlignment.center,
19 children: [
20 Text(
21 title,
25 - style: textMedium(
26 - color: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
22 + style: Theme.of(context).textTheme.bodyLarge?.copyWith(
23 + color: Theme.of(context).colorScheme.onSurface,
24 ),
25 ),
26 SizedBox(width: 50),
@@ -46,7 +43,7 @@ class CopyLinkItem extends StatelessWidget {
43 onPressed: () => Share.share(url),
44 icon: Icon(
45 Icons.share,
49 - color: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
46 + color: Theme.of(context).colorScheme.primary,
47 ),
48 )
49 ],
lib/src/screens/receive/widgets/currency_input_field.dart
+66 -61
@@ -1,8 +1,6 @@
1 import 'package:cake_wallet/generated/i18n.dart';
2 import 'package:cake_wallet/src/widgets/base_text_form_field.dart';
3 -import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart';
4 -import 'package:cake_wallet/themes/extensions/send_page_theme.dart';
5 -import 'package:cake_wallet/themes/theme_base.dart';
3 +import 'package:cake_wallet/themes/core/material_base_theme.dart';
4 import 'package:flutter/material.dart';
5 import 'package:flutter/services.dart';
6
@@ -15,7 +13,7 @@ class CurrencyAmountTextField extends StatelessWidget {
13 this.allAmountButton = false,
14 this.isPickerEnable = false,
15 this.isSelected = false,
18 - this.currentTheme = ThemeType.dark,
16 + this.currentThemeType = ThemeType.dark,
17 this.onTapPicker,
18 this.padding,
19 this.imageArrow,
@@ -30,6 +28,10 @@ class CurrencyAmountTextField extends StatelessWidget {
28 this.selectedCurrencyTextKey,
29 this.selectedCurrencyTagTextKey,
30 this.currencyAmountTextFieldWidgetKey,
31 + this.fillColor,
32 + this.borderColor,
33 + this.hasUnderlineBorder = false,
34 + this.borderWidth = 1.0,
35 }) : super(key: currencyAmountTextFieldWidgetKey);
36
37 final Key? sendAllButtonKey;
@@ -49,17 +51,19 @@ class CurrencyAmountTextField extends StatelessWidget {
51 final bool isAmountEditable;
52 final FormFieldValidator<String>? currencyValueValidator;
53 final bool isPickerEnable;
52 - final ThemeType currentTheme;
54 + final ThemeType currentThemeType;
55 final bool isSelected;
56 final bool allAmountButton;
57 final VoidCallback? allAmountCallback;
58 final VoidCallback? onTapPicker;
59 + final Color? fillColor;
60 + final Color? borderColor;
61 + final bool hasUnderlineBorder;
62 + final double borderWidth;
63
64 @override
65 Widget build(BuildContext context) {
60 - final textColor = currentTheme == ThemeType.light
61 - ? Theme.of(context).appBarTheme.titleTextStyle!.color!
62 - : Colors.white;
66 + final textColor = Theme.of(context).colorScheme.onSurface;
67 final _prefixContent = Row(
68 children: [
69 isPickerEnable
@@ -73,18 +77,22 @@ class CurrencyAmountTextField extends StatelessWidget {
77 mainAxisSize: MainAxisSize.min,
78 children: <Widget>[
79 Padding(
76 - padding: const EdgeInsets.only(right: 5),
77 - child: imageArrow ??
78 - Image.asset('assets/images/arrow_bottom_purple_icon.png',
79 - color: textColor, height: 8)),
80 + padding: const EdgeInsets.only(right: 5),
81 + child: imageArrow ??
82 + Image.asset(
83 + 'assets/images/arrow_bottom_purple_icon.png',
84 + color: textColor,
85 + height: 8,
86 + ),
87 + ),
88 Text(
89 key: selectedCurrencyTextKey,
90 selectedCurrency,
83 - style: TextStyle(
84 - fontWeight: FontWeight.w600,
85 - fontSize: 16,
86 - color: textColor,
87 - ),
91 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
92 + fontWeight: FontWeight.w600,
93 + fontSize: 16,
94 + color: textColor,
95 + ),
96 ),
97 ],
98 ),
@@ -93,11 +101,11 @@ class CurrencyAmountTextField extends StatelessWidget {
101 : Text(
102 key: selectedCurrencyTextKey,
103 selectedCurrency,
96 - style: TextStyle(
97 - fontWeight: FontWeight.w600,
98 - fontSize: 16,
99 - color: textColor,
100 - ),
104 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
105 + fontWeight: FontWeight.w600,
106 + fontSize: 16,
107 + color: textColor,
108 + ),
109 ),
110 if (tag != null)
111 Padding(
@@ -105,8 +113,7 @@ class CurrencyAmountTextField extends StatelessWidget {
113 child: Container(
114 height: 32,
115 decoration: BoxDecoration(
108 - color: tagBackgroundColor ??
109 - Theme.of(context).extension<SendPageTheme>()!.textFieldButtonColor,
116 + color: tagBackgroundColor ?? Theme.of(context).colorScheme.surfaceContainerHighest,
117 borderRadius: const BorderRadius.all(Radius.circular(6)),
118 ),
119 child: Center(
@@ -115,11 +122,10 @@ class CurrencyAmountTextField extends StatelessWidget {
122 child: Text(
123 key: selectedCurrencyTagTextKey,
124 tag!,
118 - style: TextStyle(
119 - fontSize: 12,
120 - fontWeight: FontWeight.bold,
121 - color: Theme.of(context).extension<SendPageTheme>()!.textFieldButtonIconColor,
122 - ),
125 + style: Theme.of(context).textTheme.bodySmall?.copyWith(
126 + fontWeight: FontWeight.bold,
127 + color: Theme.of(context).colorScheme.onSurfaceVariant,
128 + ),
129 ),
130 ),
131 ),
@@ -129,11 +135,11 @@ class CurrencyAmountTextField extends StatelessWidget {
135 padding: EdgeInsets.only(right: 4.0),
136 child: Text(
137 ':',
132 - style: TextStyle(
133 - fontWeight: FontWeight.w600,
134 - fontSize: 16,
135 - color: textColor,
136 - ),
138 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
139 + fontWeight: FontWeight.w600,
140 + fontSize: 16,
141 + color: textColor,
142 + ),
143 ),
144 ),
145 ],
@@ -146,13 +152,15 @@ class CurrencyAmountTextField extends StatelessWidget {
152 ? Container(
153 child: _prefixContent,
154 padding: EdgeInsets.symmetric(vertical: 4, horizontal: 8),
149 - margin: const EdgeInsets.only(right: 3),
155 + margin: const EdgeInsets.only(right: 8),
156 decoration: BoxDecoration(
151 - border: Border.all(
152 - color: textColor,
153 - ),
154 - borderRadius: BorderRadius.circular(26),
155 - color: Theme.of(context).primaryColor))
157 + border: Border.all(
158 + color: textColor,
159 + ),
160 + borderRadius: BorderRadius.circular(10),
161 + color: Theme.of(context).colorScheme.primary,
162 + ),
163 + )
164 : _prefixContent,
165 Expanded(
166 child: Row(
@@ -162,6 +170,8 @@ class CurrencyAmountTextField extends StatelessWidget {
170 child: FocusTraversalOrder(
171 order: NumericFocusOrder(1),
172 child: BaseTextFormField(
173 + hasUnderlineBorder: hasUnderlineBorder,
174 + borderWidth: borderWidth,
175 key: amountTextfieldKey,
176 focusNode: amountFocusNode,
177 controller: amountController,
@@ -175,19 +185,17 @@ class CurrencyAmountTextField extends StatelessWidget {
185 FilteringTextInputFormatter.deny(RegExp('[\\-|\\ ]')),
186 ],
187 hintText: hintText ?? '0.0000',
178 - borderColor: Colors.transparent,
179 - textStyle: TextStyle(
180 - fontSize: 16,
181 - fontWeight: FontWeight.w600,
182 - color: textColor,
183 - ),
184 - placeholderTextStyle: TextStyle(
185 - fontSize: 16,
186 - fontWeight: FontWeight.w600,
187 - color: currentTheme == ThemeType.light
188 - ? Theme.of(context).appBarTheme.titleTextStyle!.color!
189 - : Theme.of(context).extension<ExchangePageTheme>()!.hintTextColor,
190 - ),
188 + fillColor: fillColor,
189 + textStyle: Theme.of(context).textTheme.bodyMedium?.copyWith(
190 + fontSize: 16,
191 + fontWeight: FontWeight.w600,
192 + color: textColor,
193 + ),
194 + placeholderTextStyle: Theme.of(context).textTheme.bodyMedium?.copyWith(
195 + fontSize: 16,
196 + fontWeight: FontWeight.w600,
197 + color: Theme.of(context).colorScheme.onSurfaceVariant,
198 + ),
199 validator: isAmountEditable ? currencyValueValidator : null,
200 ),
201 ),
@@ -197,7 +205,7 @@ class CurrencyAmountTextField extends StatelessWidget {
205 height: 32,
206 width: 32,
207 decoration: BoxDecoration(
200 - color: Theme.of(context).extension<SendPageTheme>()!.textFieldButtonColor,
208 + color: Theme.of(context).colorScheme.surface,
209 borderRadius: const BorderRadius.all(Radius.circular(6)),
210 ),
211 child: InkWell(
@@ -207,13 +215,10 @@ class CurrencyAmountTextField extends StatelessWidget {
215 child: Text(
216 S.of(context).all,
217 textAlign: TextAlign.center,
210 - style: TextStyle(
211 - fontSize: 12,
212 - fontWeight: FontWeight.bold,
213 - color: Theme.of(context)
214 - .extension<SendPageTheme>()!
215 - .textFieldButtonIconColor,
216 - ),
218 + style: Theme.of(context).textTheme.bodySmall?.copyWith(
219 + fontWeight: FontWeight.bold,
220 + color: Theme.of(context).colorScheme.onSurfaceVariant,
221 + ),
222 ),
223 ),
224 ),
lib/src/screens/receive/widgets/header_tile.dart
+33 -45
@@ -1,5 +1,5 @@
1 import 'package:cake_wallet/generated/i18n.dart';
2 -import 'package:cake_wallet/themes/extensions/receive_page_theme.dart';
2 +import 'package:cake_wallet/src/widgets/base_text_form_field.dart';
3 import 'package:cake_wallet/view_model/wallet_address_list/wallet_address_list_view_model.dart';
4 import 'package:flutter/material.dart';
5
@@ -31,72 +31,60 @@ class _HeaderTileState extends State<HeaderTile> {
31
32 @override
33 Widget build(BuildContext context) {
34 - final searchIcon = Icon( Icons.search,
35 - color: Theme.of(context).extension<ReceivePageTheme>()!.iconsColor);
34 + final searchIcon = Icon(Icons.search, color: Theme.of(context).colorScheme.primary);
35
36 return Container(
37 padding: EdgeInsets.symmetric(horizontal: 24, vertical: 12),
39 - color: Theme.of(context).extension<ReceivePageTheme>()!.tilesBackgroundColor,
38 + color: Theme.of(context).colorScheme.surface,
39 child: Row(
40 mainAxisAlignment: MainAxisAlignment.spaceBetween,
41 children: <Widget>[
42 _isSearchActive
43 ? Expanded(
45 - child: TextField(
44 + child: BaseTextFormField(
45 onChanged: (value) {
46 widget.walletAddressListViewModel.updateSearchText(value);
47 widget.onSearchCallback?.call();
48 },
50 - cursorColor: Theme.of(context).extension<ReceivePageTheme>()!.tilesTextColor,
49 + cursorColor: Theme.of(context).colorScheme.onSurface,
50 cursorWidth: 0.5,
52 - decoration: InputDecoration(
53 - hintText: '${S.of(context).search}...',
54 - isDense: true,
55 - contentPadding: EdgeInsets.zero,
56 - hintStyle: TextStyle(
51 + isDense: true,
52 + hintText: '${S.of(context).search}...',
53 + contentPadding: EdgeInsets.all(4),
54 + placeholderTextStyle: Theme.of(context).textTheme.bodyMedium!.copyWith(
55 fontSize: 16,
56 fontWeight: FontWeight.w600,
59 - color: Theme.of(context).extension<ReceivePageTheme>()!.tilesTextColor),
60 - border: UnderlineInputBorder(
61 - borderSide: BorderSide(color: Theme.of(context).dividerColor),
62 - ),
63 - focusedBorder: UnderlineInputBorder(
64 - borderSide: BorderSide(color: Theme.of(context).dividerColor),
65 - ),
66 - enabledBorder: UnderlineInputBorder(
67 - borderSide: BorderSide(color: Theme.of(context).dividerColor),
68 - ),
69 - ),
57 + ),
58 autofocus: true,
59 ),
60 )
61 : Text(
62 widget.title,
75 - style: TextStyle(
76 - fontSize: 16,
77 - fontWeight: FontWeight.w600,
78 - color: Theme.of(context).extension<ReceivePageTheme>()!.tilesTextColor),
63 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
64 + fontSize: 16,
65 + fontWeight: FontWeight.w600,
66 + ),
67 ),
68 Row(
69 children: [
70 if (widget.showSearchButton)
71 GestureDetector(
84 - onTap: () {
85 - setState(() {
86 - _isSearchActive = !_isSearchActive;
87 - widget.walletAddressListViewModel.updateSearchText('');
88 - });
89 - },
90 - child: Container(
91 - height: 32,
92 - width: 32,
93 - decoration: BoxDecoration(
94 - shape: BoxShape.circle,
95 - color: Theme.of(context)
96 - .extension<ReceivePageTheme>()!
97 - .iconsBackgroundColor),
98 - child: searchIcon,
99 - )),
72 + onTap: () {
73 + setState(() {
74 + _isSearchActive = !_isSearchActive;
75 + widget.walletAddressListViewModel.updateSearchText('');
76 + });
77 + },
78 + child: Container(
79 + height: 32,
80 + width: 32,
81 + decoration: BoxDecoration(
82 + shape: BoxShape.circle,
83 + color: Theme.of(context).colorScheme.secondaryContainer,
84 + ),
85 + child: searchIcon,
86 + ),
87 + ),
88 const SizedBox(width: 8),
89 if (widget.showTrailingButton)
90 GestureDetector(
@@ -105,9 +93,9 @@ class _HeaderTileState extends State<HeaderTile> {
93 height: 32,
94 width: 32,
95 decoration: BoxDecoration(
108 - shape: BoxShape.circle,
109 - color:
110 - Theme.of(context).extension<ReceivePageTheme>()!.iconsBackgroundColor),
96 + shape: BoxShape.circle,
97 + color: Theme.of(context).colorScheme.secondaryContainer,
98 + ),
99 child: widget.trailingIcon,
100 ),
101 ),
lib/src/screens/receive/widgets/qr_widget.dart
+61 -83
@@ -1,16 +1,12 @@
1 import 'package:cake_wallet/entities/qr_view_data.dart';
2 -import 'package:cake_wallet/generated/i18n.dart';
2 +import 'package:cake_wallet/src/widgets/primary_button.dart';
3 import 'package:cake_wallet/routes.dart';
4 import 'package:cake_wallet/src/screens/exchange/widgets/currency_picker.dart';
5 import 'package:cake_wallet/src/screens/receive/widgets/currency_input_field.dart';
6 +import 'package:cake_wallet/themes/core/material_base_theme.dart';
7 +import 'package:cake_wallet/generated/i18n.dart';
8 import 'package:cake_wallet/src/screens/receive/widgets/qr_image.dart';
9 import 'package:cake_wallet/src/widgets/bottom_sheet/info_bottom_sheet_widget.dart';
8 -import 'package:cake_wallet/src/widgets/primary_button.dart';
9 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
10 -import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
11 -import 'package:cake_wallet/themes/extensions/picker_theme.dart';
12 -import 'package:cake_wallet/themes/extensions/qr_code_theme.dart';
13 -import 'package:cake_wallet/themes/theme_base.dart';
10 import 'package:cake_wallet/utils/address_formatter.dart';
11 import 'package:cake_wallet/utils/brightness_util.dart';
12 import 'package:cake_wallet/utils/responsive_layout_util.dart';
@@ -38,7 +34,7 @@ class QRWidget extends StatelessWidget {
34 final TextEditingController amountController;
35 final FocusNode? amountTextFieldFocusNode;
36 final GlobalKey<FormState> formKey;
41 - final ThemeBase currentTheme;
37 + final MaterialThemeBase currentTheme;
38 final int? qrVersion;
39 final String? heroTag;
40
@@ -48,15 +44,14 @@ class QRWidget extends StatelessWidget {
44
45 @override
46 Widget build(BuildContext context) {
51 - final copyImage = Image.asset('assets/images/copy_address.png',
52 - color: Theme.of(context)
53 - .extension<QRCodeTheme>()!
54 - .qrWidgetCopyButtonColor);
47 + final copyImage = Image.asset(
48 + 'assets/images/copy_address.png',
49 + color: Theme.of(context).colorScheme.onSurfaceVariant,
50 + );
51
52 // This magic number for wider screen sets the text input focus at center of the inputfield
57 - final _width = responsiveLayoutUtil.shouldRenderMobileUI
58 - ? MediaQuery.of(context).size.width
59 - : 500;
53 + final _width =
54 + responsiveLayoutUtil.shouldRenderMobileUI ? MediaQuery.of(context).size.width : 500;
55
56 return Center(
57 child: SingleChildScrollView(
@@ -71,12 +66,9 @@ class QRWidget extends StatelessWidget {
66 padding: const EdgeInsets.only(bottom: 12),
67 child: Text(
68 S.of(context).qr_fullscreen,
74 - style: TextStyle(
75 - fontSize: 14,
76 - fontWeight: FontWeight.w500,
77 - color: Theme.of(context)
78 - .extension<DashboardPageTheme>()!
79 - .textColor),
69 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
70 + fontWeight: FontWeight.w500,
71 + ),
72 ),
73 ),
74 Row(
@@ -90,11 +82,13 @@ class QRWidget extends StatelessWidget {
82 BrightnessUtil.changeBrightnessForFunction(
83 () async {
84 await Navigator.pushNamed(
93 - context, Routes.fullscreenQR,
94 - arguments: QrViewData(
95 - data: addressUri.toString(),
96 - heroTag: heroTag,
97 - ));
85 + context,
86 + Routes.fullscreenQR,
87 + arguments: QrViewData(
88 + data: addressUri.toString(),
89 + heroTag: heroTag,
90 + ),
91 + );
92 },
93 );
94 },
@@ -105,9 +99,8 @@ class QRWidget extends StatelessWidget {
99 padding: EdgeInsets.zero,
100 decoration: BoxDecoration(
101 border: Border(top: BorderSide.none),
108 - borderRadius:
109 - BorderRadius.all(Radius.circular(5)),
110 - color: Colors.white,
102 + borderRadius: BorderRadius.all(Radius.circular(5)),
103 + color: Theme.of(context).colorScheme.surface,
104 ),
105 child: Column(
106 children: [
@@ -120,16 +113,12 @@ class QRWidget extends StatelessWidget {
113 ),
114 ),
115 ),
123 - if (addressListViewModel
124 - .isPayjoinUnavailable &&
125 - !addressListViewModel
126 - .isSilentPayments) ...[
116 + if (addressListViewModel.isPayjoinUnavailable &&
117 + !addressListViewModel.isSilentPayments) ...[
118 GestureDetector(
128 - onTap: () =>
129 - _onPayjoinInactivePressed(context),
119 + onTap: () => _onPayjoinInactivePressed(context),
120 child: Row(
131 - mainAxisAlignment:
132 - MainAxisAlignment.center,
121 + mainAxisAlignment: MainAxisAlignment.center,
122 children: [
123 Padding(
124 padding: EdgeInsets.only(
@@ -144,12 +133,13 @@ class QRWidget extends StatelessWidget {
133 ),
134 Text(
135 S.of(context).payjoin_unavailable,
147 - style: TextStyle(
148 - fontSize: 12,
149 - fontWeight: FontWeight.w600,
150 - color: Color.fromARGB(
151 - 255, 139, 137, 139),
152 - ),
136 + style:
137 + Theme.of(context).textTheme.bodySmall?.copyWith(
138 + fontWeight: FontWeight.w600,
139 + color: Theme.of(context)
140 + .colorScheme
141 + .onSurfaceVariant,
142 + ),
143 ),
144 Padding(
145 padding: EdgeInsets.only(
@@ -171,13 +161,10 @@ class QRWidget extends StatelessWidget {
161 ),
162 ),
163 ],
174 - if (addressListViewModel
175 - .payjoinEndpoint.isNotEmpty &&
176 - !addressListViewModel
177 - .isSilentPayments) ...[
164 + if (addressListViewModel.payjoinEndpoint.isNotEmpty &&
165 + !addressListViewModel.isSilentPayments) ...[
166 Row(
179 - mainAxisAlignment:
180 - MainAxisAlignment.center,
167 + mainAxisAlignment: MainAxisAlignment.center,
168 children: [
169 Padding(
170 padding: EdgeInsets.only(
@@ -192,11 +179,9 @@ class QRWidget extends StatelessWidget {
179 ),
180 Text(
181 S.of(context).payjoin_enabled,
195 - style: TextStyle(
196 - fontSize: 12,
197 - fontWeight: FontWeight.w600,
198 - color: Colors.black,
199 - ),
182 + style: Theme.of(context).textTheme.bodySmall?.copyWith(
183 + fontWeight: FontWeight.w600,
184 + ),
185 ),
186 ],
187 ),
@@ -223,12 +208,13 @@ class QRWidget extends StatelessWidget {
208 child: Form(
209 key: formKey,
210 child: CurrencyAmountTextField(
211 + hasUnderlineBorder: true,
212 + borderWidth: 0.0,
213 selectedCurrency: _currencyName,
214 amountFocusNode: amountTextFieldFocusNode,
215 amountController: amountController,
229 - padding:
230 - EdgeInsets.only(top: 20, left: _width / 4),
231 - currentTheme: currentTheme.type,
216 + padding: EdgeInsets.only(top: 20, left: _width / 4),
217 + currentThemeType: currentTheme.type,
218 isAmountEditable: true,
219 tag: addressListViewModel.selectedCurrency.tag,
220 onTapPicker: () => _presentPicker(context),
@@ -239,18 +225,14 @@ class QRWidget extends StatelessWidget {
225 ],
226 ),
227 )),
242 - Divider(
243 - height: 1,
244 - color:
245 - Theme.of(context).extension<PickerTheme>()!.dividerColor),
228 + Divider(height: 1, color: Theme.of(context).colorScheme.outlineVariant),
229 Padding(
247 - padding: EdgeInsets.only(top: 20, bottom: 8),
230 + padding: EdgeInsets.only(top: 12, bottom: 8),
231 child: Builder(
232 builder: (context) => Observer(
233 builder: (context) => GestureDetector(
234 onTap: () {
252 - Clipboard.setData(
253 - ClipboardData(text: addressUri.address));
235 + Clipboard.setData(ClipboardData(text: addressUri.address));
236 showBar<void>(context, S.of(context).copied_to_clipboard);
237 },
238 child: Row(
@@ -258,16 +240,17 @@ class QRWidget extends StatelessWidget {
240 crossAxisAlignment: CrossAxisAlignment.start,
241 children: <Widget>[
242 Expanded(
261 - child: AddressFormatter.buildSegmentedAddress(
262 - address: addressUri.address,
263 - walletType: addressListViewModel.type,
264 - textAlign: TextAlign.center,
265 - evenTextStyle: TextStyle(
266 - fontSize: 15,
267 - fontWeight: FontWeight.w500,
268 - color: Theme.of(context)
269 - .extension<DashboardPageTheme>()!
270 - .textColor))),
243 + child: AddressFormatter.buildSegmentedAddress(
244 + address: addressUri.address,
245 + walletType: addressListViewModel.type,
246 + textAlign: TextAlign.center,
247 + evenTextStyle: Theme.of(context).textTheme.bodyMedium!.copyWith(
248 + fontSize: 15,
249 + fontWeight: FontWeight.w500,
250 + color: Theme.of(context).colorScheme.onSurface,
251 + ),
252 + ),
253 + ),
254 Padding(
255 padding: EdgeInsets.only(left: 12),
256 child: copyImage,
@@ -286,8 +269,7 @@ class QRWidget extends StatelessWidget {
269 padding: EdgeInsets.only(top: 12),
270 child: PrimaryImageButton(
271 onPressed: () {
289 - Clipboard.setData(
290 - ClipboardData(text: addressUri.toString()));
272 + Clipboard.setData(ClipboardData(text: addressUri.toString()));
273 showBar<void>(context, S.of(context).copied_to_clipboard);
274 },
275 image: Image.asset(
@@ -295,10 +277,8 @@ class QRWidget extends StatelessWidget {
277 width: 25,
278 ),
279 text: S.of(context).copy_payjoin_address,
298 - color: Theme.of(context).cardColor,
299 - textColor: Theme.of(context)
300 - .extension<CakeTextTheme>()!
301 - .buttonTextColor,
280 + color: Theme.of(context).colorScheme.surfaceContainer,
281 + textColor: Theme.of(context).colorScheme.onSurface,
282 ),
283 ),
284 ),
@@ -311,9 +291,7 @@ class QRWidget extends StatelessWidget {
291
292 String get _currencyName {
293 if (addressListViewModel.selectedCurrency is CryptoCurrency) {
314 - return (addressListViewModel.selectedCurrency as CryptoCurrency)
315 - .title
316 - .toUpperCase();
294 + return (addressListViewModel.selectedCurrency as CryptoCurrency).title.toUpperCase();
295 }
296 return addressListViewModel.selectedCurrency.name.toUpperCase();
297 }
lib/src/screens/release_notes/release_notes_screen.dart
+8 -9
@@ -1,7 +1,6 @@
1 import 'dart:convert';
2 import 'package:cake_wallet/src/widgets/alert_background.dart';
3 import 'package:cake_wallet/src/widgets/alert_close_button.dart';
4 -import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
4 import 'package:cake_wallet/wallet_type_utils.dart';
5 import 'package:flutter/material.dart';
6 import 'package:flutter/services.dart';
@@ -34,8 +33,8 @@ class ReleaseNotesScreen extends StatelessWidget {
33 decoration: BoxDecoration(
34 borderRadius: BorderRadius.circular(30.0),
35 gradient: LinearGradient(colors: [
37 - Theme.of(context).extension<DashboardPageTheme>()!.firstGradientBackgroundColor,
38 - Theme.of(context).extension<DashboardPageTheme>()!.secondGradientBackgroundColor,
36 + Theme.of(context).colorScheme.primaryContainer,
37 + Theme.of(context).colorScheme.secondaryContainer,
38 ], begin: Alignment.centerLeft, end: Alignment.centerRight)),
39 child: Padding(
40 padding: const EdgeInsets.symmetric(horizontal: 24.0),
@@ -47,12 +46,12 @@ class ReleaseNotesScreen extends StatelessWidget {
46 child: Container(
47 alignment: Alignment.bottomCenter,
48 child: DefaultTextStyle(
50 - style: TextStyle(
49 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
50 decoration: TextDecoration.none,
51 fontSize: 24.0,
52 fontWeight: FontWeight.bold,
54 - fontFamily: 'Lato',
55 - color: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
53 +
54 + color: Theme.of(context).colorScheme.onSurface,
55 ),
56 child: Text(title),
57 ),
@@ -115,11 +114,11 @@ class ReleaseNotesScreen extends StatelessWidget {
114 return Column(
115 children: [
116 DefaultTextStyle(
118 - style: TextStyle(
117 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
118 decoration: TextDecoration.none,
119 fontSize: 16.0,
121 - fontFamily: 'Lato',
122 - color: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
120 +
121 + color: Theme.of(context).colorScheme.onSurface,
122 ),
123 child: Row(
124 crossAxisAlignment: CrossAxisAlignment.start,
lib/src/screens/rescan/rescan_page.dart
+68 -70
@@ -16,9 +16,8 @@ class RescanPage extends BasePage {
16 : _blockchainHeightWidgetKey = GlobalKey<BlockchainHeightState>();
17
18 @override
19 - String get title => _rescanViewModel.isSilentPaymentsScan
20 - ? S.current.silent_payments_scanning
21 - : S.current.rescan;
19 + String get title =>
20 + _rescanViewModel.isSilentPaymentsScan ? S.current.silent_payments_scanning : S.current.rescan;
21 final GlobalKey<BlockchainHeightState> _blockchainHeightWidgetKey;
22 final RescanViewModel _rescanViewModel;
23
@@ -28,69 +27,69 @@ class RescanPage extends BasePage {
27 if (_rescanViewModel.wallet.type != WalletType.decred) {
28 child = Padding(
29 padding: EdgeInsets.only(left: 24, right: 24, bottom: 24),
31 - child:
32 - Column(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
33 - Observer(
30 + child: Column(
31 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
32 + children: [
33 + Observer(
34 builder: (_) => BlockchainHeightWidget(
35 - key: _blockchainHeightWidgetKey,
36 - onHeightOrDateEntered: (value) =>
37 - _rescanViewModel.isButtonEnabled = value,
38 - isSilentPaymentsScan: _rescanViewModel.isSilentPaymentsScan,
39 - isMwebScan: _rescanViewModel.isMwebScan,
40 - doSingleScan: _rescanViewModel.doSingleScan,
41 - hasDatePicker: !_rescanViewModel
42 - .isMwebScan, // disable date picker for mweb for now
43 - toggleSingleScan: () => _rescanViewModel.doSingleScan =
44 - !_rescanViewModel.doSingleScan,
45 - walletType: _rescanViewModel.wallet.type,
46 - bitcoinMempoolAPIEnabled:
47 - _rescanViewModel.isBitcoinMempoolAPIEnabled,
48 - )),
49 - Observer(
35 + key: _blockchainHeightWidgetKey,
36 + onHeightOrDateEntered: (value) => _rescanViewModel.isButtonEnabled = value,
37 + isSilentPaymentsScan: _rescanViewModel.isSilentPaymentsScan,
38 + isMwebScan: _rescanViewModel.isMwebScan,
39 + doSingleScan: _rescanViewModel.doSingleScan,
40 + hasDatePicker: !_rescanViewModel.isMwebScan, // disable date picker for mweb for now
41 + toggleSingleScan: () =>
42 + _rescanViewModel.doSingleScan = !_rescanViewModel.doSingleScan,
43 + walletType: _rescanViewModel.wallet.type,
44 + bitcoinMempoolAPIEnabled: _rescanViewModel.isBitcoinMempoolAPIEnabled,
45 + ),
46 + ),
47 + Observer(
48 builder: (_) => LoadingPrimaryButton(
51 - isLoading:
52 - _rescanViewModel.state == RescanWalletState.rescaning,
53 - text: S.of(context).rescan,
54 - onPressed: () async {
55 - if (_rescanViewModel.isSilentPaymentsScan) {
56 - return _toggleSilentPaymentsScanning(context);
57 - }
49 + isLoading: _rescanViewModel.state == RescanWalletState.rescaning,
50 + text: S.of(context).rescan,
51 + onPressed: () async {
52 + if (_rescanViewModel.isSilentPaymentsScan) {
53 + return _toggleSilentPaymentsScanning(context);
54 + }
55
59 - _rescanViewModel.rescanCurrentWallet(
60 - restoreHeight:
61 - _blockchainHeightWidgetKey.currentState!.height);
56 + _rescanViewModel.rescanCurrentWallet(
57 + restoreHeight: _blockchainHeightWidgetKey.currentState!.height);
58
63 - Navigator.of(context).pop();
64 - },
65 - color: Theme.of(context).primaryColor,
66 - textColor: Colors.white,
67 - isDisabled: !_rescanViewModel.isButtonEnabled,
68 - ))
69 - ]),
59 + Navigator.of(context).pop();
60 + },
61 + color: Theme.of(context).colorScheme.primary,
62 + textColor: Theme.of(context).colorScheme.onPrimary,
63 + isDisabled: !_rescanViewModel.isButtonEnabled,
64 + ),
65 + )
66 + ],
67 + ),
68 );
69 } else {
70 child = Center(
73 - child: Padding(
74 - padding: EdgeInsets.only(left: 24, right: 24, bottom: 24),
75 - child: Column(
71 + child: Padding(
72 + padding: EdgeInsets.only(left: 24, right: 24, bottom: 24),
73 + child: Column(
74 mainAxisAlignment: MainAxisAlignment.spaceBetween,
75 children: [
76 Spacer(),
77 Observer(
80 - builder: (_) => LoadingPrimaryButton(
81 - isLoading: _rescanViewModel.state ==
82 - RescanWalletState.rescaning,
83 - text: S.of(context).rescan,
84 - onPressed: () async {
85 - await _rescanViewModel.rescanCurrentWallet(
86 - restoreHeight: 0);
87 - Navigator.of(context).pop();
88 - },
89 - color: Theme.of(context).primaryColor,
90 - textColor: Colors.white,
91 - ))
92 - ]),
93 - ));
78 + builder: (_) => LoadingPrimaryButton(
79 + isLoading: _rescanViewModel.state == RescanWalletState.rescaning,
80 + text: S.of(context).rescan,
81 + onPressed: () async {
82 + await _rescanViewModel.rescanCurrentWallet(restoreHeight: 0);
83 + Navigator.of(context).pop();
84 + },
85 + color: Theme.of(context).colorScheme.primary,
86 + textColor: Theme.of(context).colorScheme.onPrimary,
87 + ),
88 + )
89 + ],
90 + ),
91 + ),
92 + );
93 }
94 return GestureDetector(
95 behavior: HitTestBehavior.opaque,
@@ -105,25 +104,24 @@ class RescanPage extends BasePage {
104 Navigator.of(context).pop();
105
106 final needsToSwitch =
108 - await bitcoin!.getNodeIsElectrsSPEnabled(_rescanViewModel.wallet) ==
109 - false;
107 + await bitcoin!.getNodeIsElectrsSPEnabled(_rescanViewModel.wallet) == false;
108
109 if (needsToSwitch) {
110 return showPopUp<void>(
113 - context: navigatorKey.currentState!.context,
114 - builder: (BuildContext _dialogContext) => AlertWithTwoActions(
115 - alertTitle: S.of(_dialogContext).change_current_node_title,
116 - alertContent:
117 - S.of(_dialogContext).confirm_silent_payments_switch_node,
118 - rightButtonText: S.of(_dialogContext).confirm,
119 - leftButtonText: S.of(_dialogContext).cancel,
120 - actionRightButton: () async {
121 - Navigator.of(_dialogContext).pop();
111 + context: navigatorKey.currentState!.context,
112 + builder: (BuildContext _dialogContext) => AlertWithTwoActions(
113 + alertTitle: S.of(_dialogContext).change_current_node_title,
114 + alertContent: S.of(_dialogContext).confirm_silent_payments_switch_node,
115 + rightButtonText: S.of(_dialogContext).confirm,
116 + leftButtonText: S.of(_dialogContext).cancel,
117 + actionRightButton: () async {
118 + Navigator.of(_dialogContext).pop();
119
123 - _rescanViewModel.rescanCurrentWallet(restoreHeight: height);
124 - },
125 - actionLeftButton: () => Navigator.of(_dialogContext).pop(),
126 - ));
120 + _rescanViewModel.rescanCurrentWallet(restoreHeight: height);
121 + },
122 + actionLeftButton: () => Navigator.of(_dialogContext).pop(),
123 + ),
124 + );
125 }
126
127 _rescanViewModel.rescanCurrentWallet(restoreHeight: height);
lib/src/screens/restore/restore_from_backup_page.dart
+31 -29
@@ -1,6 +1,7 @@
1 import 'package:cake_wallet/core/execution_state.dart';
2 import 'package:cake_wallet/generated/i18n.dart';
3 import 'package:cake_wallet/src/widgets/alert_with_one_action.dart';
4 +import 'package:cake_wallet/src/widgets/base_text_form_field.dart';
5 import 'package:cake_wallet/utils/responsive_layout_util.dart';
6 import 'package:cake_wallet/utils/show_pop_up.dart';
7 import 'package:flutter/material.dart';
@@ -23,11 +24,11 @@ class RestoreFromBackupPage extends BasePage {
24
25 @override
26 Function(BuildContext)? get pushToNextWidget => (context) {
26 - FocusScopeNode currentFocus = FocusScope.of(context);
27 - if (!currentFocus.hasPrimaryFocus) {
28 - currentFocus.focusedChild?.unfocus();
29 - }
30 - };
27 + FocusScopeNode currentFocus = FocusScope.of(context);
28 + if (!currentFocus.hasPrimaryFocus) {
29 + currentFocus.focusedChild?.unfocus();
30 + }
31 + };
32
33 @override
34 Widget body(BuildContext context) {
@@ -52,7 +53,7 @@ class RestoreFromBackupPage extends BasePage {
53 child: ConstrainedBox(
54 constraints: BoxConstraints(maxWidth: ResponsiveLayoutUtilBase.kDesktopMaxWidthConstraint),
55 child: Padding(
55 - padding: EdgeInsets.only(bottom: 24, left: 24, right: 24),
56 + padding: EdgeInsets.only(bottom: 24, left: 8, right: 8),
57 child: Column(
58 children: [
59 Expanded(
@@ -61,15 +62,17 @@ class RestoreFromBackupPage extends BasePage {
62 child: Column(
63 mainAxisSize: MainAxisSize.min,
64 children: [
64 - TextFormField(
65 + BaseTextFormField(
66 obscureText: true,
67 enableSuggestions: false,
68 autocorrect: false,
68 - decoration:
69 - InputDecoration(hintText: S.of(context).enter_backup_password),
69 + hintText: S.of(context).enter_backup_password,
70 keyboardType: TextInputType.visiblePassword,
71 controller: textEditingController,
72 - style: TextStyle(fontSize: 26, color: Colors.black),
72 + textStyle: Theme.of(context).textTheme.bodyLarge?.copyWith(
73 + fontSize: 26,
74 + color: Theme.of(context).colorScheme.onSurface,
75 + ),
76 ),
77 Observer(
78 builder: (_) {
@@ -81,22 +84,20 @@ class RestoreFromBackupPage extends BasePage {
84 children: [
85 Text(
86 "File Name: ",
84 - style: TextStyle(
85 - fontSize: 18.0,
86 - fontWeight: FontWeight.bold,
87 - fontFamily: 'Lato',
88 - color: titleColor(context),
89 - ),
87 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
88 + fontSize: 18.0,
89 + fontWeight: FontWeight.bold,
90 + color: titleColor(context),
91 + ),
92 ),
93 Expanded(
94 child: Text(
95 restoreFromBackupViewModel.filePath.split("/").last,
94 - style: TextStyle(
95 - fontSize: 18.0,
96 - fontWeight: FontWeight.bold,
97 - fontFamily: 'Lato',
98 - color: titleColor(context),
99 - ),
96 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
97 + fontSize: 18.0,
98 + fontWeight: FontWeight.bold,
99 + color: titleColor(context),
100 + ),
101 ),
102 ),
103 ],
@@ -120,8 +121,8 @@ class RestoreFromBackupPage extends BasePage {
121 child: PrimaryButton(
122 onPressed: () => presentFilePicker(),
123 text: S.of(context).select_backup_file,
123 - color: Colors.grey,
124 - textColor: Colors.white,
124 + color: Theme.of(context).colorScheme.error,
125 + textColor: Theme.of(context).colorScheme.onError,
126 ),
127 ),
128 SizedBox(width: 20),
@@ -129,11 +130,12 @@ class RestoreFromBackupPage extends BasePage {
130 child: Observer(
131 builder: (_) {
132 return LoadingPrimaryButton(
132 - isLoading: restoreFromBackupViewModel.state is IsExecutingState,
133 - onPressed: () => onImportHandler(context),
134 - text: S.of(context).import,
135 - color: Theme.of(context).primaryColor,
136 - textColor: Colors.white);
133 + isLoading: restoreFromBackupViewModel.state is IsExecutingState,
134 + onPressed: () => onImportHandler(context),
135 + text: S.of(context).import,
136 + color: Theme.of(context).colorScheme.primary,
137 + textColor: Theme.of(context).colorScheme.onPrimary,
138 + );
139 },
140 ),
141 ),
lib/src/screens/restore/restore_options_page.dart
+2 -6
@@ -15,9 +15,7 @@ import 'package:cw_core/hardware/device_connection_type.dart';
15 import 'package:cw_core/wallet_type.dart';
16 import 'package:flutter/material.dart';
17 import 'package:permission_handler/permission_handler.dart';
18 -import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
19 -import 'package:cake_wallet/themes/extensions/info_theme.dart';
20 -import 'package:cake_wallet/themes/theme_base.dart';
18 +import 'package:cake_wallet/themes/core/material_base_theme.dart';
19
20 class RestoreOptionsPage extends BasePage {
21 RestoreOptionsPage({required this.isNewInstall});
@@ -61,9 +59,7 @@ class _RestoreOptionsBodyState extends State<_RestoreOptionsBody> {
59
60 @override
61 Widget build(BuildContext context) {
64 - final mainImageColor = Theme.of(context).extension<DashboardPageTheme>()!.pageTitleTextColor;
65 - final brightImageColor = Theme.of(context).extension<InfoTheme>()!.textColor;
66 - final imageColor = widget.themeType == ThemeType.bright ? brightImageColor : mainImageColor;
62 + final imageColor = Theme.of(context).colorScheme.primary;
63 final imageLedger = Image.asset('assets/images/hardware_wallet/ledger_nano_x.png',
64 width: 40, color: imageColor);
65 final imageSeedKeys = Image.asset('assets/images/restore_wallet_image.png', color: imageColor);
lib/src/screens/restore/sweeping_wallet_page.dart
+18 -27
@@ -1,10 +1,7 @@
1 -import 'package:cake_wallet/themes/theme_base.dart';
2 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
1 import 'package:flutter/material.dart';
2 import 'package:cake_wallet/src/screens/base_page.dart';
3 import 'package:cake_wallet/generated/i18n.dart';
4 import 'package:flutter/scheduler.dart';
7 -import 'package:cake_wallet/themes/extensions/new_wallet_theme.dart';
5
6 class SweepingWalletPage extends BasePage {
7 SweepingWalletPage();
@@ -13,19 +10,17 @@ class SweepingWalletPage extends BasePage {
10 final welcomeImageLight = Image.asset('assets/images/welcome_light.png');
11 final welcomeImageDark = Image.asset('assets/images/welcome.png');
12
16 -
17 -
13 @override
14 Widget build(BuildContext context) {
15 return Scaffold(
21 - backgroundColor: Theme.of(context).colorScheme.background,
16 + backgroundColor: Theme.of(context).colorScheme.surface,
17 resizeToAvoidBottomInset: false,
18 body: body(context));
19 }
20
21 @override
22 Widget body(BuildContext context) {
28 - final welcomeImage = currentTheme.type == ThemeType.dark ? welcomeImageDark : welcomeImageLight;
23 + final welcomeImage = currentTheme.isDark ? welcomeImageDark : welcomeImageLight;
24
25 return SweepingWalletWidget(
26 aspectRatioImage: aspectRatioImage,
@@ -50,9 +45,7 @@ class SweepingWalletWidget extends StatefulWidget {
45 class _SweepingWalletWidgetState extends State<SweepingWalletWidget> {
46 @override
47 void initState() {
53 - SchedulerBinding.instance.addPostFrameCallback((_) async {
54 -
55 - });
48 + SchedulerBinding.instance.addPostFrameCallback((_) async {});
49 super.initState();
50 }
51
@@ -81,11 +74,11 @@ class _SweepingWalletWidgetState extends State<SweepingWalletWidget> {
74 padding: EdgeInsets.only(top: 24),
75 child: Text(
76 S.of(context).please_wait,
84 - style: TextStyle(
85 - fontSize: 18,
86 - fontWeight: FontWeight.w500,
87 - color: Theme.of(context).extension<NewWalletTheme>()!.hintTextColor,
88 - ),
77 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
78 + fontSize: 18,
79 + fontWeight: FontWeight.w500,
80 + color: Theme.of(context).colorScheme.onSurfaceVariant,
81 + ),
82 textAlign: TextAlign.center,
83 ),
84 ),
@@ -93,11 +86,11 @@ class _SweepingWalletWidgetState extends State<SweepingWalletWidget> {
86 padding: EdgeInsets.only(top: 5),
87 child: Text(
88 S.of(context).sweeping_wallet,
96 - style: TextStyle(
97 - fontSize: 36,
98 - fontWeight: FontWeight.bold,
99 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
100 - ),
89 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
90 + fontSize: 36,
91 + fontWeight: FontWeight.bold,
92 + color: Theme.of(context).colorScheme.primary,
93 + ),
94 textAlign: TextAlign.center,
95 ),
96 ),
@@ -105,11 +98,11 @@ class _SweepingWalletWidgetState extends State<SweepingWalletWidget> {
98 padding: EdgeInsets.only(top: 5),
99 child: Text(
100 S.of(context).sweeping_wallet_alert,
108 - style: TextStyle(
109 - fontSize: 16,
110 - fontWeight: FontWeight.w500,
111 - color: Theme.of(context).extension<NewWalletTheme>()!.hintTextColor,
112 - ),
101 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
102 + fontSize: 16,
103 + fontWeight: FontWeight.w500,
104 + color: Theme.of(context).colorScheme.onSurfaceVariant,
105 + ),
106 textAlign: TextAlign.center,
107 ),
108 ),
@@ -121,5 +114,3 @@ class _SweepingWalletWidgetState extends State<SweepingWalletWidget> {
114 )));
115 }
116 }
124 -
125 -
lib/src/screens/restore/wallet_restore_choose_derivation.dart
+12 -24
@@ -1,5 +1,4 @@
1 import 'package:cake_wallet/generated/i18n.dart';
2 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
2 import 'package:cake_wallet/view_model/wallet_restore_choose_derivation_view_model.dart';
3 import 'package:cw_core/wallet_info.dart';
4 import 'package:flutter/material.dart';
@@ -12,11 +11,9 @@ class WalletRestoreChooseDerivationPage extends BasePage {
11 @override
12 Widget middle(BuildContext context) => Text(
13 S.current.choose_derivation,
15 - style: TextStyle(
16 - fontSize: 18.0,
14 + style: Theme.of(context).textTheme.titleLarge?.copyWith(
15 fontWeight: FontWeight.bold,
18 - fontFamily: 'Lato',
19 - color: titleColor(context)),
16 + color: Theme.of(context).colorScheme.primary),
17 );
18
19 final WalletRestoreChooseDerivationViewModel walletRestoreChooseDerivationViewModel;
@@ -59,10 +56,10 @@ class WalletRestoreChooseDerivationPage extends BasePage {
56 title: Center(
57 child: Text(
58 "${derivation.description ?? derivation.derivationType.toString().split('.').last}",
62 - style: Theme.of(context).primaryTextTheme.labelMedium!.copyWith(
59 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
60 fontSize: 18,
61 fontWeight: FontWeight.w800,
65 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
62 + color: Theme.of(context).colorScheme.primary,
63 ),
64 ),
65 ),
@@ -72,42 +69,33 @@ class WalletRestoreChooseDerivationPage extends BasePage {
69 if (derivation.derivationPath != null)
70 Text(
71 derivation.derivationPath!,
75 - style: Theme.of(context).primaryTextTheme.labelMedium!.copyWith(
76 - fontSize: 14,
72 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
73 fontWeight: FontWeight.w500,
78 - color: Theme.of(context)
79 - .extension<CakeTextTheme>()!
80 - .secondaryTextColor,
74 + color: Theme.of(context).colorScheme.onSurfaceVariant,
75 ),
76 ),
77 Text(
78 derivation.address,
85 - style: Theme.of(context).primaryTextTheme.labelMedium!.copyWith(
79 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
80 fontSize: 16,
81 fontWeight: FontWeight.w500,
88 - color: Theme.of(context)
89 - .extension<CakeTextTheme>()!
90 - .secondaryTextColor,
82 + color: Theme.of(context).colorScheme.onSurfaceVariant,
83 ),
84 ),
85 Text(
86 "${S.current.confirmed}: ${derivation.balance}",
95 - style: Theme.of(context).primaryTextTheme.labelMedium!.copyWith(
87 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
88 fontSize: 16,
89 fontWeight: FontWeight.w500,
98 - color: Theme.of(context)
99 - .extension<CakeTextTheme>()!
100 - .secondaryTextColor,
90 + color: Theme.of(context).colorScheme.onSurfaceVariant,
91 ),
92 ),
93 Text(
94 "${S.current.transactions}: ${derivation.transactionsCount}",
105 - style: Theme.of(context).primaryTextTheme.labelMedium!.copyWith(
95 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
96 fontSize: 16,
97 fontWeight: FontWeight.w500,
108 - color: Theme.of(context)
109 - .extension<CakeTextTheme>()!
110 - .secondaryTextColor,
98 + color: Theme.of(context).colorScheme.onSurfaceVariant,
99 ),
100 ),
101 ],
lib/src/screens/restore/wallet_restore_from_keys_form.dart
+62 -59
@@ -8,7 +8,6 @@ import 'package:cake_wallet/src/widgets/blockchain_height_widget.dart';
8 import 'package:cake_wallet/src/widgets/base_text_form_field.dart';
9 import 'package:cake_wallet/core/wallet_name_validator.dart';
10 import 'package:cake_wallet/entities/generate_name.dart';
11 -import 'package:cake_wallet/themes/extensions/send_page_theme.dart';
11 import 'package:flutter/services.dart';
12
13 class WalletRestoreFromKeysForm extends StatefulWidget {
@@ -36,12 +35,13 @@ class WalletRestoreFromKeysForm extends StatefulWidget {
35 final void Function(String)? onRepeatedPasswordChange;
36
37 @override
39 - WalletRestoreFromKeysFormState createState() =>
40 - WalletRestoreFromKeysFormState(displayWalletPassword: displayWalletPassword, restoredWallet: restoredWallet);
38 + WalletRestoreFromKeysFormState createState() => WalletRestoreFromKeysFormState(
39 + displayWalletPassword: displayWalletPassword, restoredWallet: restoredWallet);
40 }
41
42 class WalletRestoreFromKeysFormState extends State<WalletRestoreFromKeysForm> {
44 - WalletRestoreFromKeysFormState({required bool displayWalletPassword, RestoredWallet? restoredWallet})
43 + WalletRestoreFromKeysFormState(
44 + {required bool displayWalletPassword, RestoredWallet? restoredWallet})
45 : formKey = GlobalKey<FormState>(),
46 blockchainHeightKey = GlobalKey<BlockchainHeightState>(),
47 nameController = TextEditingController(),
@@ -59,7 +59,8 @@ class WalletRestoreFromKeysFormState extends State<WalletRestoreFromKeysForm> {
59 : TextEditingController(),
60 nameTextEditingController = TextEditingController(),
61 passwordTextEditingController = displayWalletPassword ? TextEditingController() : null,
62 - repeatedPasswordTextEditingController = displayWalletPassword ? TextEditingController() : null;
62 + repeatedPasswordTextEditingController =
63 + displayWalletPassword ? TextEditingController() : null;
64
65 final GlobalKey<FormState> formKey;
66 final GlobalKey<BlockchainHeightState> blockchainHeightKey;
@@ -82,7 +83,8 @@ class WalletRestoreFromKeysFormState extends State<WalletRestoreFromKeysForm> {
83 }
84
85 if (repeatedPasswordTextEditingController != null) {
85 - repeatedPasswordListener = () => widget.onRepeatedPasswordChange?.call(repeatedPasswordTextEditingController!.text);
86 + repeatedPasswordListener =
87 + () => widget.onRepeatedPasswordChange?.call(repeatedPasswordTextEditingController!.text);
88 repeatedPasswordTextEditingController?.addListener(repeatedPasswordListener!);
89 }
90 super.initState();
@@ -96,7 +98,8 @@ class WalletRestoreFromKeysFormState extends State<WalletRestoreFromKeysForm> {
98
99 WidgetsBinding.instance.addPostFrameCallback((_) {
100 if (widget.restoredWallet?.height != null) {
99 - blockchainHeightKey.currentState?.restoreHeightController.text = widget.restoredWallet!.height.toString();
101 + blockchainHeightKey.currentState?.restoreHeightController.text =
102 + widget.restoredWallet!.height.toString();
103 }
104 });
105
@@ -126,64 +129,64 @@ class WalletRestoreFromKeysFormState extends State<WalletRestoreFromKeysForm> {
129 @override
130 Widget build(BuildContext context) {
131 return Container(
129 - padding: EdgeInsets.only(left: 24, right: 24),
132 + padding: EdgeInsets.symmetric(horizontal: 16),
133 child: Form(
134 key: formKey,
135 child: Column(
136 children: <Widget>[
134 - Stack(
135 - alignment: Alignment.centerRight,
136 - children: [
137 - BaseTextFormField(
138 - key: ValueKey('wallet_restore_from_keys_wallet_name_textfield_key'),
139 - controller: nameTextEditingController,
140 - hintText: S.of(context).wallet_name,
141 - validator: WalletNameValidator(),
142 - suffixIcon: IconButton(
143 - key: ValueKey('wallet_restore_from_keys_wallet_name_refresh_button_key'),
144 - onPressed: () async {
145 - final rName = await generateName();
146 - FocusManager.instance.primaryFocus?.unfocus();
137 + SizedBox(height: 8),
138 + BaseTextFormField(
139 + key: ValueKey('wallet_restore_from_keys_wallet_name_textfield_key'),
140 + controller: nameTextEditingController,
141 + hintText: S.of(context).wallet_name,
142 + validator: WalletNameValidator(),
143 + suffixIcon: IconButton(
144 + key: ValueKey('wallet_restore_from_keys_wallet_name_refresh_button_key'),
145 + onPressed: () async {
146 + final rName = await generateName();
147 + FocusManager.instance.primaryFocus?.unfocus();
148
148 - setState(() {
149 - nameTextEditingController.text = rName;
150 - nameTextEditingController.selection = TextSelection.fromPosition(
151 - TextPosition(offset: nameTextEditingController.text.length));
152 - });
153 - },
154 - icon: Container(
155 - padding: const EdgeInsets.all(8),
156 - decoration: BoxDecoration(
157 - borderRadius: BorderRadius.circular(6.0),
158 - color: Theme.of(context).hintColor,
159 - ),
160 - width: 34,
161 - height: 34,
162 - child: Image.asset(
163 - 'assets/images/refresh_icon.png',
164 - color:
165 - Theme.of(context).extension<SendPageTheme>()!.textFieldButtonIconColor,
166 - ),
167 - ),
149 + setState(() {
150 + nameTextEditingController.text = rName;
151 + nameTextEditingController.selection = TextSelection.fromPosition(
152 + TextPosition(offset: nameTextEditingController.text.length));
153 + });
154 + },
155 + icon: Container(
156 + padding: const EdgeInsets.all(8),
157 + decoration: BoxDecoration(
158 + borderRadius: BorderRadius.circular(6.0),
159 + color: Theme.of(context).colorScheme.surface,
160 + ),
161 + width: 34,
162 + height: 34,
163 + child: Image.asset(
164 + 'assets/images/refresh_icon.png',
165 + color: Theme.of(context).colorScheme.onSurfaceVariant,
166 ),
167 ),
170 - ],
168 + ),
169 ),
172 - if (widget.displayWalletPassword)
173 - ...[Container(
174 - key: ValueKey('password'),
175 - padding: EdgeInsets.only(top: 20.0),
176 - child: BaseTextFormField(
177 - controller: passwordTextEditingController,
178 - hintText: S.of(context).password,
179 - obscureText: true)),
180 - Container(
181 - key: ValueKey('repeat_wallet_password'),
182 - padding: EdgeInsets.only(top: 20.0),
183 - child: BaseTextFormField(
184 - controller: repeatedPasswordTextEditingController,
185 - hintText: S.of(context).repeat_wallet_password,
186 - obscureText: true))],
170 + if (widget.displayWalletPassword) ...[
171 + Container(
172 + key: ValueKey('password'),
173 + padding: EdgeInsets.only(top: 20.0),
174 + child: BaseTextFormField(
175 + controller: passwordTextEditingController,
176 + hintText: S.of(context).password,
177 + obscureText: true,
178 + ),
179 + ),
180 + Container(
181 + key: ValueKey('repeat_wallet_password'),
182 + padding: EdgeInsets.only(top: 20.0),
183 + child: BaseTextFormField(
184 + controller: repeatedPasswordTextEditingController,
185 + hintText: S.of(context).repeat_wallet_password,
186 + obscureText: true,
187 + ),
188 + )
189 + ],
190 Container(height: 20),
191 _restoreFromKeysFormFields(),
192 ],
@@ -202,7 +205,8 @@ class WalletRestoreFromKeysFormState extends State<WalletRestoreFromKeysForm> {
205 controller: viewKeyController,
206 hintText: S.of(context).view_key_public,
207 maxLines: null,
205 - )],
208 + )
209 + ],
210 );
211 }
212
@@ -219,7 +223,6 @@ class WalletRestoreFromKeysFormState extends State<WalletRestoreFromKeysForm> {
223 controller: privateKeyController,
224 placeholder: nanoBased ? S.of(context).seed_hex_form : S.of(context).private_key,
225 options: [AddressTextFieldOption.paste],
222 - buttonColor: Theme.of(context).hintColor,
226 onPushPasteButton: (_) {
227 _pasteText();
228 },
lib/src/screens/restore/wallet_restore_from_seed_form.dart
+101 -114
@@ -7,7 +7,6 @@ import 'package:cake_wallet/src/widgets/blockchain_height_widget.dart';
7 import 'package:cake_wallet/src/widgets/picker.dart';
8 import 'package:cake_wallet/src/widgets/seed_language_picker.dart';
9 import 'package:cake_wallet/src/widgets/seed_widget.dart';
10 -import 'package:cake_wallet/themes/extensions/send_page_theme.dart';
10 import 'package:cake_wallet/utils/show_pop_up.dart';
11 import 'package:cake_wallet/view_model/restore/restore_wallet.dart';
12 import 'package:cake_wallet/view_model/seed_settings_view_model.dart';
@@ -49,20 +48,17 @@ class WalletRestoreFromSeedForm extends StatefulWidget {
48
49 @override
50 WalletRestoreFromSeedFormState createState() =>
52 - WalletRestoreFromSeedFormState('English',
53 - displayWalletPassword: displayWalletPassword);
51 + WalletRestoreFromSeedFormState('English', displayWalletPassword: displayWalletPassword);
52 }
53
54 class WalletRestoreFromSeedFormState extends State<WalletRestoreFromSeedForm> {
57 - WalletRestoreFromSeedFormState(this.language,
58 - {required bool displayWalletPassword})
55 + WalletRestoreFromSeedFormState(this.language, {required bool displayWalletPassword})
56 : seedWidgetStateKey = GlobalKey<SeedWidgetState>(),
57 blockchainHeightKey = GlobalKey<BlockchainHeightState>(),
58 formKey = GlobalKey<FormState>(),
59 languageController = TextEditingController(),
60 nameTextEditingController = TextEditingController(),
64 - passwordTextEditingController =
65 - displayWalletPassword ? TextEditingController() : null,
61 + passwordTextEditingController = displayWalletPassword ? TextEditingController() : null,
62 repeatedPasswordTextEditingController =
63 displayWalletPassword ? TextEditingController() : null,
64 seedTypeController = TextEditingController();
@@ -90,21 +86,18 @@ class WalletRestoreFromSeedFormState extends State<WalletRestoreFromSeedForm> {
86 _setLanguageLabel(language);
87
88 if (passwordTextEditingController != null) {
93 - passwordListener = () =>
94 - widget.onPasswordChange?.call(passwordTextEditingController!.text);
89 + passwordListener = () => widget.onPasswordChange?.call(passwordTextEditingController!.text);
90 passwordTextEditingController?.addListener(passwordListener!);
91 }
92
93 if (repeatedPasswordTextEditingController != null) {
99 - repeatedPasswordListener = () => widget.onRepeatedPasswordChange
100 - ?.call(repeatedPasswordTextEditingController!.text);
101 - repeatedPasswordTextEditingController
102 - ?.addListener(repeatedPasswordListener!);
94 + repeatedPasswordListener =
95 + () => widget.onRepeatedPasswordChange?.call(repeatedPasswordTextEditingController!.text);
96 + repeatedPasswordTextEditingController?.addListener(repeatedPasswordListener!);
97 }
98
99 moneroSeedTypeReaction =
106 - reaction((_) => widget.seedSettingsViewModel.moneroSeedType,
107 - (MoneroSeedType item) {
100 + reaction((_) => widget.seedSettingsViewModel.moneroSeedType, (MoneroSeedType item) {
101 _setSeedType(item);
102 _changeLanguage('English');
103 });
@@ -121,8 +114,7 @@ class WalletRestoreFromSeedFormState extends State<WalletRestoreFromSeedForm> {
114 }
115
116 if (repeatedPasswordListener != null) {
124 - repeatedPasswordTextEditingController
125 - ?.removeListener(repeatedPasswordListener!);
117 + repeatedPasswordTextEditingController?.removeListener(repeatedPasswordListener!);
118 }
119
120 super.dispose();
@@ -154,52 +146,43 @@ class WalletRestoreFromSeedFormState extends State<WalletRestoreFromSeedForm> {
146 @override
147 Widget build(BuildContext context) {
148 return Container(
157 - padding: EdgeInsets.only(left: 24, right: 24),
158 - child: Column(children: [
149 + padding: EdgeInsets.symmetric(horizontal: 16),
150 + child: Column(
151 + children: [
152 + SizedBox(height: 8),
153 Form(
154 key: formKey,
161 - child: Stack(
162 - alignment: Alignment.centerRight,
163 - children: [
164 - BaseTextFormField(
165 - key: ValueKey(
166 - 'wallet_restore_from_seed_wallet_name_textfield_key'),
167 - controller: nameTextEditingController,
168 - hintText: S.of(context).wallet_name,
169 - suffixIcon: IconButton(
170 - key: ValueKey(
171 - 'wallet_restore_from_seed_wallet_name_refresh_button_key'),
172 - onPressed: () async {
173 - final rName = await generateName();
174 - FocusManager.instance.primaryFocus?.unfocus();
175 -
176 - setState(() {
177 - nameTextEditingController.text = rName;
178 - nameTextEditingController.selection =
179 - TextSelection.fromPosition(TextPosition(
180 - offset:
181 - nameTextEditingController.text.length));
182 - });
183 - },
184 - icon: Container(
185 - padding: const EdgeInsets.all(8),
186 - decoration: BoxDecoration(
187 - borderRadius: BorderRadius.circular(6.0),
188 - color: Theme.of(context).hintColor,
189 - ),
190 - width: 34,
191 - height: 34,
192 - child: Image.asset(
193 - 'assets/images/refresh_icon.png',
194 - color: Theme.of(context)
195 - .extension<SendPageTheme>()!
196 - .textFieldButtonIconColor,
197 - ),
198 - ),
155 + child: BaseTextFormField(
156 + key: ValueKey('wallet_restore_from_seed_wallet_name_textfield_key'),
157 + controller: nameTextEditingController,
158 + hintText: S.of(context).wallet_name,
159 + suffixIcon: IconButton(
160 + key: ValueKey('wallet_restore_from_seed_wallet_name_refresh_button_key'),
161 + onPressed: () async {
162 + final rName = await generateName();
163 + FocusManager.instance.primaryFocus?.unfocus();
164 +
165 + setState(() {
166 + nameTextEditingController.text = rName;
167 + nameTextEditingController.selection = TextSelection.fromPosition(
168 + TextPosition(offset: nameTextEditingController.text.length));
169 + });
170 + },
171 + icon: Container(
172 + padding: const EdgeInsets.all(8),
173 + decoration: BoxDecoration(
174 + borderRadius: BorderRadius.circular(6.0),
175 + color: Theme.of(context).colorScheme.surface,
176 + ),
177 + width: 34,
178 + height: 34,
179 + child: Image.asset(
180 + 'assets/images/refresh_icon.png',
181 + color: Theme.of(context).colorScheme.onSurfaceVariant,
182 ),
200 - validator: WalletNameValidator(),
183 ),
202 - ],
184 + ),
185 + validator: WalletNameValidator(),
186 )),
187 Container(height: 20),
188 SeedWidget(
@@ -208,31 +191,29 @@ class WalletRestoreFromSeedFormState extends State<WalletRestoreFromSeedForm> {
191 language: language,
192 type: widget.type,
193 onSeedChange: onSeedChange,
211 - seedTextFieldKey:
212 - ValueKey('wallet_restore_from_seed_wallet_seeds_textfield_key'),
213 - pasteButtonKey: ValueKey(
214 - 'wallet_restore_from_seed_wallet_seeds_paste_button_key'),
194 + seedTextFieldKey: ValueKey('wallet_restore_from_seed_wallet_seeds_textfield_key'),
195 + pasteButtonKey: ValueKey('wallet_restore_from_seed_wallet_seeds_paste_button_key'),
196 ),
197 if ([WalletType.monero, WalletType.wownero].contains(widget.type))
198 GestureDetector(
218 - key: ValueKey(
219 - 'wallet_restore_from_seed_seedtype_picker_button_key'),
199 + key: ValueKey('wallet_restore_from_seed_seedtype_picker_button_key'),
200 onTap: () async {
201 await showPopUp<void>(
222 - context: context,
223 - builder: (_) => Picker(
224 - items: _getItems(),
225 - selectedAtIndex: isPolyseed
226 - ? 1
227 - : (seedTypeController.value.text.contains("14") &&
228 - widget.type == WalletType.wownero) ||
229 - isBip39
230 - ? 2
231 - : 0,
232 - mainAxisAlignment: MainAxisAlignment.start,
233 - onItemSelected: _changeSeedType,
234 - isSeparated: false,
235 - ));
202 + context: context,
203 + builder: (_) => Picker(
204 + items: _getItems(),
205 + selectedAtIndex: isPolyseed
206 + ? 1
207 + : (seedTypeController.value.text.contains("14") &&
208 + widget.type == WalletType.wownero) ||
209 + isBip39
210 + ? 2
211 + : 0,
212 + mainAxisAlignment: MainAxisAlignment.start,
213 + onItemSelected: _changeSeedType,
214 + isSeparated: false,
215 + ),
216 + );
217 },
218 child: Container(
219 color: Colors.transparent,
@@ -243,36 +224,41 @@ class WalletRestoreFromSeedFormState extends State<WalletRestoreFromSeedForm> {
224 enableInteractiveSelection: false,
225 readOnly: true,
226 suffixIcon: expandIcon,
227 + textStyle: Theme.of(context).textTheme.labelLarge?.copyWith(
228 + fontSize: 16,
229 + fontWeight: FontWeight.w600,
230 + color: Theme.of(context).colorScheme.onSurfaceVariant,
231 + ),
232 ),
233 ),
234 ),
235 ),
236 if (widget.displayWalletPassword) ...[
237 BaseTextFormField(
252 - key: ValueKey('password'),
253 - controller: passwordTextEditingController,
254 - hintText: S.of(context).password,
255 - obscureText: true),
238 + key: ValueKey('password'),
239 + controller: passwordTextEditingController,
240 + hintText: S.of(context).password,
241 + obscureText: true,
242 + ),
243 BaseTextFormField(
257 - key: ValueKey('repeat_wallet_password'),
258 - controller: repeatedPasswordTextEditingController,
259 - hintText: S.of(context).repeat_wallet_password,
260 - obscureText: true)
244 + key: ValueKey('repeat_wallet_password'),
245 + controller: repeatedPasswordTextEditingController,
246 + hintText: S.of(context).repeat_wallet_password,
247 + obscureText: true,
248 + )
249 ],
250 if (widget.displayLanguageSelector)
263 - if (!seedTypeController.value.text.contains("14") &&
264 - widget.displayLanguageSelector)
251 + if (!seedTypeController.value.text.contains("14") && widget.displayLanguageSelector)
252 GestureDetector(
253 onTap: () async {
254 await showPopUp<void>(
268 - context: context,
269 - builder: (_) => SeedLanguagePicker(
270 - selected: language,
271 - onItemSelected: (lang) =>
272 - _changeLanguage(lang, isPolyseed || isBip39),
273 - seedType:
274 - widget.seedSettingsViewModel.moneroSeedType,
275 - ));
255 + context: context,
256 + builder: (_) => SeedLanguagePicker(
257 + selected: language,
258 + onItemSelected: (lang) => _changeLanguage(lang, isPolyseed || isBip39),
259 + seedType: widget.seedSettingsViewModel.moneroSeedType,
260 + ),
261 + );
262 },
263 child: Container(
264 color: Colors.transparent,
@@ -283,6 +269,11 @@ class WalletRestoreFromSeedFormState extends State<WalletRestoreFromSeedForm> {
269 enableInteractiveSelection: false,
270 readOnly: true,
271 suffixIcon: expandIcon,
272 + textStyle: Theme.of(context).textTheme.labelLarge?.copyWith(
273 + fontSize: 16,
274 + fontWeight: FontWeight.w600,
275 + color: Theme.of(context).colorScheme.onSurfaceVariant,
276 + ),
277 ),
278 ),
279 ),
@@ -292,13 +283,17 @@ class WalletRestoreFromSeedFormState extends State<WalletRestoreFromSeedForm> {
283 focusNode: widget.blockHeightFocusNode,
284 key: blockchainHeightKey,
285 blockHeightTextFieldKey: ValueKey(
295 - 'wallet_restore_from_seed_blockheight_textfield_key'),
286 + 'wallet_restore_from_seed_blockheight_textfield_key',
287 + ),
288 onHeightOrDateEntered: widget.onHeightOrDateEntered,
297 - hasDatePicker:
298 - [WalletType.monero, WalletType.wownero].contains(widget.type),
289 + hasDatePicker: [WalletType.monero, WalletType.wownero].contains(
290 + widget.type,
291 + ),
292 walletType: widget.type,
293 ),
301 - ]));
294 + ],
295 + ),
296 + );
297 }
298
299 bool get isPolyseed =>
@@ -316,7 +311,7 @@ class WalletRestoreFromSeedFormState extends State<WalletRestoreFromSeedForm> {
311 child: Image.asset(
312 'assets/images/arrow_bottom_purple_icon.png',
313 height: 8,
319 - color: Theme.of(context).hintColor,
314 + color: Theme.of(context).colorScheme.onSurfaceVariant,
315 ),
316 );
317
@@ -334,8 +329,8 @@ class WalletRestoreFromSeedFormState extends State<WalletRestoreFromSeedForm> {
329 });
330 }
331
337 - void _setLanguageLabel(String language) => languageController.text =
338 - '${language.replaceAll("POLYSEED_", "")} (Seed language)';
332 + void _setLanguageLabel(String language) =>
333 + languageController.text = '${language.replaceAll("POLYSEED_", "")} (Seed language)';
334
335 void _changeSeedType(MoneroSeedType item) {
336 widget.seedSettingsViewModel.setMoneroSeedType(item);
@@ -350,17 +345,9 @@ class WalletRestoreFromSeedFormState extends State<WalletRestoreFromSeedForm> {
345 List<MoneroSeedType> _getItems() {
346 switch (widget.type) {
347 case WalletType.monero:
353 - return [
354 - MoneroSeedType.legacy,
355 - MoneroSeedType.polyseed,
356 - MoneroSeedType.bip39
357 - ];
348 + return [MoneroSeedType.legacy, MoneroSeedType.polyseed, MoneroSeedType.bip39];
349 case WalletType.wownero:
359 - return [
360 - MoneroSeedType.legacy,
361 - MoneroSeedType.polyseed,
362 - MoneroSeedType.wowneroSeed
363 - ];
350 + return [MoneroSeedType.legacy, MoneroSeedType.polyseed, MoneroSeedType.wowneroSeed];
351 default:
352 return [MoneroSeedType.legacy];
353 }
lib/src/screens/restore/wallet_restore_page.dart
+122 -129
@@ -9,11 +9,6 @@ import 'package:cake_wallet/src/widgets/bottom_sheet/add_passphrase_bottom_sheet
9 import 'package:cake_wallet/src/widgets/keyboard_done_button.dart';
10 import 'package:cake_wallet/src/widgets/primary_button.dart';
11 import 'package:cake_wallet/src/widgets/standard_checkbox.dart';
12 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
13 -import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
14 -import 'package:cake_wallet/themes/extensions/keyboard_theme.dart';
15 -import 'package:cake_wallet/themes/theme_base.dart';
16 -import 'package:cake_wallet/utils/responsive_layout_util.dart';
12 import 'package:cake_wallet/utils/show_pop_up.dart';
13 import 'package:cake_wallet/view_model/restore/restore_mode.dart';
14 import 'package:cake_wallet/view_model/seed_settings_view_model.dart';
@@ -41,16 +36,17 @@ class WalletRestorePage extends BasePage {
36
37 @override
38 Widget middle(BuildContext context) => Observer(
44 - builder: (_) => Text(
45 - walletRestoreViewModel.mode == WalletRestoreMode.seed
46 - ? S.current.restore_title_from_seed
47 - : S.current.restore_title_from_keys,
48 - style: TextStyle(
49 - fontSize: 18.0,
50 - fontWeight: FontWeight.bold,
51 - fontFamily: 'Lato',
52 - color: titleColor(context)),
53 - ));
39 + builder: (_) => Text(
40 + walletRestoreViewModel.mode == WalletRestoreMode.seed
41 + ? S.current.restore_title_from_seed
42 + : S.current.restore_title_from_keys,
43 + style: Theme.of(context).textTheme.titleMedium?.copyWith(
44 + fontSize: 18,
45 +
46 + fontWeight: FontWeight.w600,
47 + ),
48 + ),
49 + );
50
51 // DerivationType derivationType = DerivationType.unknown;
52 // String? derivationPath = null;
@@ -72,7 +68,7 @@ class WalletRestorePage extends BasePage {
68 return KeyboardActions(
69 config: KeyboardActionsConfig(
70 keyboardActionsPlatform: KeyboardActionsPlatform.IOS,
75 - keyboardBarColor: Theme.of(context).extension<KeyboardTheme>()!.keyboardBarColor,
71 + keyboardBarColor: Theme.of(context).colorScheme.surface,
72 nextFocus: false,
73 actions: [
74 KeyboardActionsItem(
@@ -83,108 +79,105 @@ class WalletRestorePage extends BasePage {
79 ),
80 child: Container(
81 height: 0,
86 - color: Theme.of(context).colorScheme.background,
82 + color: Theme.of(context).colorScheme.surface,
83 child: Center(
88 - child: ConstrainedBox(
89 - constraints:
90 - BoxConstraints(maxWidth: ResponsiveLayoutUtilBase.kDesktopMaxWidthConstraint),
91 - child: Column(
92 - children: [
93 - Expanded(
94 - child: _WalletRestorePageBody(
95 - walletRestoreViewModel: walletRestoreViewModel,
96 - seedSettingsViewModel: seedSettingsViewModel,
97 - walletRestoreFromSeedFormKey: walletRestoreFromSeedFormKey,
98 - walletRestoreFromKeysFormKey: walletRestoreFromKeysFormKey,
99 - blockHeightFocusNode: _blockHeightFocusNode,
100 - derivationInfo: derivationInfo,
101 - onDerivationInfoChanged: (info) => derivationInfo = info,
102 - ),
84 + child: Column(
85 + children: [
86 + Expanded(
87 + child: _WalletRestorePageBody(
88 + walletRestoreViewModel: walletRestoreViewModel,
89 + seedSettingsViewModel: seedSettingsViewModel,
90 + walletRestoreFromSeedFormKey: walletRestoreFromSeedFormKey,
91 + walletRestoreFromKeysFormKey: walletRestoreFromKeysFormKey,
92 + blockHeightFocusNode: _blockHeightFocusNode,
93 + derivationInfo: derivationInfo,
94 + onDerivationInfoChanged: (info) => derivationInfo = info,
95 ),
104 - Padding(
105 - padding: EdgeInsets.only(top: 20, bottom: 24, left: 24, right: 24),
106 - child: Column(
107 - children: [
108 - Observer(
109 - builder: (context) {
110 - return walletRestoreViewModel.mode == WalletRestoreMode.seed
111 - ? StandardCheckbox(
112 - value: walletRestoreViewModel.hasPassphrase,
113 - caption: S.of(context).wallet_has_passphrase,
114 - onChanged: (value) {
115 - walletRestoreViewModel.hasPassphrase = value;
116 - },
117 - )
118 - : SizedBox.shrink();
119 - },
120 - ),
121 - SizedBox(height: 16),
122 - PrimaryButton(
123 - key: ValueKey('wallet_restore_advanced_settings_button_key'),
124 - onPressed: () {
125 - Navigator.of(context).pushNamed(
126 - Routes.advancedPrivacySettings,
127 - arguments: {
128 - 'isFromRestore': true,
129 - 'type': walletRestoreViewModel.type,
130 - 'useTestnet': walletRestoreViewModel.useTestnet,
131 - 'toggleTestnet': walletRestoreViewModel.toggleUseTestnet
132 - },
133 - );
134 - },
135 - text: S.of(context).advanced_settings,
136 - color: Theme.of(context).cardColor,
137 - textColor: Theme.of(context).extension<CakeTextTheme>()!.buttonTextColor,
138 - ),
139 - SizedBox(height: 8),
140 - Observer(
141 - builder: (context) {
142 - return LoadingPrimaryButton(
143 - key: ValueKey('wallet_restore_seed_or_key_restore_button_key'),
144 - onPressed: () async {
145 - if (walletRestoreViewModel.hasPassphrase) {
146 - await showModalBottomSheet<void>(
147 - context: context,
148 - isDismissible: false,
149 - isScrollControlled: true,
150 - builder: (BuildContext bottomSheetContext) {
151 - return Padding(
152 - padding: EdgeInsets.only(
153 - bottom: MediaQuery.of(bottomSheetContext).viewInsets.bottom,
154 - ),
155 - child: AddPassphraseBottomSheet(
156 - currentTheme: currentTheme,
157 - titleText: S.of(context).add_passphrase,
158 - onRestoreButtonPressed: (passphrase) async {
159 - await _onPassphraseBottomSheetRestoreButtonPressed(
160 - passphrase,
161 - context,
162 - );
163 - },
164 - ),
165 - );
166 - },
167 - );
168 - } else {
169 - await _confirmForm(context);
170 - }
171 - },
172 - text: walletRestoreViewModel.hasPassphrase
173 - ? S.of(context).add_passphrase
174 - : S.of(context).restore_recover,
175 - color: Theme.of(context).primaryColor,
176 - textColor: Colors.white,
177 - isLoading: walletRestoreViewModel.state is IsExecutingState,
178 - isDisabled: !walletRestoreViewModel.isButtonEnabled,
179 - );
180 - },
181 - ),
182 - const SizedBox(height: 24),
183 - ],
184 - ),
185 - )
186 - ],
187 - ),
96 + ),
97 + Padding(
98 + padding: EdgeInsets.symmetric(horizontal: 16),
99 + child: Column(
100 + children: [
101 + Observer(
102 + builder: (context) {
103 + return walletRestoreViewModel.mode == WalletRestoreMode.seed
104 + ? StandardCheckbox(
105 + captionColor: Theme.of(context).colorScheme.onSecondaryContainer,
106 + value: walletRestoreViewModel.hasPassphrase,
107 + caption: S.of(context).wallet_has_passphrase,
108 + onChanged: (value) {
109 + walletRestoreViewModel.hasPassphrase = value;
110 + },
111 + )
112 + : SizedBox.shrink();
113 + },
114 + ),
115 + SizedBox(height: 16),
116 + PrimaryButton(
117 + key: ValueKey('wallet_restore_advanced_settings_button_key'),
118 + onPressed: () {
119 + Navigator.of(context).pushNamed(
120 + Routes.advancedPrivacySettings,
121 + arguments: {
122 + 'isFromRestore': true,
123 + 'type': walletRestoreViewModel.type,
124 + 'useTestnet': walletRestoreViewModel.useTestnet,
125 + 'toggleTestnet': walletRestoreViewModel.toggleUseTestnet
126 + },
127 + );
128 + },
129 + text: S.of(context).advanced_settings,
130 + color: Theme.of(context).colorScheme.surfaceContainer,
131 + textColor: Theme.of(context).colorScheme.onSecondaryContainer,
132 + ),
133 + SizedBox(height: 8),
134 + Observer(
135 + builder: (context) {
136 + return LoadingPrimaryButton(
137 + key: ValueKey('wallet_restore_seed_or_key_restore_button_key'),
138 + onPressed: () async {
139 + if (walletRestoreViewModel.hasPassphrase) {
140 + await showModalBottomSheet<void>(
141 + context: context,
142 + isDismissible: false,
143 + isScrollControlled: true,
144 + builder: (BuildContext bottomSheetContext) {
145 + return Padding(
146 + padding: EdgeInsets.only(
147 + bottom: MediaQuery.of(bottomSheetContext).viewInsets.bottom,
148 + ),
149 + child: AddPassphraseBottomSheet(
150 + currentTheme: currentTheme,
151 + titleText: S.of(context).add_passphrase,
152 + onRestoreButtonPressed: (passphrase) async {
153 + await _onPassphraseBottomSheetRestoreButtonPressed(
154 + passphrase,
155 + context,
156 + );
157 + },
158 + ),
159 + );
160 + },
161 + );
162 + } else {
163 + await _confirmForm(context);
164 + }
165 + },
166 + text: walletRestoreViewModel.hasPassphrase
167 + ? S.of(context).add_passphrase
168 + : S.of(context).restore_recover,
169 + color: Theme.of(context).colorScheme.primary,
170 + textColor: Theme.of(context).colorScheme.onPrimary,
171 + isLoading: walletRestoreViewModel.state is IsExecutingState,
172 + isDisabled: !walletRestoreViewModel.isButtonEnabled,
173 + );
174 + },
175 + ),
176 + const SizedBox(height: 24),
177 + ],
178 + ),
179 + )
180 + ],
181 ),
182 ),
183 ),
@@ -466,18 +459,18 @@ class _WalletRestorePageBodyState extends State<_WalletRestorePageBody>
459 splashFactory: NoSplash.splashFactory,
460 indicatorSize: TabBarIndicatorSize.label,
461 isScrollable: true,
469 - labelStyle: TextStyle(
470 - fontSize: 18,
471 - fontFamily: 'Lato',
472 - fontWeight: FontWeight.w600,
473 - color: Theme.of(context).appBarTheme.titleTextStyle!.color),
474 - unselectedLabelStyle: TextStyle(
475 - fontSize: 18,
476 - fontFamily: 'Lato',
477 - fontWeight: FontWeight.w600,
478 - color: Theme.of(context).appBarTheme.titleTextStyle!.color?.withOpacity(0.5)),
479 - labelColor: Theme.of(context).appBarTheme.titleTextStyle!.color,
480 - indicatorColor: Theme.of(context).appBarTheme.titleTextStyle!.color,
462 + labelStyle: Theme.of(context).textTheme.labelLarge?.copyWith(
463 + fontWeight: FontWeight.w600,
464 + fontSize: 16,
465 + color: Theme.of(context).colorScheme.primary,
466 + ),
467 + unselectedLabelStyle: Theme.of(context).textTheme.labelLarge?.copyWith(
468 + fontWeight: FontWeight.w600,
469 + fontSize: 16,
470 + color: Theme.of(context).colorScheme.primary.withOpacity(0.5),
471 + ),
472 + labelColor: Theme.of(context).colorScheme.primary,
473 + indicatorColor: Theme.of(context).colorScheme.primary,
474 indicatorPadding: EdgeInsets.zero,
475 labelPadding: const EdgeInsets.only(right: 24),
476 tabAlignment: TabAlignment.start,
@@ -489,7 +482,7 @@ class _WalletRestorePageBodyState extends State<_WalletRestorePageBody>
482 ],
483 ),
484 ),
492 - const SizedBox(height: 20),
485 + const SizedBox(height: 12),
486 Expanded(
487 child: TabBarView(
488 controller: _tabController,
lib/src/screens/seed/pre_seed_page.dart
+5 -1
@@ -4,7 +4,11 @@ import 'package:cake_wallet/src/screens/Info_page.dart';
4 import 'package:flutter/cupertino.dart';
5
6 class PreSeedPage extends InfoPage {
7 - PreSeedPage();
7 + PreSeedPage()
8 + : super(
9 + imageLightPath: 'assets/images/seed_warning_light.svg',
10 + imageDarkPath: 'assets/images/seed_warning_dark.svg',
11 + );
12
13 @override
14 bool get onWillPop => false;
lib/src/screens/seed/seed_verification/seed_verification_page.dart
+9 -1
@@ -2,6 +2,7 @@ import 'package:cake_wallet/generated/i18n.dart';
2 import 'package:cake_wallet/src/screens/base_page.dart';
3 import 'package:cake_wallet/src/screens/seed/seed_verification/seed_verification_step_view.dart';
4 import 'package:cake_wallet/src/screens/seed/seed_verification/seed_verification_success_view.dart';
5 +import 'package:cake_wallet/src/widgets/gradient_background.dart';
6 import 'package:cake_wallet/view_model/wallet_seed_view_model.dart';
7 import 'package:flutter/material.dart';
8 import 'package:flutter_mobx/flutter_mobx.dart';
@@ -11,6 +12,13 @@ class SeedVerificationPage extends BasePage {
12
13 SeedVerificationPage(this.walletSeedViewModel);
14
15 + @override
16 + bool get gradientBackground => true;
17 +
18 + @override
19 + Widget Function(BuildContext, Widget) get rootWrapper =>
20 + (BuildContext context, Widget scaffold) => GradientBackground(scaffold: scaffold);
21 +
22 @override
23 String? get title => S.current.verify_seed;
24
@@ -23,7 +31,7 @@ class SeedVerificationPage extends BasePage {
31 child: walletSeedViewModel.isVerificationComplete ||
32 walletSeedViewModel.verificationIndices.isEmpty
33 ? SeedVerificationSuccessView(
26 - imageColor: titleColor(context),
34 + currentTheme: currentTheme,
35 )
36 : SeedVerificationStepView(
37 walletSeedViewModel: walletSeedViewModel,
lib/src/screens/seed/seed_verification/seed_verification_step_view.dart
+18 -22
@@ -1,5 +1,4 @@
1 import 'package:cake_wallet/generated/i18n.dart';
2 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
2 import 'package:cake_wallet/utils/show_bar.dart';
3 import 'package:cake_wallet/view_model/wallet_seed_view_model.dart';
4 import 'package:flutter/material.dart';
@@ -32,27 +31,24 @@ class SeedVerificationStepView extends StatelessWidget {
31 children: [
32 TextSpan(
33 text: '${S.current.seed_position_question_one} ',
35 - style: TextStyle(
36 - fontSize: 20,
37 - fontWeight: FontWeight.w600,
38 - color: questionTextColor,
39 - ),
34 + style: Theme.of(context).textTheme.bodyLarge?.copyWith(
35 + fontWeight: FontWeight.w600,
36 + color: questionTextColor,
37 + ),
38 ),
39 TextSpan(
40 text: '${getOrdinal(walletSeedViewModel.currentWordIndex + 1)} ',
43 - style: TextStyle(
44 - fontSize: 20,
45 - fontWeight: FontWeight.w800,
46 - color: questionTextColor,
47 - ),
41 + style: Theme.of(context).textTheme.bodyLarge?.copyWith(
42 + fontWeight: FontWeight.w800,
43 + color: questionTextColor,
44 + ),
45 ),
46 TextSpan(
47 text: S.current.seed_position_question_two,
51 - style: TextStyle(
52 - fontSize: 20,
53 - fontWeight: FontWeight.w600,
54 - color: questionTextColor,
55 - ),
48 + style: Theme.of(context).textTheme.bodyLarge?.copyWith(
49 + fontWeight: FontWeight.w600,
50 + color: questionTextColor,
51 + ),
52 ),
53 ],
54 ),
@@ -93,15 +89,15 @@ class SeedVerificationStepView extends StatelessWidget {
89 padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 8),
90 decoration: BoxDecoration(
91 borderRadius: BorderRadius.circular(16),
96 - color: Theme.of(context).cardColor,
92 + color: Theme.of(context).colorScheme.surfaceContainerHighest,
93 ),
94 child: Text(
95 option,
100 - style: TextStyle(
101 - fontSize: 20,
102 - fontWeight: FontWeight.w800,
103 - color: Theme.of(context).extension<CakeTextTheme>()!.buttonTextColor,
104 - ),
96 + style: Theme.of(context).textTheme.bodyLarge?.copyWith(
97 + height: 1.2,
98 + fontWeight: FontWeight.w800,
99 + color: Theme.of(context).colorScheme.onSurfaceVariant,
100 + ),
101 ),
102 ),
103 );
lib/src/screens/seed/seed_verification/seed_verification_success_view.dart
+29 -27
@@ -1,36 +1,38 @@
1 import 'package:cake_wallet/generated/i18n.dart';
2 +import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
3 import 'package:cake_wallet/src/widgets/primary_button.dart';
3 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
4 +import 'package:cake_wallet/themes/core/material_base_theme.dart';
5 import 'package:flutter/material.dart';
6
7 class SeedVerificationSuccessView extends StatelessWidget {
7 - const SeedVerificationSuccessView({required this.imageColor, super.key});
8 + const SeedVerificationSuccessView({required this.currentTheme, super.key});
9
9 - final Color imageColor;
10 + final MaterialThemeBase currentTheme;
11
12 @override
13 Widget build(BuildContext context) {
13 - final image = Image.asset('assets/images/seed_verified.png', color: imageColor);
14 -
14 return Center(
15 child: Column(
16 + crossAxisAlignment: CrossAxisAlignment.center,
17 children: [
18 ConstrainedBox(
19 constraints: BoxConstraints(maxHeight: MediaQuery.of(context).size.height * 0.3),
20 - child: AspectRatio(
21 - aspectRatio: 1.8,
22 - child: image,
23 - ),
20 + child: CakeImageWidget(
21 + height: 200,
22 + imageUrl: currentTheme.isDark
23 + ? 'assets/images/seed_verified_dark.png'
24 + : 'assets/images/seed_verified_light.png',
25 + ),
26 ),
25 - SizedBox(height: 16),
27 + SizedBox(height: 40),
28 Text(
29 S.current.seed_verified,
30 textAlign: TextAlign.center,
29 - style: TextStyle(
30 - fontSize: 20,
31 - fontWeight: FontWeight.w600,
32 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
33 - ),
31 + style: Theme.of(context).textTheme.bodyLarge?.copyWith(
32 + color: Theme.of(context).colorScheme.onSurface,
33 + fontSize: 20,
34 + fontWeight: FontWeight.w600,
35 + ),
36 ),
37 SizedBox(height: 48),
38 RichText(
@@ -38,19 +40,19 @@ class SeedVerificationSuccessView extends StatelessWidget {
40 children: [
41 TextSpan(
42 text: '${S.current.seed_verified_subtext} ',
41 - style: TextStyle(
42 - fontSize: 16,
43 - fontWeight: FontWeight.w400,
44 - color: Theme.of(context).extension<CakeTextTheme>()!.secondaryTextColor,
45 - ),
43 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
44 + fontWeight: FontWeight.w500,
45 + color: Theme.of(context).colorScheme.onSurfaceVariant,
46 + fontSize: 16,
47 + ),
48 ),
49 TextSpan(
50 text: S.current.seed_display_path,
49 - style: TextStyle(
50 - fontSize: 16,
51 - fontWeight: FontWeight.w800,
52 - color: Theme.of(context).extension<CakeTextTheme>()!.secondaryTextColor,
53 - ),
51 + style: Theme.of(context).textTheme.bodyLarge?.copyWith(
52 + color: Theme.of(context).colorScheme.onSurfaceVariant,
53 + fontWeight: FontWeight.w700,
54 + fontSize: 16,
55 + ),
56 ),
57 ],
58 ),
@@ -63,8 +65,8 @@ class SeedVerificationSuccessView extends StatelessWidget {
65 Navigator.of(context).popUntil((route) => route.isFirst);
66 },
67 text: S.current.open_wallet,
66 - color: Theme.of(context).primaryColor,
67 - textColor: Colors.white,
68 + color: Theme.of(context).colorScheme.primary,
69 + textColor: Theme.of(context).colorScheme.onPrimary,
70 ),
71 SizedBox(height: 16),
72 ],
lib/src/screens/seed/wallet_seed_page.dart
+48 -60
@@ -1,12 +1,8 @@
1 import 'package:cake_wallet/routes.dart';
2 import 'package:cake_wallet/src/widgets/seedphrase_grid_widget.dart';
3 import 'package:cake_wallet/src/widgets/warning_box_widget.dart';
4 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
5 -import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
6 -import 'package:cake_wallet/themes/theme_base.dart';
4 import 'package:cake_wallet/utils/clipboard_util.dart';
5 import 'package:cake_wallet/utils/share_util.dart';
9 -import 'package:cake_wallet/utils/responsive_layout_util.dart';
6 import 'package:cake_wallet/utils/show_bar.dart';
7 import 'package:flutter/material.dart';
8 import 'package:flutter/services.dart';
@@ -27,13 +23,6 @@ class WalletSeedPage extends BasePage {
23
24 @override
25 Widget trailing(BuildContext context) {
30 - final copyImage = Image.asset(
31 - 'assets/images/copy_address.png',
32 - color: Theme.of(context)
33 - .extension<CakeTextTheme>()!
34 - .buttonTextColor
35 - );
36 -
26 return isNewWalletCreated
27 ? GestureDetector(
28 key: ValueKey('wallet_seed_page_copy_seeds_button_key'),
@@ -50,9 +39,12 @@ class WalletSeedPage extends BasePage {
39 margin: EdgeInsets.only(left: 10),
40 decoration: BoxDecoration(
41 borderRadius: BorderRadius.all(Radius.circular(8)),
53 - color: Theme.of(context).cardColor,
42 + color: Theme.of(context).colorScheme.surfaceContainerHighest,
43 + ),
44 + child: Image.asset(
45 + 'assets/images/copy_address.png',
46 + color: Theme.of(context).colorScheme.onSurfaceVariant,
47 ),
55 - child: copyImage,
48 ),
49 )
50 : Offstage();
@@ -60,51 +52,52 @@ class WalletSeedPage extends BasePage {
52
53 @override
54 Widget body(BuildContext context) {
63 - return WillPopScope(
64 - onWillPop: () async => false,
55 + return PopScope(
56 + canPop: false,
57 child: Container(
58 alignment: Alignment.center,
67 - child: ConstrainedBox(
68 - constraints:
69 - BoxConstraints(maxWidth: ResponsiveLayoutUtilBase.kDesktopMaxWidthConstraint),
70 - child: Column(
71 - mainAxisAlignment: MainAxisAlignment.spaceBetween,
72 - children: <Widget>[
73 - Observer(
74 - builder: (_) {
75 - return Expanded(
76 - child: Padding(
77 - padding: const EdgeInsets.only(left: 22, right: 22),
59 + child: Column(
60 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
61 + children: <Widget>[
62 + Observer(
63 + builder: (_) {
64 + return Expanded(
65 + child: Padding(
66 + padding: const EdgeInsets.symmetric(horizontal: 16),
67 child: Column(
68 crossAxisAlignment: CrossAxisAlignment.center,
69 children: <Widget>[
70 + SizedBox(height: 16),
71 WarningBox(
82 - content: S.current.cake_seeds_save_disclaimer,
83 - currentTheme: currentTheme),
84 - SizedBox(height: 20),
72 + content: S.current.cake_seeds_save_disclaimer,
73 + currentTheme: currentTheme,
74 + ),
75 + SizedBox(height: 36),
76 Text(
77 key: ValueKey('wallet_seed_page_wallet_name_text_key'),
78 walletSeedViewModel.name,
88 - style: TextStyle(
79 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
80 fontSize: 18,
81 fontWeight: FontWeight.w600,
91 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
82 + color: Theme.of(context).colorScheme.onSurface,
83 ),
84 ),
94 - SizedBox(height: 20),
85 + SizedBox(height: 24),
86 Expanded(
96 - child: SeedPhraseGridWidget(list: walletSeedViewModel.seedSplit),
87 + child: SeedPhraseGridWidget(
88 + list: walletSeedViewModel.seedSplit,
89 + ),
90 ),
91 ],
92 ),
93 ),
101 - );
102 - },
103 - ),
104 - Column(
105 - children: <Widget>[
106 - Padding(
107 - padding: EdgeInsets.symmetric(horizontal: 14, vertical: 8),
94 + );
95 + },
96 + ),
97 + Column(
98 + children: <Widget>[
99 + Padding(
100 + padding: EdgeInsets.symmetric(horizontal: 14, vertical: 8),
101 child: Row(
102 mainAxisSize: MainAxisSize.max,
103 children: <Widget>[
@@ -120,36 +113,31 @@ class WalletSeedPage extends BasePage {
113 );
114 },
115 text: S.of(context).save,
123 - color: Theme.of(context).cardColor,
124 - textColor: currentTheme.type == ThemeType.dark
125 - ? Theme.of(context).extension<DashboardPageTheme>()!.textColor
126 - : Theme.of(context).extension<CakeTextTheme>()!.buttonTextColor,
116 + color: Theme.of(context).colorScheme.surfaceContainer,
117 + textColor: Theme.of(context).colorScheme.onSecondaryContainer,
118 ),
119 ),
120 ),
121 Flexible(
122 child: Container(
123 padding: EdgeInsets.only(left: 8.0, top: 8.0),
133 - child: Builder(
134 - builder: (context) => PrimaryButton(
135 - key: ValueKey('wallet_seed_page_verify_seed_button_key'),
136 - onPressed: () =>
137 - Navigator.pushNamed(context, Routes.walletSeedVerificationPage),
138 - text: S.current.verify_seed,
139 - color: Theme.of(context).primaryColor,
140 - textColor: Colors.white,
141 - ),
124 + child: PrimaryButton(
125 + key: ValueKey('wallet_seed_page_verify_seed_button_key'),
126 + onPressed: () =>
127 + Navigator.pushNamed(context, Routes.walletSeedVerificationPage),
128 + text: S.current.verify_seed,
129 + color: Theme.of(context).colorScheme.primary,
130 + textColor: Theme.of(context).colorScheme.onPrimary,
131 ),
132 ),
144 - )
133 + ),
134 ],
135 ),
147 - ),
148 - SizedBox(height: 12),
149 - ],
150 - )
151 - ],
152 - ),
136 + ),
137 + SizedBox(height: 16),
138 + ],
139 + )
140 + ],
141 ),
142 ),
143 );
lib/src/screens/select_options_page.dart
+32 -36
@@ -3,8 +3,7 @@ import 'package:cake_wallet/src/screens/base_page.dart';
3 import 'package:cake_wallet/src/widgets/primary_button.dart';
4 import 'package:cake_wallet/src/widgets/provider_optoin_tile.dart';
5 import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
6 -import 'package:cake_wallet/themes/extensions/option_tile_theme.dart';
7 -import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart';
6 +import 'package:cake_wallet/themes/core/material_base_theme.dart';
7 import 'package:flutter/material.dart';
8
9 abstract class SelectOptionsPage extends BasePage {
@@ -45,13 +44,15 @@ abstract class SelectOptionsPage extends BasePage {
44 Widget body(BuildContext context) {
45 return ScrollableWithBottomSection(
46 content: BodySelectOptionsPage(
48 - items: items,
49 - onOptionTap: onOptionTap,
50 - tilePadding: tilePadding,
51 - tileBorderRadius: tileBorderRadius,
52 - imageHeight: imageHeight,
53 - imageWidth: imageWidth,
54 - innerPadding: innerPadding),
47 + currentTheme: currentTheme,
48 + items: items,
49 + onOptionTap: onOptionTap,
50 + tilePadding: tilePadding,
51 + tileBorderRadius: tileBorderRadius,
52 + imageHeight: imageHeight,
53 + imageWidth: imageWidth,
54 + innerPadding: innerPadding,
55 + ),
56 bottomSection: Padding(
57 padding: contentPadding ?? EdgeInsets.zero,
58 child: Column(
@@ -59,24 +60,23 @@ abstract class SelectOptionsPage extends BasePage {
60 Text(
61 bottomSectionText,
62 textAlign: TextAlign.center,
62 - style: TextStyle(
63 - fontSize: 14,
64 - fontWeight: FontWeight.normal,
65 - color: Theme.of(context).extension<TransactionTradeTheme>()!.detailsTitlesColor,
66 - ),
63 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
64 + color: Theme.of(context).colorScheme.onSurfaceVariant,
65 + ),
66 ),
67 if (primaryButtonEnabled)
68 LoadingPrimaryButton(
70 - text: primaryButtonText,
71 - onPressed: () {
72 - primaryButtonAction != null
73 - ? primaryButtonAction!(context)
74 - : Navigator.pop(context);
75 - },
76 - color: Theme.of(context).primaryColor,
77 - textColor: Colors.white,
78 - isDisabled: false,
79 - isLoading: false)
69 + text: primaryButtonText,
70 + onPressed: () {
71 + primaryButtonAction != null
72 + ? primaryButtonAction!(context)
73 + : Navigator.pop(context);
74 + },
75 + color: Theme.of(context).colorScheme.primary,
76 + textColor: Theme.of(context).colorScheme.onPrimary,
77 + isDisabled: false,
78 + isLoading: false,
79 + )
80 ],
81 ),
82 ),
@@ -93,6 +93,7 @@ class BodySelectOptionsPage extends StatefulWidget {
93 this.imageHeight,
94 this.imageWidth,
95 this.innerPadding,
96 + required this.currentTheme,
97 });
98
99 final List<SelectableItem> items;
@@ -102,6 +103,7 @@ class BodySelectOptionsPage extends StatefulWidget {
103 final double? imageHeight;
104 final double? imageWidth;
105 final EdgeInsets? innerPadding;
106 + final MaterialThemeBase currentTheme;
107
108 @override
109 _BodySelectOptionsPageState createState() => _BodySelectOptionsPageState();
@@ -130,11 +132,6 @@ class _BodySelectOptionsPageState extends State<BodySelectOptionsPage> {
132
133 @override
134 Widget build(BuildContext context) {
133 - final isLightMode = Theme.of(context).extension<OptionTileTheme>()?.useDarkImage ?? false;
134 -
135 - Color titleColor =
136 - isLightMode ? Theme.of(context).appBarTheme.titleTextStyle!.color! : Colors.white;
137 -
135 return Center(
136 child: ConstrainedBox(
137 constraints: const BoxConstraints(maxWidth: 350),
@@ -148,7 +145,7 @@ class _BodySelectOptionsPageState extends State<BodySelectOptionsPage> {
145 decoration: BoxDecoration(
146 border: Border(
147 bottom: BorderSide(
151 - color: titleColor,
148 + color: Theme.of(context).colorScheme.onSurface,
149 width: 1,
150 ),
151 ),
@@ -157,11 +154,10 @@ class _BodySelectOptionsPageState extends State<BodySelectOptionsPage> {
154 padding: const EdgeInsets.only(bottom: 8.0),
155 child: Text(
156 item.title,
160 - style: TextStyle(
161 - fontSize: 18,
162 - fontWeight: FontWeight.w700,
163 - color: titleColor,
164 - ),
157 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
158 + fontSize: 18,
159 + fontWeight: FontWeight.w700,
160 + ),
161 ),
162 ),
163 ),
@@ -185,7 +181,7 @@ class _BodySelectOptionsPageState extends State<BodySelectOptionsPage> {
181 badges: item.badges,
182 isSelected: item.isOptionSelected,
183 borderRadius: widget.tileBorderRadius,
188 - isLightMode: isLightMode,
184 + isLightMode: widget.currentTheme.isDark,
185 onPressed: () => _handleOptionTap(item),
186 ),
187 );
lib/src/screens/send/send_page.dart
+89 -79
@@ -25,11 +25,6 @@ import 'package:cake_wallet/src/widgets/primary_button.dart';
25 import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
26 import 'package:cake_wallet/src/widgets/template_tile.dart';
27 import 'package:cake_wallet/src/widgets/trail_button.dart';
28 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
29 -import 'package:cake_wallet/themes/extensions/keyboard_theme.dart';
30 -import 'package:cake_wallet/themes/extensions/seed_widget_theme.dart';
31 -import 'package:cake_wallet/themes/extensions/send_page_theme.dart';
32 -import 'package:cake_wallet/themes/theme_base.dart';
28 import 'package:cake_wallet/utils/payment_request.dart';
29 import 'package:cake_wallet/utils/request_review_handler.dart';
30 import 'package:cake_wallet/utils/responsive_layout_util.dart';
@@ -87,11 +82,10 @@ class SendPage extends BasePage {
82 Widget? leading(BuildContext context) {
83 final _backButton = Icon(
84 Icons.arrow_back_ios,
90 - color: titleColor(context),
85 + color: Theme.of(context).colorScheme.primary,
86 size: 16,
87 );
93 - final _closeButton =
94 - currentTheme.type == ThemeType.dark ? closeButtonImageDarkTheme : closeButtonImage;
88 + final _closeButton = currentTheme.isDark ? closeButtonImageDarkTheme : closeButtonImage;
89
90 bool isMobileView = responsiveLayoutUtil.shouldRenderMobileUI;
91
@@ -105,7 +99,7 @@ class SendPage extends BasePage {
99 label: !isMobileView ? S.of(context).close : S.of(context).seed_alert_back,
100 child: TextButton(
101 style: ButtonStyle(
108 - overlayColor: MaterialStateColor.resolveWith((states) => Colors.transparent),
102 + overlayColor: WidgetStateColor.resolveWith((states) => Colors.transparent),
103 ),
104 onPressed: () => onClose(context),
105 child: !isMobileView ? _closeButton : _backButton,
@@ -143,25 +137,29 @@ class SendPage extends BasePage {
137 }
138
139 @override
146 - Widget trailing(context) => Observer(builder: (_) {
147 - return sendViewModel.isBatchSending
148 - ? TrailButton(
149 - caption: S.of(context).remove,
150 - onPressed: () {
151 - var pageToJump = (controller.page?.round() ?? 0) - 1;
152 - pageToJump = pageToJump > 0 ? pageToJump : 0;
153 - final output = _defineCurrentOutput();
154 - sendViewModel.removeOutput(output);
155 - controller.jumpToPage(pageToJump);
156 - })
157 - : TrailButton(
158 - caption: S.of(context).clear,
159 - onPressed: () {
160 - final output = _defineCurrentOutput();
161 - _formKey.currentState?.reset();
162 - output.reset();
163 - });
164 - });
140 + Widget trailing(context) => Observer(
141 + builder: (_) {
142 + return sendViewModel.isBatchSending
143 + ? TrailButton(
144 + caption: S.of(context).remove,
145 + onPressed: () {
146 + var pageToJump = (controller.page?.round() ?? 0) - 1;
147 + pageToJump = pageToJump > 0 ? pageToJump : 0;
148 + final output = _defineCurrentOutput();
149 + sendViewModel.removeOutput(output);
150 + controller.jumpToPage(pageToJump);
151 + },
152 + )
153 + : TrailButton(
154 + caption: S.of(context).clear,
155 + onPressed: () {
156 + final output = _defineCurrentOutput();
157 + _formKey.currentState?.reset();
158 + output.reset();
159 + },
160 + );
161 + },
162 + );
163
164 @override
165 Widget body(BuildContext context) {
@@ -173,26 +171,36 @@ class SendPage extends BasePage {
171 for (var output in sendViewModel.outputs) {
172 var cryptoAmountFocus = FocusNode();
173 var fiatAmountFocus = FocusNode();
176 - sendCards.add(SendCard(
177 - currentTheme: currentTheme,
178 - key: output.key,
179 - output: output,
180 - sendViewModel: sendViewModel,
181 - initialPaymentRequest: initialPaymentRequest,
182 - cryptoAmountFocus: cryptoAmountFocus,
183 - fiatAmountFocus: fiatAmountFocus,
184 - ));
185 - keyboardActions.add(KeyboardActionsItem(
186 - focusNode: cryptoAmountFocus, toolbarButtons: [(_) => KeyboardDoneButton()]));
187 - keyboardActions.add(KeyboardActionsItem(
188 - focusNode: fiatAmountFocus, toolbarButtons: [(_) => KeyboardDoneButton()]));
174 + sendCards.add(
175 + SendCard(
176 + currentTheme: currentTheme,
177 + key: output.key,
178 + output: output,
179 + sendViewModel: sendViewModel,
180 + initialPaymentRequest: initialPaymentRequest,
181 + cryptoAmountFocus: cryptoAmountFocus,
182 + fiatAmountFocus: fiatAmountFocus,
183 + ),
184 + );
185 + keyboardActions.add(
186 + KeyboardActionsItem(
187 + focusNode: cryptoAmountFocus,
188 + toolbarButtons: [(_) => KeyboardDoneButton()],
189 + ),
190 + );
191 + keyboardActions.add(
192 + KeyboardActionsItem(
193 + focusNode: fiatAmountFocus,
194 + toolbarButtons: [(_) => KeyboardDoneButton()],
195 + ),
196 + );
197 }
198 return Stack(
199 children: [
200 KeyboardActions(
201 config: KeyboardActionsConfig(
202 keyboardActionsPlatform: KeyboardActionsPlatform.ALL,
195 - keyboardBarColor: Theme.of(context).extension<KeyboardTheme>()!.keyboardBarColor,
203 + keyboardBarColor: Theme.of(context).colorScheme.surface,
204 nextFocus: false,
205 actions: keyboardActions,
206 ),
@@ -236,17 +244,18 @@ class SendPage extends BasePage {
244 controller: controller,
245 count: count,
246 effect: ScrollingDotsEffect(
239 - spacing: 6.0,
240 - radius: 6.0,
241 - dotWidth: 6.0,
242 - dotHeight: 6.0,
243 - dotColor: Theme.of(context)
244 - .extension<SendPageTheme>()!
245 - .indicatorDotColor,
246 - activeDotColor: Theme.of(context)
247 - .extension<SendPageTheme>()!
248 - .templateBackgroundColor),
249 - ))
247 + spacing: 6.0,
248 + radius: 6.0,
249 + dotWidth: 6.0,
250 + dotHeight: 6.0,
251 + dotColor: Theme.of(context)
252 + .colorScheme
253 + .primary
254 + .withOpacity(0.4),
255 + activeDotColor: Theme.of(context).colorScheme.primary,
256 + ),
257 + ),
258 + )
259 : Offstage();
260 },
261 ),
@@ -367,8 +376,7 @@ class SendPage extends BasePage {
376 onPressed: () => presentCurrencyPicker(context),
377 text: 'Change your asset (${sendViewModel.selectedCryptoCurrency})',
378 color: Colors.transparent,
370 - textColor:
371 - Theme.of(context).extension<SeedWidgetTheme>()!.hintTextColor,
379 + textColor: Theme.of(context).colorScheme.onSurfaceVariant,
380 ),
381 ),
382 ),
@@ -385,12 +393,9 @@ class SendPage extends BasePage {
393 },
394 text: S.of(context).add_receiver,
395 color: Colors.transparent,
388 - textColor:
389 - Theme.of(context).extension<SeedWidgetTheme>()!.hintTextColor,
396 + textColor: Theme.of(context).colorScheme.onSurfaceVariant,
397 isDottedBorder: true,
391 - borderColor: Theme.of(context)
392 - .extension<SendPageTheme>()!
393 - .templateDottedBorderColor,
398 + borderColor: Theme.of(context).colorScheme.outline,
399 )),
400 Observer(
401 builder: (_) {
@@ -463,9 +468,11 @@ class SendPage extends BasePage {
468 },
469 );
470 },
466 - text: sendViewModel.payjoinUri != null ? S.of(context).send_payjoin : S.of(context).send,
467 - color: Theme.of(context).primaryColor,
468 - textColor: Colors.white,
471 + text: sendViewModel.payjoinUri != null
472 + ? S.of(context).send_payjoin
473 + : S.of(context).send,
474 + color: Theme.of(context).colorScheme.primary,
475 + textColor: Theme.of(context).colorScheme.onPrimary,
476 isLoading: sendViewModel.state is IsExecutingState ||
477 sendViewModel.state is TransactionCommitting ||
478 sendViewModel.state is IsAwaitingDeviceResponseState ||
@@ -507,19 +514,23 @@ class SendPage extends BasePage {
514 }
515
516 if (state is FailureState) {
510 - WidgetsBinding.instance.addPostFrameCallback((_) {
511 - showPopUp<void>(
517 + WidgetsBinding.instance.addPostFrameCallback(
518 + (_) {
519 + showPopUp<void>(
520 context: context,
521 builder: (BuildContext context) {
522 return AlertWithOneAction(
515 - key: ValueKey('send_page_send_failure_dialog_key'),
516 - buttonKey: ValueKey('send_page_send_failure_dialog_button_key'),
517 - alertTitle: S.of(context).error,
518 - alertContent: state.error,
519 - buttonText: S.of(context).ok,
520 - buttonAction: () => Navigator.of(context).pop());
521 - });
522 - });
523 + key: ValueKey('send_page_send_failure_dialog_key'),
524 + buttonKey: ValueKey('send_page_send_failure_dialog_button_key'),
525 + alertTitle: S.of(context).error,
526 + alertContent: state.error,
527 + buttonText: S.of(context).ok,
528 + buttonAction: () => Navigator.of(context).pop(),
529 + );
530 + },
531 + );
532 + },
533 + );
534 }
535
536 if (state is IsExecutingState) {
@@ -604,15 +615,14 @@ class SendPage extends BasePage {
615 context: context,
616 isDismissible: false,
617 builder: (BuildContext bottomSheetContext) {
607 - return showContactSheet &&
608 - sendViewModel.ocpRequest == null
618 + return showContactSheet && sendViewModel.ocpRequest == null
619 ? InfoBottomSheet(
620 currentTheme: currentTheme,
621 showDontAskMeCheckbox: true,
622 onCheckboxChanged: (value) => sendViewModel.setShowAddressBookPopup(!value),
623 titleText: S.of(bottomSheetContext).transaction_sent,
614 - contentImage: 'assets/images/contact_icon.svg',
615 - contentImageColor: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
624 + contentImage: 'assets/images/contact.png',
625 + contentImageColor: Theme.of(context).colorScheme.onSurface,
626 content: S.of(bottomSheetContext).add_contact_to_address_book,
627 isTwoAction: true,
628 leftButtonText: 'No',
@@ -639,7 +649,7 @@ class SendPage extends BasePage {
649 : InfoBottomSheet(
650 currentTheme: currentTheme,
651 titleText: S.of(bottomSheetContext).transaction_sent,
642 - contentImage: 'assets/images/birthday_cake.svg',
652 + contentImage: 'assets/images/birthday_cake.png',
653 actionButtonText: S.of(bottomSheetContext).close,
654 actionButtonKey: ValueKey('send_page_sent_dialog_ok_button_key'),
655 actionButton: () {
@@ -685,7 +695,7 @@ class SendPage extends BasePage {
695 currentTheme: currentTheme,
696 titleText: S.of(bottomSheetContext).proceed_on_device,
697 contentImage: 'assets/images/hardware_wallet/ledger_nano_x.png',
688 - contentImageColor: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
698 + contentImageColor: Theme.of(context).colorScheme.onSurface,
699 content: S.of(bottomSheetContext).proceed_on_device_description,
700 isTwoAction: false,
701 actionButtonText: S.of(context).cancel,
lib/src/screens/send/send_template_page.dart
+136 -123
@@ -1,5 +1,3 @@
1 -import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
2 -import 'package:cake_wallet/themes/extensions/seed_widget_theme.dart';
1 import 'package:cake_wallet/src/widgets/trail_button.dart';
2 import 'package:cake_wallet/view_model/send/template_view_model.dart';
3 import 'package:flutter_mobx/flutter_mobx.dart';
@@ -9,7 +7,6 @@ import 'package:cake_wallet/generated/i18n.dart';
7 import 'package:cake_wallet/view_model/send/send_template_view_model.dart';
8 import 'package:cake_wallet/src/widgets/primary_button.dart';
9 import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
12 -import 'package:cake_wallet/themes/extensions/send_page_theme.dart';
10 import 'package:cake_wallet/src/screens/send/widgets/send_template_card.dart';
11 import 'package:smooth_page_indicator/smooth_page_indicator.dart';
12
@@ -34,136 +31,152 @@ class SendTemplatePage extends BasePage {
31
32 @override
33 Function(BuildContext)? get pushToNextWidget => (context) {
37 - FocusScopeNode currentFocus = FocusScope.of(context);
38 - if (!currentFocus.hasPrimaryFocus) {
39 - currentFocus.focusedChild?.unfocus();
40 - }
41 - };
34 + FocusScopeNode currentFocus = FocusScope.of(context);
35 + if (!currentFocus.hasPrimaryFocus) {
36 + currentFocus.focusedChild?.unfocus();
37 + }
38 + };
39
40 @override
44 - Widget trailing(context) => Observer(builder: (_) {
45 - return sendTemplateViewModel.recipients.length > 1
46 - ? TrailButton(
47 - caption: S.of(context).remove,
48 - onPressed: () {
49 - int pageToJump = (controller.page?.round() ?? 0) - 1;
50 - pageToJump = pageToJump > 0 ? pageToJump : 0;
51 - final recipient = _defineCurrentRecipient();
52 - sendTemplateViewModel.removeRecipient(recipient);
53 - controller.jumpToPage(pageToJump);
54 - })
55 - : TrailButton(
56 - caption: S.of(context).clear,
57 - onPressed: () {
58 - final recipient = _defineCurrentRecipient();
59 - _formKey.currentState?.reset();
60 - recipient.reset();
61 - });
62 - });
41 + Widget trailing(context) => Observer(
42 + builder: (_) {
43 + return sendTemplateViewModel.recipients.length > 1
44 + ? TrailButton(
45 + caption: S.of(context).remove,
46 + onPressed: () {
47 + int pageToJump = (controller.page?.round() ?? 0) - 1;
48 + pageToJump = pageToJump > 0 ? pageToJump : 0;
49 + final recipient = _defineCurrentRecipient();
50 + sendTemplateViewModel.removeRecipient(recipient);
51 + controller.jumpToPage(pageToJump);
52 + },
53 + )
54 + : TrailButton(
55 + caption: S.of(context).clear,
56 + onPressed: () {
57 + final recipient = _defineCurrentRecipient();
58 + _formKey.currentState?.reset();
59 + recipient.reset();
60 + },
61 + );
62 + },
63 + );
64
65 @override
66 Widget body(BuildContext context) {
67 return Form(
67 - key: _formKey,
68 - child: ScrollableWithBottomSection(
69 - contentPadding: EdgeInsets.only(bottom: 24),
70 - content: FocusTraversalGroup(
71 - policy: OrderedTraversalPolicy(),
72 - child: Column(children: [
73 - Container(
74 - height: 460,
75 - child: Observer(builder: (_) {
76 - return PageView.builder(
77 - scrollDirection: Axis.horizontal,
78 - controller: controller,
79 - itemCount: sendTemplateViewModel.recipients.length,
80 - itemBuilder: (_, index) {
81 - final template = sendTemplateViewModel.recipients[index];
82 - return SendTemplateCard(
83 - template: template,
84 - index: index,
85 - sendTemplateViewModel: sendTemplateViewModel);
86 - });
87 - })),
88 - Padding(
89 - padding: EdgeInsets.only(top: 10, left: 24, right: 24, bottom: 10),
90 - child: Container(
91 - height: 10,
92 - child: Observer(
93 - builder: (_) {
94 - final count = sendTemplateViewModel.recipients.length;
68 + key: _formKey,
69 + child: ScrollableWithBottomSection(
70 + contentPadding: EdgeInsets.only(bottom: 24),
71 + content: FocusTraversalGroup(
72 + policy: OrderedTraversalPolicy(),
73 + child: Column(
74 + children: [
75 + Container(
76 + height: 460,
77 + child: Observer(
78 + builder: (_) {
79 + return PageView.builder(
80 + scrollDirection: Axis.horizontal,
81 + controller: controller,
82 + itemCount: sendTemplateViewModel.recipients.length,
83 + itemBuilder: (_, index) {
84 + final template = sendTemplateViewModel.recipients[index];
85 + return SendTemplateCard(
86 + template: template,
87 + index: index,
88 + sendTemplateViewModel: sendTemplateViewModel,
89 + );
90 + },
91 + );
92 + },
93 + ),
94 + ),
95 + Padding(
96 + padding: EdgeInsets.only(top: 10, left: 24, right: 24, bottom: 10),
97 + child: Container(
98 + height: 10,
99 + child: Observer(
100 + builder: (_) {
101 + final count = sendTemplateViewModel.recipients.length;
102
96 - return count > 1
97 - ? Semantics(
98 - button: false,
99 - label: 'Page Indicator',
100 - hint: 'Swipe to change receiver',
101 - excludeSemantics: true,
102 - child: SmoothPageIndicator(
103 - controller: controller,
104 - count: count,
105 - effect: ScrollingDotsEffect(
106 - spacing: 6.0,
107 - radius: 6.0,
108 - dotWidth: 6.0,
109 - dotHeight: 6.0,
110 - dotColor: Theme.of(context)
111 - .extension<SendPageTheme>()!
112 - .indicatorDotColor,
113 - activeDotColor: Theme.of(context)
114 - .extension<DashboardPageTheme>()!
115 - .indicatorDotTheme
116 - .activeIndicatorColor)),
117 - )
118 - : Offstage();
119 - },
120 - ),
121 - ),
103 + return count > 1
104 + ? Semantics(
105 + button: false,
106 + label: 'Page Indicator',
107 + hint: 'Swipe to change receiver',
108 + excludeSemantics: true,
109 + child: SmoothPageIndicator(
110 + controller: controller,
111 + count: count,
112 + effect: ScrollingDotsEffect(
113 + spacing: 6.0,
114 + radius: 6.0,
115 + dotWidth: 6.0,
116 + dotHeight: 6.0,
117 + dotColor: Theme.of(context).colorScheme.outlineVariant,
118 + activeDotColor: Theme.of(context).colorScheme.primary,
119 + ),
120 + ),
121 + )
122 + : Offstage();
123 + },
124 ),
123 - ])),
124 - bottomSectionPadding: EdgeInsets.only(left: 24, right: 24, bottom: 24),
125 - bottomSection: Column(children: [
126 - if (sendTemplateViewModel.hasMultiRecipient)
127 - Padding(
128 - padding: EdgeInsets.only(bottom: 12),
129 - child: PrimaryButton(
130 - onPressed: () {
131 - sendTemplateViewModel.addRecipient();
132 - Future.delayed(const Duration(milliseconds: 250), () {
133 - controller.jumpToPage(sendTemplateViewModel.recipients.length - 1);
134 - });
135 - },
136 - text: S.of(context).add_receiver,
137 - color: Colors.transparent,
138 - textColor: Theme.of(context).extension<SeedWidgetTheme>()!.hintTextColor,
139 - isDottedBorder: true,
140 - borderColor:
141 - Theme.of(context).extension<SendPageTheme>()!.templateBackgroundColor)),
142 - PrimaryButton(
125 + ),
126 + ),
127 + ],
128 + ),
129 + ),
130 + bottomSectionPadding: EdgeInsets.only(left: 24, right: 24, bottom: 24),
131 + bottomSection: Column(
132 + children: [
133 + if (sendTemplateViewModel.hasMultiRecipient)
134 + Padding(
135 + padding: EdgeInsets.only(bottom: 12),
136 + child: PrimaryButton(
137 onPressed: () {
144 - if (_formKey.currentState != null && _formKey.currentState!.validate()) {
145 - final mainTemplate = sendTemplateViewModel.recipients[0];
146 - final additionalRecipients = sendTemplateViewModel.recipients
147 - .map((element) => element.toTemplate(
148 - cryptoCurrency: element.selectedCurrency.title,
149 - fiatCurrency: sendTemplateViewModel.fiatCurrency))
150 - .toList();
151 -
152 - sendTemplateViewModel.addTemplate(
153 - isCurrencySelected: mainTemplate.isCryptoSelected,
154 - name: mainTemplate.name,
155 - address: mainTemplate.address,
156 - cryptoCurrency: mainTemplate.selectedCurrency.title,
157 - amount: mainTemplate.output.cryptoAmount,
158 - amountFiat: mainTemplate.output.fiatAmount,
159 - additionalRecipients: additionalRecipients);
160 - Navigator.of(context).pop();
161 - }
138 + sendTemplateViewModel.addRecipient();
139 + Future.delayed(const Duration(milliseconds: 250), () {
140 + controller.jumpToPage(sendTemplateViewModel.recipients.length - 1);
141 + });
142 },
163 - text: S.of(context).save,
164 - color: Theme.of(context).primaryColor,
165 - textColor: Colors.white)
166 - ])));
143 + text: S.of(context).add_receiver,
144 + color: Colors.transparent,
145 + textColor: Theme.of(context).colorScheme.onSurfaceVariant,
146 + isDottedBorder: true,
147 + borderColor: Theme.of(context).colorScheme.surfaceContainerHighest,
148 + ),
149 + ),
150 + PrimaryButton(
151 + onPressed: () {
152 + if (_formKey.currentState != null && _formKey.currentState!.validate()) {
153 + final mainTemplate = sendTemplateViewModel.recipients[0];
154 + final additionalRecipients = sendTemplateViewModel.recipients
155 + .map((element) => element.toTemplate(
156 + cryptoCurrency: element.selectedCurrency.title,
157 + fiatCurrency: sendTemplateViewModel.fiatCurrency))
158 + .toList();
159 +
160 + sendTemplateViewModel.addTemplate(
161 + isCurrencySelected: mainTemplate.isCryptoSelected,
162 + name: mainTemplate.name,
163 + address: mainTemplate.address,
164 + cryptoCurrency: mainTemplate.selectedCurrency.title,
165 + amount: mainTemplate.output.cryptoAmount,
166 + amountFiat: mainTemplate.output.fiatAmount,
167 + additionalRecipients: additionalRecipients,
168 + );
169 + Navigator.of(context).pop();
170 + }
171 + },
172 + text: S.of(context).save,
173 + color: Theme.of(context).colorScheme.primary,
174 + textColor: Theme.of(context).colorScheme.onPrimary,
175 + )
176 + ],
177 + ),
178 + ),
179 + );
180 }
181
182 TemplateViewModel _defineCurrentRecipient() {
lib/src/screens/send/widgets/choose_yat_address_alert.dart
+53 -54
@@ -1,4 +1,3 @@
1 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
1 import 'package:cake_wallet/src/widgets/cake_scrollbar.dart';
2 import 'package:cake_wallet/src/widgets/section_divider.dart';
3 import 'package:flutter/material.dart';
@@ -25,8 +24,7 @@ class ChooseYatAddressAlert extends BaseAlertDialog {
24 bool get barrierDismissible => false;
25
26 @override
28 - Widget actionButtons(BuildContext context) =>
29 - ChooseYatAddressButtons(addresses);
27 + Widget actionButtons(BuildContext context) => ChooseYatAddressButtons(addresses);
28 }
29
30 class ChooseYatAddressButtons extends StatefulWidget {
@@ -35,13 +33,11 @@ class ChooseYatAddressButtons extends StatefulWidget {
33 final List<String> addresses;
34
35 @override
38 - ChooseYatAddressButtonsState createState() =>
39 - ChooseYatAddressButtonsState(addresses);
36 + ChooseYatAddressButtonsState createState() => ChooseYatAddressButtonsState(addresses);
37 }
38
39 class ChooseYatAddressButtonsState extends State<ChooseYatAddressButtons> {
43 - ChooseYatAddressButtonsState(this.addresses)
44 - : itemCount = addresses?.length ?? 0;
40 + ChooseYatAddressButtonsState(this.addresses) : itemCount = addresses?.length ?? 0;
41
42 final List<String> addresses;
43 final int itemCount;
@@ -54,8 +50,9 @@ class ChooseYatAddressButtonsState extends State<ChooseYatAddressButtons> {
50 Widget build(BuildContext context) {
51 controller.addListener(() {
52 fromTop = controller.hasClients
57 - ? (controller.offset / controller.position.maxScrollExtent *
58 - (backgroundHeight - thumbHeight))
53 + ? (controller.offset /
54 + controller.position.maxScrollExtent *
55 + (backgroundHeight - thumbHeight))
56 : 0;
57 setState(() {});
58 });
@@ -65,54 +62,56 @@ class ChooseYatAddressButtonsState extends State<ChooseYatAddressButtons> {
62 clipBehavior: Clip.none,
63 children: [
64 Container(
68 - width: 300,
69 - height: 158,
70 - color: Theme.of(context).dialogBackgroundColor,
71 - child: ListView.separated(
72 - controller: controller,
73 - padding: EdgeInsets.all(0),
74 - itemCount: itemCount,
75 - separatorBuilder: (_, __) => const HorizontalSectionDivider(),
76 - itemBuilder: (context, index) {
77 - final address = addresses[index];
65 + width: 300,
66 + height: 158,
67 + color: Theme.of(context).colorScheme.surface,
68 + child: ListView.separated(
69 + controller: controller,
70 + padding: EdgeInsets.all(0),
71 + itemCount: itemCount,
72 + separatorBuilder: (_, __) => const HorizontalSectionDivider(),
73 + itemBuilder: (context, index) {
74 + final address = addresses[index];
75
79 - return GestureDetector(
80 - onTap: () => Navigator.of(context).pop<String>(address),
81 - child: Container(
82 - width: 300,
83 - height: 52,
84 - padding: EdgeInsets.only(left: 24, right: 24),
85 - child: Row(
86 - mainAxisAlignment: MainAxisAlignment.center,
87 - crossAxisAlignment: CrossAxisAlignment.center,
88 - children: [
89 - Expanded(
90 - child: Text(
91 - address,
92 - textAlign: TextAlign.center,
93 - maxLines: 1,
94 - overflow: TextOverflow.ellipsis,
95 - style: TextStyle(
96 - fontSize: 15,
97 - fontWeight: FontWeight.w600,
98 - fontFamily: 'Lato',
99 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
100 - decoration: TextDecoration.none,
101 - ),
102 - )
103 - )
104 - ],
105 - )
106 - ),
107 - );
108 - })
76 + return GestureDetector(
77 + onTap: () => Navigator.of(context).pop<String>(address),
78 + child: Container(
79 + width: 300,
80 + height: 52,
81 + padding: EdgeInsets.only(left: 24, right: 24),
82 + child: Row(
83 + mainAxisAlignment: MainAxisAlignment.center,
84 + crossAxisAlignment: CrossAxisAlignment.center,
85 + children: [
86 + Expanded(
87 + child: Text(
88 + address,
89 + textAlign: TextAlign.center,
90 + maxLines: 1,
91 + overflow: TextOverflow.ellipsis,
92 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
93 + fontSize: 15,
94 + fontWeight: FontWeight.w600,
95 +
96 + color: Theme.of(context).colorScheme.onSurfaceVariant,
97 + decoration: TextDecoration.none,
98 + ),
99 + ),
100 + )
101 + ],
102 + ),
103 + ),
104 + );
105 + },
106 + ),
107 ),
110 - if (itemCount > 3) CakeScrollbar(
108 + if (itemCount > 3)
109 + CakeScrollbar(
110 backgroundHeight: backgroundHeight,
111 thumbHeight: thumbHeight,
113 - fromTop: fromTop
114 - )
115 - ]
112 + fromTop: fromTop,
113 + )
114 + ],
115 );
116 }
118 -}
\ No newline at end of file
117 +}
lib/src/screens/send/widgets/confirm_sending_alert.dart deleted
-595
@@ -1,595 +0,0 @@
1 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
2 -import 'package:cake_wallet/palette.dart';
3 -import 'package:cake_wallet/view_model/send/output.dart';
4 -import 'package:cw_core/pending_transaction.dart';
5 -import 'package:flutter/material.dart';
6 -import 'package:cake_wallet/src/widgets/base_alert_dialog.dart';
7 -import 'package:cake_wallet/generated/i18n.dart';
8 -import 'package:cake_wallet/src/widgets/cake_scrollbar.dart';
9 -import 'package:flutter/scheduler.dart';
10 -
11 -class ConfirmSendingAlert extends BaseAlertDialog {
12 - ConfirmSendingAlert({
13 - required this.alertTitle,
14 - this.paymentId,
15 - this.paymentIdValue,
16 - this.expirationTime,
17 - required this.amount,
18 - required this.amountValue,
19 - required this.fiatAmountValue,
20 - required this.fee,
21 - this.feeRate,
22 - required this.feeValue,
23 - required this.feeFiatAmount,
24 - required this.outputs,
25 - this.change,
26 - required this.leftButtonText,
27 - required this.rightButtonText,
28 - required this.actionLeftButton,
29 - required this.actionRightButton,
30 - this.alertBarrierDismissible = true,
31 - this.alertLeftActionButtonTextColor,
32 - this.alertRightActionButtonTextColor,
33 - this.alertLeftActionButtonColor,
34 - this.alertRightActionButtonColor,
35 - this.onDispose,
36 - this.alertLeftActionButtonKey,
37 - this.alertRightActionButtonKey,
38 - Key? key,
39 - });
40 -
41 - final String alertTitle;
42 - final String? paymentId;
43 - final String? paymentIdValue;
44 - final String? expirationTime;
45 - final String amount;
46 - final String amountValue;
47 - final String fiatAmountValue;
48 - final String fee;
49 - final String? feeRate;
50 - final String feeValue;
51 - final String feeFiatAmount;
52 - final List<Output> outputs;
53 - final PendingChange? change;
54 - final String leftButtonText;
55 - final String rightButtonText;
56 - final VoidCallback actionLeftButton;
57 - final VoidCallback actionRightButton;
58 - final bool alertBarrierDismissible;
59 - final Color? alertLeftActionButtonTextColor;
60 - final Color? alertRightActionButtonTextColor;
61 - final Color? alertLeftActionButtonColor;
62 - final Color? alertRightActionButtonColor;
63 - final Function? onDispose;
64 - final Key? alertRightActionButtonKey;
65 - final Key? alertLeftActionButtonKey;
66 -
67 - @override
68 - String get titleText => alertTitle;
69 -
70 - @override
71 - bool get isDividerExists => true;
72 -
73 - @override
74 - String get leftActionButtonText => leftButtonText;
75 -
76 - @override
77 - String get rightActionButtonText => rightButtonText;
78 -
79 - @override
80 - VoidCallback get actionLeft => actionLeftButton;
81 -
82 - @override
83 - VoidCallback get actionRight => actionRightButton;
84 -
85 - @override
86 - bool get barrierDismissible => alertBarrierDismissible;
87 -
88 - @override
89 - Color? get leftActionButtonTextColor => alertLeftActionButtonTextColor;
90 -
91 - @override
92 - Color? get rightActionButtonTextColor => alertRightActionButtonTextColor;
93 -
94 - @override
95 - Color? get leftActionButtonColor => alertLeftActionButtonColor;
96 -
97 - @override
98 - Color? get rightActionButtonColor => alertRightActionButtonColor;
99 -
100 - @override
101 - Key? get leftActionButtonKey => alertLeftActionButtonKey;
102 -
103 - @override
104 - Key? get rightActionButtonKey => alertLeftActionButtonKey;
105 -
106 - @override
107 - Widget content(BuildContext context) => ConfirmSendingAlertContent(
108 - paymentId: paymentId,
109 - paymentIdValue: paymentIdValue,
110 - expirationTime: expirationTime,
111 - amount: amount,
112 - amountValue: amountValue,
113 - fiatAmountValue: fiatAmountValue,
114 - fee: fee,
115 - feeRate: feeRate,
116 - feeValue: feeValue,
117 - feeFiatAmount: feeFiatAmount,
118 - outputs: outputs,
119 - change: change,
120 - onDispose: onDispose);
121 -}
122 -
123 -class ConfirmSendingAlertContent extends StatefulWidget {
124 - ConfirmSendingAlertContent(
125 - {this.paymentId,
126 - this.paymentIdValue,
127 - this.expirationTime,
128 - required this.amount,
129 - required this.amountValue,
130 - required this.fiatAmountValue,
131 - required this.fee,
132 - this.feeRate,
133 - required this.feeValue,
134 - required this.feeFiatAmount,
135 - required this.outputs,
136 - this.change,
137 - required this.onDispose}) {}
138 -
139 - final String? paymentId;
140 - final String? paymentIdValue;
141 - final String? expirationTime;
142 - final String amount;
143 - final String amountValue;
144 - final String fiatAmountValue;
145 - final String fee;
146 - final String? feeRate;
147 - final String feeValue;
148 - final String feeFiatAmount;
149 - final List<Output> outputs;
150 - final PendingChange? change;
151 - final Function? onDispose;
152 -
153 - @override
154 - ConfirmSendingAlertContentState createState() => ConfirmSendingAlertContentState(
155 - paymentId: paymentId,
156 - paymentIdValue: paymentIdValue,
157 - expirationTime: expirationTime,
158 - amount: amount,
159 - amountValue: amountValue,
160 - fiatAmountValue: fiatAmountValue,
161 - fee: fee,
162 - feeRate: feeRate,
163 - feeValue: feeValue,
164 - feeFiatAmount: feeFiatAmount,
165 - outputs: outputs,
166 - change: change,
167 - onDispose: onDispose);
168 -}
169 -
170 -class ConfirmSendingAlertContentState extends State<ConfirmSendingAlertContent> {
171 - ConfirmSendingAlertContentState(
172 - {this.paymentId,
173 - this.paymentIdValue,
174 - this.expirationTime,
175 - required this.amount,
176 - required this.amountValue,
177 - required this.fiatAmountValue,
178 - required this.fee,
179 - this.feeRate,
180 - required this.feeValue,
181 - required this.feeFiatAmount,
182 - required this.outputs,
183 - this.change,
184 - this.onDispose})
185 - : recipientTitle = '' {
186 - recipientTitle = outputs.length > 1
187 - ? S.current.transaction_details_recipient_address
188 - : S.current.recipient_address;
189 - }
190 -
191 - final String? paymentId;
192 - final String? paymentIdValue;
193 - final String? expirationTime;
194 - final String amount;
195 - final String amountValue;
196 - final String fiatAmountValue;
197 - final String fee;
198 - final String? feeRate;
199 - final String feeValue;
200 - final String feeFiatAmount;
201 - final List<Output> outputs;
202 - final PendingChange? change;
203 - final Function? onDispose;
204 -
205 - final double backgroundHeight = 160;
206 - final double thumbHeight = 72;
207 - ScrollController controller = ScrollController();
208 - double fromTop = 0;
209 - String recipientTitle;
210 - bool showScrollbar = false;
211 -
212 - @override
213 - void dispose() {
214 - if (onDispose != null) onDispose!();
215 - super.dispose();
216 - }
217 -
218 - @override
219 - Widget build(BuildContext context) {
220 - controller.addListener(() {
221 - fromTop = controller.hasClients
222 - ? (controller.offset /
223 - controller.position.maxScrollExtent *
224 - (backgroundHeight - thumbHeight))
225 - : 0;
226 - setState(() {});
227 - });
228 -
229 - SchedulerBinding.instance.addPostFrameCallback((_) {
230 - setState(() {
231 - showScrollbar = controller.position.maxScrollExtent > 0;
232 - });
233 - });
234 -
235 - return Stack(alignment: Alignment.center, clipBehavior: Clip.none, children: [
236 - Container(
237 - height: feeRate != null ? 250 : 200,
238 - child: SingleChildScrollView(
239 - controller: controller,
240 - child: Column(
241 - children: <Widget>[
242 - if (paymentIdValue != null && paymentId != null)
243 - Padding(
244 - padding: EdgeInsets.only(bottom: 32),
245 - child: Row(
246 - mainAxisSize: MainAxisSize.max,
247 - mainAxisAlignment: MainAxisAlignment.spaceBetween,
248 - crossAxisAlignment: CrossAxisAlignment.start,
249 - children: <Widget>[
250 - Text(
251 - paymentId!,
252 - style: TextStyle(
253 - fontSize: 16,
254 - fontWeight: FontWeight.normal,
255 - fontFamily: 'Lato',
256 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
257 - decoration: TextDecoration.none,
258 - ),
259 - ),
260 - Column(
261 - crossAxisAlignment: CrossAxisAlignment.end,
262 - children: [
263 - Container(
264 - width: 160,
265 - child: Text(
266 - paymentIdValue!,
267 - textAlign: TextAlign.right,
268 - style: TextStyle(
269 - fontSize: 16,
270 - fontWeight: FontWeight.w600,
271 - fontFamily: 'Lato',
272 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
273 - decoration: TextDecoration.none,
274 - ),
275 - ),
276 - ),
277 - ],
278 - )
279 - ],
280 - ),
281 - ),
282 - if (widget.expirationTime != null)
283 - ExpirationTimeWidget(expirationTime: widget.expirationTime!),
284 - Row(
285 - mainAxisSize: MainAxisSize.max,
286 - mainAxisAlignment: MainAxisAlignment.spaceBetween,
287 - crossAxisAlignment: CrossAxisAlignment.start,
288 - children: <Widget>[
289 - Text(
290 - amount,
291 - style: TextStyle(
292 - fontSize: 16,
293 - fontWeight: FontWeight.normal,
294 - fontFamily: 'Lato',
295 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
296 - decoration: TextDecoration.none,
297 - ),
298 - ),
299 - Column(
300 - crossAxisAlignment: CrossAxisAlignment.end,
301 - children: [
302 - Text(
303 - key: ValueKey('confirm_sending_dialog_amount_text_value_key'),
304 - amountValue,
305 - style: TextStyle(
306 - fontSize: 18,
307 - fontWeight: FontWeight.w600,
308 - fontFamily: 'Lato',
309 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
310 - decoration: TextDecoration.none,
311 - ),
312 - ),
313 - Text(
314 - fiatAmountValue,
315 - style: TextStyle(
316 - fontSize: 12,
317 - fontWeight: FontWeight.w600,
318 - fontFamily: 'Lato',
319 - color: PaletteDark.pigeonBlue,
320 - decoration: TextDecoration.none,
321 - ),
322 - )
323 - ],
324 - )
325 - ],
326 - ),
327 - if (feeValue.isNotEmpty && feeValue != "0")
328 - Padding(
329 - padding: EdgeInsets.only(top: 16),
330 - child: Row(
331 - mainAxisSize: MainAxisSize.max,
332 - mainAxisAlignment: MainAxisAlignment.spaceBetween,
333 - crossAxisAlignment: CrossAxisAlignment.start,
334 - children: <Widget>[
335 - Text(
336 - fee,
337 - style: TextStyle(
338 - fontSize: 16,
339 - fontWeight: FontWeight.normal,
340 - fontFamily: 'Lato',
341 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
342 - decoration: TextDecoration.none,
343 - ),
344 - ),
345 - Column(
346 - crossAxisAlignment: CrossAxisAlignment.end,
347 - children: [
348 - Text(
349 - feeValue,
350 - style: TextStyle(
351 - fontSize: 18,
352 - fontWeight: FontWeight.w600,
353 - fontFamily: 'Lato',
354 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
355 - decoration: TextDecoration.none,
356 - ),
357 - ),
358 - Text(
359 - feeFiatAmount,
360 - style: TextStyle(
361 - fontSize: 12,
362 - fontWeight: FontWeight.w600,
363 - fontFamily: 'Lato',
364 - color: PaletteDark.pigeonBlue,
365 - decoration: TextDecoration.none,
366 - ),
367 - )
368 - ],
369 - )
370 - ],
371 - )),
372 - if (feeRate != null && feeRate!.isNotEmpty)
373 - Padding(
374 - padding: EdgeInsets.only(top: 16),
375 - child: Row(
376 - mainAxisSize: MainAxisSize.max,
377 - mainAxisAlignment: MainAxisAlignment.spaceBetween,
378 - crossAxisAlignment: CrossAxisAlignment.start,
379 - children: <Widget>[
380 - Text(
381 - S.current.send_estimated_fee,
382 - style: TextStyle(
383 - fontSize: 16,
384 - fontWeight: FontWeight.normal,
385 - fontFamily: 'Lato',
386 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
387 - decoration: TextDecoration.none,
388 - ),
389 - ),
390 - Text(
391 - "$feeRate sat/byte",
392 - style: TextStyle(
393 - fontSize: 18,
394 - fontWeight: FontWeight.w600,
395 - fontFamily: 'Lato',
396 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
397 - decoration: TextDecoration.none,
398 - ),
399 - )
400 - ],
401 - )),
402 - Padding(
403 - padding: EdgeInsets.only(top: 16),
404 - child: Column(
405 - children: [
406 - Text(
407 - '$recipientTitle:',
408 - style: TextStyle(
409 - fontSize: 16,
410 - fontWeight: FontWeight.normal,
411 - fontFamily: 'Lato',
412 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
413 - decoration: TextDecoration.none,
414 - ),
415 - ),
416 - ListView.builder(
417 - padding: EdgeInsets.only(top: 0),
418 - shrinkWrap: true,
419 - physics: NeverScrollableScrollPhysics(),
420 - itemCount: outputs.length,
421 - itemBuilder: (context, index) {
422 - final item = outputs[index];
423 - final _address =
424 - item.isParsedAddress ? item.extractedAddress : item.address;
425 - final _amount = item.cryptoAmount.replaceAll(',', '.');
426 -
427 - return Column(
428 - children: [
429 - if (item.isParsedAddress)
430 - AddressText(text: item.parsedAddress.name),
431 - AddressText(text: _address, fontSize: 10),
432 - if (stealthAddressText(item.stealthAddress) != null)
433 - AddressText(
434 - text: stealthAddressText(item.stealthAddress)!, fontSize: 10),
435 - AmountText(text: _amount),
436 - ],
437 - );
438 - },
439 - )
440 - ],
441 - ),
442 - ),
443 - if (change != null)
444 - Padding(
445 - padding: EdgeInsets.only(top: 16),
446 - child: Column(
447 - children: [
448 - Text(
449 - S.of(context).send_change_to_you,
450 - style: TextStyle(
451 - fontSize: 16,
452 - fontWeight: FontWeight.normal,
453 - fontFamily: 'Lato',
454 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
455 - decoration: TextDecoration.none,
456 - ),
457 - ),
458 - Column(
459 - children: [
460 - AddressText(text: change!.address, fontSize: 10),
461 - AmountText(text: change!.amount),
462 - ],
463 - )
464 - ],
465 - ),
466 - )
467 - ],
468 - ))),
469 - if (showScrollbar)
470 - CakeScrollbar(
471 - backgroundHeight: backgroundHeight,
472 - thumbHeight: thumbHeight,
473 - fromTop: fromTop,
474 - rightOffset: -15)
475 - ]);
476 - }
477 -}
478 -
479 -class ExpirationTimeWidget extends StatelessWidget {
480 - const ExpirationTimeWidget({
481 - required this.expirationTime,
482 - });
483 -
484 - final String expirationTime;
485 -
486 - @override
487 - Widget build(BuildContext context) {
488 - return Padding(
489 - padding: EdgeInsets.only(bottom: 32),
490 - child: Row(
491 - mainAxisSize: MainAxisSize.max,
492 - mainAxisAlignment: MainAxisAlignment.spaceBetween,
493 - crossAxisAlignment: CrossAxisAlignment.start,
494 - children: <Widget>[
495 - Text(
496 - S.current.offer_expires_in,
497 - style: TextStyle(
498 - fontSize: 16,
499 - fontWeight: FontWeight.normal,
500 - fontFamily: 'Lato',
501 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
502 - decoration: TextDecoration.none,
503 - ),
504 - ),
505 - Text(
506 - expirationTime,
507 - textAlign: TextAlign.right,
508 - style: TextStyle(
509 - fontSize: 16,
510 - fontWeight: FontWeight.w600,
511 - fontFamily: 'Lato',
512 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
513 - decoration: TextDecoration.none,
514 - ),
515 - )
516 - ],
517 - ),
518 - );
519 - }
520 -}
521 -
522 -class AddressText extends StatelessWidget {
523 - final String text;
524 - final double fontSize;
525 - final FontWeight fontWeight;
526 - final TextAlign? textAlign;
527 -
528 - const AddressText({
529 - required this.text,
530 - this.fontSize = 14,
531 - this.fontWeight = FontWeight.w600,
532 - this.textAlign,
533 - });
534 -
535 - @override
536 - Widget build(BuildContext context) {
537 - return Padding(
538 - padding: EdgeInsets.only(top: 8),
539 - child: Text(
540 - text,
541 - style: TextStyle(
542 - fontSize: fontSize,
543 - fontWeight: fontWeight,
544 - fontFamily: 'Lato',
545 - color: PaletteDark.pigeonBlue,
546 - decoration: TextDecoration.none,
547 - ),
548 - ),
549 - );
550 - }
551 -}
552 -
553 -class AmountText extends StatelessWidget {
554 - final String text;
555 - final double fontSize;
556 - final FontWeight fontWeight;
557 - final TextAlign? textAlign;
558 -
559 - const AmountText({
560 - required this.text,
561 - this.fontSize = 10,
562 - this.fontWeight = FontWeight.w600,
563 - this.textAlign,
564 - });
565 -
566 - @override
567 - Widget build(BuildContext context) {
568 - return Padding(
569 - padding: EdgeInsets.only(top: 8),
570 - child: Row(
571 - mainAxisSize: MainAxisSize.max,
572 - mainAxisAlignment: MainAxisAlignment.end,
573 - children: [
574 - Text(
575 - text,
576 - style: TextStyle(
577 - fontSize: fontSize,
578 - fontWeight: fontWeight,
579 - fontFamily: 'Lato',
580 - color: PaletteDark.pigeonBlue,
581 - decoration: TextDecoration.none,
582 - ),
583 - )
584 - ],
585 - ));
586 - }
587 -}
588 -
589 -String? stealthAddressText(String? stealthAddress) {
590 - if (stealthAddress == null) {
591 - return null;
592 - }
593 -
594 - return stealthAddress.isNotEmpty ? "-> $stealthAddress" : null;
595 -}
lib/src/screens/send/widgets/send_card.dart
+147 -141
@@ -5,8 +5,7 @@ import 'package:cake_wallet/src/widgets/picker.dart';
5 import 'package:cake_wallet/src/widgets/standard_checkbox.dart';
6 import 'package:cake_wallet/src/screens/exchange/widgets/currency_picker.dart';
7 import 'package:cake_wallet/src/widgets/alert_with_one_action.dart';
8 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
9 -import 'package:cake_wallet/themes/theme_base.dart';
8 +import 'package:cake_wallet/themes/core/material_base_theme.dart';
9 import 'package:cake_wallet/utils/payment_request.dart';
10 import 'package:cake_wallet/utils/responsive_layout_util.dart';
11 import 'package:cw_core/crypto_currency.dart';
@@ -24,7 +23,6 @@ import 'package:cake_wallet/utils/show_pop_up.dart';
23 import 'package:cake_wallet/src/widgets/address_text_field.dart';
24 import 'package:cake_wallet/generated/i18n.dart';
25 import 'package:cake_wallet/src/widgets/base_text_form_field.dart';
27 -import 'package:cake_wallet/themes/extensions/send_page_theme.dart';
26
27 class SendCard extends StatefulWidget {
28 SendCard({
@@ -42,19 +40,18 @@ class SendCard extends StatefulWidget {
40 final PaymentRequest? initialPaymentRequest;
41 final FocusNode? cryptoAmountFocus;
42 final FocusNode? fiatAmountFocus;
45 - final ThemeBase currentTheme;
46 -
43 + final MaterialThemeBase currentTheme;
44
45 @override
46 SendCardState createState() => SendCardState(
50 - output: output,
51 - sendViewModel: sendViewModel,
52 - initialPaymentRequest: initialPaymentRequest,
53 - currentTheme: currentTheme
54 - // cryptoAmountFocus: cryptoAmountFocus ?? FocusNode(),
55 - // fiatAmountFocus: fiatAmountFocus ?? FocusNode(),
56 - // cryptoAmountFocus: FocusNode(),
57 - // fiatAmountFocus: FocusNode(),
47 + output: output,
48 + sendViewModel: sendViewModel,
49 + initialPaymentRequest: initialPaymentRequest,
50 + currentTheme: currentTheme
51 + // cryptoAmountFocus: cryptoAmountFocus ?? FocusNode(),
52 + // fiatAmountFocus: fiatAmountFocus ?? FocusNode(),
53 + // cryptoAmountFocus: FocusNode(),
54 + // fiatAmountFocus: FocusNode(),
55 );
56 }
57
@@ -74,7 +71,7 @@ class SendCardState extends State<SendCard> with AutomaticKeepAliveClientMixin<S
71 static const prefixIconWidth = 34.0;
72 static const prefixIconHeight = 34.0;
73
77 - final ThemeBase currentTheme;
74 + final MaterialThemeBase currentTheme;
75 final Output output;
76 final SendViewModel sendViewModel;
77 final PaymentRequest? initialPaymentRequest;
@@ -98,19 +95,23 @@ class SendCardState extends State<SendCard> with AutomaticKeepAliveClientMixin<S
95 /// if the current wallet doesn't match the one in the qr code
96 if (initialPaymentRequest != null &&
97 sendViewModel.walletCurrencyName != initialPaymentRequest!.scheme.toLowerCase()) {
101 - WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
102 - if (mounted) {
103 - showPopUp<void>(
98 + WidgetsBinding.instance.addPostFrameCallback(
99 + (timeStamp) {
100 + if (mounted) {
101 + showPopUp<void>(
102 context: context,
103 builder: (BuildContext context) {
104 return AlertWithOneAction(
107 - alertTitle: S.of(context).error,
108 - alertContent: S.of(context).unmatched_currencies,
109 - buttonText: S.of(context).ok,
110 - buttonAction: () => Navigator.of(context).pop());
111 - });
112 - }
113 - });
105 + alertTitle: S.of(context).error,
106 + alertContent: S.of(context).unmatched_currencies,
107 + buttonText: S.of(context).ok,
108 + buttonAction: () => Navigator.of(context).pop(),
109 + );
110 + },
111 + );
112 + }
113 + },
114 + );
115 }
116 }
117
@@ -151,15 +152,10 @@ class SendCardState extends State<SendCard> with AutomaticKeepAliveClientMixin<S
152 decoration: responsiveLayoutUtil.shouldRenderMobileUI
153 ? BoxDecoration(
154 borderRadius: BorderRadius.only(
154 - bottomLeft: Radius.circular(24), bottomRight: Radius.circular(24)),
155 - gradient: LinearGradient(
156 - colors: [
157 - Theme.of(context).extension<SendPageTheme>()!.firstGradientColor,
158 - Theme.of(context).extension<SendPageTheme>()!.secondGradientColor,
159 - ],
160 - begin: Alignment.topLeft,
161 - end: Alignment.bottomRight,
155 + bottomLeft: Radius.circular(24),
156 + bottomRight: Radius.circular(24),
157 ),
158 + color: Theme.of(context).colorScheme.surfaceContainer,
159 )
160 : null,
161 child: Padding(
@@ -179,37 +175,39 @@ class SendCardState extends State<SendCard> with AutomaticKeepAliveClientMixin<S
175 : sendViewModel.addressValidator;
176
177 return AddressTextField(
178 + contentPadding: EdgeInsets.symmetric(vertical: 8),
179 + hasUnderlineBorder: true,
180 + fillColor: Theme.of(context).colorScheme.surfaceContainerHighest,
181 addressKey: ValueKey('send_page_address_textfield_key'),
182 focusNode: addressFocusNode,
183 controller: addressController,
184 onURIScanned: (uri) async {
186 - if (OpenCryptoPayService.isOpenCryptoPayQR(
187 - uri.toString())) {
185 + if (OpenCryptoPayService.isOpenCryptoPayQR(uri.toString())) {
186 sendViewModel.createOpenCryptoPayTransaction(uri.toString());
187 } else {
188 final paymentRequest = PaymentRequest.fromUri(uri);
189 if (sendViewModel.usePayjoin) {
192 - sendViewModel.payjoinUri = paymentRequest.pjUri;
193 - }
194 - addressController.text = paymentRequest.address;
195 - cryptoAmountController.text = paymentRequest.amount;
196 - noteController.text = paymentRequest.note;}
197 - },
198 - options: [
199 - AddressTextFieldOption.paste,
200 - AddressTextFieldOption.qrCode,
201 - AddressTextFieldOption.addressBook
202 - ],
203 - buttonColor:
204 - Theme.of(context).extension<SendPageTheme>()!.textFieldButtonColor,
205 - borderColor:
206 - Theme.of(context).extension<SendPageTheme>()!.textFieldBorderColor,
207 - textStyle:
208 - TextStyle(fontSize: 14, fontWeight: FontWeight.w500, color: Colors.white),
209 - hintStyle: TextStyle(
210 - fontSize: 14,
211 - fontWeight: FontWeight.w500,
212 - color: Theme.of(context).extension<SendPageTheme>()!.textFieldHintColor),
190 + sendViewModel.payjoinUri = paymentRequest.pjUri;
191 + }
192 + addressController.text = paymentRequest.address;
193 + cryptoAmountController.text = paymentRequest.amount;
194 + noteController.text = paymentRequest.note;
195 + }
196 + },
197 + options: [
198 + AddressTextFieldOption.paste,
199 + AddressTextFieldOption.qrCode,
200 + AddressTextFieldOption.addressBook
201 + ],
202 + textStyle: Theme.of(context).textTheme.bodyMedium!.copyWith(
203 + fontSize: 16,
204 + fontWeight: FontWeight.w500,
205 + ),
206 + hintStyle: Theme.of(context).textTheme.bodyMedium!.copyWith(
207 + fontSize: 16,
208 + fontWeight: FontWeight.w500,
209 + color: Theme.of(context).colorScheme.onSurfaceVariant,
210 + ),
211 onPushPasteButton: (context) async {
212 output.resetParsedAddress();
213 await output.fetchParsedAddress(context);
@@ -226,37 +224,44 @@ class SendCardState extends State<SendCard> with AutomaticKeepAliveClientMixin<S
224 }),
225 if (output.isParsedAddress)
226 Padding(
229 - padding: const EdgeInsets.only(top: 20),
230 - child: BaseTextFormField(
231 - controller: extractedAddressController,
232 - readOnly: true,
233 - borderColor:
234 - Theme.of(context).extension<SendPageTheme>()!.textFieldBorderColor,
235 - textStyle: TextStyle(
236 - fontSize: 14, fontWeight: FontWeight.w500, color: Colors.white),
237 - validator: sendViewModel.addressValidator)),
227 + padding: const EdgeInsets.only(top: 20),
228 + child: BaseTextFormField(
229 + fillColor: Theme.of(context).colorScheme.surfaceContainerHighest,
230 + controller: extractedAddressController,
231 + readOnly: true,
232 + textStyle: Theme.of(context).textTheme.bodyMedium?.copyWith(
233 + fontSize: 16,
234 + fontWeight: FontWeight.w500,
235 + color: Theme.of(context).colorScheme.onSurface,
236 + ),
237 + validator: sendViewModel.addressValidator,
238 + ),
239 + ),
240 CurrencyAmountTextField(
239 - currencyPickerButtonKey: ValueKey('send_page_currency_picker_button_key'),
240 - amountTextfieldKey: ValueKey('send_page_amount_textfield_key'),
241 - sendAllButtonKey: ValueKey('send_page_send_all_button_key'),
242 - currencyAmountTextFieldWidgetKey:
243 - ValueKey('send_page_crypto_currency_amount_textfield_widget_key'),
244 - selectedCurrency: sendViewModel.selectedCryptoCurrency.title,
245 - amountFocusNode: widget.cryptoAmountFocus,
246 - amountController: cryptoAmountController,
247 - isAmountEditable: true,
248 - onTapPicker: () => _presentPicker(context),
249 - isPickerEnable: sendViewModel.hasMultipleTokens,
250 - tag: sendViewModel.selectedCryptoCurrency.tag,
251 - allAmountButton:
252 - !sendViewModel.isBatchSending && sendViewModel.shouldDisplaySendALL,
253 - currencyValueValidator: output.sendAll
254 - ? sendViewModel.allAmountValidator
255 - : sendViewModel.amountValidator,
256 - allAmountCallback: () async => output.setSendAll(await sendViewModel.sendingBalance)),
257 - Divider(
258 - height: 1,
259 - color: Theme.of(context).extension<SendPageTheme>()!.textFieldHintColor),
241 + borderWidth: 0.0,
242 + hasUnderlineBorder: true,
243 + fillColor: Theme.of(context).colorScheme.surfaceContainerHighest,
244 + currencyPickerButtonKey: ValueKey('send_page_currency_picker_button_key'),
245 + amountTextfieldKey: ValueKey('send_page_amount_textfield_key'),
246 + sendAllButtonKey: ValueKey('send_page_send_all_button_key'),
247 + currencyAmountTextFieldWidgetKey:
248 + ValueKey('send_page_crypto_currency_amount_textfield_widget_key'),
249 + selectedCurrency: sendViewModel.selectedCryptoCurrency.title,
250 + amountFocusNode: widget.cryptoAmountFocus,
251 + amountController: cryptoAmountController,
252 + isAmountEditable: true,
253 + onTapPicker: () => _presentPicker(context),
254 + isPickerEnable: sendViewModel.hasMultipleTokens,
255 + tag: sendViewModel.selectedCryptoCurrency.tag,
256 + allAmountButton:
257 + !sendViewModel.isBatchSending && sendViewModel.shouldDisplaySendALL,
258 + currencyValueValidator: output.sendAll
259 + ? sendViewModel.allAmountValidator
260 + : sendViewModel.amountValidator,
261 + allAmountCallback: () async =>
262 + output.setSendAll(await sendViewModel.sendingBalance),
263 + ),
264 + Divider(height: 1, color: Theme.of(context).colorScheme.outlineVariant),
265 Observer(
266 builder: (_) {
267 // force rebuild on mobx
@@ -270,23 +275,22 @@ class SendCardState extends State<SendCard> with AutomaticKeepAliveClientMixin<S
275 Expanded(
276 child: Text(
277 S.of(context).available_balance + ':',
273 - style: TextStyle(
274 - fontSize: 12,
275 - fontWeight: FontWeight.w600,
276 - color:
277 - Theme.of(context).extension<SendPageTheme>()!.textFieldHintColor),
278 + style: Theme.of(context).textTheme.bodySmall!.copyWith(
279 + fontWeight: FontWeight.w600,
280 + color: Theme.of(context).colorScheme.onSurfaceVariant,
281 + ),
282 ),
283 ),
284 FutureBuilder<String>(
285 future: sendViewModel.sendingBalance,
286 builder: (context, snapshot) {
287 return Text(
284 - snapshot.data ?? sendViewModel.balance, // default to balance while loading
285 - style: TextStyle(
286 - fontSize: 12,
287 - fontWeight: FontWeight.w600,
288 - color:
289 - Theme.of(context).extension<SendPageTheme>()!.textFieldHintColor),
288 + snapshot.data ??
289 + sendViewModel.balance, // default to balance while loading
290 + style: Theme.of(context).textTheme.bodySmall!.copyWith(
291 + fontWeight: FontWeight.w600,
292 + color: Theme.of(context).colorScheme.onSurfaceVariant,
293 + ),
294 );
295 },
296 )
@@ -297,33 +301,38 @@ class SendCardState extends State<SendCard> with AutomaticKeepAliveClientMixin<S
301 ),
302 if (!sendViewModel.isFiatDisabled)
303 CurrencyAmountTextField(
300 - amountTextfieldKey: ValueKey('send_page_fiat_amount_textfield_key'),
301 - currencyAmountTextFieldWidgetKey:
302 - ValueKey('send_page_fiat_currency_amount_textfield_widget_key'),
303 - selectedCurrency: sendViewModel.fiat.title,
304 - amountFocusNode: widget.fiatAmountFocus,
305 - amountController: fiatAmountController,
306 - hintText: '0.00',
307 - isAmountEditable: true,
308 - allAmountButton: false),
309 - Divider(
310 - height: 1,
311 - color: Theme.of(context).extension<SendPageTheme>()!.textFieldHintColor),
304 + borderWidth: 0.0,
305 + hasUnderlineBorder: true,
306 + fillColor: Theme.of(context).colorScheme.surfaceContainerHighest,
307 + amountTextfieldKey: ValueKey('send_page_fiat_amount_textfield_key'),
308 + currencyAmountTextFieldWidgetKey:
309 + ValueKey('send_page_fiat_currency_amount_textfield_widget_key'),
310 + selectedCurrency: sendViewModel.fiat.title,
311 + amountFocusNode: widget.fiatAmountFocus,
312 + amountController: fiatAmountController,
313 + hintText: '0.00',
314 + isAmountEditable: true,
315 + allAmountButton: false,
316 + ),
317 + Divider(height: 1, color: Theme.of(context).colorScheme.outlineVariant),
318 Padding(
319 padding: EdgeInsets.only(top: 20),
320 child: BaseTextFormField(
321 + hasUnderlineBorder: true,
322 + contentPadding: EdgeInsets.symmetric(vertical: 8),
323 + fillColor: Theme.of(context).colorScheme.surfaceContainerHighest,
324 key: ValueKey('send_page_note_textfield_key'),
325 controller: noteController,
326 keyboardType: TextInputType.multiline,
327 maxLines: null,
319 - borderColor: Theme.of(context).extension<SendPageTheme>()!.textFieldBorderColor,
320 - textStyle:
321 - TextStyle(fontSize: 14, fontWeight: FontWeight.w500, color: Colors.white),
328 + textStyle: Theme.of(context).textTheme.bodyMedium!.copyWith(
329 + fontWeight: FontWeight.w500,
330 + ),
331 hintText: S.of(context).note_optional,
323 - placeholderTextStyle: TextStyle(
324 - fontSize: 14,
325 - fontWeight: FontWeight.w500,
326 - color: Theme.of(context).extension<SendPageTheme>()!.textFieldHintColor),
332 + placeholderTextStyle: Theme.of(context).textTheme.bodyMedium!.copyWith(
333 + fontWeight: FontWeight.w500,
334 + color: Theme.of(context).colorScheme.onSurfaceVariant,
335 + ),
336 ),
337 ),
338 if (sendViewModel.feesViewModel.hasFees)
@@ -341,8 +350,9 @@ class SendCardState extends State<SendCard> with AutomaticKeepAliveClientMixin<S
350 children: <Widget>[
351 Text(
352 S.of(context).send_estimated_fee,
344 - style: TextStyle(
345 - fontSize: 12, fontWeight: FontWeight.w500, color: Colors.white),
353 + style: Theme.of(context).textTheme.bodySmall!.copyWith(
354 + fontWeight: FontWeight.w700,
355 + ),
356 ),
357 Container(
358 child: Row(
@@ -356,11 +366,9 @@ class SendCardState extends State<SendCard> with AutomaticKeepAliveClientMixin<S
366 output.estimatedFee.toString() +
367 ' ' +
368 sendViewModel.currency.toString(),
359 - style: TextStyle(
360 - fontSize: 12,
361 - fontWeight: FontWeight.w600,
362 - color: Colors.white,
363 - ),
369 + style: Theme.of(context).textTheme.bodySmall!.copyWith(
370 + fontWeight: FontWeight.w600,
371 + ),
372 ),
373 Padding(
374 padding: EdgeInsets.only(top: 5),
@@ -370,13 +378,13 @@ class SendCardState extends State<SendCard> with AutomaticKeepAliveClientMixin<S
378 output.estimatedFeeFiatAmount +
379 ' ' +
380 sendViewModel.fiat.title,
373 - style: TextStyle(
374 - fontSize: 12,
375 - fontWeight: FontWeight.w600,
376 - color: Theme.of(context)
377 - .extension<SendPageTheme>()!
378 - .textFieldHintColor,
379 - ),
381 + style:
382 + Theme.of(context).textTheme.bodySmall!.copyWith(
383 + fontWeight: FontWeight.w600,
384 + color: Theme.of(context)
385 + .colorScheme
386 + .onSurfaceVariant,
387 + ),
388 ),
389 ),
390 ],
@@ -386,7 +394,7 @@ class SendCardState extends State<SendCard> with AutomaticKeepAliveClientMixin<S
394 child: Icon(
395 Icons.arrow_forward_ios,
396 size: 12,
389 - color: Colors.white,
397 + color: Theme.of(context).colorScheme.onSurface,
398 ),
399 )
400 ],
@@ -419,13 +427,14 @@ class SendCardState extends State<SendCard> with AutomaticKeepAliveClientMixin<S
427 children: [
428 Text(
429 S.of(context).coin_control,
422 - style: TextStyle(
423 - fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white),
430 + style: Theme.of(context).textTheme.bodySmall!.copyWith(
431 + fontWeight: FontWeight.w700,
432 + ),
433 ),
434 Icon(
435 Icons.arrow_forward_ios,
436 size: 12,
428 - color: Colors.white,
437 + color: Theme.of(context).colorScheme.onSurface,
438 ),
439 ],
440 ),
@@ -450,13 +459,9 @@ class SendCardState extends State<SendCard> with AutomaticKeepAliveClientMixin<S
459 children: [
460 StandardCheckbox(
461 caption: S.of(context).litecoin_mweb_allow_coins,
453 - captionColor: Colors.white,
454 - borderColor: currentTheme.type == ThemeType.bright
455 - ? Colors.white
456 - : Theme.of(context).extension<CakeTextTheme>()!.secondaryTextColor,
457 - iconColor: currentTheme.type == ThemeType.bright
458 - ? Colors.white
459 - : Theme.of(context).primaryColor,
462 + captionColor: Theme.of(context).colorScheme.onSurfaceVariant,
463 + borderColor: Theme.of(context).colorScheme.primary,
464 + iconColor: Theme.of(context).colorScheme.primary,
465 value:
466 widget.sendViewModel.coinTypeToSpendFrom == UnspentCoinType.any,
467 onChanged: (bool? value) {
@@ -598,7 +603,8 @@ class SendCardState extends State<SendCard> with AutomaticKeepAliveClientMixin<S
603 final customItemIndex = sendViewModel.feesViewModel.getCustomPriorityIndex(items);
604 final isBitcoinWallet = sendViewModel.walletType == WalletType.bitcoin;
605 final maxCustomFeeRate = sendViewModel.feesViewModel.maxCustomFeeRate?.toDouble();
601 - double? customFeeRate = isBitcoinWallet ? sendViewModel.feesViewModel.customBitcoinFeeRate.toDouble() : null;
606 + double? customFeeRate =
607 + isBitcoinWallet ? sendViewModel.feesViewModel.customBitcoinFeeRate.toDouble() : null;
608
609 FocusManager.instance.primaryFocus?.unfocus();
610
lib/src/screens/send/widgets/send_template_card.dart
+89 -82
@@ -1,6 +1,5 @@
1 import 'package:cake_wallet/src/screens/exchange/widgets/currency_picker.dart';
2 import 'package:cake_wallet/src/screens/receive/widgets/currency_input_field.dart';
3 -import 'package:cake_wallet/themes/extensions/send_page_theme.dart';
3 import 'package:cake_wallet/utils/payment_request.dart';
4 import 'package:cake_wallet/utils/show_pop_up.dart';
5 import 'package:cake_wallet/view_model/send/template_view_model.dart';
@@ -8,7 +7,6 @@ import 'package:cw_core/crypto_currency.dart';
7 import 'package:cw_core/currency.dart';
8 import 'package:flutter_mobx/flutter_mobx.dart';
9 import 'package:flutter/material.dart';
11 -import 'package:flutter/services.dart';
10 import 'package:cake_wallet/generated/i18n.dart';
11 import 'package:cake_wallet/view_model/send/send_template_view_model.dart';
12 import 'package:cake_wallet/src/widgets/address_text_field.dart';
@@ -41,74 +39,77 @@ class SendTemplateCard extends StatelessWidget {
39
40 return Container(
41 decoration: BoxDecoration(
44 - borderRadius:
45 - BorderRadius.only(bottomLeft: Radius.circular(24), bottomRight: Radius.circular(24)),
46 - gradient: LinearGradient(colors: [
47 - Theme.of(context).extension<SendPageTheme>()!.firstGradientColor,
48 - Theme.of(context).extension<SendPageTheme>()!.secondGradientColor
49 - ], begin: Alignment.topLeft, end: Alignment.bottomRight)),
42 + borderRadius: BorderRadius.only(
43 + bottomLeft: Radius.circular(24),
44 + bottomRight: Radius.circular(24),
45 + ),
46 + color: Theme.of(context).colorScheme.surfaceContainer,
47 + ),
48 child: Column(
49 children: <Widget>[
50 Padding(
51 padding: EdgeInsets.fromLTRB(24, 90, 24, 32),
52 child: Column(
53 children: <Widget>[
54 + SizedBox(height: 32),
55 if (index == 0)
56 BaseTextFormField(
58 - controller: _nameController,
59 - hintText: sendTemplateViewModel.recipients.length > 1
60 - ? S.of(context).template_name
61 - : S.of(context).send_name,
62 - borderColor:
63 - Theme.of(context).extension<SendPageTheme>()!.textFieldBorderColor,
64 - textStyle:
65 - TextStyle(fontSize: 14, fontWeight: FontWeight.w500, color: Colors.white),
66 - placeholderTextStyle: TextStyle(
67 - color: Theme.of(context).extension<SendPageTheme>()!.textFieldHintColor,
57 + contentPadding: EdgeInsets.symmetric(vertical: 8),
58 + hasUnderlineBorder: true,
59 + controller: _nameController,
60 + hintText: sendTemplateViewModel.recipients.length > 1
61 + ? S.of(context).template_name
62 + : S.of(context).send_name,
63 + textStyle: Theme.of(context).textTheme.bodyMedium!.copyWith(
64 + fontWeight: FontWeight.w500,
65 + ),
66 + placeholderTextStyle: Theme.of(context).textTheme.bodyMedium!.copyWith(
67 + color: Theme.of(context).colorScheme.onSurfaceVariant,
68 fontWeight: FontWeight.w500,
69 - fontSize: 14),
70 - validator: sendTemplateViewModel.templateValidator),
69 + ),
70 + validator: sendTemplateViewModel.templateValidator,
71 + fillColor: Theme.of(context).colorScheme.surfaceContainerHighest,
72 + ),
73 Padding(
74 padding: EdgeInsets.only(top: 20),
73 - child: Observer(builder: (context) {
74 - return AddressTextField(
75 - selectedCurrency: template.selectedCurrency,
76 - controller: _addressController,
77 - onURIScanned: (uri) {
78 - final paymentRequest = PaymentRequest.fromUri(uri);
79 - _addressController.text = paymentRequest.address;
80 - _cryptoAmountController.text = paymentRequest.amount;
81 - },
82 - options: [
83 - AddressTextFieldOption.paste,
84 - AddressTextFieldOption.qrCode,
85 - AddressTextFieldOption.addressBook
86 - ],
87 - onPushPasteButton: (context) async {
88 - template.output.resetParsedAddress();
89 - await template.output.fetchParsedAddress(context);
90 - },
91 - onPushAddressBookButton: (context) async {
92 - template.output.resetParsedAddress();
93 - await template.output.fetchParsedAddress(context);
94 - },
95 - buttonColor:
96 - Theme.of(context).extension<SendPageTheme>()!.textFieldButtonColor,
97 - borderColor:
98 - Theme.of(context).extension<SendPageTheme>()!.textFieldBorderColor,
99 - textStyle: TextStyle(
100 - fontSize: 14,
101 - fontWeight: FontWeight.w500,
102 - color: Colors.white,
103 - ),
104 - hintStyle: TextStyle(
105 - fontSize: 14,
106 - fontWeight: FontWeight.w500,
107 - color: Theme.of(context).extension<SendPageTheme>()!.textFieldHintColor,
108 - ),
109 - validator: sendTemplateViewModel.addressValidator,
110 - );
111 - }),
75 + child: Observer(
76 + builder: (context) {
77 + return AddressTextField(
78 + hasUnderlineBorder: true,
79 + contentPadding: EdgeInsets.symmetric(vertical: 8),
80 + selectedCurrency: template.selectedCurrency,
81 + controller: _addressController,
82 + onURIScanned: (uri) {
83 + final paymentRequest = PaymentRequest.fromUri(uri);
84 + _addressController.text = paymentRequest.address;
85 + _cryptoAmountController.text = paymentRequest.amount;
86 + },
87 + options: [
88 + AddressTextFieldOption.paste,
89 + AddressTextFieldOption.qrCode,
90 + AddressTextFieldOption.addressBook
91 + ],
92 + onPushPasteButton: (context) async {
93 + template.output.resetParsedAddress();
94 + await template.output.fetchParsedAddress(context);
95 + },
96 + onPushAddressBookButton: (context) async {
97 + template.output.resetParsedAddress();
98 + await template.output.fetchParsedAddress(context);
99 + },
100 + buttonColor: Theme.of(context).colorScheme.surfaceContainerHighest,
101 + textStyle: Theme.of(context).textTheme.bodyMedium!.copyWith(
102 + fontWeight: FontWeight.w500,
103 + ),
104 + hintStyle: Theme.of(context).textTheme.bodyMedium!.copyWith(
105 + fontWeight: FontWeight.w500,
106 + color: Theme.of(context).colorScheme.onSurfaceVariant,
107 + ),
108 + validator: sendTemplateViewModel.addressValidator,
109 + fillColor: Theme.of(context).colorScheme.surfaceContainerHighest,
110 + );
111 + },
112 + ),
113 ),
114 Focus(
115 onFocusChange: (hasFocus) {
@@ -117,19 +118,22 @@ class SendTemplateCard extends StatelessWidget {
118 child: Column(
119 children: [
120 Observer(
120 - builder: (context) => CurrencyAmountTextField(
121 - selectedCurrency: template.selectedCurrency.title,
122 - amountFocusNode: _cryptoAmountFocus,
123 - amountController: _cryptoAmountController,
124 - isSelected: template.isCryptoSelected,
125 - tag: template.selectedCurrency.tag,
126 - isPickerEnable: sendTemplateViewModel.hasMultipleTokens,
127 - onTapPicker: () => _presentPicker(context),
128 - currencyValueValidator: sendTemplateViewModel.amountValidator,
129 - isAmountEditable: true)),
130 - Divider(
131 - height: 1,
132 - color: Theme.of(context).extension<SendPageTheme>()!.textFieldBorderColor)
121 + builder: (context) => CurrencyAmountTextField(
122 + hasUnderlineBorder: true,
123 + borderWidth: 0.0,
124 + selectedCurrency: template.selectedCurrency.title,
125 + amountFocusNode: _cryptoAmountFocus,
126 + amountController: _cryptoAmountController,
127 + isSelected: template.isCryptoSelected,
128 + tag: template.selectedCurrency.tag,
129 + isPickerEnable: sendTemplateViewModel.hasMultipleTokens,
130 + onTapPicker: () => _presentPicker(context),
131 + currencyValueValidator: sendTemplateViewModel.amountValidator,
132 + isAmountEditable: true,
133 + fillColor: Theme.of(context).colorScheme.surfaceContainerHighest,
134 + ),
135 + ),
136 + Divider(height: 1, color: Theme.of(context).colorScheme.outlineVariant),
137 ],
138 ),
139 ),
@@ -140,16 +144,19 @@ class SendTemplateCard extends StatelessWidget {
144 child: Column(
145 children: [
146 Observer(
143 - builder: (context) => CurrencyAmountTextField(
144 - selectedCurrency: sendTemplateViewModel.fiatCurrency,
145 - amountFocusNode: _fiatAmountFocus,
146 - amountController: _fiatAmountController,
147 - isSelected: !template.isCryptoSelected,
148 - hintText: '0.00',
149 - isAmountEditable: true)),
150 - Divider(
151 - height: 1,
152 - color: Theme.of(context).extension<SendPageTheme>()!.textFieldBorderColor)
147 + builder: (context) => CurrencyAmountTextField(
148 + hasUnderlineBorder: true,
149 + borderWidth: 0.0,
150 + selectedCurrency: sendTemplateViewModel.fiatCurrency,
151 + amountFocusNode: _fiatAmountFocus,
152 + amountController: _fiatAmountController,
153 + isSelected: !template.isCryptoSelected,
154 + hintText: '0.00',
155 + isAmountEditable: true,
156 + fillColor: Theme.of(context).colorScheme.surfaceContainerHighest,
157 + ),
158 + ),
159 + Divider(height: 1, color: Theme.of(context).colorScheme.outlineVariant),
160 ],
161 ),
162 ),
lib/src/screens/settings/connection_sync_page.dart
-5
@@ -5,16 +5,11 @@ import 'package:cake_wallet/reactions/wallet_connect.dart';
5 import 'package:cake_wallet/routes.dart';
6 import 'package:cake_wallet/src/screens/base_page.dart';
7 import 'package:cake_wallet/src/screens/settings/widgets/settings_cell_with_arrow.dart';
8 -import 'package:cake_wallet/src/screens/settings/widgets/settings_picker_cell.dart';
9 -import 'package:cake_wallet/src/screens/settings/widgets/settings_switcher_cell.dart';
8 import 'package:cake_wallet/src/screens/settings/widgets/wallet_connect_button.dart';
9 import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
12 -import 'package:cake_wallet/utils/device_info.dart';
10 import 'package:cake_wallet/utils/feature_flag.dart';
11 import 'package:cake_wallet/utils/show_pop_up.dart';
12 import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart';
16 -import 'package:cake_wallet/view_model/settings/sync_mode.dart';
17 -import 'package:cw_core/battery_optimization_native.dart';
13 import 'package:flutter/material.dart';
14 import 'package:flutter_mobx/flutter_mobx.dart';
15
lib/src/screens/settings/desktop_settings/desktop_settings_page.dart
+3 -4
@@ -6,7 +6,6 @@ import 'package:cake_wallet/typography.dart';
6 import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart';
7 import 'package:flutter/material.dart';
8 import 'package:cake_wallet/router.dart' as Router;
9 -import 'package:cake_wallet/themes/extensions/menu_theme.dart';
9
10 final _settingsNavigatorKey = GlobalKey<NavigatorState>();
11
@@ -34,7 +33,7 @@ class _DesktopSettingsPageState extends State<DesktopSettingsPage> {
33 Widget build(BuildContext context) {
34 return Scaffold(
35 body: Container(
37 - color: Theme.of(context).colorScheme.background,
36 + color: Theme.of(context).colorScheme.surface,
37 height: MediaQuery.of(context).size.height,
38 child: Row(
39 children: [
@@ -87,8 +86,8 @@ class _DesktopSettingsPageState extends State<DesktopSettingsPage> {
86 );
87 },
88 separatorBuilder: (_, index) => Container(
90 - height: 1,
91 - color: Theme.of(context).extension<CakeMenuTheme>()!.dividerColor,
89 + height: 0.0,
90 + color: Theme.of(context).colorScheme.outlineVariant,
91 ),
92 itemCount: itemCount,
93 ),
lib/src/screens/settings/display_settings_page.dart
+15 -2
@@ -76,8 +76,21 @@ class DisplaySettingsPage extends BasePage {
76 return LanguageService.list[code]?.toLowerCase().contains(searchText) ?? false;
77 },
78 ),
79 - if (responsiveLayoutUtil.shouldRenderMobileUI && DeviceInfo.instance.isMobile)
80 - Semantics(label: S.current.color_theme, child: SettingsThemeChoicesCell(_displaySettingsViewModel)),
79 +
80 + if (responsiveLayoutUtil.shouldRenderMobileUI && DeviceInfo.instance.isMobile) ...[
81 + SettingsSwitcherCell(
82 + title: S.current.use_device_theme,
83 + value: _displaySettingsViewModel.themeMode == ThemeMode.system,
84 + onValueChange: (_, bool value) {
85 + _displaySettingsViewModel
86 + .setThemeMode(value ? ThemeMode.system : ThemeMode.dark);
87 + },
88 + ),
89 + Semantics(
90 + label: S.current.color_theme,
91 + child: SettingsThemeChoicesCell(_displaySettingsViewModel),
92 + ),
93 + ],
94 ],
95 ),
96 );
lib/src/screens/settings/mweb_logs_page.dart
+3 -3
@@ -38,7 +38,7 @@ class MwebLogsPage extends BasePage {
38 padding: EdgeInsets.all(16.0),
39 child: Text(
40 snapshot.data!,
41 - style: TextStyle(fontFamily: 'Monospace'),
41 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(fontFamily: 'Monospace'),
42 ),
43 ),
44 );
@@ -49,8 +49,8 @@ class MwebLogsPage extends BasePage {
49 child: LoadingPrimaryButton(
50 onPressed: () => onExportLogs(context),
51 text: S.of(context).export_logs,
52 - color: Theme.of(context).primaryColor,
53 - textColor: Colors.white,
52 + color: Theme.of(context).colorScheme.primary,
53 + textColor: Theme.of(context).colorScheme.onPrimary,
54 ),
55 bottom: 24,
56 left: 24,
lib/src/screens/settings/mweb_node_page.dart
+2 -2
@@ -37,8 +37,8 @@ class MwebNodePage extends BasePage {
37 builder: (_) => LoadingPrimaryButton(
38 onPressed: () => save(context),
39 text: S.of(context).save,
40 - color: Theme.of(context).primaryColor,
41 - textColor: Colors.white,
40 + color: Theme.of(context).colorScheme.primary,
41 + textColor: Theme.of(context).colorScheme.onPrimary,
42 ),
43 ),
44 bottom: 24,
lib/src/screens/settings/tor_page.dart
+79 -78
@@ -1,8 +1,8 @@
1 import 'dart:async';
2 -import 'dart:io';
2
3 import 'package:cake_wallet/src/screens/base_page.dart';
4 import 'package:cake_wallet/store/app_store.dart';
5 +import 'package:cake_wallet/themes/utils/custom_theme_colors.dart';
6 import 'package:cw_core/utils/print_verbose.dart';
7 import 'package:flutter/material.dart';
8 // import 'package:tor/tor.dart';
@@ -62,15 +62,15 @@ class _TorPageBodyState extends State<TorPageBody> {
62 }
63
64 Future<void> endTor() async {
65 - // // Start the proxy
66 - // Tor.instance.disable();
67 - //
68 - // // Toggle started flag.
69 - // setState(() {
70 - // torEnabled = Tor.instance.enabled; // Update flag
71 - // });
72 - //
73 - // printV('Done awaiting; tor should be stopped');
65 + // // Start the proxy
66 + // Tor.instance.disable();
67 + //
68 + // // Toggle started flag.
69 + // setState(() {
70 + // torEnabled = Tor.instance.enabled; // Update flag
71 + // });
72 + //
73 + // printV('Done awaiting; tor should be stopped');
74 }
75 //
76 // @override
@@ -110,58 +110,60 @@ class ConnectScreen extends StatelessWidget {
110 @override
111 Widget build(BuildContext context) {
112 return Center(
113 - child: Column(
114 - mainAxisAlignment: MainAxisAlignment.center,
115 - children: <Widget>[
116 - Container(
117 - width: 200,
118 - height: 200,
119 - decoration: BoxDecoration(
120 - shape: BoxShape.circle,
121 - color: Colors.blue,
122 - ),
123 - child: Icon(
124 - Icons.lock,
125 - color: Colors.white,
126 - size: 100,
113 + child: Padding(
114 + padding: const EdgeInsets.symmetric(horizontal: 16),
115 + child: Column(
116 + mainAxisAlignment: MainAxisAlignment.center,
117 + children: <Widget>[
118 + Container(
119 + width: 200,
120 + height: 200,
121 + decoration: BoxDecoration(
122 + shape: BoxShape.circle,
123 + color: Theme.of(context).colorScheme.primary,
124 + ),
125 + child: Icon(
126 + Icons.lock,
127 + color: Theme.of(context).colorScheme.onPrimary,
128 + size: 100,
129 + ),
130 ),
128 - ),
129 - SizedBox(height: 20),
130 - Text(
131 - 'Connect to Tor',
132 - style: TextStyle(
133 - fontSize: 24,
134 - fontWeight: FontWeight.bold,
131 + SizedBox(height: 48),
132 + Text(
133 + 'Connect to Tor',
134 + style: Theme.of(context).textTheme.titleLarge?.copyWith(
135 + fontSize: 24,
136 + fontWeight: FontWeight.bold,
137 + ),
138 ),
136 - ),
137 - SizedBox(height: 10),
138 - Text(
139 - 'Your connection to the Tor network ensures privacy and security.',
140 - style: TextStyle(
141 - fontSize: 16,
142 - color: Colors.grey,
139 + SizedBox(height: 16),
140 + Text(
141 + 'Your connection to the Tor network ensures privacy and security.',
142 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
143 + fontSize: 16,
144 + color: Theme.of(context).colorScheme.onSurfaceVariant,
145 + ),
146 + textAlign: TextAlign.center,
147 ),
144 - textAlign: TextAlign.center,
145 - ),
146 - SizedBox(height: 30),
147 - ElevatedButton(
148 - onPressed: connect,
149 - style: ElevatedButton.styleFrom(
150 - // primary: Colors.blue,
151 - padding: EdgeInsets.symmetric(horizontal: 40, vertical: 15),
152 - shape: RoundedRectangleBorder(
153 - borderRadius: BorderRadius.circular(30),
148 + SizedBox(height: 48),
149 + ElevatedButton(
150 + onPressed: connect,
151 + style: ElevatedButton.styleFrom(
152 + padding: EdgeInsets.symmetric(horizontal: 40, vertical: 15),
153 + shape: RoundedRectangleBorder(
154 + borderRadius: BorderRadius.circular(12),
155 + ),
156 ),
155 - ),
156 - child: Text(
157 - 'Connect',
158 - style: TextStyle(
159 - fontSize: 18,
160 - color: Colors.white,
157 + child: Text(
158 + 'Connect',
159 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
160 + fontSize: 18,
161 + color: Theme.of(context).colorScheme.onPrimary,
162 + ),
163 ),
164 ),
163 - ),
164 - ],
165 + ],
166 + ),
167 ),
168 );
169 }
@@ -183,47 +185,46 @@ class DisconnectScreen extends StatelessWidget {
185 height: 200,
186 decoration: BoxDecoration(
187 shape: BoxShape.circle,
186 - color: Colors.green,
188 + color: CustomThemeColors.syncGreen,
189 ),
190 child: Icon(
191 Icons.check,
190 - color: Colors.white,
192 + color: Theme.of(context).colorScheme.onPrimary,
193 size: 100,
194 ),
195 ),
196 SizedBox(height: 20),
197 Text(
198 'Connected to Tor',
197 - style: TextStyle(
198 - fontSize: 24,
199 - fontWeight: FontWeight.bold,
200 - ),
199 + style: Theme.of(context).textTheme.titleLarge?.copyWith(
200 + fontSize: 24,
201 + fontWeight: FontWeight.bold,
202 + ),
203 ),
204 SizedBox(height: 10),
205 Text(
206 'You are currently connected to the Tor network.',
205 - style: TextStyle(
206 - fontSize: 16,
207 - color: Colors.grey,
208 - ),
207 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
208 + fontSize: 16,
209 + color: Theme.of(context).colorScheme.onSurfaceVariant,
210 + ),
211 textAlign: TextAlign.center,
212 ),
213 SizedBox(height: 30),
214 ElevatedButton(
215 onPressed: disconnect,
216 style: ElevatedButton.styleFrom(
215 - // primary: Colors.red,
217 padding: EdgeInsets.symmetric(horizontal: 40, vertical: 15),
218 shape: RoundedRectangleBorder(
218 - borderRadius: BorderRadius.circular(30),
219 + borderRadius: BorderRadius.circular(12),
220 ),
221 ),
222 child: Text(
223 'Disconnect',
223 - style: TextStyle(
224 - fontSize: 18,
225 - color: Colors.white,
226 - ),
224 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
225 + fontSize: 18,
226 + color: Theme.of(context).colorScheme.onPrimary,
227 + ),
228 ),
229 ),
230 ],
@@ -244,21 +245,21 @@ class ConnectingScreen extends StatelessWidget {
245 height: 200,
246 decoration: BoxDecoration(
247 shape: BoxShape.circle,
247 - color: Colors.yellow,
248 + color: CustomThemeColors.syncYellow,
249 ),
250 child: Icon(
251 Icons.hourglass_bottom,
251 - color: Colors.white,
252 + color: Theme.of(context).colorScheme.onPrimary,
253 size: 100,
254 ),
255 ),
256 SizedBox(height: 20),
257 Text(
258 'Connecting...',
258 - style: TextStyle(
259 - fontSize: 24,
260 - fontWeight: FontWeight.bold,
261 - ),
259 + style: Theme.of(context).textTheme.titleLarge?.copyWith(
260 + fontSize: 24,
261 + fontWeight: FontWeight.bold,
262 + ),
263 ),
264 SizedBox(height: 10),
265 ],
lib/src/screens/settings/trocador_providers_page.dart
+4 -5
@@ -38,8 +38,8 @@ class TrocadorProvidersPage extends BasePage {
38 leading: Badge(
39 title: 'KYC \nRATING',
40 subTitle: providerRatings[providerName] ?? 'N/A',
41 - textColor: Colors.white,
42 - backgroundColor: Theme.of(context).primaryColor,
41 + textColor: Theme.of(context).colorScheme.onPrimary,
42 + backgroundColor: Theme.of(context).colorScheme.primary,
43 ),
44 onValueChange: (BuildContext _, value) =>
45 trocadorProvidersViewModel.toggleProviderState(providerName),
@@ -78,7 +78,7 @@ class Badge extends StatelessWidget {
78 Text(
79 title,
80 textAlign: TextAlign.center,
81 - style: TextStyle(
81 + style: Theme.of(context).textTheme.bodySmall!.copyWith(
82 color: textColor,
83 fontSize: 7,
84 fontWeight: FontWeight.w600,
@@ -90,9 +90,8 @@ class Badge extends StatelessWidget {
90 ),
91 Text(
92 subTitle,
93 - style: TextStyle(
93 + style: Theme.of(context).textTheme.bodySmall!.copyWith(
94 color: textColor,
95 - fontSize: 12,
95 fontWeight: FontWeight.w600,
96 ),
97 ),
lib/src/screens/settings/widgets/setting_priority_picker_cell.dart
+5 -7
@@ -1,4 +1,3 @@
1 -import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart';
1 import 'package:cake_wallet/utils/show_pop_up.dart';
2 import 'package:flutter/material.dart';
3 import 'package:cake_wallet/src/widgets/picker.dart';
@@ -69,13 +68,12 @@ class SettingsPriorityPickerCell<ItemType> extends StandardListRow {
68 @override
69 Widget buildTrailing(BuildContext context) {
70 return Text(
72 - displayItem?.call(selectedItem,customValue?.round() ?? 0) ?? selectedItem.toString(),
71 + displayItem?.call(selectedItem, customValue?.round() ?? 0) ?? selectedItem.toString(),
72 textAlign: TextAlign.right,
74 - style: TextStyle(
75 - fontSize: 14.0,
76 - fontWeight: FontWeight.w500,
77 - color: Theme.of(context).extension<TransactionTradeTheme>()!.detailsTitlesColor,
78 - ),
73 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
74 + fontWeight: FontWeight.w500,
75 + color: Theme.of(context).colorScheme.onSurfaceVariant,
76 + ),
77 );
78 }
79 }
lib/src/screens/settings/widgets/settings_cell_with_arrow.dart
+4 -3
@@ -1,6 +1,5 @@
1 import 'package:flutter/material.dart';
2 import 'package:cake_wallet/src/widgets/standard_list.dart';
3 -import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart';
3
4 class SettingsCellWithArrow extends StandardListRow {
5 SettingsCellWithArrow({
@@ -10,6 +9,8 @@ class SettingsCellWithArrow extends StandardListRow {
9 }) : super(title: title, isSelected: false, onTap: handler, key: key);
10
11 @override
13 - Widget buildTrailing(BuildContext context) => Image.asset('assets/images/select_arrow.png',
14 - color: Theme.of(context).extension<TransactionTradeTheme>()!.detailsTitlesColor);
12 + Widget buildTrailing(BuildContext context) => Image.asset(
13 + 'assets/images/select_arrow.png',
14 + color: Theme.of(context).colorScheme.onSurfaceVariant,
15 + );
16 }
lib/src/screens/settings/widgets/settings_choices_cell.dart
+12 -18
@@ -1,7 +1,5 @@
1 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
1 import 'package:cake_wallet/view_model/settings/choices_list_item.dart';
2 import 'package:flutter/material.dart';
4 -import 'package:cake_wallet/themes/extensions/address_theme.dart';
3
4 class SettingsChoicesCell extends StatelessWidget {
5 const SettingsChoicesCell(this.choicesListItem, {Key? key}) : super(key: key);
@@ -11,7 +9,7 @@ class SettingsChoicesCell extends StatelessWidget {
9 @override
10 Widget build(BuildContext context) {
11 return Container(
14 - color: Theme.of(context).colorScheme.background,
12 + color: Theme.of(context).colorScheme.surface,
13 padding: EdgeInsets.only(left: 24, right: 24, top: 16, bottom: 16),
14 child: Column(
15 mainAxisSize: MainAxisSize.min,
@@ -22,11 +20,7 @@ class SettingsChoicesCell extends StatelessWidget {
20 children: [
21 Text(
22 choicesListItem.title,
25 - style: TextStyle(
26 - fontSize: 14,
27 - fontWeight: FontWeight.normal,
28 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
29 - ),
23 + style: Theme.of(context).textTheme.bodyMedium,
24 ),
25 ],
26 ),
@@ -35,8 +29,8 @@ class SettingsChoicesCell extends StatelessWidget {
29 Center(
30 child: Container(
31 decoration: BoxDecoration(
38 - borderRadius: BorderRadius.circular(30),
39 - color: Theme.of(context).extension<AddressTheme>()!.actionButtonColor,
32 + borderRadius: BorderRadius.circular(10),
33 + color: Theme.of(context).colorScheme.surfaceContainerHighest,
34 ),
35 child: Row(
36 mainAxisAlignment: MainAxisAlignment.center,
@@ -50,18 +44,18 @@ class SettingsChoicesCell extends StatelessWidget {
44 child: Container(
45 padding: EdgeInsets.symmetric(vertical: 8),
46 decoration: BoxDecoration(
53 - borderRadius: BorderRadius.circular(30),
54 - color: isSelected ? Theme.of(context).primaryColor : null,
47 + borderRadius: BorderRadius.circular(10),
48 + color: isSelected ? Theme.of(context).colorScheme.primary : null,
49 ),
50 child: Center(
51 child: Text(
52 choicesListItem.displayItem.call(e),
59 - style: TextStyle(
60 - color: isSelected
61 - ? Colors.white
62 - : Theme.of(context).extension<CakeTextTheme>()!.secondaryTextColor,
63 - fontWeight: isSelected ? FontWeight.w700 : FontWeight.normal,
64 - ),
53 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
54 + color: isSelected
55 + ? Theme.of(context).colorScheme.onPrimary
56 + : Theme.of(context).colorScheme.onSurfaceVariant,
57 + fontWeight: isSelected ? FontWeight.w600 : FontWeight.normal,
58 + ),
59 ),
60 ),
61 ),
lib/src/screens/settings/widgets/settings_link_provider_cell.dart
+12 -12
@@ -1,4 +1,3 @@
1 -import 'package:cake_wallet/palette.dart';
1 import 'package:flutter/material.dart';
2 import 'package:cake_wallet/src/widgets/standard_list.dart';
3 import 'package:url_launcher/url_launcher.dart';
@@ -6,13 +5,12 @@ import 'package:url_launcher/url_launcher.dart';
5 class SettingsLinkProviderCell extends StandardListRow {
6 SettingsLinkProviderCell(
7 {required String title,
9 - required this.link,
10 - required this.linkTitle,
11 - this.icon,
12 - this.iconColor})
13 - : super(title: title, isSelected: false, onTap: (BuildContext context) => _launchUrl(link) );
8 + required this.link,
9 + required this.linkTitle,
10 + this.icon,
11 + this.iconColor})
12 + : super(title: title, isSelected: false, onTap: (BuildContext context) => _launchUrl(link));
13
15 -
14 final String link;
15 final String linkTitle;
16 final String? icon;
@@ -23,11 +21,13 @@ class SettingsLinkProviderCell extends StandardListRow {
21 icon != null ? Image.asset(icon!, color: iconColor, height: 24, width: 24) : null;
22
23 @override
26 - Widget buildTrailing(BuildContext context) => Text(linkTitle,
27 - style: TextStyle(
28 - fontSize: 14.0,
29 - fontWeight: FontWeight.w500,
30 - color: Theme.of(context).primaryColor));
24 + Widget buildTrailing(BuildContext context) => Text(
25 + linkTitle,
26 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
27 + fontWeight: FontWeight.w500,
28 + color: Theme.of(context).colorScheme.primary,
29 + ),
30 + );
31
32 static void _launchUrl(String url) async {
33 try {
lib/src/screens/settings/widgets/settings_picker_cell.dart
+5 -7
@@ -1,6 +1,5 @@
1 -import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart';
2 -import 'package:cake_wallet/utils/show_pop_up.dart';
1 import 'package:flutter/material.dart';
2 +import 'package:cake_wallet/utils/show_pop_up.dart';
3 import 'package:cake_wallet/src/widgets/picker.dart';
4 import 'package:cake_wallet/src/widgets/standard_list.dart';
5
@@ -55,11 +54,10 @@ class SettingsPickerCell<ItemType> extends StandardListRow {
54 return Text(
55 displayItem?.call(selectedItem) ?? selectedItem.toString(),
56 textAlign: TextAlign.right,
58 - style: TextStyle(
59 - fontSize: 14.0,
60 - fontWeight: FontWeight.w500,
61 - color: Theme.of(context).extension<TransactionTradeTheme>()!.detailsTitlesColor,
62 - ),
57 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
58 + fontWeight: FontWeight.w600,
59 + color: Theme.of(context).colorScheme.onSurfaceVariant,
60 + ),
61 );
62 }
63 }
lib/src/screens/settings/widgets/settings_switcher_cell.dart
+2 -2
@@ -37,8 +37,8 @@ class SettingsSwitcherCell extends StandardListRow {
37 }
38 },
39 style: ButtonStyle(
40 - //backgroundColor: MaterialStateProperty.all(Theme.of(context).cardColor),
41 - shape: MaterialStateProperty.all(
40 + //backgroundColor: MaterialStateProperty.all(Theme.of(context).colorScheme.surfaceContainer),
41 + shape: WidgetStateProperty.all(
42 RoundedRectangleBorder(
43 borderRadius: BorderRadius.all(Radius.circular(10)
44 ),
lib/src/screens/settings/widgets/settings_theme_choice.dart
+67 -76
@@ -1,7 +1,6 @@
1 import 'package:cake_wallet/generated/i18n.dart';
2 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
3 -import 'package:cake_wallet/themes/theme_base.dart';
4 -import 'package:cake_wallet/themes/theme_list.dart';
2 +import 'package:cake_wallet/themes/core/material_base_theme.dart';
3 +import 'package:cake_wallet/themes/utils/theme_list.dart';
4 import 'package:cake_wallet/view_model/settings/display_settings_view_model.dart';
5 import 'package:flutter/material.dart';
6
@@ -28,92 +27,84 @@ class SettingsThemeChoicesCell extends StatelessWidget {
27 children: [
28 Text(
29 S.current.color_theme,
31 - style: TextStyle(
32 - fontSize: 14,
33 - fontWeight: FontWeight.normal,
34 - color:
35 - Theme.of(context).extension<CakeTextTheme>()!.titleColor,
36 - ),
30 + style: Theme.of(context).textTheme.bodyMedium,
31 ),
32 ],
33 ),
34 SizedBox(height: cellHeight),
35 GridView.builder(
42 - itemCount: items.length,
43 - shrinkWrap: true,
44 - physics: NeverScrollableScrollPhysics(),
45 - gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
46 - crossAxisCount: 3,
47 - mainAxisExtent: 75,
48 - crossAxisSpacing: 20,
49 - ),
50 - itemBuilder: (context, index) {
51 - final ThemeBase e = items[index];
52 - final currentTheme = _displaySettingsViewModel.theme;
53 - final isSelected = currentTheme == e;
36 + itemCount: items.length,
37 + shrinkWrap: true,
38 + physics: NeverScrollableScrollPhysics(),
39 + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
40 + crossAxisCount: 3,
41 + mainAxisExtent: 75,
42 + crossAxisSpacing: 20,
43 + ),
44 + itemBuilder: (context, index) {
45 + final MaterialThemeBase e = items[index];
46 + final currentTheme = _displaySettingsViewModel.theme;
47 + final isSelected = currentTheme == e;
48
55 - return Padding(
56 - padding: EdgeInsets.all(5),
57 - child: Semantics(
58 - label: e.toString(),
59 - selected: isSelected,
60 - child: GestureDetector(
61 - onTap: () {
62 - _displaySettingsViewModel.setTheme(e);
63 - },
64 - child: Container(
65 - padding: EdgeInsets.all(5),
66 - decoration: BoxDecoration(
67 - borderRadius: BorderRadius.circular(cellRadius),
68 - border: isSelected
69 - ? Border.all(
70 - color: Theme.of(context).primaryColor)
71 - : null,
72 - color: Theme.of(context)
73 - .extension<CakeTextTheme>()!
74 - .secondaryTextColor
75 - .withOpacity(
76 - currentTheme.brightness == Brightness.light
77 - ? 0.1
78 - : 0.3),
79 - ),
80 - child: Row(
81 - mainAxisAlignment: MainAxisAlignment.center,
82 - children: [
83 - Container(
84 - padding: EdgeInsets.symmetric(
85 - horizontal: cellWidth, vertical: cellHeight),
86 - decoration: BoxDecoration(
87 - borderRadius: BorderRadius.only(
88 - topLeft: Radius.circular(cellRadius),
89 - bottomLeft: Radius.circular(cellRadius)),
90 - color: e.themeData.primaryColor,
91 - ),
92 - ),
93 - Container(
94 - padding: EdgeInsets.symmetric(
95 - horizontal: cellWidth, vertical: cellHeight),
96 - decoration: BoxDecoration(
97 - color: e.themeData.colorScheme.background,
49 + return Padding(
50 + padding: EdgeInsets.all(5),
51 + child: Semantics(
52 + label: e.toString(),
53 + selected: isSelected,
54 + child: GestureDetector(
55 + onTap: () {
56 + _displaySettingsViewModel.onThemeSelected(e);
57 + },
58 + child: Container(
59 + padding: EdgeInsets.all(5),
60 + decoration: BoxDecoration(
61 + borderRadius: BorderRadius.circular(cellRadius),
62 + border: isSelected
63 + ? Border.all(color: Theme.of(context).colorScheme.primary)
64 + : null,
65 + color: Theme.of(context)
66 + .colorScheme
67 + .onSurfaceVariant
68 + .withOpacity(currentTheme.brightness == Brightness.light ? 0.1 : 0.3),
69 + ),
70 + child: Row(
71 + mainAxisAlignment: MainAxisAlignment.center,
72 + children: [
73 + Container(
74 + padding:
75 + EdgeInsets.symmetric(horizontal: cellWidth, vertical: cellHeight),
76 + decoration: BoxDecoration(
77 + borderRadius: BorderRadius.only(
78 + topLeft: Radius.circular(cellRadius),
79 + bottomLeft: Radius.circular(cellRadius),
80 ),
81 + color: e.colorScheme.primary,
82 ),
100 - Container(
101 - padding: EdgeInsets.symmetric(
102 - horizontal: cellWidth, vertical: cellHeight),
103 - decoration: BoxDecoration(
104 - borderRadius: BorderRadius.only(
105 - topRight: Radius.circular(cellRadius),
106 - bottomRight: Radius.circular(cellRadius)),
107 - color: e.themeData.cardColor,
83 + ),
84 + Container(
85 + padding:
86 + EdgeInsets.symmetric(horizontal: cellWidth, vertical: cellHeight),
87 + decoration: BoxDecoration(color: e.colorScheme.surface),
88 + ),
89 + Container(
90 + padding:
91 + EdgeInsets.symmetric(horizontal: cellWidth, vertical: cellHeight),
92 + decoration: BoxDecoration(
93 + borderRadius: BorderRadius.only(
94 + topRight: Radius.circular(cellRadius),
95 + bottomRight: Radius.circular(cellRadius),
96 ),
97 + color: e.colorScheme.tertiary,
98 ),
110 - ],
111 - ),
99 + ),
100 + ],
101 ),
102 ),
103 ),
115 - );
116 - }),
104 + ),
105 + );
106 + },
107 + ),
108 ],
109 ),
110 );
lib/src/screens/settings/widgets/settings_version_cell.dart
+4 -5
@@ -1,5 +1,4 @@
1 import 'package:flutter/material.dart';
2 -import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart';
2
3 class SettingsVersionCell extends StatelessWidget {
4 SettingsVersionCell({required this.title});
@@ -16,10 +15,10 @@ class SettingsVersionCell extends StatelessWidget {
15 children: <Widget>[
16 Text(
17 title,
19 - style: TextStyle(
20 - fontSize: 12,
21 - fontWeight: FontWeight.normal,
22 - color: Theme.of(context).extension<TransactionTradeTheme>()!.detailsTitlesColor),
18 + style: Theme.of(context).textTheme.bodySmall!.copyWith(
19 + fontWeight: FontWeight.normal,
20 + color: Theme.of(context).colorScheme.onSurfaceVariant,
21 + ),
22 )
23 ],
24 ),
lib/src/screens/settings/widgets/wallet_connect_button.dart
+3 -7
@@ -1,6 +1,4 @@
1 import 'package:cake_wallet/generated/i18n.dart';
2 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
3 -import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart';
2 import 'package:flutter/material.dart';
3
4 class WalletConnectTile extends StatelessWidget {
@@ -27,16 +25,14 @@ class WalletConnectTile extends StatelessWidget {
25 Expanded(
26 child: Text(
27 S.current.walletConnect,
30 - style: TextStyle(
31 - fontSize: 14,
32 - fontWeight: FontWeight.normal,
33 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
28 + style: Theme.of(context).textTheme.bodyLarge?.copyWith(
29 + color: Theme.of(context).colorScheme.onSurface,
30 ),
31 ),
32 ),
33 Image.asset(
34 'assets/images/select_arrow.png',
39 - color: Theme.of(context).extension<TransactionTradeTheme>()!.detailsTitlesColor,
35 + color: Theme.of(context).colorScheme.onSurfaceVariant,
36 )
37 ],
38 ),
lib/src/screens/setup_2fa/setup_2fa.dart
+13 -11
@@ -2,8 +2,9 @@ import 'package:cake_wallet/generated/i18n.dart';
2 import 'package:cake_wallet/routes.dart';
3 import 'package:cake_wallet/src/screens/base_page.dart';
4 import 'package:cake_wallet/src/screens/settings/widgets/settings_cell_with_arrow.dart';
5 +import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
6 +import 'package:cake_wallet/src/widgets/section_divider.dart';
7 import 'package:cake_wallet/src/widgets/standard_list.dart';
6 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
8 import 'package:cake_wallet/view_model/set_up_2fa_viewmodel.dart';
9 import 'package:flutter/material.dart';
10 import 'package:url_launcher/url_launcher.dart';
@@ -28,10 +29,13 @@ class Setup2FAPage extends BasePage {
29 flex: 2,
30 child: ConstrainedBox(
31 constraints: BoxConstraints(maxHeight: MediaQuery.of(context).size.height * 0.3),
31 - child:
32 - AspectRatio(aspectRatio: 0.6, child: Image.asset('assets/images/setup_2fa_img.png')),
32 + child: AspectRatio(
33 + aspectRatio: 0.764,
34 + child: CakeImageWidget(imageUrl: 'assets/images/2fa.png'),
35 + ),
36 ),
37 ),
38 + const SizedBox(height: 24),
39 Expanded(
40 flex: 2,
41 child: Padding(
@@ -39,12 +43,10 @@ class Setup2FAPage extends BasePage {
43 child: Text(
44 S.current.setup_2fa_text,
45 textAlign: TextAlign.center,
42 - style: TextStyle(
43 - fontWeight: FontWeight.w400,
44 - fontSize: 14,
45 - height: 1.571,
46 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
47 - ),
46 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
47 + height: 1.571,
48 + color: Theme.of(context).colorScheme.onSurfaceVariant,
49 + ),
50 ),
51 ),
52 ),
@@ -58,10 +60,10 @@ class Setup2FAPage extends BasePage {
60 return Navigator.of(context).pushReplacementNamed(Routes.setup_2faQRPage);
61 },
62 ),
61 - StandardListSeparator(padding: EdgeInsets.symmetric(horizontal: 24)),
63 + HorizontalSectionDivider(margin: EdgeInsets.symmetric(horizontal: 24)),
64 SettingsCellWithArrow(
65 title: cake2FAGuideTitle, handler: (_) => _launchUrl(cake2FAGuideUri)),
64 - StandardListSeparator(padding: EdgeInsets.symmetric(horizontal: 24)),
66 + HorizontalSectionDivider(margin: EdgeInsets.symmetric(horizontal: 24)),
67 ],
68 ),
69 ),
lib/src/screens/setup_2fa/setup_2fa_enter_code_page.dart
+21 -37
@@ -16,11 +16,9 @@ import 'package:cake_wallet/view_model/set_up_2fa_viewmodel.dart';
16 import 'package:flutter_mobx/flutter_mobx.dart';
17 import 'package:mobx/mobx.dart';
18
19 -import '../../../palette.dart';
19 import '../../../routes.dart';
20
22 -typedef OnTotpAuthenticationFinished = void Function(
23 - bool, TotpAuthCodePageState);
21 +typedef OnTotpAuthenticationFinished = void Function(bool, TotpAuthCodePageState);
22
23 class TotpAuthCodePage extends StatefulWidget {
24 TotpAuthCodePage(
@@ -46,8 +44,7 @@ class TotpAuthCodePageState extends State<TotpAuthCodePage> {
44 @override
45 void initState() {
46 if (widget.totpArguments.onTotpAuthenticationFinished != null) {
49 - _reaction ??= reaction((_) => widget.setup2FAViewModel.state,
50 - (ExecutionState state) {
47 + _reaction ??= reaction((_) => widget.setup2FAViewModel.state, (ExecutionState state) {
48 WidgetsBinding.instance.addPostFrameCallback((_) {
49 if (state is ExecutedSuccessfullyState) {
50 widget.totpArguments.onTotpAuthenticationFinished!(true, this);
@@ -76,8 +73,7 @@ class TotpAuthCodePageState extends State<TotpAuthCodePage> {
73
74 void changeProcessText(String text) {
75 dismissFlushBar(_authBar);
79 - _progressBar = createBar<void>(text, duration: null)
80 - ..show(_key.currentContext!);
76 + _progressBar = createBar<void>(text, context, duration: null)..show(_key.currentContext!);
77 }
78
79 Future<void> close({String? route, dynamic arguments}) async {
@@ -86,8 +82,7 @@ class TotpAuthCodePageState extends State<TotpAuthCodePage> {
82 }
83 await Future<void>.delayed(Duration(milliseconds: 50));
84 if (route != null) {
89 - Navigator.of(_key.currentContext!)
90 - .pushReplacementNamed(route, arguments: arguments);
85 + Navigator.of(_key.currentContext!).pushReplacementNamed(route, arguments: arguments);
86 } else {
87 Navigator.of(_key.currentContext!).pop();
88 }
@@ -125,8 +120,7 @@ class TOTPEnterCode extends BasePage {
120 }
121
122 @override
128 - String get title =>
129 - isForSetup ? S.current.setup_2fa : S.current.verify_with_2fa;
123 + String get title => isForSetup ? S.current.setup_2fa : S.current.verify_with_2fa;
124
125 Widget? leading(BuildContext context) {
126 return isClosable ? super.leading(context) : null;
@@ -150,20 +144,18 @@ class TOTPEnterCode extends BasePage {
144 hintText: S.current.totp_code,
145 controller: totpController,
146 keyboardType: TextInputType.number,
153 - placeholderTextStyle: TextStyle(
154 - fontSize: 16,
155 - fontWeight: FontWeight.w600,
156 - ),
147 + placeholderTextStyle: Theme.of(context).textTheme.bodyMedium?.copyWith(
148 + color: Theme.of(context).colorScheme.onSurfaceVariant,
149 + fontSize: 16,
150 + ),
151 ),
152 SizedBox(height: 16),
153 Text(
154 S.current.please_fill_totp,
161 - style: TextStyle(
162 - fontSize: 12,
163 - fontWeight: FontWeight.w400,
164 - height: 1.2,
165 - color: Palette.darkGray,
166 - ),
155 + style: Theme.of(context).textTheme.bodySmall?.copyWith(
156 + height: 1.2,
157 + color: Theme.of(context).colorScheme.onSurfaceVariant,
158 + ),
159 textAlign: TextAlign.center,
160 ),
161 Spacer(),
@@ -172,17 +164,15 @@ class TOTPEnterCode extends BasePage {
164 return PrimaryButton(
165 isDisabled: setup2FAViewModel.enteredOTPCode.length != 8,
166 onPressed: () async {
175 - final result = await setup2FAViewModel.totp2FAAuth(
176 - totpController.text, isForSetup);
177 - final bannedState =
178 - setup2FAViewModel.state is AuthenticationBanned;
167 + final result =
168 + await setup2FAViewModel.totp2FAAuth(totpController.text, isForSetup);
169 + final bannedState = setup2FAViewModel.state is AuthenticationBanned;
170
171 await showPopUp<void>(
172 context: context,
173 builder: (BuildContext context) {
174 return PopUpCancellableAlertDialog(
184 - contentText: _textDisplayedInPopupOnResult(
185 - result, bannedState, context),
175 + contentText: _textDisplayedInPopupOnResult(result, bannedState, context),
176 actionButtonText: S.of(context).ok,
177 buttonAction: () {
178 result ? setup2FAViewModel.success() : null;
@@ -202,11 +192,10 @@ class TOTPEnterCode extends BasePage {
192 Navigator.pushReplacementNamed(context, Routes.modify2FAPage);
193 }
194 }
205 -
195 },
196 text: S.of(context).continue_text,
208 - color: Theme.of(context).primaryColor,
209 - textColor: Colors.white,
197 + color: Theme.of(context).colorScheme.primary,
198 + textColor: Theme.of(context).colorScheme.onPrimary,
199 );
200 },
201 ),
@@ -216,13 +205,10 @@ class TOTPEnterCode extends BasePage {
205 );
206 }
207
219 - String _textDisplayedInPopupOnResult(
220 - bool result, bool bannedState, BuildContext context) {
208 + String _textDisplayedInPopupOnResult(bool result, bool bannedState, BuildContext context) {
209 switch (result) {
210 case true:
223 - return isForSetup
224 - ? S.current.totp_2fa_success
225 - : S.current.totp_verification_success;
211 + return isForSetup ? S.current.totp_2fa_success : S.current.totp_verification_success;
212 case false:
213 if (bannedState) {
214 final state = setup2FAViewModel.state as AuthenticationBanned;
@@ -230,8 +216,6 @@ class TOTPEnterCode extends BasePage {
216 } else {
217 return S.current.totp_2fa_failure;
218 }
233 - default:
234 - return S.current.enter_totp_code;
219 }
220 }
221 }
lib/src/screens/setup_2fa/setup_2fa_info_page.dart
+6
@@ -4,6 +4,12 @@ import 'package:cake_wallet/src/screens/Info_page.dart';
4 import 'package:flutter/cupertino.dart';
5
6 class Setup2FAInfoPage extends InfoPage {
7 + Setup2FAInfoPage()
8 + : super(
9 + imageLightPath: 'assets/images/2fa_warning_light.svg',
10 + imageDarkPath: 'assets/images/2fa_warning_dark.svg',
11 + );
12 +
13 @override
14 String get pageTitle => S.current.pre_seed_title;
15
lib/src/screens/setup_2fa/setup_2fa_qr_page.dart
+43 -69
@@ -5,7 +5,6 @@ import 'package:cake_wallet/src/widgets/primary_button.dart';
5 import 'package:cake_wallet/src/widgets/standard_list.dart';
6 import 'package:cake_wallet/generated/i18n.dart';
7 import 'package:cake_wallet/routes.dart';
8 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
8 import 'package:cake_wallet/utils/clipboard_util.dart';
9 import 'package:cake_wallet/utils/show_bar.dart';
10 import 'package:cake_wallet/view_model/set_up_2fa_viewmodel.dart';
@@ -25,9 +24,7 @@ class Setup2FAQRPage extends BasePage {
24 @override
25 Widget body(BuildContext context) {
26 final copyImage = Image.asset('assets/images/copy_content.png',
28 - height: 16,
29 - width: 16,
30 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor);
27 + height: 16, width: 16, color: Theme.of(context).colorScheme.onSurface);
28 final cake2FAHowToUseUrl = Uri.parse(
29 'https://docs.cakewallet.com/features/advanced/authentication/#enabling-cake-2fa');
30 return Padding(
@@ -37,17 +34,14 @@ class Setup2FAQRPage extends BasePage {
34 Spacer(),
35 Text(
36 S.current.scan_qr_on_device,
40 - style: TextStyle(
41 - fontSize: 14,
42 - fontWeight: FontWeight.w700,
43 - height: 1.5714,
44 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
45 - ),
37 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
38 + fontWeight: FontWeight.w700,
39 + height: 1.5714,
40 + ),
41 ),
42 SizedBox(height: 10),
43 ConstrainedBox(
49 - constraints: BoxConstraints(
50 - maxHeight: MediaQuery.of(context).size.height * 0.4),
44 + constraints: BoxConstraints(maxHeight: MediaQuery.of(context).size.height * 0.4),
45 child: AspectRatio(
46 aspectRatio: 1.0,
47 child: Container(
@@ -55,17 +49,14 @@ class Setup2FAQRPage extends BasePage {
49 decoration: BoxDecoration(
50 border: Border.all(
51 width: 3,
58 - color: Theme.of(context)
59 - .extension<CakeTextTheme>()!
60 - .titleColor,
52 + color: Theme.of(context).colorScheme.onSurface,
53 ),
54 ),
55 child: Container(
56 child: QrImage(
57 data: setup2FAViewModel.totpVersionOneLink,
58 version: qr.QrVersions.auto,
67 - foregroundColor:
68 - Theme.of(context).extension<CakeTextTheme>()!.titleColor,
59 + foregroundColor: Theme.of(context).colorScheme.onSurface,
60 backgroundColor: Colors.transparent,
61 )),
62 ),
@@ -74,12 +65,10 @@ class Setup2FAQRPage extends BasePage {
65 SizedBox(height: 26),
66 Text(
67 S.current.add_secret_code,
77 - style: TextStyle(
78 - fontSize: 14,
79 - fontWeight: FontWeight.w700,
80 - height: 1.5714,
81 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
82 - ),
68 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
69 + fontWeight: FontWeight.w700,
70 + height: 1.5714,
71 + ),
72 ),
73 Row(
74 mainAxisAlignment: MainAxisAlignment.spaceBetween,
@@ -92,23 +81,19 @@ class Setup2FAQRPage extends BasePage {
81 children: [
82 Text(
83 S.current.totp_secret_code,
95 - style: TextStyle(
96 - fontSize: 12,
97 - fontWeight: FontWeight.w500,
98 - color: Theme.of(context)
99 - .extension<CakeTextTheme>()!
100 - .secondaryTextColor,
101 - height: 1.8333,
102 - ),
84 + style: Theme.of(context).textTheme.bodySmall!.copyWith(
85 + fontWeight: FontWeight.w500,
86 + color: Theme.of(context).colorScheme.onSurfaceVariant,
87 + height: 1.8333,
88 + ),
89 ),
90 SizedBox(height: 8),
91 Text(
92 '${setup2FAViewModel.totpSecretKey}',
107 - style: TextStyle(
108 - fontSize: 18,
109 - color: Theme.of(context)
110 - .extension<CakeTextTheme>()!
111 - .titleColor),
93 + style: Theme.of(context)
94 + .textTheme
95 + .bodyMedium!
96 + .copyWith(fontSize: 18, color: Theme.of(context).colorScheme.onSurface),
97 maxLines: 1,
98 overflow: TextOverflow.ellipsis,
99 ),
@@ -121,8 +106,8 @@ class Setup2FAQRPage extends BasePage {
106 height: 32,
107 child: InkWell(
108 onTap: () {
124 - ClipboardUtil.setSensitiveDataToClipboard(ClipboardData(
125 - text: '${setup2FAViewModel.totpSecretKey}'));
109 + ClipboardUtil.setSensitiveDataToClipboard(
110 + ClipboardData(text: '${setup2FAViewModel.totpSecretKey}'));
111 showBar<void>(context, S.of(context).copied_to_clipboard);
112 },
113 child: Container(
@@ -146,23 +131,19 @@ class Setup2FAQRPage extends BasePage {
131 children: [
132 Text(
133 S.current.totp_auth_url,
149 - style: TextStyle(
150 - fontSize: 12,
151 - fontWeight: FontWeight.w500,
152 - color: Theme.of(context)
153 - .extension<CakeTextTheme>()!
154 - .secondaryTextColor,
155 - height: 1.8333,
156 - ),
134 + style: Theme.of(context).textTheme.bodySmall!.copyWith(
135 + fontWeight: FontWeight.w500,
136 + color: Theme.of(context).colorScheme.onSurfaceVariant,
137 + height: 1.8333,
138 + ),
139 ),
140 SizedBox(height: 8),
141 Text(
142 '${setup2FAViewModel.totpVersionOneLink}',
161 - style: TextStyle(
162 - fontSize: 18,
163 - color: Theme.of(context)
164 - .extension<CakeTextTheme>()!
165 - .titleColor),
143 + style: Theme.of(context)
144 + .textTheme
145 + .bodyMedium!
146 + .copyWith(fontSize: 18, color: Theme.of(context).colorScheme.onSurface),
147 maxLines: 1,
148 overflow: TextOverflow.ellipsis,
149 ),
@@ -175,8 +156,8 @@ class Setup2FAQRPage extends BasePage {
156 height: 32,
157 child: InkWell(
158 onTap: () {
178 - ClipboardUtil.setSensitiveDataToClipboard(ClipboardData(
179 - text: '${setup2FAViewModel.totpVersionOneLink}'));
159 + ClipboardUtil.setSensitiveDataToClipboard(
160 + ClipboardData(text: '${setup2FAViewModel.totpVersionOneLink}'));
161 showBar<void>(context, S.of(context).copied_to_clipboard);
162 },
163 child: Container(
@@ -196,32 +177,25 @@ class Setup2FAQRPage extends BasePage {
177 mainAxisAlignment: MainAxisAlignment.center,
178 children: [
179 Text(S.current.how_to_use,
199 - style: TextStyle(
180 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
181 decoration: TextDecoration.underline,
182 fontSize: 16,
183 fontWeight: FontWeight.w500,
203 - color: Theme.of(context)
204 - .extension<CakeTextTheme>()!
205 - .titleColor)),
206 - Icon(Icons.info_outline,
207 - size: 20,
208 - color: Theme.of(context)
209 - .extension<CakeTextTheme>()!
210 - .titleColor)
184 + color: Theme.of(context).colorScheme.onSurface)),
185 + Icon(Icons.info_outline, size: 20, color: Theme.of(context).colorScheme.onSurface)
186 ],
187 )),
188 Spacer(flex: 5),
189 PrimaryButton(
190 onPressed: () {
216 - Navigator.of(context)
217 - .pushReplacementNamed(Routes.totpAuthCodePage,
218 - arguments: TotpAuthArgumentsModel(
219 - isForSetup: true,
220 - ));
191 + Navigator.of(context).pushReplacementNamed(Routes.totpAuthCodePage,
192 + arguments: TotpAuthArgumentsModel(
193 + isForSetup: true,
194 + ));
195 },
196 text: S.current.continue_text,
223 - color: Theme.of(context).primaryColor,
224 - textColor: Colors.white,
197 + color: Theme.of(context).colorScheme.primary,
198 + textColor: Theme.of(context).colorScheme.onPrimary,
199 ),
200 SizedBox(height: 24),
201 ],
lib/src/screens/setup_2fa/widgets/popup_cancellable_alert.dart
+6 -9
@@ -1,9 +1,6 @@
1 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
1 import 'package:cake_wallet/src/widgets/alert_close_button.dart';
2 import 'package:cake_wallet/src/widgets/primary_button.dart';
3 import 'package:flutter/material.dart';
5 -import 'package:cake_wallet/palette.dart';
6 -
4 import 'package:cake_wallet/src/widgets/alert_background.dart';
5
6 class PopUpCancellableAlertDialog extends StatelessWidget {
@@ -27,11 +24,11 @@ class PopUpCancellableAlertDialog extends StatelessWidget {
24 return Text(
25 contentText,
26 textAlign: TextAlign.center,
30 - style: TextStyle(
27 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
28 fontSize: 16,
29 fontWeight: FontWeight.normal,
33 - fontFamily: 'Lato',
34 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
30 +
31 + color: Theme.of(context).colorScheme.onSurface,
32 decoration: TextDecoration.none,
33 ),
34 );
@@ -56,7 +53,7 @@ class PopUpCancellableAlertDialog extends StatelessWidget {
53 child: Container(
54 width: 340,
55 padding: EdgeInsets.all(10),
59 - color: Theme.of(context).dialogBackgroundColor,
56 + color: Theme.of(context).colorScheme.surface,
57 child: Column(
58 mainAxisSize: MainAxisSize.min,
59 children: <Widget>[
@@ -69,8 +66,8 @@ class PopUpCancellableAlertDialog extends StatelessWidget {
66 PrimaryButton(
67 onPressed: buttonAction,
68 text: actionButtonText,
72 - color: Color(0xffE9F2FC),
73 - textColor: Palette.darkBlueCraiola,
69 + color: Theme.of(context).colorScheme.primaryContainer,
70 + textColor: Theme.of(context).colorScheme.onPrimaryContainer,
71 ),
72 ],
73 ),
lib/src/screens/subaddress/address_edit_or_create_page.dart
+18 -21
@@ -13,8 +13,7 @@ class AddressEditOrCreatePage extends BasePage {
13 : _formKey = GlobalKey<FormState>(),
14 _labelController = TextEditingController(),
15 super() {
16 - _labelController.addListener(
17 - () => addressEditOrCreateViewModel.label = _labelController.text);
16 + _labelController.addListener(() => addressEditOrCreateViewModel.label = _labelController.text);
17 _labelController.text = addressEditOrCreateViewModel.label;
18 }
19
@@ -39,10 +38,12 @@ class AddressEditOrCreatePage extends BasePage {
38 children: <Widget>[
39 Expanded(
40 child: Center(
42 - child: BaseTextFormField(
43 - controller: _labelController,
44 - hintText: S.of(context).new_subaddress_label_name,
45 - validator: AddressLabelValidator()))),
41 + child: BaseTextFormField(
42 + controller: _labelController,
43 + hintText: S.of(context).new_subaddress_label_name,
44 + validator: AddressLabelValidator(),
45 + ),
46 + )),
47 Observer(
48 builder: (_) => LoadingPrimaryButton(
49 onPressed: () async {
@@ -53,12 +54,10 @@ class AddressEditOrCreatePage extends BasePage {
54 text: addressEditOrCreateViewModel.isEdit
55 ? S.of(context).rename
56 : S.of(context).new_subaddress_create,
56 - color: Theme.of(context).primaryColor,
57 - textColor: Colors.white,
58 - isLoading:
59 - addressEditOrCreateViewModel.state is AddressIsSaving,
60 - isDisabled:
61 - addressEditOrCreateViewModel.label.isEmpty,
57 + color: Theme.of(context).colorScheme.primary,
58 + textColor: Theme.of(context).colorScheme.onPrimary,
59 + isLoading: addressEditOrCreateViewModel.state is AddressIsSaving,
60 + isDisabled: addressEditOrCreateViewModel.label.isEmpty,
61 ),
62 )
63 ],
@@ -70,16 +69,14 @@ class AddressEditOrCreatePage extends BasePage {
69 if (_isEffectsInstalled) {
70 return;
71 }
73 - reaction((_) => addressEditOrCreateViewModel.state,
74 - (AddressEditOrCreateState state) {
75 - if (state is AddressSavedSuccessfully) {
76 - WidgetsBinding.instance
77 - .addPostFrameCallback((_) {
78 - if (context.mounted) Navigator.of(context).pop();
79 - });
80 - }
72 + reaction((_) => addressEditOrCreateViewModel.state, (AddressEditOrCreateState state) {
73 + if (state is AddressSavedSuccessfully) {
74 + WidgetsBinding.instance.addPostFrameCallback((_) {
75 + if (context.mounted) Navigator.of(context).pop();
76 });
77 + }
78 + });
79
80 _isEffectsInstalled = true;
81 }
85 -}
\ No newline at end of file
82 +}
lib/src/screens/support/support_page.dart
+7 -16
@@ -2,13 +2,10 @@ import 'package:cake_wallet/generated/i18n.dart';
2 import 'package:cake_wallet/routes.dart';
3 import 'package:cake_wallet/src/screens/base_page.dart';
4 import 'package:cake_wallet/src/widgets/option_tile.dart';
5 -import 'package:cake_wallet/themes/extensions/info_theme.dart';
6 -import 'package:cake_wallet/utils/device_info.dart';
7 -import 'package:cake_wallet/view_model/support_view_model.dart';
5 import 'package:flutter/material.dart';
6 import 'package:url_launcher/url_launcher.dart';
10 -import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
11 -import 'package:cake_wallet/themes/theme_base.dart';
7 +import 'package:cake_wallet/utils/device_info.dart';
8 +import 'package:cake_wallet/view_model/support_view_model.dart';
9
10 class SupportPage extends BasePage {
11 SupportPage(this.supportViewModel);
@@ -25,20 +22,14 @@ class SupportPage extends BasePage {
22 @override
23 AppBarStyle get appBarStyle => AppBarStyle.regular;
24
28 -
29 -
25 @override
26 Widget body(BuildContext context) {
32 -
33 - final mainColor = Theme.of(context).extension<DashboardPageTheme>()!.pageTitleTextColor;
34 - final brightColor = Theme.of(context).extension<InfoTheme>()!.textColor;
35 -
36 - final iconColor = currentTheme.type == ThemeType.bright ? brightColor : mainColor;
27 + final iconColor = Theme.of(context).colorScheme.primary;
28
29 return Container(
30 child: Center(
40 - child: ConstrainedBox(
41 - constraints: BoxConstraints(maxWidth: 330),
31 + child: Container(
32 + padding: EdgeInsets.only(left: 24, right: 24),
33 child: Column(
34 children: [
35 Padding(
@@ -64,8 +55,8 @@ class SupportPage extends BasePage {
55 padding: EdgeInsets.only(top: 20),
56 child: OptionTile(
57 icon: Icon(
67 - Icons.find_in_page,
68 - color: iconColor,
58 + Icons.find_in_page,
59 + color: iconColor,
60 size: 50,
61 ),
62 title: S.of(context).support_title_guides,
lib/src/screens/support_other_links/support_other_links_page.dart
+2 -6
@@ -1,13 +1,11 @@
1 import 'package:cake_wallet/src/screens/settings/widgets/settings_cell_with_arrow.dart';
2 import 'package:cake_wallet/src/screens/settings/widgets/settings_link_provider_cell.dart';
3 import 'package:cake_wallet/src/widgets/standard_list.dart';
4 -import 'package:cake_wallet/themes/extensions/support_page_theme.dart';
4 import 'package:cake_wallet/view_model/settings/link_list_item.dart';
5 import 'package:cake_wallet/view_model/settings/regular_list_item.dart';
6 import 'package:cake_wallet/view_model/support_view_model.dart';
7 import 'package:flutter/material.dart';
8 import 'package:cake_wallet/src/screens/base_page.dart';
10 -import 'package:cake_wallet/themes/extensions/option_tile_theme.dart';
9 import 'package:cake_wallet/generated/i18n.dart';
10
11 class SupportOtherLinksPage extends BasePage {
@@ -23,10 +21,8 @@ class SupportOtherLinksPage extends BasePage {
21
22 @override
23 Widget body(BuildContext context) {
26 -
27 - final iconColor = Theme.of(context).extension<SupportPageTheme>()!.iconColor;
28 -
29 - final isLightMode = Theme.of(context).extension<OptionTileTheme>()?.useDarkImage ?? false;
24 + final isLightMode = Theme.of(context).colorScheme.brightness == Brightness.light;
25 + final iconColor = Theme.of(context).colorScheme.onSurfaceVariant;
26
27 return Container(
28 child: Center(
lib/src/screens/trade_details/trade_details_page.dart
+36 -24
@@ -9,7 +9,7 @@ import 'package:cake_wallet/src/widgets/list_row.dart';
9 import 'package:cake_wallet/src/widgets/standard_list.dart';
10 import 'package:cake_wallet/src/widgets/standard_list_card.dart';
11 import 'package:cake_wallet/src/widgets/standard_list_status_row.dart';
12 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
12 +import 'package:cake_wallet/themes/core/material_base_theme.dart';
13 import 'package:cake_wallet/utils/show_bar.dart';
14 import 'package:cake_wallet/view_model/trade_details_view_model.dart';
15 import 'package:flutter/material.dart';
@@ -25,13 +25,14 @@ class TradeDetailsPage extends BasePage {
25 final TradeDetailsViewModel tradeDetailsViewModel;
26
27 @override
28 - Widget body(BuildContext context) => TradeDetailsPageBody(tradeDetailsViewModel);
28 + Widget body(BuildContext context) => TradeDetailsPageBody(tradeDetailsViewModel, currentTheme);
29 }
30
31 class TradeDetailsPageBody extends StatefulWidget {
32 - TradeDetailsPageBody(this.tradeDetailsViewModel);
32 + TradeDetailsPageBody(this.tradeDetailsViewModel, this.currentTheme);
33
34 final TradeDetailsViewModel tradeDetailsViewModel;
35 + final MaterialThemeBase currentTheme;
36
37 @override
38 TradeDetailsPageBodyState createState() => TradeDetailsPageBodyState(tradeDetailsViewModel);
@@ -50,10 +51,11 @@ class TradeDetailsPageBodyState extends State<TradeDetailsPageBody> {
51
52 @override
53 Widget build(BuildContext context) {
53 - return Observer(builder: (_) {
54 - final itemsCount = tradeDetailsViewModel.items.length;
54 + return Observer(
55 + builder: (_) {
56 + final itemsCount = tradeDetailsViewModel.items.length;
57
56 - return SectionStandardList(
58 + return SectionStandardList(
59 sectionCount: 1,
60 itemCounter: (int _) => itemsCount,
61 itemBuilder: (__, index) {
@@ -63,6 +65,7 @@ class TradeDetailsPageBodyState extends State<TradeDetailsPageBody> {
65 return ListRow(
66 title: '${item.title}',
67 value: '${item.value}',
68 + hintTextColor: Theme.of(context).colorScheme.onSurfaceVariant,
69 textWidget: GestureDetector(
70 onTap: () {
71 Clipboard.setData(ClipboardData(text: '${item.value}'));
@@ -70,10 +73,10 @@ class TradeDetailsPageBodyState extends State<TradeDetailsPageBody> {
73 },
74 child: Text(
75 '${item.value}',
73 - style: TextStyle(
76 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
77 fontSize: 16,
78 fontWeight: FontWeight.w500,
76 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
79 + color: Theme.of(context).colorScheme.onSurface,
80 ),
81 ),
82 ),
@@ -81,7 +84,7 @@ class TradeDetailsPageBodyState extends State<TradeDetailsPageBody> {
84 onTap: item.onTap,
85 child: Icon(
86 Icons.launch_rounded,
84 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
87 + color: Theme.of(context).colorScheme.onSurface,
88 ),
89 ),
90 );
@@ -95,26 +98,35 @@ class TradeDetailsPageBodyState extends State<TradeDetailsPageBody> {
98 extraId: item.extraId,
99 create: item.createdAt,
100 pair: item.pair,
98 - currentTheme: tradeDetailsViewModel.settingsStore.currentTheme.type,
101 + currentTheme: widget.currentTheme.type,
102 onTap: item.onTap,
103 );
104
105 if (item is TradeProviderUnsupportedItem)
103 - return AutoSizeText(item.value,
104 - textAlign: TextAlign.center,
105 - style: TextStyle(
106 - fontSize: 16,
107 - fontWeight: FontWeight.w500,
108 - color: Colors.red,
109 - ));
106 + return AutoSizeText(
107 + item.value,
108 + textAlign: TextAlign.center,
109 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
110 + fontSize: 16,
111 + fontWeight: FontWeight.w500,
112 + color: Theme.of(context).colorScheme.error,
113 + ),
114 + );
115
116 return GestureDetector(
112 - onTap: () {
113 - Clipboard.setData(ClipboardData(text: '${item.value}'));
114 - showBar<void>(context, S.of(context).copied_to_clipboard);
115 - },
116 - child: ListRow(title: '${item.title}', value: '${item.value}'));
117 - });
118 - });
117 + onTap: () {
118 + Clipboard.setData(ClipboardData(text: '${item.value}'));
119 + showBar<void>(context, S.of(context).copied_to_clipboard);
120 + },
121 + child: ListRow(
122 + title: '${item.title}',
123 + value: '${item.value}',
124 + hintTextColor: Theme.of(context).colorScheme.onSurfaceVariant,
125 + ),
126 + );
127 + },
128 + );
129 + },
130 + );
131 }
132 }
lib/src/screens/transaction_details/rbf_details_page.dart
+2 -2
@@ -104,8 +104,8 @@ class RBFDetailsPage extends BasePage {
104 text: S.of(context).send,
105 isLoading:
106 transactionDetailsViewModel.sendViewModel.state is IsExecutingState,
107 - color: Theme.of(context).primaryColor,
108 - textColor: Colors.white,
107 + color: Theme.of(context).colorScheme.primary,
108 + textColor: Theme.of(context).colorScheme.onPrimary,
109 ))),
110 ],
111 );
lib/src/screens/transaction_details/transaction_details_page.dart
+2 -3
@@ -9,7 +9,6 @@ import 'package:cake_wallet/src/screens/transaction_details/textfield_list_item.
9 import 'package:cake_wallet/src/screens/transaction_details/widgets/textfield_list_row.dart';
10 import 'package:cake_wallet/src/widgets/list_row.dart';
11 import 'package:cake_wallet/src/widgets/standard_list.dart';
12 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
12 import 'package:cake_wallet/utils/address_formatter.dart';
13 import 'package:cake_wallet/utils/show_bar.dart';
14 import 'package:cake_wallet/view_model/transaction_details_view_model.dart';
@@ -115,10 +114,10 @@ class TransactionDetailsPage extends BasePage {
114 required String value,
115 required WalletType walletType,
116 }) {
118 - final textStyle = TextStyle(
117 + final textStyle = Theme.of(context).textTheme.bodyMedium!.copyWith(
118 fontSize: 16,
119 fontWeight: FontWeight.w500,
121 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
120 + color: Theme.of(context).colorScheme.onSurface,
121 );
122 final List<Widget> children = [];
123 final bool hasDoubleNewline = value.contains('\n\n');
lib/src/screens/transaction_details/widgets/textfield_list_row.dart
+23 -26
@@ -1,6 +1,5 @@
1 import 'package:cake_wallet/generated/i18n.dart';
2 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
3 -import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart';
2 +import 'package:cake_wallet/src/widgets/base_text_form_field.dart';
3 import 'package:flutter/material.dart';
4
5 class TextFieldListRow extends StatefulWidget {
@@ -51,7 +50,7 @@ class _TextFieldListRowState extends State<TextFieldListRow> {
50 Widget build(BuildContext context) {
51 return Container(
52 width: double.infinity,
54 - color: Theme.of(context).colorScheme.background,
53 + color: Theme.of(context).colorScheme.surface,
54 child: Padding(
55 padding: const EdgeInsets.only(left: 24, top: 16, bottom: 16, right: 24),
56 child: Column(
@@ -59,37 +58,35 @@ class _TextFieldListRowState extends State<TextFieldListRow> {
58 children: <Widget>[
59 Text(
60 widget.title,
62 - style: TextStyle(
63 - fontSize: widget.titleFontSize,
64 - fontWeight: FontWeight.w500,
65 - color: Theme.of(context).extension<TransactionTradeTheme>()!.detailsTitlesColor,
66 - ),
61 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
62 + fontSize: widget.titleFontSize,
63 + fontWeight: FontWeight.w500,
64 + color: Theme.of(context).colorScheme.onSurfaceVariant,
65 + ),
66 textAlign: TextAlign.left,
67 ),
69 - TextField(
68 + SizedBox(height: 4),
69 + BaseTextFormField(
70 controller: _textController,
71 focusNode: _focusNode,
72 keyboardType: TextInputType.multiline,
73 textInputAction: TextInputAction.done,
74 maxLines: null,
75 textAlign: TextAlign.start,
76 - style: TextStyle(
77 - fontSize: widget.valueFontSize,
78 - fontWeight: FontWeight.w500,
79 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
80 - ),
81 - decoration: InputDecoration(
82 - isDense: true,
83 - contentPadding: EdgeInsets.only(top: 12, bottom: 0),
84 - hintText: S.of(context).enter_your_note,
85 - hintStyle: TextStyle(
86 - fontSize: widget.valueFontSize,
87 - fontWeight: FontWeight.w500,
88 - color: Theme.of(context).extension<TransactionTradeTheme>()!.detailsTitlesColor,
89 - ),
90 - border: InputBorder.none,
91 - ),
92 - onSubmitted: (value) {
76 + textStyle: Theme.of(context).textTheme.bodyMedium!.copyWith(
77 + fontSize: widget.valueFontSize,
78 + fontWeight: FontWeight.w500,
79 + color: Theme.of(context).colorScheme.onSurface,
80 + ),
81 + isDense: true,
82 + contentPadding: EdgeInsets.only(top: 12, bottom: 0, left: 8, right: 8),
83 + hintText: S.of(context).enter_your_note,
84 + placeholderTextStyle: Theme.of(context).textTheme.bodyMedium?.copyWith(
85 + fontSize: widget.valueFontSize,
86 + fontWeight: FontWeight.w500,
87 + color: Theme.of(context).colorScheme.onSurfaceVariant,
88 + ),
89 + onSubmit: (value) {
90 widget.onSubmitted?.call(value);
91 },
92 ),
lib/src/screens/unspent_coins/unspent_coins_list_page.dart
+19 -6
@@ -4,7 +4,6 @@ import 'package:cake_wallet/src/screens/base_page.dart';
4 import 'package:cake_wallet/src/screens/unspent_coins/widgets/unspent_coins_list_item.dart';
5 import 'package:cake_wallet/src/widgets/alert_with_no_action.dart.dart';
6 import 'package:cake_wallet/src/widgets/standard_checkbox.dart';
7 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
7 import 'package:cake_wallet/view_model/unspent_coins/unspent_coins_list_view_model.dart';
8 import 'package:flutter/material.dart';
9 import 'package:flutter_mobx/flutter_mobx.dart';
@@ -28,7 +27,7 @@ class UnspentCoinsListPage extends BasePage {
27 label: S.of(context).seed_alert_back,
28 child: TextButton(
29 style: ButtonStyle(
31 - overlayColor: WidgetStateColor.resolveWith((states) => Colors.transparent),
30 + overlayColor: WidgetStateProperty.all(Colors.transparent),
31 ),
32 onPressed: () async => await handleOnPopInvoked(context),
33 child: backButton(context),
@@ -126,7 +125,9 @@ class UnspentCoinsListFormState extends State<UnspentCoinsListForm> {
125 future: _initialization,
126 builder: (context, snapshot) {
127 if (snapshot.connectionState == ConnectionState.waiting) {
129 - return Center(child: CircularProgressIndicator());
128 + return Center(child: CircularProgressIndicator(
129 + color: Theme.of(context).colorScheme.primary,
130 + ));
131 }
132
133 if (snapshot.hasError) return Center(child: Text('Failed to load unspent coins'));
@@ -141,21 +142,33 @@ class UnspentCoinsListFormState extends State<UnspentCoinsListForm> {
142 children: [
143 SizedBox(width: 12),
144 StandardCheckbox(
144 - iconColor: Theme.of(context).extension<CakeTextTheme>()!.buttonTextColor,
145 + iconColor: Theme.of(context).colorScheme.onSurfaceVariant,
146 value: unspentCoinsListViewModel.isAllSelected,
147 onChanged: (value) => unspentCoinsListViewModel.toggleSelectAll(value),
148 ),
149 SizedBox(width: 12),
150 Text(
151 S.current.all_coins,
151 - style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
152 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
153 + fontSize: 16,
154 + fontWeight: FontWeight.bold,
155 + color: Theme.of(context).colorScheme.onSurface,
156 + ),
157 ),
158 ],
159 ),
160 SizedBox(height: 15),
161 Expanded(
162 child: unspentCoinsListViewModel.items.isEmpty
158 - ? Center(child: Text('No unspent coins available',textAlign: TextAlign.center))
163 + ? Center(
164 + child: Text(
165 + 'No unspent coins available',
166 + textAlign: TextAlign.center,
167 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
168 + color: Theme.of(context).colorScheme.onSurfaceVariant,
169 + ),
170 + )
171 + )
172 : ListView.separated(
173 itemCount: unspentCoinsListViewModel.items.length,
174 separatorBuilder: (_, __) => SizedBox(height: 15),
lib/src/screens/unspent_coins/widgets/unspent_coins_list_item.dart
+146 -121
@@ -1,7 +1,6 @@
1 import 'package:auto_size_text/auto_size_text.dart';
2 import 'package:cake_wallet/generated/i18n.dart';
3 import 'package:cake_wallet/src/widgets/standard_checkbox.dart';
4 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
4 import 'package:flutter/material.dart';
5
6 class UnspentCoinsListItem extends StatelessWidget {
@@ -27,144 +26,170 @@ class UnspentCoinsListItem extends StatelessWidget {
26
27 @override
28 Widget build(BuildContext context) {
30 - final unselectedItemColor = Theme.of(context).cardColor;
31 - final selectedItemColor = Theme.of(context).primaryColor;
29 + final unselectedItemColor = Theme.of(context).colorScheme.surfaceContainer;
30 + final selectedItemColor = Theme.of(context).colorScheme.primary;
31 final itemColor = isSending ? selectedItemColor : unselectedItemColor;
33 - final amountColor =
34 - isSending ? Colors.white : Theme.of(context).extension<CakeTextTheme>()!.buttonTextColor;
32 + final amountColor = isSending
33 + ? Theme.of(context).colorScheme.onPrimary
34 + : Theme.of(context).colorScheme.onSurface;
35 final addressColor = isSending
36 - ? Colors.white.withOpacity(0.5)
37 - : Theme.of(context).extension<CakeTextTheme>()!.buttonSecondaryTextColor;
36 + ? Theme.of(context).colorScheme.onPrimary
37 + : Theme.of(context).colorScheme.onSurface;
38
39 return Container(
40 - height: 70,
41 - padding: EdgeInsets.symmetric(vertical: 6, horizontal: 12),
42 - decoration:
43 - BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(12)), color: itemColor),
44 - child: Row(
45 - crossAxisAlignment: CrossAxisAlignment.center,
46 - children: [
47 - Padding(
48 - padding: EdgeInsets.only(right: 12),
49 - child: StandardCheckbox(
50 - iconColor: amountColor,
51 - borderColor: addressColor,
52 - value: isSending,
53 - onChanged: (value) => onCheckBoxTap?.call())),
54 - Expanded(
55 - child: Column(
56 - mainAxisAlignment: MainAxisAlignment.spaceBetween,
57 - crossAxisAlignment: CrossAxisAlignment.start,
58 - children: [
59 - Row(
60 - mainAxisAlignment: MainAxisAlignment.spaceBetween,
61 - crossAxisAlignment: CrossAxisAlignment.start,
62 - children: [
63 - Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
40 + height: 70,
41 + padding: EdgeInsets.symmetric(vertical: 6, horizontal: 12),
42 + decoration: BoxDecoration(
43 + borderRadius: BorderRadius.all(Radius.circular(12)),
44 + color: itemColor,
45 + ),
46 + child: Row(
47 + crossAxisAlignment: CrossAxisAlignment.center,
48 + children: [
49 + Padding(
50 + padding: EdgeInsets.only(right: 12),
51 + child: StandardCheckbox(
52 + iconColor: amountColor,
53 + borderColor: addressColor,
54 + value: isSending,
55 + onChanged: (value) => onCheckBoxTap?.call(),
56 + ),
57 + ),
58 + Expanded(
59 + child: Column(
60 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
61 + crossAxisAlignment: CrossAxisAlignment.start,
62 + children: [
63 + Row(
64 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
65 + crossAxisAlignment: CrossAxisAlignment.start,
66 + children: [
67 + Column(
68 + crossAxisAlignment: CrossAxisAlignment.start,
69 + children: [
70 if (note.isNotEmpty)
71 AutoSizeText(
72 note,
67 - style: TextStyle(
68 - color: amountColor, fontSize: 15, fontWeight: FontWeight.w600),
73 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
74 + color: amountColor,
75 + fontSize: 15,
76 + fontWeight: FontWeight.w600,
77 + ),
78 maxLines: 1,
79 ),
80 AutoSizeText(
81 amount,
73 - style: TextStyle(
74 - color: amountColor, fontSize: 15, fontWeight: FontWeight.w600),
75 - maxLines: 1,
76 - )
77 - ]),
78 - if (isFrozen)
79 - Container(
80 - height: 17,
81 - padding: EdgeInsets.only(left: 6, right: 6),
82 - decoration: BoxDecoration(
83 - borderRadius: BorderRadius.all(Radius.circular(8.5)),
84 - color: Colors.white),
85 - alignment: Alignment.center,
86 - child: Text(
87 - S.of(context).frozen,
88 - style: TextStyle(
89 - color: Colors.black, fontSize: 7, fontWeight: FontWeight.w600),
90 - )),
91 - ],
92 - ),
93 - Expanded(
94 - child: Row(
95 - crossAxisAlignment: CrossAxisAlignment.center,
96 - mainAxisAlignment: MainAxisAlignment.spaceBetween,
97 - children: [
98 - AutoSizeText(
99 - '${address.substring(0, 5)}...${address.substring(address.length - 5)}', // ToDo: Maybe use address label
100 - style: TextStyle(
101 - color: addressColor,
102 - fontSize: 12,
82 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
83 + color: amountColor,
84 + fontSize: 15,
85 + fontWeight: FontWeight.w600,
86 ),
87 maxLines: 1,
88 + )
89 + ],
90 + ),
91 + if (isFrozen)
92 + Container(
93 + height: 17,
94 + padding: EdgeInsets.only(left: 6, right: 6),
95 + decoration: BoxDecoration(
96 + borderRadius: BorderRadius.all(Radius.circular(8.5)),
97 + color: Theme.of(context).colorScheme.primary,
98 ),
106 - Row(
107 - mainAxisAlignment: MainAxisAlignment.spaceEvenly,
108 - children: [
109 - if (isChange)
110 - Container(
111 - height: 17,
112 - padding: EdgeInsets.only(left: 6, right: 6),
113 - decoration: BoxDecoration(
114 - borderRadius: BorderRadius.all(Radius.circular(8.5)),
115 - color: Colors.white),
116 - alignment: Alignment.center,
117 - child: Text(
118 - S.of(context).unspent_change,
119 - style: TextStyle(
120 - color: itemColor,
121 - fontSize: 7,
122 - fontWeight: FontWeight.w600,
123 - ),
124 - ),
99 + alignment: Alignment.center,
100 + child: Text(
101 + S.of(context).frozen,
102 + style: Theme.of(context).textTheme.bodySmall!.copyWith(
103 + fontWeight: FontWeight.w600,
104 + color: itemColor,
105 + fontSize: 8,
106 ),
126 - if (address.toLowerCase().contains("mweb"))
127 - Container(
128 - height: 17,
129 - padding: EdgeInsets.only(left: 6, right: 6),
130 - margin: EdgeInsets.only(left: 6),
131 - decoration: BoxDecoration(
132 - borderRadius: BorderRadius.all(Radius.circular(8.5)),
133 - color: Colors.white),
134 - alignment: Alignment.center,
135 - child: Text(
136 - "MWEB",
137 - style: TextStyle(
138 - color: itemColor,
139 - fontSize: 7,
140 - fontWeight: FontWeight.w600,
141 - ),
142 - ),
107 + ),
108 + ),
109 + ],
110 + ),
111 + Expanded(
112 + child: Row(
113 + crossAxisAlignment: CrossAxisAlignment.center,
114 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
115 + children: [
116 + AutoSizeText(
117 + '${address.substring(0, 5)}...${address.substring(address.length - 5)}', // ToDo: Maybe use address label
118 + style: Theme.of(context).textTheme.bodySmall!.copyWith(
119 + color: addressColor,
120 + ),
121 + maxLines: 1,
122 + ),
123 + Row(
124 + mainAxisAlignment: MainAxisAlignment.spaceEvenly,
125 + children: [
126 + if (isChange)
127 + Container(
128 + height: 17,
129 + padding: EdgeInsets.only(left: 6, right: 6),
130 + decoration: BoxDecoration(
131 + borderRadius: BorderRadius.all(Radius.circular(8.5)),
132 + color: Theme.of(context).colorScheme.primaryContainer,
133 ),
144 - if (isSilentPayment)
145 - Container(
146 - height: 17,
147 - padding: EdgeInsets.only(left: 6, right: 6),
148 - decoration: BoxDecoration(
149 - borderRadius: BorderRadius.all(Radius.circular(8.5)),
150 - color: Colors.white),
151 - alignment: Alignment.center,
152 - child: Text(
153 - S.of(context).silent_payments,
154 - style: TextStyle(
155 - color: itemColor,
156 - fontSize: 7,
157 - fontWeight: FontWeight.w600,
158 - ),
134 + alignment: Alignment.center,
135 + child: Text(
136 + S.of(context).unspent_change,
137 + style: Theme.of(context).textTheme.bodySmall!.copyWith(
138 + fontWeight: FontWeight.w600,
139 + fontSize: 8,
140 + color: Theme.of(context).colorScheme.onPrimaryContainer,
141 + ),
142 + ),
143 + ),
144 + if (address.toLowerCase().contains("mweb"))
145 + Container(
146 + height: 17,
147 + padding: EdgeInsets.only(left: 6, right: 6),
148 + margin: EdgeInsets.only(left: 6),
149 + decoration: BoxDecoration(
150 + borderRadius: BorderRadius.all(
151 + Radius.circular(8.5),
152 ),
153 + color: Theme.of(context).colorScheme.primaryContainer,
154 ),
161 - ],
162 - ),
163 - ],
164 - ),
155 + alignment: Alignment.center,
156 + child: Text(
157 + "MWEB",
158 + style: Theme.of(context).textTheme.bodySmall!.copyWith(
159 + fontWeight: FontWeight.w600,
160 + fontSize: 8,
161 + color: Theme.of(context).colorScheme.onPrimaryContainer,
162 + ),
163 + ),
164 + ),
165 + if (isSilentPayment)
166 + Container(
167 + height: 17,
168 + padding: EdgeInsets.only(left: 6, right: 6),
169 + decoration: BoxDecoration(
170 + borderRadius: BorderRadius.all(Radius.circular(8.5)),
171 + color: Theme.of(context).colorScheme.primaryContainer,
172 + ),
173 + alignment: Alignment.center,
174 + child: Text(
175 + S.of(context).silent_payments,
176 + style: Theme.of(context).textTheme.bodySmall!.copyWith(
177 + fontWeight: FontWeight.w600,
178 + fontSize: 8,
179 + color: Theme.of(context).colorScheme.onPrimaryContainer,
180 + ),
181 + ),
182 + ),
183 + ],
184 + ),
185 + ],
186 ),
166 - ])),
167 - ],
168 - ));
187 + ),
188 + ],
189 + ),
190 + ),
191 + ],
192 + ),
193 + );
194 }
195 }
lib/src/screens/unspent_coins/widgets/unspent_coins_switch_row.dart
+3 -4
@@ -1,6 +1,5 @@
1 import 'package:cake_wallet/src/widgets/standard_switch.dart';
2 import 'package:flutter/material.dart';
3 -import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart';
3
4 class UnspentCoinsSwitchRow extends StatelessWidget {
5 UnspentCoinsSwitchRow(
@@ -18,7 +17,7 @@ class UnspentCoinsSwitchRow extends StatelessWidget {
17 Widget build(BuildContext context) {
18 return Container(
19 width: double.infinity,
21 - color: Theme.of(context).colorScheme.background,
20 + color: Theme.of(context).colorScheme.surface,
21 child: Padding(
22 padding:
23 const EdgeInsets.only(left: 24, top: 16, bottom: 16, right: 24),
@@ -26,10 +25,10 @@ class UnspentCoinsSwitchRow extends StatelessWidget {
25 crossAxisAlignment: CrossAxisAlignment.start,
26 children: <Widget>[
27 Text(title,
29 - style: TextStyle(
28 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
29 fontSize: titleFontSize,
30 fontWeight: FontWeight.w500,
32 - color: Theme.of(context).extension<TransactionTradeTheme>()!.detailsTitlesColor),
31 + color: Theme.of(context).colorScheme.onSurfaceVariant),
32 textAlign: TextAlign.left),
33 Padding(
34 padding: EdgeInsets.only(top: 12),
lib/src/screens/ur/animated_ur_page.dart
+3 -11
@@ -1,22 +1,14 @@
1 import 'dart:async';
2
3 -import 'package:cake_wallet/di.dart';
3 import 'package:cake_wallet/entities/qr_scanner.dart';
4 import 'package:cake_wallet/generated/i18n.dart';
5 import 'package:cake_wallet/monero/monero.dart';
6 import 'package:cake_wallet/src/screens/base_page.dart';
7 import 'package:cake_wallet/src/screens/receive/widgets/qr_image.dart';
9 -import 'package:cake_wallet/src/screens/send/widgets/confirm_sending_alert.dart';
8 import 'package:cake_wallet/src/widgets/alert_with_one_action.dart';
9 import 'package:cake_wallet/src/widgets/primary_button.dart';
10 import 'package:cake_wallet/utils/show_pop_up.dart';
11 import 'package:cake_wallet/view_model/animated_ur_model.dart';
14 -import 'package:cake_wallet/view_model/dashboard/wallet_balance.dart';
15 -import 'package:cw_core/balance.dart';
16 -import 'package:cw_core/transaction_history.dart';
17 -import 'package:cw_core/transaction_info.dart';
18 -import 'package:cw_core/wallet_base.dart';
19 -import 'package:flutter/foundation.dart';
12 import 'package:flutter/material.dart';
13
14 // ur:xmr-txunsigned - unsigned transaction
@@ -63,8 +55,8 @@ class AnimatedURPage extends BasePage {
55 child: PrimaryButton(
56 onPressed: () => _continue(context),
57 text: "Continue",
66 - color: Theme.of(context).primaryColor,
67 - textColor: Colors.white,
58 + color: Theme.of(context).colorScheme.primary,
59 + textColor: Theme.of(context).colorScheme.onPrimary,
60 ),
61 ),
62 ),
@@ -77,7 +69,7 @@ class AnimatedURPage extends BasePage {
69 onPressed: () => _exportAll(context),
70 text: "Export all",
71 color: Theme.of(context).colorScheme.secondary,
80 - textColor: Colors.white,
72 + textColor: Theme.of(context).colorScheme.onPrimary,
73 ),
74 ),
75 ),
lib/src/screens/wallet/wallet_edit_page.dart
+25 -23
@@ -1,7 +1,6 @@
1 import 'package:another_flushbar/flushbar.dart';
2 import 'package:cake_wallet/core/wallet_name_validator.dart';
3 import 'package:cake_wallet/entities/wallet_edit_page_arguments.dart';
4 -import 'package:cake_wallet/palette.dart';
4 import 'package:cake_wallet/src/widgets/alert_with_one_action.dart';
5 import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
6 import 'package:cake_wallet/routes.dart';
@@ -72,11 +71,12 @@ class WalletEditPage extends BasePage {
71 child: Container(
72 padding: EdgeInsets.only(right: 8.0),
73 child: LoadingPrimaryButton(
75 - isDisabled: isLoading,
76 - onPressed: () => _removeWallet(context),
77 - text: S.of(context).delete,
78 - color: Palette.red,
79 - textColor: Colors.white),
74 + isDisabled: isLoading,
75 + onPressed: () => _removeWallet(context),
76 + text: S.of(context).delete,
77 + color: Theme.of(context).colorScheme.errorContainer,
78 + textColor: Theme.of(context).colorScheme.onErrorContainer,
79 + ),
80 ),
81 ),
82 Flexible(
@@ -142,8 +142,8 @@ class WalletEditPage extends BasePage {
142 }
143 },
144 text: S.of(context).save,
145 - color: Theme.of(context).primaryColor,
146 - textColor: Colors.white,
145 + color: Theme.of(context).colorScheme.primary,
146 + textColor: Theme.of(context).colorScheme.onPrimary,
147 isDisabled: walletEditViewModel.newName.isEmpty || isLoading,
148 ),
149 ),
@@ -176,20 +176,22 @@ class WalletEditPage extends BasePage {
176 bool confirmed = false;
177
178 await showPopUp<void>(
179 - context: context,
180 - builder: (BuildContext dialogContext) {
181 - return AlertWithTwoActions(
182 - alertTitle: S.of(context).delete_wallet,
183 - alertContent:
184 - S.of(context).delete_wallet_confirm_message(pageArguments.editingWallet.name),
185 - leftButtonText: S.of(context).cancel,
186 - rightButtonText: S.of(context).delete,
187 - actionLeftButton: () => Navigator.of(dialogContext).pop(),
188 - actionRightButton: () {
189 - confirmed = true;
190 - Navigator.of(dialogContext).pop();
191 - });
192 - });
179 + context: context,
180 + builder: (BuildContext dialogContext) {
181 + return AlertWithTwoActions(
182 + alertTitle: S.of(context).delete_wallet,
183 + alertContent:
184 + S.of(context).delete_wallet_confirm_message(pageArguments.editingWallet.name),
185 + leftButtonText: S.of(context).cancel,
186 + rightButtonText: S.of(context).delete,
187 + actionLeftButton: () => Navigator.of(dialogContext).pop(),
188 + actionRightButton: () {
189 + confirmed = true;
190 + Navigator.of(dialogContext).pop();
191 + },
192 + );
193 + },
194 + );
195
196 if (confirmed) {
197 Navigator.of(context).pop();
@@ -211,7 +213,7 @@ class WalletEditPage extends BasePage {
213 }
214
215 void changeProcessText(BuildContext context, String text) {
214 - _progressBar = createBar<void>(text, duration: null)..show(context);
216 + _progressBar = createBar<void>(text, context, duration: null)..show(context);
217 }
218
219 Future<void> hideProgressText() async {
lib/src/screens/wallet_connect/utils/method_utils.dart
+15 -8
@@ -5,6 +5,7 @@ import 'package:cake_wallet/src/screens/wallet_connect/models/wc_connection_mode
5 import 'package:cake_wallet/src/screens/wallet_connect/services/walletkit_service.dart';
6 import 'package:cake_wallet/src/screens/wallet_connect/widgets/wc_connection_widget.dart';
7 import 'package:cake_wallet/src/screens/wallet_connect/widgets/wc_request_widget.dart';
8 +import 'package:cake_wallet/themes/utils/custom_theme_colors.dart';
9 import 'package:flutter/material.dart';
10 import 'package:reown_walletkit/reown_walletkit.dart';
11
@@ -112,7 +113,7 @@ class GoBackModalWidget extends StatelessWidget {
113 @override
114 Widget build(BuildContext context) {
115 return Container(
115 - color: Theme.of(context).colorScheme.background,
116 + color: Theme.of(context).colorScheme.surface,
117 height: 280.0,
118 width: double.infinity,
119 padding: const EdgeInsets.all(20.0),
@@ -120,18 +121,24 @@ class GoBackModalWidget extends StatelessWidget {
121 children: [
122 Icon(
123 isSuccess ? Icons.check_circle_sharp : Icons.error_outline_sharp,
123 - color: isSuccess ? Colors.green[100] : Colors.red[100],
124 + color: isSuccess
125 + ? CustomThemeColors.syncGreen
126 + : Theme.of(context).colorScheme.errorContainer,
127 size: 80.0,
128 ),
129 Text(
130 title ?? S.current.connected,
128 - style: TextStyle(
129 - color: Theme.of(context).appBarTheme.titleTextStyle!.color!,
130 - fontSize: 18.0,
131 - fontWeight: FontWeight.w600,
132 - ),
131 + style: Theme.of(context).textTheme.titleLarge?.copyWith(
132 + fontSize: 18.0,
133 + fontWeight: FontWeight.w600,
134 + ),
135 + ),
136 + Text(
137 + message ?? S.current.youCanGoBackToYourDapp,
138 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
139 + fontSize: 16.0,
140 + ),
141 ),
134 - Text(message ?? S.current.youCanGoBackToYourDapp),
142 ],
143 ),
144 );
lib/src/screens/wallet_connect/wc_connections_listing_view.dart
+7 -12
@@ -3,7 +3,6 @@ import 'package:cake_wallet/src/screens/base_page.dart';
3 import 'package:cake_wallet/src/screens/wallet_connect/services/walletkit_service.dart';
4 import 'package:cake_wallet/src/screens/wallet_connect/widgets/enter_wallet_connect_uri_widget.dart';
5 import 'package:cake_wallet/src/widgets/alert_with_one_action.dart';
6 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
6 import 'package:cake_wallet/utils/device_info.dart';
7 import 'package:flutter/material.dart';
8 import 'package:flutter_mobx/flutter_mobx.dart';
@@ -121,17 +120,17 @@ class WCPairingsWidget extends BasePage {
120 SizedBox(height: 24),
121 Text(
122 S.current.connectWalletPrompt,
124 - style: TextStyle(
123 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
124 fontSize: 16.0,
125 fontWeight: FontWeight.normal,
127 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
126 + color: Theme.of(context).colorScheme.onSurface,
127 ),
128 ),
129 SizedBox(height: 16),
130 PrimaryButton(
131 text: S.current.newConnection,
133 - color: Theme.of(context).primaryColor,
134 - textColor: Colors.white,
132 + color: Theme.of(context).colorScheme.primary,
133 + textColor: Theme.of(context).colorScheme.onPrimary,
134 onPressed: () => _onScanQrCode(context, walletKit),
135 ),
136 SizedBox(height: 4),
@@ -142,11 +141,7 @@ class WCPairingsWidget extends BasePage {
141 },
142 child: Text(
143 'Click to paste WalletConnect Link',
145 - style: TextStyle(
146 - fontSize: 14.0,
147 - fontWeight: FontWeight.normal,
148 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
149 - ),
144 + style: Theme.of(context).textTheme.bodyMedium,
145 ),
146 ),
147 ],
@@ -160,10 +155,10 @@ class WCPairingsWidget extends BasePage {
155 child: Text(
156 S.current.activeConnectionsPrompt,
157 textAlign: TextAlign.center,
163 - style: TextStyle(
158 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
159 fontSize: 16.0,
160 fontWeight: FontWeight.normal,
166 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
161 + color: Theme.of(context).colorScheme.onSurface,
162 ),
163 ),
164 ),
lib/src/screens/wallet_connect/wc_pairing_detail_page.dart
+23 -29
@@ -3,7 +3,6 @@ import 'package:cake_wallet/src/screens/base_page.dart';
3 import 'package:cake_wallet/src/screens/wallet_connect/services/walletkit_service.dart';
4 import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
5 import 'package:cake_wallet/src/widgets/primary_button.dart';
6 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
6 import 'package:cake_wallet/utils/show_pop_up.dart';
7 import 'package:flutter/material.dart';
8 import 'package:reown_walletkit/reown_walletkit.dart';
@@ -74,9 +73,9 @@ class WalletConnectPairingDetailsPageState extends State<WalletConnectPairingDet
73 debugPrint('${e.toString()}');
74 }
75 },
77 - text: S.current.extend_session,
78 - color: Theme.of(context).primaryColor,
79 - textColor: Colors.white,
76 + text: S.current.extend_session,
77 + color: Theme.of(context).colorScheme.primary,
78 + textColor: Theme.of(context).colorScheme.onPrimary,
79 ),
80 );
81 sessionWidgets.add(const SizedBox.square(dimension: 10.0));
@@ -93,8 +92,8 @@ class WalletConnectPairingDetailsPageState extends State<WalletConnectPairingDet
92 }
93 },
94 text: S.current.update_session,
96 - color: Theme.of(context).primaryColor,
97 - textColor: Colors.white,
95 + color: Theme.of(context).colorScheme.primary,
96 + textColor: Theme.of(context).colorScheme.onPrimary,
97 ),
98 );
99 sessionWidgets.add(const SizedBox.square(dimension: 10.0));
@@ -109,9 +108,9 @@ class WalletConnectPairingDetailsPageState extends State<WalletConnectPairingDet
108 debugPrint('${e.toString()}');
109 }
110 },
112 - text: S.current.disconnect_session,
113 - color: Theme.of(context).primaryColor,
114 - textColor: Colors.white,
111 + text: S.current.disconnect_session,
112 + color: Theme.of(context).colorScheme.primary,
113 + textColor: Theme.of(context).colorScheme.onPrimary,
114 ),
115 );
116 }
@@ -153,37 +152,32 @@ class WCCDetailsWidget extends BasePage {
152 Flexible(
153 child: CircleAvatar(
154 backgroundImage: (pairing.peerMetadata!.icons.isNotEmpty
156 - ? NetworkImage(pairing.peerMetadata!.icons[0])
157 - : const AssetImage('assets/images/app_logo.png'))
158 - as ImageProvider<Object>,
155 + ? NetworkImage(pairing.peerMetadata!.icons[0])
156 + : const AssetImage('assets/images/app_logo.png')) as ImageProvider<Object>,
157 ),
158 ),
159 const SizedBox(height: 20.0),
160 Text(
161 pairing.peerMetadata!.name,
164 - style: TextStyle(
165 - fontSize: 16.0,
166 - fontWeight: FontWeight.w500,
167 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
168 - ),
162 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
163 + fontSize: 16.0,
164 + fontWeight: FontWeight.w500,
165 + color: Theme.of(context).colorScheme.onSurfaceVariant,
166 + ),
167 ),
168 const SizedBox(height: 16.0),
169 Text(
170 pairing.peerMetadata!.url,
173 - style: TextStyle(
174 - fontSize: 14.0,
175 - fontWeight: FontWeight.normal,
176 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
177 - ),
171 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
172 + color: Theme.of(context).colorScheme.onSurfaceVariant,
173 + ),
174 ),
175 const SizedBox(height: 8.0),
176 Text(
177 '${S.current.expiresOn}: $expiryDate',
182 - style: TextStyle(
183 - fontSize: 14.0,
184 - fontWeight: FontWeight.normal,
185 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
186 - ),
178 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
179 + color: Theme.of(context).colorScheme.onSurfaceVariant,
180 + ),
181 ),
182 const SizedBox(height: 20.0),
183 Column(
@@ -196,8 +190,8 @@ class WCCDetailsWidget extends BasePage {
190 onPressed: () =>
191 _onDeleteButtonPressed(context, pairing.peerMetadata!.name, walletKitService),
192 text: S.current.delete,
199 - color: Theme.of(context).primaryColor,
200 - textColor: Colors.white,
193 + color: Theme.of(context).colorScheme.primary,
194 + textColor: Theme.of(context).colorScheme.onPrimary,
195 ),
196 ],
197 ),
lib/src/screens/wallet_connect/widgets/bottom_sheet/bottom_sheet_listener_widget.dart
+20 -17
@@ -52,7 +52,7 @@ class BottomSheetListenerState extends State<BottomSheetListener> {
52 });
53 }
54 return Material(
55 - color: Theme.of(context).colorScheme.background,
55 + color: Theme.of(context).colorScheme.surface,
56 borderRadius: BorderRadius.all(Radius.circular(16)),
57 child: Padding(
58 padding: EdgeInsets.only(
@@ -64,22 +64,25 @@ class BottomSheetListenerState extends State<BottomSheetListener> {
64 child: Column(
65 mainAxisSize: MainAxisSize.min,
66 children: [
67 - Row(
68 - mainAxisAlignment: MainAxisAlignment.end,
69 - children: [
70 - IconButton(
71 - color: Theme.of(context).appBarTheme.titleTextStyle!.color!,
72 - padding: const EdgeInsets.all(0.0),
73 - visualDensity: VisualDensity.compact,
74 - onPressed: () {
75 - if (Navigator.canPop(context)) {
76 - Navigator.pop(context);
77 - }
78 - },
79 - icon: const Icon(Icons.close_sharp),
80 - ),
81 - ],
82 - ),
67 + // Row(
68 + // mainAxisAlignment: MainAxisAlignment.end,
69 + // children: [
70 + // IconButton(
71 + // color: Theme.of(context).colorScheme.surfaceContainerHighest,
72 + // padding: const EdgeInsets.all(0.0),
73 + // visualDensity: VisualDensity.compact,
74 + // onPressed: () {
75 + // if (Navigator.canPop(context)) {
76 + // Navigator.pop(context);
77 + // }
78 + // },
79 + // icon: Icon(
80 + // Icons.close_sharp,
81 + // color: Theme.of(context).colorScheme.onSurfaceVariant,
82 + // ),
83 + // ),
84 + // ],
85 + // ),
86 Flexible(child: item.widget),
87 ],
88 ),
lib/src/screens/wallet_connect/widgets/bottom_sheet/bottom_sheet_message_display_widget.dart
+13 -13
@@ -1,5 +1,4 @@
1 import 'package:cake_wallet/generated/i18n.dart';
2 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
2 import 'package:flutter/material.dart';
3
4 class BottomSheetMessageDisplayWidget extends StatelessWidget {
@@ -20,14 +19,14 @@ class BottomSheetMessageDisplayWidget extends StatelessWidget {
19 children: [
20 Text(
21 isError ? S.current.error : S.current.successful,
23 - style: TextStyle(
24 - fontSize: 16,
25 - fontWeight: FontWeight.normal,
26 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
27 - ),
22 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
23 + fontSize: 16,
24 + fontWeight: FontWeight.normal,
25 + color: Theme.of(context).colorScheme.onSurfaceVariant,
26 + ),
27 ),
28 IconButton(
30 - color: Theme.of(context).appBarTheme.titleTextStyle!.color!,
29 + color: Theme.of(context).colorScheme.surfaceContainerHighest,
30 padding: const EdgeInsets.all(0.0),
31 visualDensity: VisualDensity.compact,
32 onPressed: () {
@@ -35,7 +34,10 @@ class BottomSheetMessageDisplayWidget extends StatelessWidget {
34 Navigator.pop(context);
35 }
36 },
38 - icon: const Icon(Icons.close_sharp),
37 + icon: Icon(
38 + Icons.close_sharp,
39 + color: Theme.of(context).colorScheme.onSurfaceVariant,
40 + ),
41 ),
42 ],
43 ),
@@ -45,11 +47,9 @@ class BottomSheetMessageDisplayWidget extends StatelessWidget {
47 Expanded(
48 child: Text(
49 message,
48 - style: TextStyle(
49 - fontSize: 14,
50 - fontWeight: FontWeight.normal,
51 - color: Theme.of(context).extension<CakeTextTheme>()!.secondaryTextColor,
52 - ),
50 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
51 + color: Theme.of(context).colorScheme.onSurfaceVariant,
52 + ),
53 ),
54 ),
55 ],
lib/src/screens/wallet_connect/widgets/enter_wallet_connect_uri_widget.dart
+34 -45
@@ -1,7 +1,6 @@
1 import 'package:cake_wallet/generated/i18n.dart';
2 import 'package:cake_wallet/src/widgets/base_alert_dialog.dart';
3 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
4 -import 'package:cake_wallet/themes/extensions/send_page_theme.dart';
3 +import 'package:cake_wallet/src/widgets/base_text_form_field.dart';
4 import 'package:flutter/material.dart';
5 import 'package:flutter/services.dart';
6
@@ -58,7 +57,7 @@ class EnterWalletConnectURIWidget extends BaseAlertDialog {
57 @override
58 Widget content(BuildContext context) {
59 return Card(
61 - color: Theme.of(context).dialogBackgroundColor,
60 + color: Theme.of(context).colorScheme.surface,
61 elevation: 0.0,
62 margin: EdgeInsets.zero,
63 child: Column(
@@ -70,47 +69,37 @@ class EnterWalletConnectURIWidget extends BaseAlertDialog {
69 style: Theme.of(context).textTheme.bodySmall,
70 ),
71 SizedBox(height: 16),
73 - TextField(
72 + BaseTextFormField(
73 controller: controller,
75 - style: TextStyle(
76 - fontSize: 14,
77 - fontWeight: FontWeight.w500,
78 - color: Theme.of(context).extension<CakeTextTheme>()!.secondaryTextColor,
79 - ),
80 - decoration: InputDecoration(
81 - suffixIcon: Container(
82 - width: 24,
83 - height: 24,
84 - padding: EdgeInsets.only(top: 0),
85 - child: Semantics(
86 - label: S.of(context).paste,
87 - child: InkWell(
88 - onTap: () => _pasteWalletConnectURI(),
89 - child: Container(
90 - padding: EdgeInsets.all(10),
91 - decoration: BoxDecoration(
92 - borderRadius: BorderRadius.all(Radius.circular(6)),
93 - ),
94 - child: Image.asset(
95 - 'assets/images/paste_ios.png',
96 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
97 - ),
74 + textStyle: Theme.of(context).textTheme.bodyMedium!.copyWith(
75 + fontWeight: FontWeight.w500,
76 + ),
77 + suffixIcon: Container(
78 + width: 24,
79 + height: 24,
80 + padding: EdgeInsets.only(top: 0),
81 + child: Semantics(
82 + label: S.of(context).paste,
83 + child: InkWell(
84 + onTap: () => _pasteWalletConnectURI(),
85 + child: Container(
86 + padding: EdgeInsets.all(10),
87 + decoration: BoxDecoration(
88 + borderRadius: BorderRadius.all(Radius.circular(6)),
89 + ),
90 + child: Image.asset(
91 + 'assets/images/paste_ios.png',
92 + color: Theme.of(context).colorScheme.onSurfaceVariant,
93 ),
94 ),
95 ),
96 ),
102 - hintText: S.current.enterWalletConnectURI,
103 - border: OutlineInputBorder(
104 - borderSide: BorderSide(
105 - color: Theme.of(context).extension<SendPageTheme>()!.textFieldBorderColor,
106 - ),
107 - ),
108 - hintStyle: TextStyle(
109 - color: Theme.of(context).extension<CakeTextTheme>()!.secondaryTextColor,
110 - fontWeight: FontWeight.w500,
111 - fontSize: 14,
112 - ),
97 ),
98 + hintText: S.current.enterWalletConnectURI,
99 + placeholderTextStyle: Theme.of(context).textTheme.bodyMedium!.copyWith(
100 + color: Theme.of(context).colorScheme.onSurfaceVariant,
101 + fontWeight: FontWeight.w500,
102 + ),
103 ),
104 ],
105 ),
@@ -123,7 +112,7 @@ class EnterWalletConnectURIWidget extends BaseAlertDialog {
112 width: 300,
113 height: 52,
114 padding: EdgeInsets.only(left: 12, right: 12),
126 - color: Theme.of(context).dialogBackgroundColor,
115 + color: Theme.of(context).colorScheme.surface,
116 child: ButtonTheme(
117 minWidth: double.infinity,
118 child: TextButton(
@@ -133,12 +122,12 @@ class EnterWalletConnectURIWidget extends BaseAlertDialog {
122 child: Text(
123 S.current.confirm,
124 textAlign: TextAlign.center,
136 - style: TextStyle(
137 - fontSize: 15,
138 - fontWeight: FontWeight.w600,
139 - color: Theme.of(context).primaryColor,
140 - decoration: TextDecoration.none,
141 - ),
125 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
126 + fontSize: 15,
127 + fontWeight: FontWeight.w600,
128 + color: Theme.of(context).colorScheme.primary,
129 + decoration: TextDecoration.none,
130 + ),
131 ),
132 ),
133 ),
lib/src/screens/wallet_connect/widgets/wc_connection_item_widget.dart
+19 -27
@@ -1,5 +1,4 @@
1 import 'package:cake_wallet/src/screens/wallet_connect/models/wc_connection_model.dart';
2 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
2 import 'package:flutter/material.dart';
3
4 class WCConnectionItemWidget extends StatelessWidget {
@@ -9,11 +8,10 @@ class WCConnectionItemWidget extends StatelessWidget {
8
9 @override
10 Widget build(BuildContext context) {
12 -
11 return Container(
12 width: double.infinity,
13 decoration: BoxDecoration(
16 - color: Theme.of(context).cardColor,
14 + color: Theme.of(context).colorScheme.surfaceContainer,
15 borderRadius: BorderRadius.circular(8),
16 ),
17 padding: const EdgeInsets.all(8),
@@ -25,22 +23,20 @@ class WCConnectionItemWidget extends StatelessWidget {
23 children: [
24 Text(
25 model.title ?? '',
28 - style: TextStyle(
29 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
30 - fontSize: 14,
31 - fontWeight: FontWeight.w600,
32 - ),
26 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
27 + fontWeight: FontWeight.w600,
28 + ),
29 ),
30 const SizedBox(height: 8),
31 if (model.elements != null)
36 - Wrap(
37 - spacing: 4,
38 - runSpacing: 4,
39 - direction: Axis.horizontal,
40 - children: model.elements!
41 - .map((e) => _ModelElementWidget(model: model, modelElement: e))
42 - .toList(),
43 - ),
32 + Wrap(
33 + spacing: 4,
34 + runSpacing: 4,
35 + direction: Axis.horizontal,
36 + children: model.elements!
37 + .map((e) => _ModelElementWidget(model: model, modelElement: e))
38 + .toList(),
39 + ),
40 ],
41 ),
42 replacement: _NoModelElementWidget(model: model),
@@ -58,11 +54,9 @@ class _NoModelElementWidget extends StatelessWidget {
54 Widget build(BuildContext context) {
55 return Text(
56 model.text!,
61 - style: TextStyle(
62 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
63 - fontSize: 14,
64 - fontWeight: FontWeight.w600,
65 - ),
57 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
58 + fontWeight: FontWeight.w600,
59 + ),
60 );
61 }
62 }
@@ -82,17 +76,15 @@ class _ModelElementWidget extends StatelessWidget {
76 onTap: model.elementActions != null ? model.elementActions![modelElement] : null,
77 child: Container(
78 decoration: BoxDecoration(
85 - color: Theme.of(context).colorScheme.background,
79 + color: Theme.of(context).colorScheme.surface,
80 borderRadius: BorderRadius.circular(6),
81 ),
82 padding: const EdgeInsets.all(8),
83 child: Text(
84 modelElement,
91 - style: TextStyle(
92 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
93 - fontSize: 14,
94 - fontWeight: FontWeight.w600,
95 - ),
85 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
86 + fontWeight: FontWeight.w600,
87 + ),
88 maxLines: 10,
89 overflow: TextOverflow.ellipsis,
90 ),
lib/src/screens/wallet_connect/widgets/wc_connection_request_widget.dart
+1 -1
@@ -43,7 +43,7 @@ class WCConnectionRequestWidget extends StatelessWidget {
43 const SizedBox(height: 8),
44 Text(
45 '${requester!.metadata.name} ${S.current.wouoldLikeToConnect}',
46 - style: TextStyle(
46 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
47 fontSize: 18.0,
48 fontWeight: FontWeight.bold,
49 ),
lib/src/screens/wallet_connect/widgets/wc_connection_widget.dart
+5 -5
@@ -14,7 +14,7 @@ class WCConnectionWidget extends StatelessWidget {
14
15 return Container(
16 decoration: BoxDecoration(
17 - color: Theme.of(context).primaryColorLight,
17 + color: Theme.of(context).colorScheme.primary,
18 borderRadius: BorderRadius.circular(8),
19 ),
20 padding: const EdgeInsets.all(8),
@@ -23,17 +23,17 @@ class WCConnectionWidget extends StatelessWidget {
23 children: [
24 Container(
25 decoration: BoxDecoration(
26 - color: Theme.of(context) .colorScheme.background,
26 + color: Theme.of(context).colorScheme.surface,
27 borderRadius: BorderRadius.circular(8),
28 ),
29 padding: EdgeInsets.symmetric(vertical: 8, horizontal: 8),
30 child: Text(
31 title,
32 - style: TextStyle(
32 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
33 fontSize: 16,
34 fontWeight: FontWeight.w600,
35 - color: Theme.of(context).appBarTheme.titleTextStyle!.color!
36 - ),
35 + color: Theme.of(context).colorScheme.onSurface,
36 + ),
37 ),
38 ),
39 const SizedBox(height: 8),
lib/src/screens/wallet_connect/widgets/wc_pairing_item_widget.dart
+17 -21
@@ -1,7 +1,5 @@
1 import 'package:cake_wallet/generated/i18n.dart';
2 import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
3 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
4 -import 'package:cake_wallet/themes/extensions/receive_page_theme.dart';
3 import 'package:flutter/material.dart';
4 import 'package:reown_walletkit/reown_walletkit.dart';
5
@@ -29,37 +27,35 @@ class WCPairingItemWidget extends StatelessWidget {
27
28 return ListTile(
29 leading: CakeImageWidget(
32 - imageUrl: metadata.icons.isNotEmpty ? metadata.icons[0]: null,
33 - displayOnError: CircleAvatar(
30 + imageUrl: metadata.icons.isNotEmpty ? metadata.icons[0] : null,
31 + errorWidget: CircleAvatar(
32 backgroundImage: AssetImage('assets/images/walletconnect_logo.png'),
33 ),
34 ),
35 title: Text(
36 metadata.name,
39 - style: TextStyle(
40 - fontSize: 16.0,
41 - fontWeight: FontWeight.w700,
42 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
43 - ),
37 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
38 + fontSize: 16.0,
39 + fontWeight: FontWeight.w700,
40 + color: Theme.of(context).colorScheme.onSurfaceVariant,
41 + ),
42 ),
43 subtitle: Column(
44 crossAxisAlignment: CrossAxisAlignment.start,
45 children: [
46 Text(
47 metadata.url,
50 - style: TextStyle(
51 - fontSize: 14.0,
52 - fontWeight: FontWeight.w700,
53 - color: Theme.of(context).extension<CakeTextTheme>()!.secondaryTextColor,
54 - ),
48 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
49 + fontWeight: FontWeight.w700,
50 + color: Theme.of(context).colorScheme.onSurfaceVariant,
51 + ),
52 ),
53 Text(
54 '${S.current.expiresOn}: $expiryDate',
58 - style: TextStyle(
59 - fontSize: 14.0,
60 - fontWeight: FontWeight.w700,
61 - color: Theme.of(context).extension<CakeTextTheme>()!.secondaryTextColor,
62 - ),
55 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
56 + fontWeight: FontWeight.w700,
57 + color: Theme.of(context).colorScheme.onSurfaceVariant,
58 + ),
59 ),
60 ],
61 ),
@@ -69,12 +65,12 @@ class WCPairingItemWidget extends StatelessWidget {
65 padding: EdgeInsets.all(10),
66 decoration: BoxDecoration(
67 shape: BoxShape.circle,
72 - color: Theme.of(context).extension<ReceivePageTheme>()!.iconsBackgroundColor,
68 + color: Theme.of(context).colorScheme.primary,
69 ),
70 child: Icon(
71 Icons.edit,
72 size: 14,
77 - color: Theme.of(context).extension<ReceivePageTheme>()!.iconsColor,
73 + color: Theme.of(context).colorScheme.onPrimary,
74 ),
75 ),
76 onTap: onTap,
lib/src/screens/wallet_connect/widgets/wc_request_widget.dart
+4 -9
@@ -3,10 +3,7 @@ import 'package:cake_wallet/generated/i18n.dart';
3 import 'package:cake_wallet/src/screens/wallet_connect/services/bottom_sheet_service.dart';
4 import 'package:cake_wallet/src/screens/wallet_connect/widgets/wc_verify_context_widget.dart';
5 import 'package:cake_wallet/src/widgets/primary_button.dart';
6 -import 'package:cake_wallet/store/settings_store.dart';
7 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
8 -import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
9 -import 'package:cake_wallet/themes/theme_base.dart';
6 +import 'package:cake_wallet/themes/core/theme_store.dart';
7 import 'package:flutter/material.dart';
8 import 'package:reown_walletkit/reown_walletkit.dart';
9
@@ -25,7 +22,7 @@ class WCRequestWidget extends StatelessWidget {
22
23 @override
24 Widget build(BuildContext context) {
28 - final currentTheme = getIt.get<SettingsStore>().currentTheme;
25 + final currentTheme = getIt.get<ThemeStore>().currentTheme;
26
27 return Column(
28 mainAxisSize: MainAxisSize.min,
@@ -65,10 +62,8 @@ class WCRequestWidget extends StatelessWidget {
62 }
63 },
64 text: S.current.approve,
68 - color: Theme.of(context).primaryColor,
69 - textColor: currentTheme.type == ThemeType.dark
70 - ? Theme.of(context).extension<DashboardPageTheme>()!.textColor
71 - : Theme.of(context).extension<CakeTextTheme>()!.buttonTextColor,
65 + color: Theme.of(context).colorScheme.primary,
66 + textColor: Theme.of(context).colorScheme.onPrimary,
67 ),
68 ),
69 ],
lib/src/screens/wallet_connect/widgets/wc_session_auth_request_widget.dart
+3 -4
@@ -1,7 +1,6 @@
1 import 'package:cake_wallet/generated/i18n.dart';
2 import 'package:cake_wallet/src/screens/wallet_connect/services/bottom_sheet_service.dart';
3 import 'package:cake_wallet/src/widgets/primary_button.dart';
4 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
4 import 'package:flutter/material.dart';
5
6 class WCSessionAuthRequestWidget extends StatelessWidget {
@@ -39,8 +38,8 @@ class WCSessionAuthRequestWidget extends StatelessWidget {
38 }
39 },
40 text: S.current.sign_one,
42 - color: Theme.of(context).primaryColor,
43 - textColor: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
41 + color: Theme.of(context).colorScheme.primary,
42 + textColor: Theme.of(context).colorScheme.onPrimary,
43 ),
44 const SizedBox(width: 8),
45 PrimaryButton(
@@ -51,7 +50,7 @@ class WCSessionAuthRequestWidget extends StatelessWidget {
50 },
51 text: S.current.sign_all,
52 color: Theme.of(context).secondaryHeaderColor,
54 - textColor: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
53 + textColor: Theme.of(context).colorScheme.onPrimary,
54 ),
55 ],
56 ),
lib/src/screens/wallet_connect/widgets/wc_verify_context_widget.dart
+18 -21
@@ -1,7 +1,6 @@
1 import 'package:cake_wallet/generated/i18n.dart';
2 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
3 -import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
4 -import 'package:cake_wallet/themes/theme_base.dart';
2 +import 'package:cake_wallet/themes/core/material_base_theme.dart';
3 +import 'package:cake_wallet/themes/utils/custom_theme_colors.dart';
4 import 'package:flutter/material.dart';
5 import 'package:reown_walletkit/reown_walletkit.dart';
6
@@ -13,7 +12,7 @@ class WCVerifyContextWidget extends StatelessWidget {
12 });
13
14 final VerifyContext? verifyContext;
16 - final ThemeBase currentTheme;
15 + final MaterialThemeBase currentTheme;
16
17 @override
18 Widget build(BuildContext context) {
@@ -23,7 +22,7 @@ class WCVerifyContextWidget extends StatelessWidget {
22
23 if (verifyContext!.validation.scam) {
24 return VerifyBanner(
26 - color: Theme.of(context).colorScheme.error,
25 + color: Theme.of(context).colorScheme.errorContainer,
26 origin: verifyContext!.origin,
27 title: S.current.security_risk,
28 text: S.current.security_risk_description,
@@ -31,7 +30,7 @@ class WCVerifyContextWidget extends StatelessWidget {
30 }
31 if (verifyContext!.validation.invalid) {
32 return VerifyBanner(
34 - color: Theme.of(context).colorScheme.error,
33 + color: Theme.of(context).colorScheme.errorContainer,
34 origin: verifyContext!.origin,
35 title: S.current.domain_mismatch,
36 text: S.current.domain_mismatch_description,
@@ -39,14 +38,12 @@ class WCVerifyContextWidget extends StatelessWidget {
38 }
39 if (verifyContext!.validation.valid) {
40 return VerifyHeader(
42 - iconColor: currentTheme.type == ThemeType.dark
43 - ? Theme.of(context).extension<DashboardPageTheme>()!.textColor
44 - : Theme.of(context).extension<CakeTextTheme>()!.buttonTextColor,
41 + iconColor: Theme.of(context).colorScheme.onPrimary,
42 title: verifyContext!.origin,
43 );
44 }
45 return VerifyBanner(
49 - color: Colors.orange,
46 + color: CustomThemeColors.syncYellow,
47 origin: verifyContext!.origin,
48 title: S.current.cannot_verify,
49 text: S.current.cannot_verify_description,
@@ -75,10 +72,10 @@ class VerifyHeader extends StatelessWidget {
72 const SizedBox(width: 8),
73 Text(
74 title,
78 - style: TextStyle(
79 - color: iconColor,
80 - fontWeight: FontWeight.bold,
81 - ),
75 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
76 + color: iconColor,
77 + fontWeight: FontWeight.bold,
78 + ),
79 ),
80 ],
81 );
@@ -102,9 +99,9 @@ class VerifyBanner extends StatelessWidget {
99 children: [
100 Text(
101 origin,
105 - style: const TextStyle(
106 - fontWeight: FontWeight.bold,
107 - ),
102 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
103 + fontWeight: FontWeight.bold,
104 + ),
105 ),
106 const SizedBox.square(dimension: 8.0),
107 Container(
@@ -123,10 +120,10 @@ class VerifyBanner extends StatelessWidget {
120 Text(
121 text,
122 textAlign: TextAlign.center,
126 - style: TextStyle(
127 - color: color,
128 - fontWeight: FontWeight.bold,
129 - ),
123 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
124 + color: color,
125 + fontWeight: FontWeight.bold,
126 + ),
127 ),
128 ],
129 ),
lib/src/screens/wallet_keys/wallet_keys_page.dart
+54 -57
@@ -6,9 +6,7 @@ import 'package:cake_wallet/src/widgets/primary_button.dart';
6 import 'package:cake_wallet/src/widgets/seedphrase_grid_widget.dart';
7 import 'package:cake_wallet/src/widgets/text_info_box.dart';
8 import 'package:cake_wallet/src/widgets/warning_box_widget.dart';
9 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
10 -import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
11 -import 'package:cake_wallet/themes/theme_base.dart';
9 +import 'package:cake_wallet/themes/core/material_base_theme.dart';
10 import 'package:cake_wallet/utils/brightness_util.dart';
11 import 'package:cake_wallet/utils/clipboard_util.dart';
12 import 'package:cake_wallet/utils/show_bar.dart';
@@ -59,7 +57,7 @@ class WalletKeysPageBody extends StatefulWidget {
57 });
58
59 final WalletKeysViewModel walletKeysViewModel;
62 - final ThemeBase currentTheme;
60 + final MaterialThemeBase currentTheme;
61
62 @override
63 State<StatefulWidget> createState() => _WalletKeysPageBodyState();
@@ -108,20 +106,20 @@ class _WalletKeysPageBodyState extends State<WalletKeysPageBody>
106 splashFactory: NoSplash.splashFactory,
107 indicatorSize: TabBarIndicatorSize.label,
108 isScrollable: true,
111 - labelStyle: TextStyle(
112 - fontSize: 18,
113 - fontFamily: 'Lato',
114 - fontWeight: FontWeight.w600,
115 - color: Theme.of(context).appBarTheme.titleTextStyle!.color,
116 - ),
117 - unselectedLabelStyle: TextStyle(
118 - fontSize: 18,
119 - fontFamily: 'Lato',
120 - fontWeight: FontWeight.w600,
121 - color: Theme.of(context).appBarTheme.titleTextStyle!.color?.withOpacity(0.5),
122 - ),
123 - labelColor: Theme.of(context).appBarTheme.titleTextStyle!.color,
124 - indicatorColor: Theme.of(context).appBarTheme.titleTextStyle!.color,
109 + labelStyle: Theme.of(context).textTheme.bodyMedium!.copyWith(
110 + fontSize: 18,
111 +
112 + fontWeight: FontWeight.w600,
113 + color: Theme.of(context).colorScheme.onSurfaceVariant,
114 + ),
115 + unselectedLabelStyle: Theme.of(context).textTheme.bodyMedium!.copyWith(
116 + fontSize: 18,
117 +
118 + fontWeight: FontWeight.w600,
119 + color: Theme.of(context).colorScheme.onSurfaceVariant.withOpacity(0.5),
120 + ),
121 + labelColor: Theme.of(context).colorScheme.onSurfaceVariant,
122 + indicatorColor: Theme.of(context).colorScheme.onSurfaceVariant,
123 indicatorPadding: EdgeInsets.zero,
124 labelPadding: const EdgeInsets.only(right: 24),
125 tabAlignment: TabAlignment.start,
@@ -219,7 +217,7 @@ class _WalletKeysPageBodyState extends State<WalletKeysPageBody>
217 padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 14),
218 decoration: BoxDecoration(
219 borderRadius: BorderRadius.circular(8),
222 - color: Theme.of(context).cardColor,
220 + color: Theme.of(context).colorScheme.surfaceContainer,
221 ),
222 child: Row(
223 mainAxisAlignment: MainAxisAlignment.center,
@@ -227,11 +225,10 @@ class _WalletKeysPageBodyState extends State<WalletKeysPageBody>
225 Text(
226 S.of(context).block_height,
227 textAlign: TextAlign.center,
230 - style: TextStyle(
231 - fontSize: 14,
232 - fontWeight: FontWeight.w500,
233 - color: Theme.of(context).extension<CakeTextTheme>()!.buttonTextColor.withOpacity(0.5),
234 - ),
228 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
229 + fontWeight: FontWeight.w500,
230 + color: Theme.of(context).colorScheme.onSurfaceVariant.withOpacity(0.5),
231 + ),
232 ),
233 const SizedBox(width: 6),
234 Expanded(
@@ -247,11 +244,10 @@ class _WalletKeysPageBodyState extends State<WalletKeysPageBody>
244 children: [
245 Text(
246 textToDisplay,
250 - style: TextStyle(
251 - fontSize: 14,
252 - fontWeight: FontWeight.w500,
253 - color: Theme.of(context).extension<CakeTextTheme>()!.buttonTextColor,
254 - ),
247 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
248 + fontWeight: FontWeight.w500,
249 + color: Theme.of(context).colorScheme.onSurfaceVariant,
250 + ),
251 ),
252 if (snapshot.connectionState == ConnectionState.done && snapshot.data != null)
253 GestureDetector(
@@ -278,7 +274,7 @@ class _WalletKeysPageBodyState extends State<WalletKeysPageBody>
274 padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 14),
275 decoration: BoxDecoration(
276 borderRadius: BorderRadius.circular(8),
281 - color: Theme.of(context).cardColor,
277 + color: Theme.of(context).colorScheme.surfaceContainer,
278 ),
279 child: Row(
280 mainAxisAlignment: MainAxisAlignment.center,
@@ -286,31 +282,32 @@ class _WalletKeysPageBodyState extends State<WalletKeysPageBody>
282 Text(
283 S.of(context).passphrase_view_keys,
284 textAlign: TextAlign.center,
289 - style: TextStyle(
290 - fontSize: 14,
291 - fontWeight: FontWeight.w500,
292 - color: Theme.of(context).extension<CakeTextTheme>()!.buttonTextColor.withOpacity(0.5),
293 - ),
285 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
286 + fontWeight: FontWeight.w500,
287 + color: Theme.of(context).colorScheme.onSurfaceVariant.withOpacity(0.5),
288 + ),
289 ),
290 const SizedBox(width: 6),
291 Expanded(
292 child: Row(
293 mainAxisAlignment: MainAxisAlignment.spaceBetween,
294 children: [
300 - Observer(builder: (BuildContext context) {
301 - return Text(
302 - (widget.walletKeysViewModel.obscurePassphrase)
303 - ? "*****"
304 - : widget.walletKeysViewModel.passphrase,
305 - style: TextStyle(
306 - fontSize: 14,
307 - fontWeight: FontWeight.w500,
308 - color: Theme.of(context).extension<CakeTextTheme>()!.buttonTextColor,
309 - ),
310 - );
311 - }),
312 - Observer(builder: (BuildContext context) {
313 - return GestureDetector(
295 + Observer(
296 + builder: (BuildContext context) {
297 + return Text(
298 + (widget.walletKeysViewModel.obscurePassphrase)
299 + ? "*****"
300 + : widget.walletKeysViewModel.passphrase,
301 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
302 + fontWeight: FontWeight.w500,
303 + color: Theme.of(context).colorScheme.onSurfaceVariant,
304 + ),
305 + );
306 + },
307 + ),
308 + Observer(
309 + builder: (BuildContext context) {
310 + return GestureDetector(
311 onTap: () {
312 widget.walletKeysViewModel.obscurePassphrase =
313 !widget.walletKeysViewModel.obscurePassphrase;
@@ -321,8 +318,10 @@ class _WalletKeysPageBodyState extends State<WalletKeysPageBody>
318 : Icons.visibility,
319 size: 16,
320 color: Theme.of(context).textTheme.bodyLarge?.color?.withOpacity(0.7),
324 - ));
325 - }),
321 + ),
322 + );
323 + },
324 + ),
325 ],
326 ),
327 ),
@@ -350,10 +349,8 @@ class _WalletKeysPageBodyState extends State<WalletKeysPageBody>
349 key: const ValueKey('wallet_keys_page_copy_seeds_button_key'),
350 onPressed: () => _onCopy(titleForClipboard, dataToCopy, context),
351 text: S.of(context).copy,
353 - color: Theme.of(context).cardColor,
354 - textColor: widget.currentTheme.type == ThemeType.dark
355 - ? Theme.of(context).extension<DashboardPageTheme>()!.textColor
356 - : Theme.of(context).extension<CakeTextTheme>()!.buttonTextColor,
352 + color: Theme.of(context).colorScheme.surfaceContainer,
353 + textColor: Theme.of(context).colorScheme.onSecondaryContainer,
354 ),
355 ),
356 ),
@@ -364,8 +361,8 @@ class _WalletKeysPageBodyState extends State<WalletKeysPageBody>
361 key: const ValueKey('wallet_keys_page_show_qr_seeds_button_key'),
362 onPressed: onShowQR,
363 text: S.current.show + ' QR',
367 - color: Theme.of(context).primaryColor,
368 - textColor: Colors.white,
364 + color: Theme.of(context).colorScheme.primary,
365 + textColor: Theme.of(context).colorScheme.onPrimary,
366 ),
367 ),
368 ),
lib/src/screens/wallet_list/edit_wallet_button_widget.dart
+3 -5
@@ -1,5 +1,3 @@
1 -import 'package:cake_wallet/themes/extensions/filter_theme.dart';
2 -import 'package:cake_wallet/themes/extensions/receive_page_theme.dart';
1 import 'package:flutter/material.dart';
2
3 class EditWalletButtonWidget extends StatelessWidget {
@@ -31,12 +29,12 @@ class EditWalletButtonWidget extends StatelessWidget {
29 padding: EdgeInsets.all(10),
30 decoration: BoxDecoration(
31 shape: BoxShape.circle,
34 - color: Theme.of(context).extension<ReceivePageTheme>()!.iconsBackgroundColor,
32 + color: Theme.of(context).colorScheme.surface,
33 ),
34 child: Icon(
35 Icons.edit,
36 size: 14,
39 - color: Theme.of(context).extension<ReceivePageTheme>()!.iconsColor,
37 + color: Theme.of(context).colorScheme.onSurfaceVariant,
38 ),
39 ),
40 ),
@@ -46,7 +44,7 @@ class EditWalletButtonWidget extends StatelessWidget {
44 Icon(
45 isExpanded ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down,
46 size: 24,
49 - color: Theme.of(context).extension<FilterTheme>()!.titlesColor,
47 + color: Theme.of(context).colorScheme.onSurfaceVariant,
48 ),
49 },
50 ],
lib/src/screens/wallet_list/wallet_list_page.dart
+86 -132
@@ -17,9 +17,6 @@ import 'package:cake_wallet/src/screens/wallet_unlock/wallet_unlock_arguments.da
17 import 'package:cake_wallet/src/widgets/alert_with_one_action.dart';
18 import 'package:cake_wallet/src/widgets/primary_button.dart';
19 import 'package:cake_wallet/store/settings_store.dart';
20 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
21 -import 'package:cake_wallet/themes/extensions/filter_theme.dart';
22 -import 'package:cake_wallet/themes/extensions/wallet_list_theme.dart';
20 import 'package:cake_wallet/utils/exception_handler.dart';
21 import 'package:cake_wallet/utils/responsive_layout_util.dart';
22 import 'package:cake_wallet/utils/show_bar.dart';
@@ -49,14 +46,11 @@ class WalletListPage extends BasePage {
46 Widget body(BuildContext context) => WalletListBody(
47 walletListViewModel: walletListViewModel,
48 authService: authService,
52 - onWalletLoaded:
53 - onWalletLoaded ?? (context) => Navigator.of(context).pop(),
49 + onWalletLoaded: onWalletLoaded ?? (context) => Navigator.of(context).pop(),
50 );
51
52 @override
53 Widget trailing(BuildContext context) {
58 - final filterIcon = Image.asset('assets/images/filter_icon.png',
59 - color: Theme.of(context).extension<FilterTheme>()!.iconColor);
54 return MergeSemantics(
55 child: SizedBox(
56 height: 37,
@@ -88,10 +82,12 @@ class WalletListPage extends BasePage {
82 width: 36,
83 decoration: BoxDecoration(
84 shape: BoxShape.circle,
91 - color:
92 - Theme.of(context).extension<FilterTheme>()!.buttonColor,
85 + color: Theme.of(context).colorScheme.surfaceContainer,
86 + ),
87 + child: Image.asset(
88 + 'assets/images/filter_icon.png',
89 + color: Theme.of(context).colorScheme.onSurfaceVariant,
90 ),
94 - child: filterIcon,
91 ),
92 ),
93 ),
@@ -141,17 +137,9 @@ class WalletListBodyState extends State<WalletListBody> {
137
138 @override
139 Widget build(BuildContext context) {
144 - final newWalletImage = Image.asset('assets/images/new_wallet.png',
145 - height: 12, width: 12, color: Colors.white);
146 - final restoreWalletImage = Image.asset('assets/images/restore_wallet.png',
147 - height: 12,
148 - width: 12,
149 - color: Theme.of(context).extension<CakeTextTheme>()!.buttonTextColor);
150 -
140 return Container(
152 - height: double.infinity,
141 + height: double.infinity,
142 padding: EdgeInsets.only(top: 16),
154 -
143 child: Stack(
144 alignment: Alignment.bottomCenter,
145 fit: StackFit.expand,
@@ -160,19 +148,16 @@ class WalletListBodyState extends State<WalletListBody> {
148 child: Column(
149 crossAxisAlignment: CrossAxisAlignment.start,
150 children: [
163 - if (widget
164 - .walletListViewModel.multiWalletGroups.isNotEmpty) ...{
151 + if (widget.walletListViewModel.multiWalletGroups.isNotEmpty) ...{
152 Padding(
153 padding: const EdgeInsets.only(left: 24),
154 child: Text(
155 S.current.shared_seed_wallet_groups,
169 - style: TextStyle(
170 - fontSize: 18,
171 - fontWeight: FontWeight.w500,
172 - color: Theme.of(context)
173 - .extension<CakeTextTheme>()!
174 - .titleColor,
175 - ),
156 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
157 + fontSize: 18,
158 + fontWeight: FontWeight.w700,
159 + color: Theme.of(context).colorScheme.onSurface,
160 + ),
161 ),
162 ),
163 SizedBox(height: 16),
@@ -181,34 +166,27 @@ class WalletListBodyState extends State<WalletListBody> {
166 builder: (_) => FilteredList(
167 shrinkWrap: true,
168 list: widget.walletListViewModel.multiWalletGroups,
184 - updateFunction: widget
185 - .walletListViewModel.reorderAccordingToWalletList,
169 + updateFunction: widget.walletListViewModel.reorderAccordingToWalletList,
170 itemBuilder: (context, index) {
187 - final group = widget
188 - .walletListViewModel.multiWalletGroups[index];
189 - final groupName = group.groupName ??
190 - '${S.current.wallet_group} ${index + 1}';
171 + final group = widget.walletListViewModel.multiWalletGroups[index];
172 + final groupName =
173 + group.groupName ?? '${S.current.wallet_group} ${index + 1}';
174
175 widget.walletListViewModel.updateTileState(
176 index,
194 - widget.walletListViewModel
195 - .expansionTileStateTrack[index] ??
196 - false,
177 + widget.walletListViewModel.expansionTileStateTrack[index] ?? false,
178 );
179
180 return GroupedWalletExpansionTile(
181 onExpansionChanged: (value) {
201 - widget.walletListViewModel
202 - .updateTileState(index, value);
182 + widget.walletListViewModel.updateTileState(index, value);
183 setState(() {});
184 },
185 shouldShowCurrentWalletPointer: true,
186 borderRadius: BorderRadius.all(Radius.circular(16)),
207 - margin: EdgeInsets.only(
208 - left: 20, right: 20, bottom: 12),
187 + margin: EdgeInsets.only(left: 20, right: 20, bottom: 12),
188 title: groupName,
210 - tileKey: ValueKey(
211 - 'group_wallets_expansion_tile_widget_$index'),
189 + tileKey: ValueKey('group_wallets_expansion_tile_widget_$index'),
190 leadingWidget: Icon(
191 Icons.account_balance_wallet_outlined,
192 size: 28,
@@ -216,17 +194,15 @@ class WalletListBodyState extends State<WalletListBody> {
194 trailingWidget: EditWalletButtonWidget(
195 width: 74,
196 isGroup: true,
219 - isExpanded: widget.walletListViewModel
220 - .expansionTileStateTrack[index]!,
197 + isExpanded:
198 + widget.walletListViewModel.expansionTileStateTrack[index]!,
199 onTap: () {
200 final wallet = widget.walletListViewModel
223 - .convertWalletInfoToWalletListItem(
224 - group.wallets.first);
201 + .convertWalletInfoToWalletListItem(group.wallets.first);
202 Navigator.of(context).pushNamed(
203 Routes.walletEdit,
204 arguments: WalletEditPageArguments(
228 - walletListViewModel:
229 - widget.walletListViewModel,
205 + walletListViewModel: widget.walletListViewModel,
206 editingWallet: wallet,
207 isWalletGroup: true,
208 groupName: groupName,
@@ -237,8 +213,7 @@ class WalletListBodyState extends State<WalletListBody> {
213 ),
214 childWallets: group.wallets.map((walletInfo) {
215 return widget.walletListViewModel
240 - .convertWalletInfoToWalletListItem(
241 - walletInfo);
216 + .convertWalletInfoToWalletListItem(walletInfo);
217 }).toList(),
218 isSelected: false,
219 onChildItemTapped: (wallet) =>
@@ -250,12 +225,10 @@ class WalletListBodyState extends State<WalletListBody> {
225 padding: const EdgeInsets.only(right: 16),
226 child: EditWalletButtonWidget(
227 width: 44,
253 - onTap: () =>
254 - Navigator.of(context).pushNamed(
228 + onTap: () => Navigator.of(context).pushNamed(
229 Routes.walletEdit,
230 arguments: WalletEditPageArguments(
257 - walletListViewModel:
258 - widget.walletListViewModel,
231 + walletListViewModel: widget.walletListViewModel,
232 editingWallet: item,
233 ),
234 ),
@@ -269,19 +242,16 @@ class WalletListBodyState extends State<WalletListBody> {
242 ),
243 SizedBox(height: 24),
244 },
272 - if (widget
273 - .walletListViewModel.singleWalletsList.isNotEmpty) ...{
245 + if (widget.walletListViewModel.singleWalletsList.isNotEmpty) ...{
246 Padding(
247 padding: const EdgeInsets.only(left: 24),
248 child: Text(
249 S.current.single_seed_wallets_group,
278 - style: TextStyle(
279 - fontSize: 18,
280 - fontWeight: FontWeight.w500,
281 - color: Theme.of(context)
282 - .extension<CakeTextTheme>()!
283 - .titleColor,
284 - ),
250 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
251 + fontSize: 18,
252 + fontWeight: FontWeight.w700,
253 + color: Theme.of(context).colorScheme.onSurface,
254 + ),
255 ),
256 ),
257 SizedBox(height: 16),
@@ -290,20 +260,15 @@ class WalletListBodyState extends State<WalletListBody> {
260 builder: (_) => FilteredList(
261 shrinkWrap: true,
262 list: widget.walletListViewModel.singleWalletsList,
293 - updateFunction: widget
294 - .walletListViewModel.reorderAccordingToWalletList,
263 + updateFunction: widget.walletListViewModel.reorderAccordingToWalletList,
264 itemBuilder: (context, index) {
296 - final wallet = widget
297 - .walletListViewModel.singleWalletsList[index];
265 + final wallet = widget.walletListViewModel.singleWalletsList[index];
266 final currentColor = wallet.isCurrent
299 - ? Theme.of(context)
300 - .extension<WalletListTheme>()!
301 - .createNewWalletButtonBackgroundColor
302 - : Theme.of(context).colorScheme.background;
267 + ? Theme.of(context).colorScheme.primary
268 + : Theme.of(context).colorScheme.surface;
269
270 return GroupedWalletExpansionTile(
305 - tileKey: ValueKey(
306 - 'single_wallets_expansion_tile_widget_$index'),
271 + tileKey: ValueKey('single_wallets_expansion_tile_widget_$index'),
272 isCurrentlySelectedWallet: wallet.isCurrent,
273 leadingWidget: SizedBox(
274 width: wallet.isCurrent ? 56 : 40,
@@ -324,8 +289,7 @@ class WalletListBodyState extends State<WalletListBody> {
289 )
290 : SizedBox(width: 6),
291 Image.asset(
327 - walletTypeToCryptoCurrency(wallet.type)
328 - .iconPath!,
292 + walletTypeToCryptoCurrency(wallet.type).iconPath!,
293 width: 32,
294 height: 32,
295 ),
@@ -335,10 +299,8 @@ class WalletListBodyState extends State<WalletListBody> {
299 title: wallet.name,
300 isSelected: false,
301 borderRadius: BorderRadius.all(Radius.circular(16)),
338 - margin: EdgeInsets.only(
339 - left: 20, right: 20, bottom: 12),
340 - onTitleTapped: () =>
341 - wallet.isCurrent ? null : _loadWallet(wallet),
302 + margin: EdgeInsets.only(left: 20, right: 20, bottom: 12),
303 + onTitleTapped: () => wallet.isCurrent ? null : _loadWallet(wallet),
304 trailingWidget: wallet.isCurrent
305 ? null
306 : EditWalletButtonWidget(
@@ -347,8 +309,7 @@ class WalletListBodyState extends State<WalletListBody> {
309 Navigator.of(context).pushNamed(
310 Routes.walletEdit,
311 arguments: WalletEditPageArguments(
350 - walletListViewModel:
351 - widget.walletListViewModel,
312 + walletListViewModel: widget.walletListViewModel,
313 editingWallet: wallet,
314 ),
315 );
@@ -364,8 +325,8 @@ class WalletListBodyState extends State<WalletListBody> {
325 ],
326 ),
327 ),
367 - Positioned(
368 - bottom: 0.0,
328 + Positioned(
329 + bottom: 0.0,
330 child: Container(
331 //padding: EdgeInsets.only(top: 100),
332 alignment: Alignment.bottomCenter,
@@ -377,10 +338,10 @@ class WalletListBodyState extends State<WalletListBody> {
338 begin: Alignment.topCenter,
339 end: Alignment.bottomCenter,
340 colors: <Color>[
380 - Theme.of(context).colorScheme.background.withAlpha(10),
381 - Theme.of(context).colorScheme.background,
382 - Theme.of(context).colorScheme.background,
383 - Theme.of(context).colorScheme.background
341 + Theme.of(context).colorScheme.surface.withAlpha(10),
342 + Theme.of(context).colorScheme.surface,
343 + Theme.of(context).colorScheme.surface,
344 + Theme.of(context).colorScheme.surface
345 ],
346 ),
347 ),
@@ -396,89 +357,86 @@ class WalletListBodyState extends State<WalletListBody> {
357 crossAxisAlignment: CrossAxisAlignment.center,
358 children: <Widget>[
359 PrimaryImageButton(
399 - key: ValueKey(
400 - 'wallet_list_page_restore_wallet_button_key'),
360 + image: Image.asset(
361 + 'assets/images/restore_wallet.png',
362 + height: 12,
363 + width: 12,
364 + color: Theme.of(context).colorScheme.onSecondaryContainer,
365 + ),
366 + key: ValueKey('wallet_list_page_restore_wallet_button_key'),
367 onPressed: () {
402 - if (widget.walletListViewModel
403 - .shouldRequireTOTP2FAForCreatingNewWallets) {
368 + if (widget.walletListViewModel.shouldRequireTOTP2FAForCreatingNewWallets) {
369 widget.authService.authenticateAction(
370 context,
371 route: Routes.restoreOptions,
372 arguments: false,
373 conditionToDetermineIfToUse2FA: widget
409 - .walletListViewModel
410 - .shouldRequireTOTP2FAForCreatingNewWallets,
374 + .walletListViewModel.shouldRequireTOTP2FAForCreatingNewWallets,
375 );
376 } else {
413 - Navigator.of(context).pushNamed(Routes.restoreOptions,
414 - arguments: false);
377 + Navigator.of(context).pushNamed(Routes.restoreOptions, arguments: false);
378 }
379 },
417 - image: restoreWalletImage,
380 text: S.of(context).wallet_list_restore_wallet,
419 - color: Theme.of(context).cardColor,
420 - textColor: Theme.of(context)
421 - .extension<CakeTextTheme>()!
422 - .buttonTextColor,
381 + color: Theme.of(context).colorScheme.surfaceContainer,
382 + textColor: Theme.of(context).colorScheme.onSecondaryContainer,
383 ),
384 SizedBox(height: 10.0),
385 PrimaryImageButton(
426 - key: ValueKey(
427 - 'wallet_list_page_create_new_wallet_button_key'),
386 + image: Image.asset(
387 + 'assets/images/new_wallet.png',
388 + height: 12,
389 + width: 12,
390 + color: Theme.of(context).colorScheme.onPrimary,
391 + ),
392 + key: ValueKey('wallet_list_page_create_new_wallet_button_key'),
393 onPressed: () {
394 //TODO(David): Find a way to optimize this
395 if (isSingleCoin) {
431 - if (widget.walletListViewModel
432 - .shouldRequireTOTP2FAForCreatingNewWallets) {
396 + if (widget
397 + .walletListViewModel.shouldRequireTOTP2FAForCreatingNewWallets) {
398 widget.authService.authenticateAction(
399 context,
400 route: Routes.newWallet,
401 arguments: NewWalletArguments(
437 - type: widget
438 - .walletListViewModel.currentWalletType,
402 + type: widget.walletListViewModel.currentWalletType,
403 ),
404 conditionToDetermineIfToUse2FA: widget
441 - .walletListViewModel
442 - .shouldRequireTOTP2FAForCreatingNewWallets,
405 + .walletListViewModel.shouldRequireTOTP2FAForCreatingNewWallets,
406 );
407 } else {
408 Navigator.of(context).pushNamed(
409 Routes.newWallet,
410 arguments: NewWalletArguments(
448 - type: widget
449 - .walletListViewModel.currentWalletType,
411 + type: widget.walletListViewModel.currentWalletType,
412 ),
413 );
414 }
415 } else {
454 - if (widget.walletListViewModel
455 - .shouldRequireTOTP2FAForCreatingNewWallets) {
416 + if (widget
417 + .walletListViewModel.shouldRequireTOTP2FAForCreatingNewWallets) {
418 widget.authService.authenticateAction(
419 context,
420 route: Routes.newWalletType,
421 conditionToDetermineIfToUse2FA: widget
460 - .walletListViewModel
461 - .shouldRequireTOTP2FAForCreatingNewWallets,
422 + .walletListViewModel.shouldRequireTOTP2FAForCreatingNewWallets,
423 );
424 } else {
464 - Navigator.of(context)
465 - .pushNamed(Routes.newWalletType);
425 + Navigator.of(context).pushNamed(Routes.newWalletType);
426 }
427 }
428 },
469 - image: newWalletImage,
429 text: S.of(context).wallet_list_create_new_wallet,
471 - color: Theme.of(context).primaryColor,
472 - textColor: Colors.white,
430 + color: Theme.of(context).colorScheme.primary,
431 + textColor: Theme.of(context).colorScheme.onPrimary,
432 ),
433 ],
434 ),
435 ),
436 ),
478 - ),
437 + ),
438 ],
439 ),
481 -
440 );
441 }
442
@@ -490,8 +448,7 @@ class WalletListBodyState extends State<WalletListBody> {
448 if (SettingsStoreBase.walletPasswordDirectInput) {
449 Navigator.of(context).pushNamed(Routes.walletUnlockLoadable,
450 arguments: WalletUnlockArguments(
493 - callback:
494 - (bool isAuthenticatedSuccessfully, AuthPageState auth) async {
451 + callback: (bool isAuthenticatedSuccessfully, AuthPageState auth) async {
452 if (isAuthenticatedSuccessfully) {
453 auth.close();
454 setState(() {});
@@ -512,8 +469,8 @@ class WalletListBodyState extends State<WalletListBody> {
469 }
470
471 try {
515 - final requireHardwareWalletConnection = widget.walletListViewModel
516 - .requireHardwareWalletConnection(wallet);
472 + final requireHardwareWalletConnection =
473 + widget.walletListViewModel.requireHardwareWalletConnection(wallet);
474 if (requireHardwareWalletConnection) {
475 bool didConnect = false;
476 await Navigator.of(context).pushNamed(
@@ -542,8 +499,7 @@ class WalletListBodyState extends State<WalletListBody> {
499 );
500 }
501
545 - changeProcessText(
546 - S.of(context).wallet_list_loading_wallet(wallet.name));
502 + changeProcessText(S.of(context).wallet_list_loading_wallet(wallet.name));
503 await widget.walletListViewModel.loadWallet(wallet);
504 await hideProgressText();
505 // only pop the wallets route in mobile as it will go back to dashboard page
@@ -563,9 +519,7 @@ class WalletListBodyState extends State<WalletListBody> {
519 final err = e.toString();
520 await ExceptionHandler.onError(FlutterErrorDetails(exception: err));
521 if (this.mounted) {
566 - changeProcessText(S
567 - .of(context)
568 - .wallet_list_failed_to_load(wallet.name, e.toString()));
522 + changeProcessText(S.of(context).wallet_list_failed_to_load(wallet.name, e.toString()));
523 }
524 } finally {
525 _loadingWallet = false;
@@ -577,7 +531,7 @@ class WalletListBodyState extends State<WalletListBody> {
531 }
532
533 void changeProcessText(String text) {
580 - _progressBar = createBar<void>(text, duration: null)..show(context);
534 + _progressBar = createBar<void>(text, context, duration: null)..show(context);
535 }
536
537 Future<void> hideProgressText() async {
lib/src/screens/wallet_unlock/wallet_unlock_page.dart
+38 -53
@@ -3,9 +3,8 @@ import 'package:cake_wallet/core/execution_state.dart';
3 import 'package:cake_wallet/generated/i18n.dart';
4 import 'package:cake_wallet/src/screens/auth/auth_page.dart';
5 import 'package:cake_wallet/src/screens/wallet_unlock/wallet_unlock_arguments.dart';
6 +import 'package:cake_wallet/src/widgets/base_text_form_field.dart';
7 import 'package:cake_wallet/src/widgets/primary_button.dart';
7 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
8 -import 'package:cake_wallet/themes/extensions/new_wallet_theme.dart';
8 import 'package:cake_wallet/utils/responsive_layout_util.dart';
9 import 'package:cake_wallet/utils/show_bar.dart';
10 import 'package:flutter/cupertino.dart';
@@ -52,7 +51,8 @@ class WalletUnlockPageState extends AuthPageState<WalletUnlockPage> {
51 if (state is IsExecutingState) {
52 WidgetsBinding.instance.addPostFrameCallback((_) {
53 // null duration to make it indefinite until its disposed
55 - _authBar = createBar<void>(S.of(context).authentication, duration: null)..show(context);
54 + _authBar = createBar<void>(S.of(context).authentication, context, duration: null)
55 + ..show(context);
56 });
57 }
58
@@ -90,7 +90,7 @@ class WalletUnlockPageState extends AuthPageState<WalletUnlockPage> {
90 @override
91 void changeProcessText(String text) {
92 dismissFlushBar(_authBar);
93 - _progressBar = createBar<void>(text, duration: null)..show(_key.currentContext!);
93 + _progressBar = createBar<void>(text, context, duration: null)..show(_key.currentContext!);
94 }
95
96 @override
@@ -141,7 +141,7 @@ class WalletUnlockPageState extends AuthPageState<WalletUnlockPage> {
141 ),
142 ))
143 : Container(),
144 - backgroundColor: Theme.of(context).colorScheme.background,
144 + backgroundColor: Theme.of(context).colorScheme.surface,
145 border: null),
146 resizeToAvoidBottomInset: false,
147 body: Center(
@@ -161,45 +161,30 @@ class WalletUnlockPageState extends AuthPageState<WalletUnlockPage> {
161 Text(
162 widget.walletUnlockViewModel.walletName,
163 textAlign: TextAlign.center,
164 - style: TextStyle(
165 - fontSize: 24,
166 - fontWeight: FontWeight.w500,
167 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
168 - ),
164 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
165 + fontSize: 24,
166 + fontWeight: FontWeight.w500,
167 + color: Theme.of(context).colorScheme.onSurface,
168 + ),
169 ),
170 SizedBox(height: 24),
171 Form(
172 - child: TextFormField(
172 + child: BaseTextFormField(
173 key: ValueKey('enter_wallet_password'),
174 onChanged: (value) => null,
175 controller: _passwordController,
176 textAlign: TextAlign.center,
177 obscureText: true,
178 - style: TextStyle(
179 - fontSize: 20.0,
180 - fontWeight: FontWeight.w600,
181 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
182 - ),
183 - decoration: InputDecoration(
184 - hintStyle: TextStyle(
185 - fontSize: 18.0,
186 - fontWeight: FontWeight.w500,
187 - color: Theme.of(context).extension<NewWalletTheme>()!.hintTextColor,
188 - ),
189 - hintText: S.of(context).enter_wallet_password,
190 - focusedBorder: UnderlineInputBorder(
191 - borderSide: BorderSide(
192 - color: Theme.of(context).extension<NewWalletTheme>()!.underlineColor,
193 - width: 1.0,
178 + textStyle: Theme.of(context).textTheme.bodyMedium!.copyWith(
179 + fontSize: 20.0,
180 + fontWeight: FontWeight.w600,
181 ),
195 - ),
196 - enabledBorder: UnderlineInputBorder(
197 - borderSide: BorderSide(
198 - color: Theme.of(context).extension<NewWalletTheme>()!.underlineColor,
199 - width: 1.0,
200 - ),
201 - ),
202 - ),
182 + placeholderTextStyle: Theme.of(context).textTheme.bodyMedium!.copyWith(
183 + fontSize: 18.0,
184 + fontWeight: FontWeight.w500,
185 + color: Theme.of(context).colorScheme.onSurfaceVariant,
186 + ),
187 + hintText: S.of(context).enter_wallet_password,
188 ),
189 ),
190 ],
@@ -210,25 +195,25 @@ class WalletUnlockPageState extends AuthPageState<WalletUnlockPage> {
195 padding: EdgeInsets.only(bottom: 24),
196 child: Observer(
197 builder: (_) => LoadingPrimaryButton(
213 - onPressed: () async {
214 - if (widget.authPasswordHandler != null) {
215 - try {
216 - await widget
217 - .authPasswordHandler!(widget.walletUnlockViewModel.password);
218 - widget.walletUnlockViewModel.success();
219 - } catch (e) {
220 - widget.walletUnlockViewModel.failure(e);
221 - }
222 - return;
198 + onPressed: () async {
199 + if (widget.authPasswordHandler != null) {
200 + try {
201 + await widget.authPasswordHandler!(widget.walletUnlockViewModel.password);
202 + widget.walletUnlockViewModel.success();
203 + } catch (e) {
204 + widget.walletUnlockViewModel.failure(e);
205 }
224 -
225 - widget.walletUnlockViewModel.unlock();
226 - },
227 - text: S.of(context).unlock,
228 - color: Colors.green,
229 - textColor: Colors.white,
230 - isLoading: widget.walletUnlockViewModel.state is IsExecutingState,
231 - isDisabled: widget.walletUnlockViewModel.state is IsExecutingState),
206 + return;
207 + }
208 +
209 + widget.walletUnlockViewModel.unlock();
210 + },
211 + text: S.of(context).unlock,
212 + color: Theme.of(context).colorScheme.primary,
213 + textColor: Theme.of(context).colorScheme.onPrimary,
214 + isLoading: widget.walletUnlockViewModel.state is IsExecutingState,
215 + isDisabled: widget.walletUnlockViewModel.state is IsExecutingState,
216 + ),
217 ),
218 ),
219 ],
lib/src/screens/welcome/create_pin_welcome_page.dart
+156 -77
@@ -1,7 +1,6 @@
1 +import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
2 import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
2 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
3 -import 'package:cake_wallet/themes/theme_base.dart';
4 -import 'package:cake_wallet/utils/responsive_layout_util.dart';
3 +import 'package:cake_wallet/themes/utils/custom_theme_colors.dart';
4 import 'package:flutter/gestures.dart';
5 import 'package:flutter/material.dart';
6 import 'package:cake_wallet/routes.dart';
@@ -9,17 +8,20 @@ import 'package:cake_wallet/src/widgets/primary_button.dart';
8 import 'package:cake_wallet/src/screens/base_page.dart';
9 import 'package:cake_wallet/generated/i18n.dart';
10 import 'package:cake_wallet/wallet_type_utils.dart';
12 -import 'package:cake_wallet/themes/extensions/new_wallet_theme.dart';
13 -import 'package:cake_wallet/themes/extensions/wallet_list_theme.dart';
11 +import '../../widgets/gradient_background.dart';
12 +import '../../widgets/animated_typing_text.dart';
13
14 class CreatePinWelcomePage extends BasePage {
15 CreatePinWelcomePage(this.isWalletPasswordDirectInput);
16
17 final bool isWalletPasswordDirectInput;
18
20 - static const aspectRatioImage = 1.25;
21 - final welcomeImageLight = Image.asset('assets/images/welcome_light.png');
22 - final welcomeImageDark = Image.asset('assets/images/welcome.png');
19 + static const imageAspectRatio = 1.25;
20 + static const imageMaxWidth = 600.0;
21 + final welcomeImageLight = 'assets/images/welcome_light_theme.svg';
22 + final welcomeImageDark = 'assets/images/welcome_dark_theme.svg';
23 + final cakeLogoLight = 'assets/images/cake_logo_light.svg';
24 + final cakeLogoDark = 'assets/images/cake_logo_dark.svg';
25
26 String appTitle(BuildContext context) {
27 if (isMoneroOnly) {
@@ -34,82 +36,156 @@ class CreatePinWelcomePage extends BasePage {
36 return S.of(context).monero_com_wallet_text;
37 }
38
37 - return S.of(context).new_first_wallet_text;
39 + return S.of(context).payment_made_easy;
40 }
41
42 + @override
43 + bool get gradientBackground => true;
44 +
45 + @override
46 + Widget Function(BuildContext, Widget) get rootWrapper =>
47 + (BuildContext context, Widget scaffold) => GradientBackground(scaffold: scaffold);
48 +
49 @override
50 Widget build(BuildContext context) {
51 return Scaffold(
43 - backgroundColor: Theme.of(context).colorScheme.background,
44 - resizeToAvoidBottomInset: false,
45 - body: body(context));
52 + backgroundColor: Theme.of(context).colorScheme.surface,
53 + resizeToAvoidBottomInset: false,
54 + body: Builder(
55 + builder: (BuildContext context) {
56 + return Container(
57 + decoration: BoxDecoration(
58 + color: Theme.of(context).colorScheme.surface,
59 + gradient: LinearGradient(
60 + colors: [
61 + Theme.of(context).colorScheme.surface,
62 + currentTheme.isDark
63 + ? CustomThemeColors.backgroundGradientColorDark
64 + : CustomThemeColors.backgroundGradientColorLight,
65 + ],
66 + begin: Alignment.topCenter,
67 + end: Alignment.bottomCenter,
68 + ),
69 + ),
70 + child: body(context),
71 + );
72 + },
73 + ),
74 + );
75 }
76
77 @override
78 Widget body(BuildContext context) {
50 - final welcomeImage = currentTheme.type == ThemeType.dark ? welcomeImageDark : welcomeImageLight;
79 + String welcomeImage;
80 + String cakeLogoThemed;
81
52 - final newWalletImage = Image.asset('assets/images/new_wallet.png',
53 - height: 12,
54 - width: 12,
55 - color: Theme.of(context).extension<WalletListTheme>()!.restoreWalletButtonTextColor);
82 + if (currentTheme.isDark) {
83 + welcomeImage = welcomeImageDark;
84 + cakeLogoThemed = cakeLogoDark;
85 + } else {
86 + welcomeImage = welcomeImageLight;
87 + cakeLogoThemed = cakeLogoLight;
88 + }
89
90 return PopScope(
91 canPop: false,
92 child: ScrollableWithBottomSection(
93 + contentPadding: EdgeInsets.zero,
94 content: Container(
95 alignment: Alignment.center,
96 child: ConstrainedBox(
63 - constraints:
64 - BoxConstraints(maxWidth: ResponsiveLayoutUtilBase.kDesktopMaxWidthConstraint),
65 - child: Column(
66 - mainAxisAlignment: MainAxisAlignment.spaceBetween,
97 + constraints: BoxConstraints(maxWidth: imageMaxWidth),
98 + child: Stack(
99 + alignment: Alignment.center,
100 + clipBehavior: Clip.none,
101 children: <Widget>[
68 - Column(
69 - children: <Widget>[
70 - SizedBox(height: 70),
71 - AspectRatio(
72 - aspectRatio: aspectRatioImage,
73 - child: FittedBox(child: welcomeImage, fit: BoxFit.contain),
102 + AspectRatio(
103 + aspectRatio: imageAspectRatio,
104 + child: FittedBox(
105 + child: CakeImageWidget(
106 + imageUrl: welcomeImage,
107 + fit: BoxFit.contain,
108 ),
75 - SizedBox(height: 50),
76 - Padding(
77 - padding: EdgeInsets.only(top: 24),
78 - child: Text(
79 - S.of(context).welcome,
80 - style: TextStyle(
81 - fontSize: 18,
82 - fontWeight: FontWeight.w500,
83 - color: Theme.of(context).extension<NewWalletTheme>()!.hintTextColor,
84 - ),
109 + fit: BoxFit.contain,
110 + ),
111 + ),
112 + Positioned(
113 + top: (imageMaxWidth / imageAspectRatio) * 0.57,
114 + child: Column(
115 + children: <Widget>[
116 + Text(
117 + S.current.welcome,
118 + style: Theme.of(context).textTheme.displayLarge?.copyWith(
119 + fontWeight: FontWeight.w700,
120 + fontSize: 60,
121 + letterSpacing: 2.5,
122 + color: Theme.of(context).colorScheme.primary,
123 + ),
124 textAlign: TextAlign.center,
125 ),
87 - ),
88 - Padding(
89 - padding: EdgeInsets.only(top: 5),
90 - child: Text(
91 - appTitle(context),
92 - style: TextStyle(
93 - fontSize: 36,
94 - fontWeight: FontWeight.bold,
95 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
96 - ),
97 - textAlign: TextAlign.center,
126 + SizedBox(height: 16),
127 + Row(
128 + mainAxisAlignment: MainAxisAlignment.center,
129 + children: [
130 + Text(
131 + S.current.to.toLowerCase(),
132 + style: Theme.of(context).textTheme.titleMedium,
133 + textAlign: TextAlign.center,
134 + ),
135 + SizedBox(width: 8),
136 + if (!isMoneroOnly) ...[
137 + SizedBox(width: 8),
138 + CakeImageWidget(
139 + height: 40,
140 + imageUrl: cakeLogoThemed,
141 + fit: BoxFit.contain,
142 + ),
143 + SizedBox(width: 8),
144 + ],
145 + Text(
146 + appTitle(context),
147 + style: Theme.of(context).textTheme.titleLarge?.copyWith(
148 + fontWeight: FontWeight.w600,
149 + ),
150 + textAlign: TextAlign.center,
151 + ),
152 + ],
153 ),
99 - ),
100 - Padding(
101 - padding: EdgeInsets.only(top: 5),
102 - child: Text(
103 - appDescription(context),
104 - style: TextStyle(
105 - fontSize: 16,
106 - fontWeight: FontWeight.w500,
107 - color: Theme.of(context).extension<NewWalletTheme>()!.hintTextColor,
154 + SizedBox(height: 48),
155 + if (isMoneroOnly)
156 + Text(
157 + appDescription(context),
158 + style: Theme.of(context)
159 + .textTheme
160 + .bodyLarge
161 + ?.copyWith(fontWeight: FontWeight.w500),
162 + textAlign: TextAlign.center,
163 ),
109 - textAlign: TextAlign.center,
110 - ),
111 - ),
112 - ],
164 + if (!isMoneroOnly)
165 + Row(
166 + mainAxisAlignment: MainAxisAlignment.center,
167 + children: [
168 + AnimatedTypingText(
169 + words: [S.current.payments, S.current.privacy, S.current.security],
170 + style: Theme.of(context).textTheme.titleLarge?.copyWith(
171 + fontWeight: FontWeight.w600,
172 + color: Theme.of(context).colorScheme.primary,
173 + ),
174 + cursorColor: Theme.of(context).colorScheme.primary,
175 + cursorHeight: 24,
176 + cursorWidth: 4,
177 + ),
178 + SizedBox(width: 8),
179 + Text(
180 + S.current.made_easy,
181 + style: Theme.of(context).textTheme.titleLarge?.copyWith(
182 + fontWeight: FontWeight.w600,
183 + ),
184 + ),
185 + ],
186 + ),
187 + ],
188 + ),
189 ),
190 ],
191 ),
@@ -120,18 +196,24 @@ class CreatePinWelcomePage extends BasePage {
196 RichText(
197 textAlign: TextAlign.center,
198 text: TextSpan(
123 - style: TextStyle(
124 - fontSize: 14,
125 - color: Theme.of(context).extension<NewWalletTheme>()!.hintTextColor,
126 - ),
199 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
200 + color: Theme.of(context).colorScheme.onSurfaceVariant,
201 + ),
202 children: [
128 - TextSpan(text: 'By continuing, you agree to our '),
203 + TextSpan(
204 + text: 'By continuing, you agree to our ',
205 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
206 + color: Theme.of(context).colorScheme.onSurfaceVariant,
207 + fontWeight: FontWeight.w500,
208 + ),
209 + ),
210 TextSpan(
211 text: 'Terms of Service',
131 - style: TextStyle(
132 - color: Theme.of(context).primaryColor,
133 - decoration: TextDecoration.underline,
134 - ),
212 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
213 + color: Theme.of(context).colorScheme.onSurfaceVariant,
214 + decoration: TextDecoration.underline,
215 + fontWeight: FontWeight.w700,
216 + ),
217 recognizer: TapGestureRecognizer()
218 ..onTap = () => Navigator.pushNamed(context, Routes.readDisclaimer),
219 ),
@@ -140,18 +222,15 @@ class CreatePinWelcomePage extends BasePage {
222 ),
223 Padding(
224 padding: EdgeInsets.only(top: 24),
143 - child: PrimaryImageButton(
225 + child: PrimaryButton(
226 key: ValueKey('create_pin_welcome_page_create_a_pin_button_key'),
227 onPressed: () => Navigator.pushNamed(context, Routes.welcomeWallet),
146 - image: newWalletImage,
228 text: isWalletPasswordDirectInput ? S.current.set_up_a_wallet : S.current.set_a_pin,
148 - color: Theme.of(context)
149 - .extension<WalletListTheme>()!
150 - .createNewWalletButtonBackgroundColor,
151 - textColor:
152 - Theme.of(context).extension<WalletListTheme>()!.restoreWalletButtonTextColor,
229 + color: Theme.of(context).colorScheme.primary,
230 + textColor: Theme.of(context).colorScheme.onPrimary,
231 ),
232 ),
233 + SizedBox(height: 16),
234 ],
235 ),
236 ),
lib/src/screens/welcome/welcome_page.dart
+75 -71
@@ -1,31 +1,37 @@
1 +import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
2 import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
2 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
3 -import 'package:cake_wallet/themes/theme_base.dart';
3 +import 'package:cake_wallet/themes/core/material_base_theme.dart';
4 import 'package:cake_wallet/utils/responsive_layout_util.dart';
5 import 'package:flutter/material.dart';
6 import 'package:cake_wallet/routes.dart';
7 import 'package:cake_wallet/src/widgets/primary_button.dart';
8 import 'package:cake_wallet/src/screens/base_page.dart';
9 import 'package:cake_wallet/generated/i18n.dart';
10 -import 'package:cake_wallet/wallet_type_utils.dart';
11 -import 'package:cake_wallet/themes/extensions/new_wallet_theme.dart';
12 -import 'package:cake_wallet/themes/extensions/wallet_list_theme.dart';
10 import 'package:url_launcher/url_launcher.dart';
11 +import 'package:cake_wallet/src/widgets/gradient_background.dart';
12
13 class WelcomePage extends BasePage {
16 - static const aspectRatioImage = 1.25;
17 - final welcomeImageLight = Image.asset('assets/images/wallet_type_light.png');
18 - final welcomeImageDark = Image.asset('assets/images/wallet_type.png');
14 + static const aspectRatioImage = 1.5;
15 + final welcomeImageLight = 'assets/images/welcome_wallet_light.png';
16 + final welcomeImageDark = 'assets/images/welcome_wallet_dark.png';
17
18 @override
19 String? get title => S.current.wallet;
20
21 + @override
22 + bool get gradientBackground => true;
23 +
24 + @override
25 + Widget Function(BuildContext, Widget) get rootWrapper =>
26 + (BuildContext context, Widget scaffold) => GradientBackground(scaffold: scaffold);
27 +
28 @override
29 bool get resizeToAvoidBottomInset => false;
30
31 @override
32 Widget trailing(BuildContext context) {
28 - final Uri _url = Uri.parse('https://docs.cakewallet.com/get-started/setup/create-first-wallet/');
33 + final Uri _url =
34 + Uri.parse('https://docs.cakewallet.com/get-started/setup/create-first-wallet/');
35 return IconButton(
36 icon: Icon(Icons.info_outline),
37 onPressed: () async {
@@ -36,14 +42,7 @@ class WelcomePage extends BasePage {
42
43 @override
44 Widget body(BuildContext context) {
39 - final welcomeImage = currentTheme.type == ThemeType.dark ? welcomeImageDark : welcomeImageLight;
40 -
41 - final newWalletImage = Image.asset('assets/images/new_wallet.png',
42 - height: 12,
43 - width: 12,
44 - color: Theme.of(context).extension<WalletListTheme>()!.restoreWalletButtonTextColor);
45 - final restoreWalletImage = Image.asset('assets/images/restore_wallet.png',
46 - height: 12, width: 12, color: Theme.of(context).extension<CakeTextTheme>()!.titleColor);
45 + final welcomeImage = currentTheme.isDark ? welcomeImageDark : welcomeImageLight;
46
47 return ScrollableWithBottomSection(
48 content: Container(
@@ -59,17 +58,28 @@ class WelcomePage extends BasePage {
58 children: <Widget>[
59 AspectRatio(
60 aspectRatio: aspectRatioImage,
62 - child: FittedBox(child: welcomeImage, fit: BoxFit.contain),
61 + child: FittedBox(
62 + fit: BoxFit.contain,
63 + child: CakeImageWidget(imageUrl: welcomeImage),
64 + ),
65 ),
66 Padding(
65 - padding: EdgeInsets.only(top: 20),
66 - child: highlightText(context, S.of(context).welcome_subtitle_new_wallet,
67 - S.of(context).create_new)),
67 + padding: EdgeInsets.only(top: 48),
68 + child: highlightText(
69 + context,
70 + S.of(context).welcome_subtitle_new_wallet,
71 + S.of(context).create_new,
72 + ),
73 + ),
74 SizedBox(height: 10),
75 Padding(
70 - padding: EdgeInsets.only(top: 5),
71 - child: highlightText(context, S.of(context).welcome_subtitle_restore_wallet,
72 - S.of(context).restore_existing_wallet)),
76 + padding: EdgeInsets.only(top: 5),
77 + child: highlightText(
78 + context,
79 + S.of(context).welcome_subtitle_restore_wallet,
80 + S.of(context).restore_existing_wallet,
81 + ),
82 + ),
83 ],
84 ),
85 ],
@@ -78,32 +88,37 @@ class WelcomePage extends BasePage {
88 ),
89 bottomSection: Column(
90 children: <Widget>[
91 + Text(
92 + 'Please make selection below \nto create or recover your wallet.',
93 + style: Theme.of(context).textTheme.bodySmall?.copyWith(
94 + fontWeight: FontWeight.w500,
95 + color: Theme.of(context).colorScheme.onSurfaceVariant,
96 + ),
97 + textAlign: TextAlign.center,
98 + ),
99 Padding(
100 padding: EdgeInsets.only(top: 24),
83 - child: PrimaryImageButton(
84 - key: ValueKey('welcome_page_restore_wallet_button_key'),
85 - onPressed: () {
86 - Navigator.pushNamed(context, Routes.restoreOptions, arguments: true);
87 - },
88 - image: restoreWalletImage,
89 - text: S.of(context).restore_existing_wallet,
90 - color: Theme.of(context).cardColor,
91 - textColor: Theme.of(context).extension<CakeTextTheme>()!.titleColor),
101 + child: PrimaryButton(
102 + key: ValueKey('welcome_page_restore_wallet_button_key'),
103 + onPressed: () {
104 + Navigator.pushNamed(context, Routes.restoreOptions, arguments: true);
105 + },
106 + text: S.of(context).restore_restore_wallet,
107 + color: Theme.of(context).colorScheme.surfaceContainer,
108 + textColor: Theme.of(context).colorScheme.onSecondaryContainer,
109 + ),
110 ),
111 Padding(
94 - padding: EdgeInsets.only(top: 10),
95 - child: PrimaryImageButton(
112 + padding: EdgeInsets.only(top: 12),
113 + child: PrimaryButton(
114 key: ValueKey('welcome_page_create_new_wallet_button_key'),
115 onPressed: () => Navigator.pushNamed(context, Routes.newWalletFromWelcome),
98 - image: newWalletImage,
116 text: S.of(context).create_new,
100 - color: Theme.of(context)
101 - .extension<WalletListTheme>()!
102 - .createNewWalletButtonBackgroundColor,
103 - textColor:
104 - Theme.of(context).extension<WalletListTheme>()!.restoreWalletButtonTextColor,
117 + color: Theme.of(context).colorScheme.primary,
118 + textColor: Theme.of(context).colorScheme.onPrimary,
119 ),
120 ),
121 + SizedBox(height: 16),
122 ],
123 ),
124 );
@@ -118,12 +133,7 @@ class WelcomePage extends BasePage {
133 textAlign: TextAlign.center,
134 text: TextSpan(
135 text: text,
121 - style: TextStyle(
122 - fontSize: 16,
123 - height: 1.5,
124 - fontWeight: FontWeight.w400,
125 - color: Theme.of(context).extension<CakeTextTheme>()!.secondaryTextColor,
126 - ),
136 + style: Theme.of(context).textTheme.bodyLarge?.copyWith(height: 1.5),
137 ),
138 );
139 }
@@ -136,40 +146,34 @@ class WelcomePage extends BasePage {
146 final end = match.end;
147
148 if (start > lastMatchEnd) {
139 - spans.add(TextSpan(
140 - text: text.substring(lastMatchEnd, start),
141 - style: TextStyle(
142 - fontSize: 16,
143 - height: 1.5,
144 - fontWeight: FontWeight.w400,
145 - color: Theme.of(context).extension<CakeTextTheme>()!.secondaryTextColor,
149 + spans.add(
150 + TextSpan(
151 + text: text.substring(lastMatchEnd, start),
152 + style: Theme.of(context).textTheme.bodyLarge?.copyWith(height: 1.5),
153 ),
147 - ));
154 + );
155 }
156
150 - spans.add(TextSpan(
151 - text: text.substring(start, end),
152 - style: TextStyle(
153 - fontSize: 16,
154 - height: 1.5,
155 - color: Theme.of(context).extension<CakeTextTheme>()!.secondaryTextColor,
156 - fontWeight: FontWeight.bold,
157 + spans.add(
158 + TextSpan(
159 + text: text.substring(start, end),
160 + style: Theme.of(context).textTheme.bodyLarge?.copyWith(
161 + height: 1.5,
162 + fontWeight: FontWeight.w700,
163 + ),
164 ),
158 - ));
165 + );
166
167 lastMatchEnd = end;
168 }
169
170 if (lastMatchEnd < text.length) {
164 - spans.add(TextSpan(
165 - text: text.substring(lastMatchEnd),
166 - style: TextStyle(
167 - fontSize: 16,
168 - height: 1.5,
169 - fontWeight: FontWeight.w400,
170 - color: Theme.of(context).extension<CakeTextTheme>()!.secondaryTextColor,
171 + spans.add(
172 + TextSpan(
173 + text: text.substring(lastMatchEnd),
174 + style: Theme.of(context).textTheme.bodyLarge?.copyWith(height: 1.5),
175 ),
172 - ));
176 + );
177 }
178
179 return RichText(
lib/src/screens/yat/widgets/first_introduction.dart
+9 -11
@@ -2,9 +2,7 @@ import 'package:cake_wallet/src/screens/yat/widgets/yat_bar.dart';
2 import 'package:cake_wallet/src/screens/yat/widgets/yat_page_indicator.dart';
3 import 'package:cake_wallet/src/widgets/primary_button.dart';
4 import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
5 -import 'package:flutter/cupertino.dart';
5 import 'package:flutter/material.dart';
7 -import 'package:cake_wallet/palette.dart';
6 import 'package:lottie/lottie.dart';
7 import 'package:cake_wallet/generated/i18n.dart';
8
@@ -24,7 +22,7 @@ class FirstIntroduction extends StatelessWidget {
22 return Container(
23 height: screenHeight,
24 width: screenWidth,
27 - color: Colors.white,
25 + color: Theme.of(context).colorScheme.surfaceContainer,
26 child: ScrollableWithBottomSection(
27 contentPadding: EdgeInsets.only(top: 40, bottom: 40),
28 content: Column(
@@ -42,11 +40,11 @@ class FirstIntroduction extends StatelessWidget {
40 Text(
41 S.of(context).yat_alert_title,
42 textAlign: TextAlign.center,
45 - style: TextStyle(
43 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
44 fontSize: 24,
45 fontWeight: FontWeight.bold,
48 - fontFamily: 'Lato',
49 - color: Colors.black,
46 +
47 + color: Theme.of(context).colorScheme.onSurface,
48 decoration: TextDecoration.none,
49 )
50 ),
@@ -55,11 +53,11 @@ class FirstIntroduction extends StatelessWidget {
53 child: Text(
54 S.of(context).yat_alert_content,
55 textAlign: TextAlign.center,
58 - style: TextStyle(
56 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
57 fontSize: 16,
58 fontWeight: FontWeight.normal,
61 - fontFamily: 'Lato',
62 - color: Colors.black,
59 +
60 + color: Theme.of(context).colorScheme.onSurface,
61 decoration: TextDecoration.none,
62 )
63 )
@@ -75,8 +73,8 @@ class FirstIntroduction extends StatelessWidget {
73 children: [
74 PrimaryButton(
75 text: S.of(context).restore_next,
78 - textColor: Colors.white,
79 - color: Palette.protectiveBlue,
76 + textColor: Theme.of(context).colorScheme.onPrimary,
77 + color: Theme.of(context).colorScheme.primary,
78 onPressed: onNext
79 ),
80 Padding(
lib/src/screens/yat/widgets/second_introduction.dart
+9 -11
@@ -2,9 +2,7 @@ import 'package:cake_wallet/src/screens/yat/widgets/yat_bar.dart';
2 import 'package:cake_wallet/src/screens/yat/widgets/yat_page_indicator.dart';
3 import 'package:cake_wallet/src/widgets/primary_button.dart';
4 import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
5 -import 'package:flutter/cupertino.dart';
5 import 'package:flutter/material.dart';
7 -import 'package:cake_wallet/palette.dart';
6 import 'package:lottie/lottie.dart';
7 import 'package:cake_wallet/generated/i18n.dart';
8
@@ -23,7 +21,7 @@ class SecondIntroduction extends StatelessWidget {
21 return Container(
22 height: screenHeight,
23 width: screenWidth,
26 - color: Colors.white,
24 + color: Theme.of(context).colorScheme.surfaceContainer,
25 child: ScrollableWithBottomSection(
26 contentPadding: EdgeInsets.only(top: 40, bottom: 40),
27 content: Column(
@@ -41,11 +39,11 @@ class SecondIntroduction extends StatelessWidget {
39 Text(
40 S.of(context).second_intro_title,
41 textAlign: TextAlign.center,
44 - style: TextStyle(
42 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
43 fontSize: 24,
44 fontWeight: FontWeight.bold,
47 - fontFamily: 'Lato',
48 - color: Colors.black,
45 +
46 + color: Theme.of(context).colorScheme.onSurface,
47 decoration: TextDecoration.none,
48 )
49 ),
@@ -54,11 +52,11 @@ class SecondIntroduction extends StatelessWidget {
52 child: Text(
53 S.of(context).second_intro_content,
54 textAlign: TextAlign.center,
57 - style: TextStyle(
55 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
56 fontSize: 16,
57 fontWeight: FontWeight.normal,
60 - fontFamily: 'Lato',
61 - color: Colors.black,
58 +
59 + color: Theme.of(context).colorScheme.onSurface,
60 decoration: TextDecoration.none,
61 )
62 )
@@ -74,8 +72,8 @@ class SecondIntroduction extends StatelessWidget {
72 children: [
73 PrimaryButton(
74 text: S.of(context).restore_next,
77 - textColor: Colors.white,
78 - color: Palette.protectiveBlue,
75 + textColor: Theme.of(context).colorScheme.onPrimary,
76 + color: Theme.of(context).colorScheme.primary,
77 onPressed: onNext
78 ),
79 Padding(
lib/src/screens/yat/widgets/third_introduction.dart
+75 -88
@@ -4,15 +4,11 @@ import 'package:cake_wallet/src/widgets/primary_button.dart';
4 import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
5 import 'package:flutter/cupertino.dart';
6 import 'package:flutter/material.dart';
7 -import 'package:cake_wallet/palette.dart';
7 import 'package:lottie/lottie.dart';
8 import 'package:cake_wallet/generated/i18n.dart';
9
10 class ThirdIntroduction extends StatelessWidget {
12 - ThirdIntroduction({
13 - required this.onGet,
14 - required this.onConnect,
15 - this.onClose});
11 + ThirdIntroduction({required this.onGet, required this.onConnect, this.onClose});
12
13 final VoidCallback? onClose;
14 final VoidCallback onGet;
@@ -25,89 +21,80 @@ class ThirdIntroduction extends StatelessWidget {
21 final screenWidth = MediaQuery.of(context).size.width;
22
23 return Container(
28 - height: screenHeight,
29 - width: screenWidth,
30 - color: Colors.white,
31 - child: ScrollableWithBottomSection(
32 - contentPadding: EdgeInsets.only(top: 40, bottom: 40),
33 - content: Column(
34 - children: [
35 - Container(
36 - height: 90,
37 - padding: EdgeInsets.only(left: 24, right: 24),
38 - child: YatBar(onClose: onClose)
24 + height: screenHeight,
25 + width: screenWidth,
26 + color: Theme.of(context).colorScheme.surfaceContainer,
27 + child: ScrollableWithBottomSection(
28 + contentPadding: EdgeInsets.only(top: 40, bottom: 40),
29 + content: Column(
30 + children: [
31 + Container(
32 + height: 90,
33 + padding: EdgeInsets.only(left: 24, right: 24),
34 + child: YatBar(onClose: onClose)),
35 + animation,
36 + Padding(
37 + padding: EdgeInsets.only(top: 40, left: 30, right: 30),
38 + child: Column(children: [
39 + Text(S.of(context).third_intro_title,
40 + textAlign: TextAlign.center,
41 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
42 + fontSize: 24,
43 + fontWeight: FontWeight.bold,
44 +
45 + color: Theme.of(context).colorScheme.onSurface,
46 + decoration: TextDecoration.none,
47 + )),
48 + Padding(
49 + padding: EdgeInsets.only(top: 20),
50 + child: Text(S.of(context).third_intro_content,
51 + textAlign: TextAlign.center,
52 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
53 + fontSize: 16,
54 + fontWeight: FontWeight.normal,
55 +
56 + color: Theme.of(context).colorScheme.onSurface,
57 + decoration: TextDecoration.none,
58 + )))
59 + ])),
60 + ],
61 + ),
62 + bottomSectionPadding: EdgeInsets.fromLTRB(24, 0, 24, 24),
63 + bottomSection: Column(
64 + crossAxisAlignment: CrossAxisAlignment.center,
65 + children: [
66 + PrimaryIconButton(
67 + text: S.of(context).get_your_yat,
68 + textColor: Theme.of(context).colorScheme.onPrimary,
69 + color: Theme.of(context).colorScheme.primary,
70 + borderColor: Theme.of(context).colorScheme.primary,
71 + iconColor: Theme.of(context).colorScheme.onPrimary,
72 + iconBackgroundColor: Colors.transparent,
73 + iconData: CupertinoIcons.arrow_up_right_square,
74 + mainAxisAlignment: MainAxisAlignment.end,
75 + onPressed: onGet,
76 + ),
77 + Padding(
78 + padding: EdgeInsets.only(top: 12),
79 + child: PrimaryIconButton(
80 + text: S.of(context).connect_an_existing_yat,
81 + textColor: Theme.of(context).colorScheme.onPrimary,
82 + color: Theme.of(context).colorScheme.primary,
83 + borderColor: Theme.of(context).colorScheme.primary,
84 + iconColor: Theme.of(context).colorScheme.onPrimary,
85 + iconBackgroundColor: Colors.transparent,
86 + iconData: CupertinoIcons.arrow_up_right_square,
87 + mainAxisAlignment: MainAxisAlignment.end,
88 + onPressed: onConnect,
89 ),
40 - animation,
41 - Padding(
42 - padding: EdgeInsets.only(top: 40, left: 30, right: 30),
43 - child: Column(
44 - children: [
45 - Text(
46 - S.of(context).third_intro_title,
47 - textAlign: TextAlign.center,
48 - style: TextStyle(
49 - fontSize: 24,
50 - fontWeight: FontWeight.bold,
51 - fontFamily: 'Lato',
52 - color: Colors.black,
53 - decoration: TextDecoration.none,
54 - )
55 - ),
56 - Padding(
57 - padding: EdgeInsets.only(top: 20),
58 - child: Text(
59 - S.of(context).third_intro_content,
60 - textAlign: TextAlign.center,
61 - style: TextStyle(
62 - fontSize: 16,
63 - fontWeight: FontWeight.normal,
64 - fontFamily: 'Lato',
65 - color: Colors.black,
66 - decoration: TextDecoration.none,
67 - )
68 - )
69 - )
70 - ]
71 - )
72 - ),
73 - ],
74 - ),
75 - bottomSectionPadding: EdgeInsets.fromLTRB(24, 0, 24, 24),
76 - bottomSection: Column(
77 - crossAxisAlignment: CrossAxisAlignment.center,
78 - children: [
79 - PrimaryIconButton(
80 - text: S.of(context).get_your_yat,
81 - textColor: Colors.white,
82 - color: Palette.protectiveBlue,
83 - borderColor: Palette.protectiveBlue,
84 - iconColor: Colors.white,
85 - iconBackgroundColor: Colors.transparent,
86 - iconData: CupertinoIcons
87 - .arrow_up_right_square,
88 - mainAxisAlignment: MainAxisAlignment.end,
89 - onPressed: onGet),
90 - Padding(
91 - padding: EdgeInsets.only(top: 12),
92 - child: PrimaryIconButton(
93 - text: S.of(context).connect_an_existing_yat,
94 - textColor: Colors.black,
95 - color: Palette.blueAlice,
96 - borderColor: Palette.blueAlice,
97 - iconColor: Colors.black,
98 - iconBackgroundColor: Colors.transparent,
99 - iconData: CupertinoIcons
100 - .arrow_up_right_square,
101 - mainAxisAlignment: MainAxisAlignment.end,
102 - onPressed: onConnect)
103 - ),
104 - Padding(
105 - padding: EdgeInsets.only(top: 24),
106 - child: YatPageIndicator(filled: 2)
107 - )
108 - ]
109 - ),
110 - )
90 + ),
91 + Padding(
92 + padding: EdgeInsets.only(top: 24),
93 + child: YatPageIndicator(filled: 2),
94 + )
95 + ],
96 + ),
97 + ),
98 );
99 }
113 -}
\ No newline at end of file
100 +}
lib/src/screens/yat/widgets/yat_close_button.dart
+16 -16
@@ -1,4 +1,3 @@
1 -import 'package:cake_wallet/palette.dart';
1 import 'package:flutter/material.dart';
2
3 class YatCloseButton extends StatelessWidget {
@@ -9,20 +8,21 @@ class YatCloseButton extends StatelessWidget {
8 @override
9 Widget build(BuildContext context) {
10 return GestureDetector(
12 - onTap: onClose,
13 - child: Container(
14 - height: 28,
15 - width: 28,
16 - alignment: Alignment.center,
17 - decoration: BoxDecoration(
18 - color: Palette.manatee,
19 - shape: BoxShape.circle
20 - ),
21 - child: Icon(
22 - Icons.clear,
23 - color: Colors.white,
24 - size: 20)
25 - )
11 + onTap: onClose,
12 + child: Container(
13 + height: 28,
14 + width: 28,
15 + alignment: Alignment.center,
16 + decoration: BoxDecoration(
17 + color: Theme.of(context).colorScheme.surfaceContainerHighest,
18 + shape: BoxShape.circle,
19 + ),
20 + child: Icon(
21 + Icons.clear,
22 + color: Theme.of(context).colorScheme.onSecondaryContainer,
23 + size: 20,
24 + ),
25 + ),
26 );
27 }
28 -}
\ No newline at end of file
28 +}
lib/src/screens/yat/widgets/yat_page_indicator.dart
+2 -3
@@ -1,5 +1,4 @@
1 import 'package:flutter/material.dart';
2 -import 'package:cake_wallet/palette.dart';
2
3 class YatPageIndicator extends StatelessWidget {
4 YatPageIndicator({required this.filled});
@@ -22,8 +21,8 @@ class YatPageIndicator extends StatelessWidget {
21 decoration: BoxDecoration(
22 shape: BoxShape.circle,
23 color: isFilled
25 - ? Palette.frostySky
26 - : Palette.stateGray.withOpacity(0.1)
24 + ? Theme.of(context).colorScheme.primary
25 + : Theme.of(context).colorScheme.onSurfaceVariant.withOpacity(0.1)
26 )
27 );
28 })
lib/src/screens/yat/yat_popup.dart
+95 -128
@@ -1,4 +1,3 @@
1 -import 'package:cake_wallet/palette.dart';
1 import 'package:cake_wallet/src/screens/yat/widgets/first_introduction.dart';
2 import 'package:cake_wallet/src/screens/yat/widgets/second_introduction.dart';
3 import 'package:cake_wallet/src/screens/yat/widgets/third_introduction.dart';
@@ -15,9 +14,7 @@ import 'package:cake_wallet/generated/i18n.dart';
14
15 class YatPopup extends StatelessWidget {
16 YatPopup({required this.dashboardViewModel, required this.onClose})
18 - : baseUrl = YatLink.isDevMode
19 - ? YatLink.baseDevUrl
20 - : YatLink.baseReleaseUrl;
17 + : baseUrl = YatLink.isDevMode ? YatLink.baseDevUrl : YatLink.baseReleaseUrl;
18
19 static const durationInMilliseconds = 250;
20
@@ -34,154 +31,124 @@ class YatPopup extends StatelessWidget {
31 clipBehavior: Clip.none,
32 alignment: Alignment.bottomCenter,
33 children: [
37 - AlertBackground(
38 - child: Container()
39 - ),
34 + AlertBackground(child: Container()),
35 SlideInUp(
36 from: 420,
37 duration: Duration(milliseconds: durationInMilliseconds),
38 child: ClipRRect(
44 - borderRadius: BorderRadius.only(
45 - topLeft: Radius.circular(24),
46 - topRight: Radius.circular(24)),
39 + borderRadius:
40 + BorderRadius.only(topLeft: Radius.circular(24), topRight: Radius.circular(24)),
41 child: Container(
42 height: 420,
49 - color: Colors.white,
43 + color: Theme.of(context).colorScheme.surfaceContainer,
44 padding: EdgeInsets.fromLTRB(24, 15, 24, 24),
45 child: Column(
46 mainAxisSize: MainAxisSize.max,
47 mainAxisAlignment: MainAxisAlignment.spaceBetween,
48 children: [
55 - Column(
56 - children: [
57 - Row(
58 - mainAxisSize: MainAxisSize.max,
59 - mainAxisAlignment: MainAxisAlignment.end,
60 - children: [
61 - YatCloseButton(onClose: onClose)
62 - ]
63 - ),
64 - Row(
65 - mainAxisSize: MainAxisSize.max,
66 - mainAxisAlignment: MainAxisAlignment.center,
67 - children: [
68 - Container(
69 - height: 64,
70 - width: 165,
71 - alignment: Alignment.center,
72 - decoration: BoxDecoration(
73 - color: Colors.white,
74 - borderRadius: BorderRadius
75 - .all(Radius.circular(32)),
76 - boxShadow: [
77 - BoxShadow(
78 - color: Colors.black.withOpacity(0.05),
79 - blurRadius: 15,
80 - offset: Offset(0, 5)
81 - )
82 - ]
83 - ),
84 - child: image
85 - )
86 - ]
87 - )
88 - ]
89 - ),
49 + Column(children: [
50 + Row(
51 + mainAxisSize: MainAxisSize.max,
52 + mainAxisAlignment: MainAxisAlignment.end,
53 + children: [YatCloseButton(onClose: onClose)]),
54 + Row(
55 + mainAxisSize: MainAxisSize.max,
56 + mainAxisAlignment: MainAxisAlignment.center,
57 + children: [
58 + Container(
59 + height: 64,
60 + width: 165,
61 + alignment: Alignment.center,
62 + decoration: BoxDecoration(
63 + color: Theme.of(context).colorScheme.surfaceContainer,
64 + borderRadius: BorderRadius.all(Radius.circular(32)),
65 + boxShadow: [
66 + BoxShadow(
67 + color: Theme.of(context)
68 + .colorScheme
69 + .onSurface
70 + .withOpacity(0.05),
71 + blurRadius: 15,
72 + offset: Offset(0, 5))
73 + ]),
74 + child: image)
75 + ])
76 + ]),
77 Container(
78 padding: EdgeInsets.only(left: 6, right: 6),
92 - child: Column(
93 - children: [
94 - Text(
95 - S.of(context).yat_popup_title,
96 - textAlign: TextAlign.center,
97 - style: TextStyle(
79 + child: Column(children: [
80 + Text(S.of(context).yat_popup_title,
81 + textAlign: TextAlign.center,
82 + style: Theme.of(context).textTheme.bodyLarge?.copyWith(
83 fontSize: 24,
84 fontWeight: FontWeight.bold,
100 - fontFamily: 'Lato',
101 - color: Colors.black,
85 decoration: TextDecoration.none,
103 - )
104 - ),
105 - Padding(
106 - padding: EdgeInsets.only(top: 20),
107 - child: Text(
108 - S.of(context).yat_popup_content,
109 - textAlign: TextAlign.center,
110 - style: TextStyle(
86 + )),
87 + Padding(
88 + padding: EdgeInsets.only(top: 20),
89 + child: Text(S.of(context).yat_popup_content,
90 + textAlign: TextAlign.center,
91 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
92 fontSize: 16,
112 - fontWeight: FontWeight.normal,
113 - fontFamily: 'Lato',
114 - color: Colors.black,
93 decoration: TextDecoration.none,
116 - )
117 - )
118 - )
119 - ]
120 - )
121 - ),
94 + )))
95 + ])),
96 PrimaryButton(
97 text: S.of(context).learn_more,
124 - textColor: Colors.white,
125 - color: Palette.protectiveBlue,
126 - onPressed: () => dashboardViewModel
127 - .isShowFirstYatIntroduction = true
128 - )
98 + textColor: Theme.of(context).colorScheme.onPrimary,
99 + color: Theme.of(context).colorScheme.primary,
100 + onPressed: () => dashboardViewModel.isShowFirstYatIntroduction = true)
101 ],
130 - )
131 - )
132 - ),
133 - ),
134 - Observer(builder: (_) => dashboardViewModel.isShowFirstYatIntroduction
135 - ? SlideInRight(
136 - from: screenWidth,
137 - duration: Duration(milliseconds: durationInMilliseconds),
138 - child: FirstIntroduction(
139 - onClose: onClose,
140 - onNext: () => dashboardViewModel
141 - .isShowSecondYatIntroduction = true
142 - ))
143 - : Container()
144 - ),
145 - Observer(builder: (_) => dashboardViewModel.isShowSecondYatIntroduction
146 - ? SlideInRight(
147 - from: screenWidth,
148 - duration: Duration(milliseconds: durationInMilliseconds),
149 - child: SecondIntroduction(
150 - onClose: onClose,
151 - onNext: () => dashboardViewModel
152 - .isShowThirdYatIntroduction = true
153 - ))
154 - : Container()
102 + ))),
103 ),
156 - Observer(builder: (_) => dashboardViewModel.isShowThirdYatIntroduction
157 - ? SlideInRight(
158 - from: screenWidth,
159 - duration: Duration(milliseconds: durationInMilliseconds),
160 - child: ThirdIntroduction(
161 - onClose: onClose,
162 - onGet: () {
163 - var createNewYatUrl = YatLink.startFlowUrl;
164 - final createNewYatUrlParameters =
165 - dashboardViewModel.yatStore.defineQueryParameters();
104 + Observer(
105 + builder: (_) => dashboardViewModel.isShowFirstYatIntroduction
106 + ? SlideInRight(
107 + from: screenWidth,
108 + duration: Duration(milliseconds: durationInMilliseconds),
109 + child: FirstIntroduction(
110 + onClose: onClose,
111 + onNext: () => dashboardViewModel.isShowSecondYatIntroduction = true))
112 + : Container()),
113 + Observer(
114 + builder: (_) => dashboardViewModel.isShowSecondYatIntroduction
115 + ? SlideInRight(
116 + from: screenWidth,
117 + duration: Duration(milliseconds: durationInMilliseconds),
118 + child: SecondIntroduction(
119 + onClose: onClose,
120 + onNext: () => dashboardViewModel.isShowThirdYatIntroduction = true))
121 + : Container()),
122 + Observer(
123 + builder: (_) => dashboardViewModel.isShowThirdYatIntroduction
124 + ? SlideInRight(
125 + from: screenWidth,
126 + duration: Duration(milliseconds: durationInMilliseconds),
127 + child: ThirdIntroduction(
128 + onClose: onClose,
129 + onGet: () {
130 + var createNewYatUrl = YatLink.startFlowUrl;
131 + final createNewYatUrlParameters =
132 + dashboardViewModel.yatStore.defineQueryParameters();
133
167 - if (createNewYatUrlParameters.isNotEmpty) {
168 - createNewYatUrl += '?sub1=' + createNewYatUrlParameters;
169 - }
134 + if (createNewYatUrlParameters.isNotEmpty) {
135 + createNewYatUrl += '?sub1=' + createNewYatUrlParameters;
136 + }
137
171 - final uri = Uri.parse(createNewYatUrl);
172 - launchUrl(uri, mode: LaunchMode.externalApplication);
173 - },
174 - onConnect: () {
175 - String url = baseUrl + YatLink.signInSuffix;
176 - final parameters = dashboardViewModel.yatStore.defineQueryParameters();
177 - if (parameters.isNotEmpty) {
178 - url += YatLink.queryParameter + parameters;
179 - }
180 - final uri = Uri.parse(url);
181 - launchUrl(uri, mode: LaunchMode.externalApplication);
182 - }))
183 - : Container())
138 + final uri = Uri.parse(createNewYatUrl);
139 + launchUrl(uri, mode: LaunchMode.externalApplication);
140 + },
141 + onConnect: () {
142 + String url = baseUrl + YatLink.signInSuffix;
143 + final parameters = dashboardViewModel.yatStore.defineQueryParameters();
144 + if (parameters.isNotEmpty) {
145 + url += YatLink.queryParameter + parameters;
146 + }
147 + final uri = Uri.parse(url);
148 + launchUrl(uri, mode: LaunchMode.externalApplication);
149 + }))
150 + : Container())
151 ],
152 );
153 }
187 -}
\ No newline at end of file
154 +}
lib/src/screens/yat_emoji_id.dart
+45 -82
@@ -1,20 +1,8 @@
1 -import 'package:cake_wallet/palette.dart';
2 -import 'package:cake_wallet/src/screens/yat/widgets/first_introduction.dart';
3 -import 'package:cake_wallet/src/screens/yat/widgets/second_introduction.dart';
4 -import 'package:cake_wallet/src/screens/yat/widgets/third_introduction.dart';
1 import 'package:cake_wallet/src/screens/yat/widgets/yat_close_button.dart';
2 import 'package:cake_wallet/src/widgets/alert_background.dart';
3 import 'package:cake_wallet/src/widgets/primary_button.dart';
8 -import 'package:cake_wallet/store/yat/yat_store.dart';
9 -import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart';
10 -import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart';
4 import 'package:flutter/material.dart';
5 import 'package:animate_do/animate_do.dart';
13 -import 'package:flutter_mobx/flutter_mobx.dart';
14 -import 'package:url_launcher/url_launcher.dart';
15 -import 'package:cake_wallet/generated/i18n.dart';
16 -import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
17 -import 'package:cake_wallet/themes/extensions/balance_page_theme.dart';
6
7 class YatEmojiId extends StatelessWidget {
8 YatEmojiId(this.emojiId);
@@ -36,95 +24,70 @@ class YatEmojiId extends StatelessWidget {
24 from: 420,
25 duration: Duration(milliseconds: durationInMilliseconds),
26 child: ClipRRect(
39 - borderRadius: BorderRadius.only(
40 - topLeft: Radius.circular(24),
41 - topRight: Radius.circular(24)),
27 + borderRadius:
28 + BorderRadius.only(topLeft: Radius.circular(24), topRight: Radius.circular(24)),
29 child: Container(
30 height: 420,
44 - color:
45 - Theme.of(context).extension<SyncIndicatorTheme>()!.syncedBackgroundColor,
31 + color: Theme.of(context).colorScheme.primaryContainer,
32 padding: EdgeInsets.fromLTRB(24, 15, 24, 24),
33 child: Column(
34 mainAxisSize: MainAxisSize.max,
35 mainAxisAlignment: MainAxisAlignment.spaceBetween,
36 children: [
51 - Column(
52 - children: [
53 - Row(
54 - mainAxisSize: MainAxisSize.max,
55 - mainAxisAlignment: MainAxisAlignment.end,
56 - children: [
57 - YatCloseButton(onClose: () => Navigator.of(context).pop())
58 - ]
59 - ),
60 - Row(
61 - mainAxisSize: MainAxisSize.max,
62 - mainAxisAlignment: MainAxisAlignment.center,
63 - children: [
64 - Container(
65 - padding: EdgeInsets.fromLTRB(10, 5, 10, 5),
66 - decoration: BoxDecoration(
67 - color: Colors.white,
68 - border: Border.all(color: Colors.white),
69 - borderRadius: BorderRadius.all(Radius.circular(50))
70 - ),
71 - child:
72 - Text(
73 - emojiId,
37 + Column(children: [
38 + Row(
39 + mainAxisSize: MainAxisSize.max,
40 + mainAxisAlignment: MainAxisAlignment.end,
41 + children: [YatCloseButton(onClose: () => Navigator.of(context).pop())]),
42 + Row(
43 + mainAxisSize: MainAxisSize.max,
44 + mainAxisAlignment: MainAxisAlignment.center,
45 + children: [
46 + Container(
47 + padding: EdgeInsets.fromLTRB(10, 5, 10, 5),
48 + decoration: BoxDecoration(
49 + color: Theme.of(context).colorScheme.surfaceContainer,
50 + border: Border.all(
51 + color: Theme.of(context).colorScheme.outlineVariant),
52 + borderRadius: BorderRadius.all(Radius.circular(50))),
53 + child: Text(emojiId,
54 textAlign: TextAlign.center,
75 - style: TextStyle(
76 - fontSize: 46,
77 - decoration: TextDecoration.none,
78 - )
79 - ))
80 - ]
81 - )
82 - ]
83 - ),
55 + style: Theme.of(context).textTheme.bodyLarge?.copyWith(
56 + fontSize: 46,
57 + decoration: TextDecoration.none,
58 + )))
59 + ])
60 + ]),
61 Container(
62 padding: EdgeInsets.only(left: 6, right: 6),
86 - child: Column(
87 - children: [
88 - Text(
89 - "That's one nice Yat!",
90 - textAlign: TextAlign.center,
91 - style: TextStyle(
63 + child: Column(children: [
64 + Text("That's one nice Yat!",
65 + textAlign: TextAlign.center,
66 + style: Theme.of(context).textTheme.bodyLarge?.copyWith(
67 fontSize: 32,
68 fontWeight: FontWeight.bold,
94 - fontFamily: 'Lato',
95 - color: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
69 decoration: TextDecoration.none,
97 - )
98 - ),
99 - Padding(
100 - padding: EdgeInsets.only(top: 20),
101 - child: Text(
102 - 'You can manage your Yat or purchase additional Yats in your account settings',
103 - textAlign: TextAlign.center,
104 - style: TextStyle(
70 + )),
71 + Padding(
72 + padding: EdgeInsets.only(top: 20),
73 + child: Text(
74 + 'You can manage your Yat or purchase additional Yats in your account settings',
75 + textAlign: TextAlign.center,
76 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
77 fontSize: 18,
106 - fontWeight: FontWeight.normal,
107 - fontFamily: 'Lato',
108 - color: Theme.of(context).extension<BalancePageTheme>()!.labelTextColor,
78 + color: Theme.of(context).colorScheme.onSurfaceVariant,
79 decoration: TextDecoration.none,
110 - )
111 - )
112 - )
113 - ]
114 - )
115 - ),
80 + )))
81 + ])),
82 PrimaryButton(
83 text: 'Got it',
118 - textColor: Colors.white,
119 - color: Palette.protectiveBlue,
120 - onPressed: () => Navigator.of(context).pop()
121 - )
84 + textColor: Theme.of(context).colorScheme.onPrimary,
85 + color: Theme.of(context).colorScheme.primary,
86 + onPressed: () => Navigator.of(context).pop())
87 ],
123 - )
124 - )
125 - ),
88 + ))),
89 )
90 ],
91 );
92 }
130 -}
\ No newline at end of file
93 +}
lib/src/widgets/add_template_button.dart
+10 -12
@@ -2,7 +2,6 @@ import 'package:cake_wallet/generated/i18n.dart';
2 import 'package:cake_wallet/utils/responsive_layout_util.dart';
3 import 'package:dotted_border/dotted_border.dart';
4 import 'package:flutter/material.dart';
5 -import 'package:cake_wallet/themes/extensions/send_page_theme.dart';
5
6 class AddTemplateButton extends StatelessWidget {
7 final Function() onTap;
@@ -20,31 +19,30 @@ class AddTemplateButton extends StatelessWidget {
19 child: DottedBorder(
20 borderType: BorderType.RRect,
21 dashPattern: [6, 4],
23 - color:
24 - Theme.of(context).extension<SendPageTheme>()!.templateDottedBorderColor,
22 + color: Theme.of(context).colorScheme.outline,
23 strokeWidth: 2,
26 - radius: Radius.circular(20),
24 + radius: Radius.circular(12),
25 child: Container(
26 height: 34,
27 padding: EdgeInsets.symmetric(
30 - horizontal: responsiveLayoutUtil.shouldRenderMobileUI ? 10 : 30),
28 + horizontal: responsiveLayoutUtil.shouldRenderMobileUI ? 10 : 30,
29 + ),
30 alignment: Alignment.center,
31 decoration: BoxDecoration(
33 - borderRadius: BorderRadius.all(Radius.circular(20)),
32 + borderRadius: BorderRadius.all(Radius.circular(12)),
33 color: Colors.transparent,
34 ),
35 child: currentTemplatesLength >= 1
36 ? Icon(
37 Icons.add,
39 - color: Theme.of(context).extension<SendPageTheme>()!.templateNewTextColor,
38 + color: Theme.of(context).colorScheme.onSurfaceVariant,
39 )
40 : Text(
41 S.of(context).new_template,
43 - style: TextStyle(
44 - fontSize: 14,
45 - fontWeight: FontWeight.w600,
46 - color: Theme.of(context).extension<SendPageTheme>()!.templateNewTextColor,
47 - ),
42 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
43 + fontWeight: FontWeight.w600,
44 + color: Theme.of(context).colorScheme.onSurfaceVariant,
45 + ),
46 ),
47 ),
48 ),
lib/src/widgets/address_text_field.dart
+138 -145
@@ -2,8 +2,7 @@ import 'package:cake_wallet/entities/contact_base.dart';
2 import 'package:cake_wallet/entities/qr_scanner.dart';
3 import 'package:cake_wallet/generated/i18n.dart';
4 import 'package:cake_wallet/routes.dart';
5 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
6 -import 'package:cake_wallet/themes/extensions/send_page_theme.dart';
5 +import 'package:cake_wallet/src/widgets/base_text_form_field.dart';
6 import 'package:cake_wallet/utils/device_info.dart';
7 import 'package:cake_wallet/utils/permission_handler.dart';
8 import 'package:cake_wallet/utils/responsive_layout_util.dart';
@@ -22,9 +21,7 @@ class AddressTextField<T extends Currency> extends StatelessWidget {
21 this.options = const [AddressTextFieldOption.qrCode, AddressTextFieldOption.addressBook],
22 this.onURIScanned,
23 this.focusNode,
25 - this.isBorderExist = true,
24 this.buttonColor,
27 - this.borderColor,
25 this.iconColor,
26 this.textStyle,
27 this.hintStyle,
@@ -35,6 +32,10 @@ class AddressTextField<T extends Currency> extends StatelessWidget {
32 this.onSelectedContact,
33 this.selectedCurrency,
34 this.addressKey,
35 + this.fillColor,
36 + this.hasUnderlineBorder = false,
37 + this.borderWidth = 1.0,
38 + this.contentPadding,
39 });
40
41 static const prefixIconWidth = 34.0;
@@ -47,25 +48,32 @@ class AddressTextField<T extends Currency> extends StatelessWidget {
48 final Function(Uri)? onURIScanned;
49 final List<AddressTextFieldOption> options;
50 final FormFieldValidator<String>? validator;
50 - final bool isBorderExist;
51 +
52 final Color? buttonColor;
52 - final Color? borderColor;
53 + final Color? fillColor;
54 final Color? iconColor;
55 + final double borderWidth;
56 final TextStyle? textStyle;
57 final TextStyle? hintStyle;
58 + final bool hasUnderlineBorder;
59 + final EdgeInsetsGeometry? contentPadding;
60 final FocusNode? focusNode;
61 + final T? selectedCurrency;
62 + final Key? addressKey;
63 +
64 final Function(BuildContext context)? onPushPasteButton;
65 final Function(BuildContext context)? onPushAddressBookButton;
66 final Function(BuildContext context)? onPushAddressPickerButton;
67 final Function(ContactBase contact)? onSelectedContact;
61 - final T? selectedCurrency;
62 - final Key? addressKey;
68
69 @override
70 Widget build(BuildContext context) {
71 return Stack(
72 children: <Widget>[
68 - TextFormField(
73 + BaseTextFormField(
74 + contentPadding: contentPadding,
75 + borderWidth: borderWidth,
76 + hasUnderlineBorder: hasUnderlineBorder,
77 key: addressKey,
78 enableIMEPersonalizedLearning: false,
79 keyboardType: TextInputType.visiblePassword,
@@ -73,156 +81,142 @@ class AddressTextField<T extends Currency> extends StatelessWidget {
81 enabled: isActive,
82 controller: controller,
83 focusNode: focusNode,
76 - style: textStyle ??
77 - TextStyle(
78 - fontSize: 16, color: Theme.of(context).extension<CakeTextTheme>()!.titleColor),
79 - decoration: InputDecoration(
80 - suffixIcon: SizedBox(
81 - width: prefixIconWidth * options.length + (spaceBetweenPrefixIcons * options.length),
82 - ),
83 - hintStyle: hintStyle ?? TextStyle(fontSize: 16, color: Theme.of(context).hintColor),
84 - hintText: placeholder ?? S.current.widgets_address,
85 - focusedBorder: isBorderExist
86 - ? UnderlineInputBorder(
87 - borderSide: BorderSide(
88 - color: borderColor ?? Theme.of(context).dividerColor, width: 1.0))
89 - : InputBorder.none,
90 - disabledBorder: isBorderExist
91 - ? UnderlineInputBorder(
92 - borderSide: BorderSide(
93 - color: borderColor ?? Theme.of(context).dividerColor, width: 1.0))
94 - : InputBorder.none,
95 - enabledBorder: isBorderExist
96 - ? UnderlineInputBorder(
97 - borderSide: BorderSide(
98 - color: borderColor ?? Theme.of(context).dividerColor, width: 1.0))
99 - : InputBorder.none,
84 + textStyle: textStyle ??
85 + Theme.of(context).textTheme.bodyMedium!.copyWith(
86 + fontSize: 16,
87 + color: Theme.of(context).colorScheme.onSurfaceVariant,
88 + ),
89 + fillColor: fillColor ?? Theme.of(context).colorScheme.surfaceContainer,
90 + suffixIcon: SizedBox(
91 + width: prefixIconWidth * options.length + (spaceBetweenPrefixIcons * options.length),
92 ),
93 + placeholderTextStyle: hintStyle ??
94 + Theme.of(context).textTheme.bodyMedium!.copyWith(
95 + fontSize: 16,
96 + color: Theme.of(context).colorScheme.onSurfaceVariant,
97 + ),
98 + hintText: placeholder ?? S.current.widgets_address,
99 validator: validator,
100 ),
101 Positioned(
104 - top: 2,
105 - right: 0,
106 - child: SizedBox(
107 - width:
108 - (prefixIconWidth * options.length) + (spaceBetweenPrefixIcons * options.length),
109 - child: Row(
110 - mainAxisAlignment: responsiveLayoutUtil.shouldRenderMobileUI
111 - ? MainAxisAlignment.spaceBetween
112 - : MainAxisAlignment.end,
113 - children: [
114 - if (this.options.contains(AddressTextFieldOption.paste)) ...[
115 - SizedBox(width: 5),
116 - Container(
117 - width: prefixIconWidth,
118 - height: prefixIconHeight,
119 - padding: EdgeInsets.only(top: 0),
120 - child: Semantics(
121 - label: S.of(context).paste,
122 - child: InkWell(
123 - onTap: () async => _pasteAddress(context),
124 - child: Container(
125 - padding: EdgeInsets.all(8),
126 - decoration: BoxDecoration(
127 - color:
128 - buttonColor ?? Theme.of(context).dialogTheme.backgroundColor,
129 - borderRadius: BorderRadius.all(Radius.circular(6))),
130 - child: Image.asset(
131 - 'assets/images/paste_ios.png',
132 - color: iconColor ??
133 - Theme.of(context)
134 - .extension<SendPageTheme>()!
135 - .textFieldButtonIconColor,
136 - )),
102 + top: 8,
103 + right: 6,
104 + child: SizedBox(
105 + width: (prefixIconWidth * options.length) + (spaceBetweenPrefixIcons * options.length),
106 + child: Row(
107 + mainAxisAlignment: responsiveLayoutUtil.shouldRenderMobileUI
108 + ? MainAxisAlignment.spaceBetween
109 + : MainAxisAlignment.end,
110 + children: [
111 + if (this.options.contains(AddressTextFieldOption.paste)) ...[
112 + SizedBox(width: 5),
113 + Container(
114 + width: prefixIconWidth,
115 + height: prefixIconHeight,
116 + padding: EdgeInsets.only(top: 0),
117 + child: Semantics(
118 + label: S.of(context).paste,
119 + child: InkWell(
120 + onTap: () async => _pasteAddress(context),
121 + child: Container(
122 + padding: EdgeInsets.all(8),
123 + decoration: BoxDecoration(
124 + color: Theme.of(context).colorScheme.surface,
125 + borderRadius: BorderRadius.all(Radius.circular(6)),
126 + ),
127 + child: Image.asset(
128 + 'assets/images/paste_ios.png',
129 + color: iconColor ?? Theme.of(context).colorScheme.onSurfaceVariant,
130 + ),
131 ),
132 ),
133 ),
140 - ],
141 - if (this.options.contains(AddressTextFieldOption.qrCode) &&
142 - DeviceInfo.instance.isMobile) ...[
143 - SizedBox(width: 5),
144 - Container(
145 - width: prefixIconWidth,
146 - height: prefixIconHeight,
147 - padding: EdgeInsets.only(top: 0),
148 - child: Semantics(
149 - label: S.of(context).scan_qr_code,
150 - child: InkWell(
151 - onTap: () async => _presentQRScanner(context),
152 - child: Container(
153 - padding: EdgeInsets.all(8),
154 - decoration: BoxDecoration(
155 - color:
156 - buttonColor ?? Theme.of(context).dialogTheme.backgroundColor,
157 - borderRadius: BorderRadius.all(Radius.circular(6))),
158 - child: Image.asset(
159 - 'assets/images/qr_code_icon.png',
160 - color: iconColor ??
161 - Theme.of(context)
162 - .extension<SendPageTheme>()!
163 - .textFieldButtonIconColor,
164 - )),
134 + ),
135 + ],
136 + if (this.options.contains(AddressTextFieldOption.qrCode) &&
137 + DeviceInfo.instance.isMobile) ...[
138 + SizedBox(width: 5),
139 + Container(
140 + width: prefixIconWidth,
141 + height: prefixIconHeight,
142 + padding: EdgeInsets.only(top: 0),
143 + child: Semantics(
144 + label: S.of(context).scan_qr_code,
145 + child: InkWell(
146 + onTap: () async => _presentQRScanner(context),
147 + child: Container(
148 + padding: EdgeInsets.all(8),
149 + decoration: BoxDecoration(
150 + color: Theme.of(context).colorScheme.surface,
151 + borderRadius: BorderRadius.all(
152 + Radius.circular(6),
153 + ),
154 + ),
155 + child: Image.asset(
156 + 'assets/images/qr_code_icon.png',
157 + color: iconColor ?? Theme.of(context).colorScheme.onSurfaceVariant,
158 + ),
159 ),
160 ),
161 ),
168 - ],
169 - if (this.options.contains(AddressTextFieldOption.addressBook)) ...[
170 - SizedBox(width: 5),
171 - Container(
172 - width: prefixIconWidth,
173 - height: prefixIconHeight,
174 - padding: EdgeInsets.only(top: 0),
175 - child: Semantics(
176 - label: S.of(context).address_book,
177 - child: InkWell(
178 - onTap: () async => _presetAddressBookPicker(context),
179 - child: Container(
180 - padding: EdgeInsets.all(8),
181 - decoration: BoxDecoration(
182 - color:
183 - buttonColor ?? Theme.of(context).dialogTheme.backgroundColor,
184 - borderRadius: BorderRadius.all(Radius.circular(6))),
185 - child: Image.asset(
186 - 'assets/images/open_book.png',
187 - color: iconColor ??
188 - Theme.of(context)
189 - .extension<SendPageTheme>()!
190 - .textFieldButtonIconColor,
191 - )),
162 + ),
163 + ],
164 + if (this.options.contains(AddressTextFieldOption.addressBook)) ...[
165 + SizedBox(width: 5),
166 + Container(
167 + width: prefixIconWidth,
168 + height: prefixIconHeight,
169 + padding: EdgeInsets.only(top: 0),
170 + child: Semantics(
171 + label: S.of(context).address_book,
172 + child: InkWell(
173 + onTap: () async => _presetAddressBookPicker(context),
174 + child: Container(
175 + padding: EdgeInsets.all(8),
176 + decoration: BoxDecoration(
177 + color: Theme.of(context).colorScheme.surface,
178 + borderRadius: BorderRadius.all(
179 + Radius.circular(6),
180 + ),
181 + ),
182 + child: Image.asset(
183 + 'assets/images/open_book.png',
184 + color: iconColor ?? Theme.of(context).colorScheme.onSurfaceVariant,
185 + ),
186 ),
187 ),
188 ),
195 - ],
196 - if (this.options.contains(AddressTextFieldOption.walletAddresses)) ...[
197 - SizedBox(width: 5),
198 - Container(
199 - width: prefixIconWidth,
200 - height: prefixIconHeight,
201 - padding: EdgeInsets.only(top: 0),
202 - child: Semantics(
203 - label: S.of(context).address_book,
204 - child: InkWell(
205 - onTap: () async => _presetWalletAddressPicker(context),
206 - child: Container(
207 - padding: EdgeInsets.all(8),
208 - decoration: BoxDecoration(
209 - color:
210 - buttonColor ?? Theme.of(context).dialogTheme.backgroundColor,
211 - borderRadius: BorderRadius.all(Radius.circular(6))),
212 - child: Image.asset(
213 - 'assets/images/open_book.png',
214 - color: iconColor ??
215 - Theme.of(context)
216 - .extension<SendPageTheme>()!
217 - .textFieldButtonIconColor,
218 - )),
189 + ),
190 + ],
191 + if (this.options.contains(AddressTextFieldOption.walletAddresses)) ...[
192 + SizedBox(width: 5),
193 + Container(
194 + width: prefixIconWidth,
195 + height: prefixIconHeight,
196 + padding: EdgeInsets.only(top: 0),
197 + child: Semantics(
198 + label: S.of(context).address_book,
199 + child: InkWell(
200 + onTap: () async => _presetWalletAddressPicker(context),
201 + child: Container(
202 + padding: EdgeInsets.all(8),
203 + decoration: BoxDecoration(
204 + color: buttonColor ?? Theme.of(context).colorScheme.surfaceContainerLow,
205 + borderRadius: BorderRadius.all(Radius.circular(6)),
206 + ),
207 + child: Image.asset(
208 + 'assets/images/open_book.png',
209 + color: iconColor ?? Theme.of(context).colorScheme.onSurfaceVariant,
210 + ),
211 ),
212 ),
221 - )
222 - ],
213 + ),
214 + )
215 ],
224 - ),
225 - ))
216 + ],
217 + ),
218 + ),
219 + )
220 ],
221 );
222 }
@@ -256,8 +250,7 @@ class AddressTextField<T extends Currency> extends StatelessWidget {
250 }
251
252 Future<void> _presetWalletAddressPicker(BuildContext context) async {
259 - final address =
260 - await Navigator.of(context).pushNamed(Routes.pickerWalletAddress);
253 + final address = await Navigator.of(context).pushNamed(Routes.pickerWalletAddress);
254
255 if (address is String) {
256 controller?.text = address;
lib/src/widgets/alert_background.dart
+1 -3
@@ -1,5 +1,4 @@
1 import 'dart:ui';
2 -import 'package:cake_wallet/themes/extensions/alert_theme.dart';
2 import 'package:cake_wallet/utils/responsive_layout_util.dart';
3 import 'package:flutter/material.dart';
4
@@ -21,8 +20,7 @@ class AlertBackground extends StatelessWidget {
20 filter: ImageFilter.blur(sigmaX: 3.0, sigmaY: 3.0),
21 child: Container(
22 decoration: BoxDecoration(
24 - color:
25 - Theme.of(context).extension<AlertTheme>()!.backdropColor),
23 + color: Theme.of(context).colorScheme.surface.withOpacity(0.8)),
24 child: Center(
25 child: Container(
26 width: ResponsiveLayoutUtilBase.kDesktopMaxWidthConstraint,
lib/src/widgets/alert_close_button.dart
+22 -16
@@ -1,5 +1,4 @@
1 import 'package:cake_wallet/generated/i18n.dart';
2 -import 'package:cake_wallet/palette.dart';
2 import 'package:flutter/material.dart';
3
4 class AlertCloseButton extends StatelessWidget {
@@ -17,24 +16,31 @@ class AlertCloseButton extends StatelessWidget {
16 final double? bottom;
17 final bool isPositioned;
18
20 - final closeButton = Image.asset(
21 - 'assets/images/close.png',
22 - color: Palette.darkBlueCraiola,
23 - );
24 -
19 @override
20 Widget build(BuildContext context) {
21 final button = GestureDetector(
28 - onTap: onTap ?? () => Navigator.of(context).pop(),
29 - child: Semantics(
30 - label: S.of(context).close,
31 - button: true,
32 - enabled: true,
33 - child: Container(
34 - height: 42,
35 - width: 42,
36 - decoration: BoxDecoration(color: Colors.white, shape: BoxShape.circle),
37 - child: Center(child: image ?? closeButton))));
22 + onTap: onTap ?? () => Navigator.of(context).pop(),
23 + child: Semantics(
24 + label: S.of(context).close,
25 + button: true,
26 + enabled: true,
27 + child: Container(
28 + height: 42,
29 + width: 42,
30 + decoration: BoxDecoration(
31 + color: Theme.of(context).colorScheme.onSurface,
32 + shape: BoxShape.circle,
33 + ),
34 + child: Center(
35 + child: image ??
36 + Image.asset(
37 + 'assets/images/close.png',
38 + color: Theme.of(context).colorScheme.surface,
39 + ),
40 + ),
41 + ),
42 + ),
43 + );
44
45 return isPositioned ? Positioned(bottom: bottom ?? 60, child: button) : button;
46 }
lib/src/widgets/alert_with_one_action.dart
+17 -16
@@ -44,25 +44,26 @@ class AlertWithOneAction extends BaseAlertDialog {
44 width: 300,
45 height: 52,
46 padding: EdgeInsets.only(left: 12, right: 12),
47 - color: Theme.of(context).dialogBackgroundColor,
47 + color: Theme.of(context).colorScheme.surface,
48 child: ButtonTheme(
49 minWidth: double.infinity,
50 child: TextButton(
51 - key: buttonKey,
52 - onPressed: buttonAction,
53 - // FIX-ME: Style
54 - //highlightColor: Colors.transparent,
55 - //splashColor: Colors.transparent,
56 - child: Text(
57 - buttonText,
58 - textAlign: TextAlign.center,
59 - style: TextStyle(
60 - fontSize: 15,
61 - fontWeight: FontWeight.w600,
62 - color: Theme.of(context).primaryColor,
63 - decoration: TextDecoration.none,
64 - ),
65 - )),
51 + key: buttonKey,
52 + onPressed: buttonAction,
53 + // FIX-ME: Style
54 + //highlightColor: Colors.transparent,
55 + //splashColor: Colors.transparent,
56 + child: Text(
57 + buttonText,
58 + textAlign: TextAlign.center,
59 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
60 + fontSize: 15,
61 + fontWeight: FontWeight.w600,
62 + color: Theme.of(context).colorScheme.primary,
63 + decoration: TextDecoration.none,
64 + ),
65 + ),
66 + ),
67 ),
68 );
69 }
lib/src/widgets/alert_with_picker_option.dart
+15 -21
@@ -1,6 +1,5 @@
1 import 'package:flutter/material.dart';
2 import 'package:cake_wallet/src/widgets/base_alert_dialog.dart';
3 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
3
4 class AlertWithPickerOption extends BaseAlertDialog {
5 AlertWithPickerOption(
@@ -46,12 +45,13 @@ class AlertWithPickerOption extends BaseAlertDialog {
45 Text(
46 contentText,
47 textAlign: TextAlign.center,
49 - style: TextStyle(
50 - fontSize: 10,
51 - fontWeight: FontWeight.w500,
52 - fontFamily: 'Lato',
53 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
54 - decoration: TextDecoration.none),
48 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
49 + fontSize: 10,
50 + fontWeight: FontWeight.w500,
51 +
52 + color: Theme.of(context).colorScheme.onSurface,
53 + decoration: TextDecoration.none,
54 + ),
55 ),
56 const SizedBox(height: 4),
57 Container(
@@ -75,35 +75,29 @@ class AlertWithPickerOption extends BaseAlertDialog {
75 padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 12),
76 decoration: BoxDecoration(
77 borderRadius: BorderRadius.circular(30),
78 - color: Theme.of(context).colorScheme.background),
78 + color: Theme.of(context).colorScheme.surface),
79 child: Row(
80 mainAxisAlignment: MainAxisAlignment.spaceBetween,
81 children: [
82 Text(
83 displayKey,
84 - style: TextStyle(
85 - fontSize: 12,
86 - fontFamily: 'Lato',
87 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
88 - decoration: TextDecoration.none,
89 - ),
84 + style: Theme.of(context).textTheme.bodySmall!.copyWith(
85 + decoration: TextDecoration.none,
86 + ),
87 ),
88 Row(
89 children: [
90 Text(
91 displayValue,
95 - style: TextStyle(
96 - fontSize: 12,
97 - fontFamily: 'Lato',
98 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
99 - decoration: TextDecoration.none,
100 - ),
92 + style: Theme.of(context).textTheme.bodySmall!.copyWith(
93 + decoration: TextDecoration.none,
94 + ),
95 ),
96 const SizedBox(width: 4),
97 Icon(
98 Icons.arrow_forward_ios,
99 size: 18,
106 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
100 + color: Theme.of(context).colorScheme.onSurface,
101 ),
102 ],
103 ),
lib/src/widgets/alert_with_two_actions.dart
-1
@@ -1,4 +1,3 @@
1 -import 'dart:ui';
1 import 'package:cake_wallet/src/widgets/base_alert_dialog.dart';
2 import 'package:flutter/cupertino.dart';
3
lib/src/widgets/animated_typing_text.dart new
+194
@@ -0,0 +1,194 @@
1 +import 'package:flutter/material.dart';
2 +
3 +class AnimatedTypingText extends StatefulWidget {
4 + final List<String> words;
5 + final TextStyle? style;
6 + final Duration typingSpeed;
7 + final Duration pauseDuration;
8 + final Color cursorColor;
9 + final double cursorWidth;
10 + final double cursorHeight;
11 + final Duration cursorBlinkDuration;
12 +
13 + const AnimatedTypingText({
14 + Key? key,
15 + required this.words,
16 + this.style,
17 + this.typingSpeed = const Duration(milliseconds: 100),
18 + this.pauseDuration = const Duration(milliseconds: 3000),
19 + this.cursorColor = Colors.black,
20 + this.cursorWidth = 2.0,
21 + this.cursorHeight = 20.0,
22 + this.cursorBlinkDuration = const Duration(milliseconds: 500),
23 + }) : super(key: key);
24 +
25 + @override
26 + State<AnimatedTypingText> createState() => _AnimatedTypingTextState();
27 +}
28 +
29 +class _AnimatedTypingTextState extends State<AnimatedTypingText> with TickerProviderStateMixin {
30 + late AnimationController _controller;
31 + late AnimationController _cursorController;
32 + late Animation<double> _cursorAnimation;
33 +
34 + String _displayText = '';
35 +
36 + double _maxTextWidth = 0;
37 + int _currentWordIndex = 0;
38 + int _currentCharIndex = 0;
39 +
40 + bool _isTyping = true;
41 + bool _isPaused = false;
42 + bool _isWaitingForPause = false;
43 +
44 + @override
45 + void initState() {
46 + super.initState();
47 + _controller = AnimationController(
48 + vsync: this,
49 + duration: widget.typingSpeed,
50 + );
51 +
52 + _cursorController = AnimationController(
53 + vsync: this,
54 + duration: widget.cursorBlinkDuration,
55 + )..repeat(reverse: true);
56 +
57 + _cursorAnimation = Tween<double>(begin: 1.0, end: 0.0).animate(
58 + CurvedAnimation(
59 + parent: _cursorController,
60 + curve: Curves.easeInOut,
61 + ),
62 + );
63 +
64 + WidgetsBinding.instance.addPostFrameCallback((_) {
65 + _calculateMaxTextWidth();
66 + });
67 +
68 + _controller.addStatusListener((status) {
69 + if (status == AnimationStatus.completed) {
70 + _updateText();
71 + if (!_isWaitingForPause) {
72 + _controller.reset();
73 + _controller.forward();
74 + }
75 + }
76 + });
77 +
78 + _controller.forward();
79 + }
80 +
81 + void _calculateMaxTextWidth() {
82 + final textStyle = widget.style ?? DefaultTextStyle.of(context).style;
83 + double maxWidth = 0;
84 + final textPainter = TextPainter(
85 + textDirection: TextDirection.ltr,
86 + );
87 + for (final word in widget.words) {
88 + textPainter.text = TextSpan(text: word, style: textStyle);
89 + textPainter.layout();
90 + if (textPainter.width > maxWidth) {
91 + maxWidth = textPainter.width;
92 + }
93 + }
94 + setState(() {
95 + _maxTextWidth = maxWidth;
96 + });
97 + }
98 +
99 + void _updateText() {
100 + if (_isWaitingForPause) return;
101 +
102 + if (_isPaused) {
103 + if (_isTyping) {
104 + _isTyping = false;
105 + _isWaitingForPause = true;
106 + Future.delayed(widget.pauseDuration, () {
107 + if (mounted) {
108 + setState(() {
109 + _isPaused = false;
110 + _isWaitingForPause = false;
111 + _controller.reset();
112 + _controller.forward();
113 + });
114 + }
115 + });
116 + } else {
117 + _deletePrevChar();
118 + }
119 + } else {
120 + if (_isTyping) {
121 + _typeNextChar();
122 + } else {
123 + _deletePrevChar();
124 + }
125 + }
126 +
127 + setState(() {
128 + _displayText = widget.words[_currentWordIndex].substring(0, _currentCharIndex);
129 + });
130 + }
131 +
132 + void _typeNextChar() {
133 + if (_currentCharIndex < widget.words[_currentWordIndex].length) {
134 + _currentCharIndex++;
135 + } else {
136 + _isPaused = true;
137 + }
138 + }
139 +
140 + void _deletePrevChar() {
141 + if (_currentCharIndex > 0) {
142 + _currentCharIndex--;
143 + } else {
144 + _currentWordIndex = (_currentWordIndex + 1) % widget.words.length;
145 + _currentCharIndex = 0;
146 + _isTyping = true;
147 + _isPaused = false;
148 + }
149 + }
150 +
151 + @override
152 + void dispose() {
153 + _controller.dispose();
154 + _cursorController.dispose();
155 + super.dispose();
156 + }
157 +
158 + @override
159 + Widget build(BuildContext context) {
160 + return SizedBox(
161 + width: _maxTextWidth + widget.cursorWidth,
162 + child: Stack(
163 + clipBehavior: Clip.none,
164 + children: [
165 + // Fixed cursor position
166 + Positioned(
167 + right: 0,
168 + child: AnimatedBuilder(
169 + animation: _cursorAnimation,
170 + builder: (context, child) {
171 + return Opacity(
172 + opacity: _cursorAnimation.value,
173 + child: Container(
174 + width: widget.cursorWidth,
175 + height: widget.cursorHeight,
176 + color: widget.cursorColor,
177 + ),
178 + );
179 + },
180 + ),
181 + ),
182 + // Animated text
183 + Align(
184 + alignment: Alignment.centerRight,
185 + child: Text(
186 + _displayText + ' ',
187 + style: widget.style,
188 + ),
189 + ),
190 + ],
191 + ),
192 + );
193 + }
194 +}
\ No newline at end of file
lib/src/widgets/base_alert_dialog.dart
+79 -81
@@ -1,7 +1,6 @@
1 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
1 import 'dart:ui';
2 +
3 import 'package:cake_wallet/src/widgets/section_divider.dart';
4 -import 'package:cake_wallet/themes/extensions/alert_theme.dart';
4 import 'package:flutter/material.dart';
5
6 class BaseAlertDialog extends StatelessWidget {
@@ -49,13 +48,12 @@ class BaseAlertDialog extends StatelessWidget {
48 return Text(
49 titleText!,
50 textAlign: TextAlign.center,
52 - style: TextStyle(
53 - fontSize: titleTextSize,
54 - fontFamily: 'Lato',
55 - fontWeight: FontWeight.w600,
56 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
57 - decoration: TextDecoration.none,
58 - ),
51 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
52 + fontSize: titleTextSize,
53 + fontWeight: FontWeight.w600,
54 + color: Theme.of(context).colorScheme.onSurface,
55 + decoration: TextDecoration.none,
56 + ),
57 );
58 }
59
@@ -65,13 +63,12 @@ class BaseAlertDialog extends StatelessWidget {
63 child: Text(
64 headerText!,
65 textAlign: TextAlign.center,
68 - style: TextStyle(
69 - fontSize: 25,
70 - fontFamily: 'Lato',
71 - fontWeight: FontWeight.w600,
72 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
73 - decoration: TextDecoration.none,
74 - ),
66 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
67 + fontSize: 25,
68 + fontWeight: FontWeight.w600,
69 + color: Theme.of(context).colorScheme.onSurface,
70 + decoration: TextDecoration.none,
71 + ),
72 ),
73 );
74 }
@@ -83,16 +80,13 @@ class BaseAlertDialog extends StatelessWidget {
80 children: [
81 contentTextWidget ??
82 Text(
86 - contentText,
87 - textAlign: TextAlign.center,
88 - style: TextStyle(
89 - fontSize: 16,
90 - fontWeight: FontWeight.normal,
91 - fontFamily: 'Lato',
92 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
93 - decoration: TextDecoration.none,
94 - ),
95 - ),
83 + contentText,
84 + textAlign: TextAlign.center,
85 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
86 + fontSize: 16,
87 + decoration: TextDecoration.none,
88 + ),
89 + ),
90 ],
91 ),
92 );
@@ -100,57 +94,59 @@ class BaseAlertDialog extends StatelessWidget {
94
95 Widget actionButtons(BuildContext context) {
96 return Container(
103 - height: 60,
104 - child: Row(
105 - mainAxisSize: MainAxisSize.max,
106 - crossAxisAlignment: CrossAxisAlignment.stretch,
107 - children: <Widget>[
108 - Expanded(
109 - child: TextButton(
110 - key: leftActionButtonKey,
111 - onPressed: actionLeft,
112 - style: TextButton.styleFrom(
113 - backgroundColor:
114 - leftActionButtonColor ?? Theme.of(context).dialogBackgroundColor,
115 - shape: const RoundedRectangleBorder(
116 - borderRadius: BorderRadius.all(Radius.zero))),
117 - child: Text(
118 - leftActionButtonText,
119 - textAlign: TextAlign.center,
120 - style: TextStyle(
121 - fontSize: 15,
122 - fontFamily: 'Lato',
123 - fontWeight: FontWeight.w600,
124 - color: leftActionButtonTextColor ??
125 - Theme.of(context).extension<AlertTheme>()!.leftButtonTextColor,
126 - decoration: TextDecoration.none,
127 - ),
128 - )),
129 - ),
130 - const VerticalSectionDivider(),
131 - Expanded(
132 - child: TextButton(
133 - key: rightActionButtonKey,
134 - onPressed: actionRight,
135 - style: TextButton.styleFrom(
136 - backgroundColor:
137 - rightActionButtonColor ?? Theme.of(context).dialogBackgroundColor,
138 - shape: const RoundedRectangleBorder(
139 - borderRadius: BorderRadius.all(Radius.zero))),
140 - child: Text(
141 - rightActionButtonText,
142 - textAlign: TextAlign.center,
143 - style: TextStyle(
97 + height: 60,
98 + child: Row(
99 + mainAxisSize: MainAxisSize.max,
100 + crossAxisAlignment: CrossAxisAlignment.stretch,
101 + children: <Widget>[
102 + Expanded(
103 + child: TextButton(
104 + key: leftActionButtonKey,
105 + onPressed: actionLeft,
106 + style: TextButton.styleFrom(
107 + backgroundColor: leftActionButtonColor ?? Theme.of(context).colorScheme.surface,
108 + shape: const RoundedRectangleBorder(
109 + borderRadius: BorderRadius.all(Radius.zero),
110 + ),
111 + ),
112 + child: Text(
113 + leftActionButtonText,
114 + textAlign: TextAlign.center,
115 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
116 + fontSize: 15,
117 + fontWeight: FontWeight.w600,
118 + color: leftActionButtonTextColor ??
119 + Theme.of(context).colorScheme.errorContainer,
120 + decoration: TextDecoration.none,
121 + ),
122 + )),
123 + ),
124 + const VerticalSectionDivider(),
125 + Expanded(
126 + child: TextButton(
127 + key: rightActionButtonKey,
128 + onPressed: actionRight,
129 + style: TextButton.styleFrom(
130 + backgroundColor: rightActionButtonColor ?? Theme.of(context).colorScheme.surface,
131 + shape: const RoundedRectangleBorder(
132 + borderRadius: BorderRadius.all(Radius.zero),
133 + ),
134 + ),
135 + child: Text(
136 + rightActionButtonText,
137 + textAlign: TextAlign.center,
138 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
139 fontSize: 15,
145 - fontFamily: 'Lato',
140 fontWeight: FontWeight.w600,
147 - color: rightActionButtonTextColor ?? Theme.of(context).primaryColor,
141 + color: rightActionButtonTextColor ?? Theme.of(context).colorScheme.onSurface,
142 decoration: TextDecoration.none,
143 ),
150 - )),
144 + ),
145 ),
152 - ],
153 - ));
146 + ),
147 + ],
148 + ),
149 + );
150 }
151
152 Widget headerImage(BuildContext context, String imageUrl) {
@@ -160,7 +156,7 @@ class BaseAlertDialog extends StatelessWidget {
156 right: 0,
157 child: CircleAvatar(
158 radius: 50,
163 - backgroundColor: Colors.white,
159 + backgroundColor: Theme.of(context).colorScheme.surfaceContainerHighest,
160 child: ClipOval(
161 child: Image.network(
162 imageUrl,
@@ -182,14 +178,15 @@ class BaseAlertDialog extends StatelessWidget {
178 filter: ImageFilter.blur(sigmaX: 3.0, sigmaY: 3.0),
179 child: Container(
180 decoration:
185 - BoxDecoration(color: Theme.of(context).extension<AlertTheme>()!.backdropColor),
181 + BoxDecoration(color: Theme.of(context).colorScheme.surface.withOpacity(0.8)),
182 child: Center(
183 child: GestureDetector(
184 onTap: () => null,
185 child: Container(
186 decoration: BoxDecoration(
191 - borderRadius: BorderRadius.circular(30),
192 - color: Theme.of(context).dialogBackgroundColor),
187 + borderRadius: BorderRadius.circular(30),
188 + color: Theme.of(context).colorScheme.surface,
189 + ),
190 width: 300,
191 child: Stack(
192 clipBehavior: Clip.none,
@@ -203,11 +200,12 @@ class BaseAlertDialog extends StatelessWidget {
200 crossAxisAlignment: CrossAxisAlignment.center,
201 children: <Widget>[
202 if (headerText?.isNotEmpty ?? false) headerTitle(context),
206 - titleText != null ?
207 - Padding(
208 - padding: EdgeInsets.fromLTRB(24, 20, 24, 0),
209 - child: title(context),
210 - ) : SizedBox(height: 16),
203 + titleText != null
204 + ? Padding(
205 + padding: EdgeInsets.fromLTRB(24, 20, 24, 0),
206 + child: title(context),
207 + )
208 + : SizedBox(height: 16),
209 isDividerExists
210 ? Padding(
211 padding: EdgeInsets.only(top: 16, bottom: 8),
lib/src/widgets/base_text_form_field.dart
+125 -65
@@ -1,39 +1,50 @@
1 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
1 import 'package:flutter/material.dart';
2 import 'package:flutter/services.dart';
3
4 class BaseTextFormField extends StatelessWidget {
6 - BaseTextFormField(
7 - {this.controller,
8 - this.keyboardType = TextInputType.text,
9 - this.textInputAction = TextInputAction.done,
10 - this.textAlign = TextAlign.start,
11 - this.autovalidateMode,
12 - this.hintText = '',
13 - this.maxLines = 1,
14 - this.inputFormatters,
15 - this.textColor,
16 - this.hintColor,
17 - this.borderColor,
18 - this.fillColor,
19 - this.filled,
20 - this.prefix,
21 - this.prefixIcon,
22 - this.suffix,
23 - this.suffixIcon,
24 - this.enabled = true,
25 - this.readOnly = false,
26 - this.enableInteractiveSelection = true,
27 - this.obscureText = false,
28 - this.validator,
29 - this.textStyle,
30 - this.placeholderTextStyle,
31 - this.maxLength,
32 - this.focusNode,
33 - this.initialValue,
34 - this.onSubmit,
35 - this.borderWidth = 1.0,
36 - super.key});
5 + BaseTextFormField({
6 + this.onChanged,
7 + this.controller,
8 + this.keyboardType = TextInputType.text,
9 + this.textInputAction = TextInputAction.done,
10 + this.textAlign = TextAlign.start,
11 + this.autovalidateMode,
12 + this.hintText = '',
13 + this.maxLines = 1,
14 + this.inputFormatters,
15 + this.textColor,
16 + this.hintColor,
17 + this.fillColor,
18 + this.prefix,
19 + this.prefixIcon,
20 + this.suffix,
21 + this.suffixIcon,
22 + this.enabled = true,
23 + this.readOnly = false,
24 + this.enableInteractiveSelection = true,
25 + this.obscureText = false,
26 + this.validator,
27 + this.textStyle,
28 + this.placeholderTextStyle,
29 + this.maxLength,
30 + this.focusNode,
31 + this.initialValue,
32 + this.onSubmit,
33 + this.autofocus = false,
34 + this.autocorrect = true,
35 + this.enableSuggestions = true,
36 + this.contentPadding,
37 + this.alignLabelWithHint = false,
38 + this.floatingLabelBehavior,
39 + this.cursorColor,
40 + this.cursorWidth,
41 + this.isDense,
42 + this.enableIMEPersonalizedLearning,
43 + this.onFieldSubmitted,
44 + this.hasUnderlineBorder = false,
45 + this.borderWidth = 1.0,
46 + super.key,
47 + });
48
49 final TextEditingController? controller;
50 final TextInputType? keyboardType;
@@ -45,9 +56,7 @@ class BaseTextFormField extends StatelessWidget {
56 final List<TextInputFormatter>? inputFormatters;
57 final Color? textColor;
58 final Color? hintColor;
48 - final Color? borderColor;
59 final Color? fillColor;
50 - bool? filled;
60 final Widget? prefix;
61 final Widget? prefixIcon;
62 final Widget? suffix;
@@ -61,13 +70,33 @@ class BaseTextFormField extends StatelessWidget {
70 final bool readOnly;
71 final bool? enableInteractiveSelection;
72 final String? initialValue;
64 - final double borderWidth;
73 final void Function(String)? onSubmit;
74 final bool obscureText;
75 + final bool? autofocus;
76 + final bool? autocorrect;
77 + final bool? enableSuggestions;
78 + final void Function(String)? onChanged;
79 + final EdgeInsetsGeometry? contentPadding;
80 + final bool? alignLabelWithHint;
81 + final FloatingLabelBehavior? floatingLabelBehavior;
82 + final Color? cursorColor;
83 + final double? cursorWidth;
84 + final bool? isDense;
85 + final bool? enableIMEPersonalizedLearning;
86 + final void Function(String)? onFieldSubmitted;
87 + final bool hasUnderlineBorder;
88 + final double borderWidth;
89
90 @override
91 Widget build(BuildContext context) {
92 return TextFormField(
93 + enableIMEPersonalizedLearning: enableIMEPersonalizedLearning ?? true,
94 + cursorColor: cursorColor,
95 + cursorWidth: cursorWidth ?? 2.0,
96 + onChanged: onChanged,
97 + autofocus: autofocus ?? false,
98 + autocorrect: autocorrect ?? true,
99 + enableSuggestions: enableSuggestions ?? true,
100 enableInteractiveSelection: enableInteractiveSelection,
101 readOnly: readOnly,
102 initialValue: initialValue,
@@ -84,37 +113,68 @@ class BaseTextFormField extends StatelessWidget {
113 maxLength: maxLength,
114 onFieldSubmitted: onSubmit,
115 style: textStyle ??
87 - TextStyle(
88 - fontSize: 16.0,
89 - color: textColor ??
90 - Theme.of(context).extension<CakeTextTheme>()!.titleColor),
116 + Theme.of(context).textTheme.bodyMedium!.copyWith(
117 + fontSize: 16.0, color: textColor ?? Theme.of(context).colorScheme.onSurface),
118 decoration: InputDecoration(
92 - prefix: prefix,
93 - prefixIcon: prefixIcon,
94 - suffix: suffix,
95 - suffixIcon: suffixIcon,
96 - fillColor: fillColor,
97 - filled: filled,
98 - hintStyle: placeholderTextStyle ??
99 - TextStyle(
100 - color: hintColor ?? Theme.of(context).hintColor,
101 - fontSize: 16),
102 - hintText: hintText,
103 - focusedBorder: UnderlineInputBorder(
104 - borderSide: BorderSide(
105 - color: borderColor ??
106 - Theme.of(context).extension<CakeTextTheme>()!.textfieldUnderlineColor,
107 - width: borderWidth)),
108 - disabledBorder: UnderlineInputBorder(
109 - borderSide: BorderSide(
110 - color: borderColor ??
111 - Theme.of(context).extension<CakeTextTheme>()!.textfieldUnderlineColor,
112 - width: borderWidth)),
113 - enabledBorder: UnderlineInputBorder(
114 - borderSide: BorderSide(
115 - color: borderColor ??
116 - Theme.of(context).extension<CakeTextTheme>()!.textfieldUnderlineColor,
117 - width: borderWidth))),
119 + isDense: isDense,
120 + alignLabelWithHint: alignLabelWithHint,
121 + contentPadding: contentPadding,
122 + floatingLabelBehavior: FloatingLabelBehavior.never,
123 + prefix: prefix,
124 + prefixIcon: prefixIcon,
125 + suffix: suffix,
126 + suffixIcon: suffixIcon,
127 + filled: !hasUnderlineBorder,
128 + //border: !hasUnderlineBorder ? OutlineInputBorder() : null,
129 + fillColor:
130 + hasUnderlineBorder ? null : fillColor ?? Theme.of(context).colorScheme.surfaceContainer,
131 + hintStyle: placeholderTextStyle ??
132 + Theme.of(context)
133 + .textTheme
134 + .bodyMedium!
135 + .copyWith(color: hintColor ?? Theme.of(context).hintColor, fontSize: 16),
136 + hintText: hasUnderlineBorder ? hintText : null,
137 + labelText: !hasUnderlineBorder ? hintText : null,
138 + labelStyle: !hasUnderlineBorder ? placeholderTextStyle : null,
139 + focusedBorder: hasUnderlineBorder
140 + ? UnderlineInputBorder(
141 + borderSide: BorderSide(
142 + color: Theme.of(context).colorScheme.outlineVariant,
143 + style: borderWidth == 0.0 ? BorderStyle.none : BorderStyle.solid,
144 + width: borderWidth,
145 + ),
146 + )
147 + : null,
148 + disabledBorder: hasUnderlineBorder
149 + ? UnderlineInputBorder(
150 + borderSide: BorderSide(
151 + color: Theme.of(context).colorScheme.outlineVariant,
152 + width: borderWidth,
153 + ),
154 + )
155 + : null,
156 + enabledBorder: hasUnderlineBorder
157 + ? UnderlineInputBorder(
158 + borderSide: BorderSide(
159 + color: Theme.of(context).colorScheme.outlineVariant,
160 + style: borderWidth == 1 ? BorderStyle.none : BorderStyle.solid,
161 + width: borderWidth,
162 + ),
163 + )
164 + : null,
165 + // OutlineInputBorder(
166 + // borderRadius: BorderRadius.circular(10),
167 + // borderSide: BorderSide(
168 + // color: Theme.of(context).colorScheme.outlineVariant,
169 + // width: 1.5,
170 + // )
171 + // ),
172 + errorBorder: hasUnderlineBorder
173 + ? UnderlineInputBorder(
174 + borderSide: BorderSide(color: Theme.of(context).colorScheme.error),
175 + )
176 + : null,
177 + ),
178 validator: validator,
179 );
180 }
lib/src/widgets/blockchain_height_widget.dart
+34 -34
@@ -1,6 +1,5 @@
1 import 'package:cake_wallet/bitcoin/bitcoin.dart';
2 import 'package:cake_wallet/src/widgets/standard_switch.dart';
3 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
3 import 'package:cake_wallet/utils/date_picker.dart';
4 import 'package:cake_wallet/wownero/wownero.dart';
5 import 'package:cw_core/wallet_type.dart';
@@ -10,8 +9,6 @@ import 'package:cake_wallet/generated/i18n.dart';
9 import 'package:cake_wallet/monero/monero.dart';
10 import 'package:cake_wallet/src/widgets/base_text_form_field.dart';
11 import 'package:cake_wallet/decred/decred.dart';
13 -import 'package:cw_core/wallet_type.dart';
14 -
12
13 class BlockchainHeightWidget extends StatefulWidget {
14 BlockchainHeightWidget({
@@ -83,18 +80,22 @@ class BlockchainHeightState extends State<BlockchainHeightWidget> {
80 Row(
81 children: <Widget>[
82 Flexible(
86 - child: Container(
87 - padding: EdgeInsets.only(top: 20.0, bottom: 10.0),
88 - child: BaseTextFormField(
89 - key: widget.blockHeightTextFieldKey,
90 - focusNode: widget.focusNode,
91 - controller: restoreHeightController,
92 - keyboardType:
93 - TextInputType.numberWithOptions(signed: false, decimal: false),
94 - hintText: widget.isSilentPaymentsScan
95 - ? S.of(context).silent_payments_scan_from_height
96 - : S.of(context).widgets_restore_from_blockheight,
97 - )))
83 + child: Container(
84 + padding: EdgeInsets.only(top: 20.0, bottom: 10.0),
85 + child: BaseTextFormField(
86 + key: widget.blockHeightTextFieldKey,
87 + focusNode: widget.focusNode,
88 + controller: restoreHeightController,
89 + keyboardType: TextInputType.numberWithOptions(
90 + signed: false,
91 + decimal: false,
92 + ),
93 + hintText: widget.isSilentPaymentsScan
94 + ? S.of(context).silent_payments_scan_from_height
95 + : S.of(context).widgets_restore_from_blockheight,
96 + ),
97 + ),
98 + )
99 ],
100 ),
101 if (widget.hasDatePicker) ...[
@@ -102,10 +103,11 @@ class BlockchainHeightState extends State<BlockchainHeightWidget> {
103 padding: EdgeInsets.only(top: 15, bottom: 15),
104 child: Text(
105 S.of(context).widgets_or,
105 - style: TextStyle(
106 - fontSize: 16.0,
107 - fontWeight: FontWeight.w500,
108 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor),
106 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
107 + fontSize: 16,
108 + fontWeight: FontWeight.w500,
109 + color: Theme.of(context).colorScheme.onSurfaceVariant,
110 + ),
111 ),
112 ),
113 Row(
@@ -115,12 +117,13 @@ class BlockchainHeightState extends State<BlockchainHeightWidget> {
117 child: InkWell(
118 onTap: () => _selectDate(context),
119 child: IgnorePointer(
118 - child: BaseTextFormField(
119 - controller: dateController,
120 - hintText: widget.isSilentPaymentsScan
121 - ? S.of(context).silent_payments_scan_from_date
122 - : S.of(context).widgets_restore_from_date,
123 - )),
120 + child: BaseTextFormField(
121 + controller: dateController,
122 + hintText: widget.isSilentPaymentsScan
123 + ? S.of(context).silent_payments_scan_from_date
124 + : S.of(context).widgets_restore_from_date,
125 + ),
126 + ),
127 ),
128 ))
129 ],
@@ -133,11 +136,9 @@ class BlockchainHeightState extends State<BlockchainHeightWidget> {
136 children: [
137 Text(
138 S.of(context).scan_one_block,
136 - style: TextStyle(
137 - fontSize: 14,
138 - fontWeight: FontWeight.normal,
139 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
140 - ),
139 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
140 + color: Theme.of(context).colorScheme.onSurfaceVariant,
141 + ),
142 ),
143 Padding(
144 padding: const EdgeInsets.only(right: 8),
@@ -156,10 +157,9 @@ class BlockchainHeightState extends State<BlockchainHeightWidget> {
157 ? S.of(context).silent_payments_scan_from_date_or_blockheight
158 : S.of(context).restore_from_date_or_blockheight,
159 textAlign: TextAlign.center,
159 - style: TextStyle(
160 - fontSize: 12,
161 - fontWeight: FontWeight.normal,
162 - color: Theme.of(context).hintColor),
160 + style: Theme.of(context).textTheme.bodySmall?.copyWith(
161 + color: Theme.of(context).colorScheme.onSurfaceVariant,
162 + ),
163 ),
164 )
165 ]
lib/src/widgets/bottom_sheet/add_passphrase_bottom_sheet_widget.dart
+63 -76
@@ -1,10 +1,9 @@
1 import 'package:cake_wallet/generated/i18n.dart';
2 -import 'package:cake_wallet/palette.dart';
2 +import 'package:cake_wallet/src/widgets/base_text_form_field.dart';
3 +import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
4 import 'package:cake_wallet/src/widgets/primary_button.dart';
4 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
5 -import 'package:cake_wallet/themes/theme_base.dart';
5 +import 'package:cake_wallet/themes/core/material_base_theme.dart';
6 import 'package:flutter/material.dart';
7 -import 'package:flutter_svg/svg.dart';
7
8 class AddPassphraseBottomSheet extends StatefulWidget {
9 AddPassphraseBottomSheet({
@@ -14,7 +13,7 @@ class AddPassphraseBottomSheet extends StatefulWidget {
13 });
14
15 final void Function(String) onRestoreButtonPressed;
17 - final ThemeBase currentTheme;
16 + final MaterialThemeBase currentTheme;
17
18 @override
19 State<AddPassphraseBottomSheet> createState() => _AddPassphraseBottomSheetState();
@@ -38,13 +37,19 @@ class _AddPassphraseBottomSheetState extends State<AddPassphraseBottomSheet> {
37 super.dispose();
38 }
39
40 + final passphraseImageLight = 'assets/images/passphrase_light.png';
41 + final passphraseImageDark = 'assets/images/passphrase_dark.png';
42 +
43 bool obscurePassphrase = true;
44 @override
45 Widget build(BuildContext context) {
46 +
47 + final passphraseImage = widget.currentTheme.isDark ? passphraseImageDark : passphraseImageLight;
48 +
49 return Container(
50 decoration: BoxDecoration(
51 borderRadius: const BorderRadius.vertical(top: Radius.circular(30.0)),
47 - color: Theme.of(context).dialogBackgroundColor,
52 + color: Theme.of(context).colorScheme.surface,
53 ),
54 child: SingleChildScrollView(
55 padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 16),
@@ -59,8 +64,7 @@ class _AddPassphraseBottomSheetState extends State<AddPassphraseBottomSheet> {
64 height: 6,
65 decoration: BoxDecoration(
66 borderRadius: BorderRadius.circular(4),
62 - color:
63 - Theme.of(context).extension<CakeTextTheme>()!.titleColor.withOpacity(0.6),
67 + color: Theme.of(context).colorScheme.onSurface.withOpacity(0.6),
68 ),
69 ),
70 ),
@@ -71,15 +75,16 @@ class _AddPassphraseBottomSheetState extends State<AddPassphraseBottomSheet> {
75 Text(
76 S.of(context).add_passphrase,
77 textAlign: TextAlign.center,
74 - style: TextStyle(
75 - fontSize: 18,
76 - fontFamily: 'Lato',
77 - fontWeight: FontWeight.w600,
78 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
79 - decoration: TextDecoration.none,
80 - ),
78 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
79 + fontSize: 18,
80 + fontWeight: FontWeight.w600,
81 + color: Theme.of(context).colorScheme.onSurface,
82 + decoration: TextDecoration.none,
83 + ),
84 ),
82 - SvgPicture.asset('assets/images/passphrase_key.svg'),
85 + SizedBox(height: 20),
86 + CakeImageWidget(imageUrl: passphraseImage, height: 85),
87 + SizedBox(height: 20),
88 Padding(
89 padding: const EdgeInsets.symmetric(horizontal: 16),
90 child: Text.rich(
@@ -87,13 +92,12 @@ class _AddPassphraseBottomSheetState extends State<AddPassphraseBottomSheet> {
92 children: [
93 TextSpan(
94 text: '${S.of(context).warning.toUpperCase()}: ',
90 - style: TextStyle(
91 - fontSize: 16,
92 - fontFamily: 'Lato',
93 - fontWeight: FontWeight.w700,
94 - color: Palette.red,
95 - decoration: TextDecoration.none,
96 - ),
95 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
96 + fontSize: 16,
97 + fontWeight: FontWeight.w700,
98 + color: Theme.of(context).colorScheme.errorContainer,
99 + decoration: TextDecoration.none,
100 + ),
101 ),
102 TextSpan(
103 text: S.of(context).add_passphrase_warning_text,
@@ -101,68 +105,51 @@ class _AddPassphraseBottomSheetState extends State<AddPassphraseBottomSheet> {
105 ],
106 ),
107 textAlign: TextAlign.center,
104 - style: TextStyle(
105 - fontSize: 16,
106 - fontFamily: 'Lato',
107 - fontWeight: FontWeight.w500,
108 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor.withOpacity(0.7),
109 - decoration: TextDecoration.none,
110 - ),
108 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
109 + fontSize: 16,
110 + fontWeight: FontWeight.w500,
111 + color: Theme.of(context).colorScheme.onSurface.withOpacity(0.7),
112 + decoration: TextDecoration.none,
113 + ),
114 ),
115 ),
116 SizedBox(height: 24),
114 - TextFormField(
117 + BaseTextFormField(
118 key: ValueKey('add_passphrase_bottom_sheet_widget_passphrase_textfield_key'),
119 controller: passphraseController,
120 obscureText: obscurePassphrase,
118 - decoration: InputDecoration(
119 - contentPadding: EdgeInsets.symmetric(horizontal: 12),
120 - filled: true,
121 - fillColor: Theme.of(context).cardColor,
122 - hintText: S.of(context).required_passphrase,
123 - suffixIcon: GestureDetector(
124 - onTap: () {
125 - setState(() {
126 - obscurePassphrase = !obscurePassphrase;
127 - });
128 - },
129 - child: Icon(
130 - obscurePassphrase ? Icons.visibility_off : Icons.visibility,
131 - size: 24,
132 - color: Theme.of(context).textTheme.bodyLarge?.color?.withOpacity(0.6),
133 - ),
134 - ),
135 - border: OutlineInputBorder(
136 - borderSide: BorderSide.none,
137 - borderRadius: BorderRadius.circular(16),
121 + contentPadding: EdgeInsets.symmetric(horizontal: 12),
122 + hintText: S.of(context).required_passphrase,
123 + suffixIcon: GestureDetector(
124 + onTap: () {
125 + setState(() {
126 + obscurePassphrase = !obscurePassphrase;
127 + });
128 + },
129 + child: Icon(
130 + obscurePassphrase ? Icons.visibility_off : Icons.visibility,
131 + size: 24,
132 + color: Theme.of(context).colorScheme.onSurface.withOpacity(0.6),
133 ),
134 ),
135 ),
136 SizedBox(height: 8),
142 - TextFormField(
137 + BaseTextFormField(
138 key: ValueKey('add_passphrase_bottom_sheet_widget_confirm_passphrase_textfield_key'),
139 controller: confirmPassphraseController,
140 obscureText: obscurePassphrase,
146 - decoration: InputDecoration(
147 - contentPadding: EdgeInsets.symmetric(horizontal: 12),
148 - filled: true,
149 - fillColor: Theme.of(context).cardColor,
150 - hintText: S.of(context).confirm_passphrase,
151 - suffixIcon: GestureDetector(
152 - onTap: () {
153 - setState(() {
154 - obscurePassphrase = !obscurePassphrase;
155 - });
156 - },
157 - child: Icon(
158 - obscurePassphrase ? Icons.visibility_off : Icons.visibility,
159 - size: 24,
160 - color: Theme.of(context).textTheme.bodyLarge?.color?.withOpacity(0.6),
161 - ),
162 - ),
163 - border: OutlineInputBorder(
164 - borderSide: BorderSide.none,
165 - borderRadius: BorderRadius.circular(16),
141 + contentPadding: EdgeInsets.symmetric(horizontal: 12),
142 + hintText: S.of(context).confirm_passphrase,
143 + suffixIcon: GestureDetector(
144 + onTap: () {
145 + setState(() {
146 + obscurePassphrase = !obscurePassphrase;
147 + });
148 + },
149 + child: Icon(
150 + obscurePassphrase ? Icons.visibility_off : Icons.visibility,
151 + size: 24,
152 + color: Theme.of(context).colorScheme.onSurface.withOpacity(0.6),
153 ),
154 ),
155 validator: (text) {
@@ -188,8 +175,8 @@ class _AddPassphraseBottomSheetState extends State<AddPassphraseBottomSheet> {
175 Navigator.pop(context);
176 },
177 text: S.of(context).cancel,
191 - color: Theme.of(context).cardColor,
192 - textColor: Theme.of(context).extension<CakeTextTheme>()!.buttonTextColor,
178 + color: Theme.of(context).colorScheme.surfaceContainer,
179 + textColor: Theme.of(context).colorScheme.onSurface,
180 ),
181 ),
182 ),
@@ -203,8 +190,8 @@ class _AddPassphraseBottomSheetState extends State<AddPassphraseBottomSheet> {
190 widget.onRestoreButtonPressed(passphraseController.text);
191 },
192 text: S.of(context).restore,
206 - color: Theme.of(context).primaryColor,
207 - textColor: Colors.white,
193 + color: Theme.of(context).colorScheme.primary,
194 + textColor: Theme.of(context).colorScheme.onPrimary,
195 ),
196 ),
197 ),
lib/src/widgets/bottom_sheet/base_bottom_sheet_widget.dart
+8 -11
@@ -1,5 +1,4 @@
1 import 'package:flutter/material.dart';
2 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
2
3 abstract class BaseBottomSheet extends StatelessWidget {
4 final String titleText;
@@ -21,7 +20,7 @@ abstract class BaseBottomSheet extends StatelessWidget {
20 height: 6,
21 decoration: BoxDecoration(
22 borderRadius: BorderRadius.circular(4),
24 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
23 + color: Theme.of(context).colorScheme.onSurface,
24 ),
25 ),
26 ),
@@ -40,17 +39,15 @@ abstract class BaseBottomSheet extends StatelessWidget {
39 Text(
40 titleText,
41 textAlign: TextAlign.center,
43 - style: TextStyle(
44 - fontSize: 20,
45 - fontFamily: 'Lato',
46 - fontWeight: FontWeight.w600,
47 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
48 - decoration: TextDecoration.none,
49 - ),
42 + style: Theme.of(context).textTheme.titleLarge!.copyWith(
43 + fontSize: 20,
44 + fontWeight: FontWeight.w600,
45 + decoration: TextDecoration.none,
46 + ),
47 ),
48 ],
49 ),
53 - const SizedBox(height: 13),
50 + const SizedBox(height: 24),
51 ],
52 );
53 }
@@ -67,7 +64,7 @@ abstract class BaseBottomSheet extends StatelessWidget {
64 borderRadius: const BorderRadius.only(
65 topLeft: Radius.circular(30.0), topRight: Radius.circular(30.0)),
66 child: Container(
70 - color: Theme.of(context).dialogBackgroundColor,
67 + color: Theme.of(context).colorScheme.surface,
68 child: Column(
69 mainAxisSize: MainAxisSize.min,
70 children: <Widget>[
lib/src/widgets/bottom_sheet/confirm_sending_bottom_sheet_widget.dart
+42 -62
@@ -1,10 +1,6 @@
1 import 'package:cake_wallet/generated/i18n.dart';
2 import 'package:cake_wallet/src/widgets/standard_slide_button_widget.dart';
3 -import 'package:cake_wallet/themes/extensions/balance_page_theme.dart';
4 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
5 -import 'package:cake_wallet/themes/extensions/filter_theme.dart';
6 -import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart';
7 -import 'package:cake_wallet/themes/theme_base.dart';
3 +import 'package:cake_wallet/themes/core/material_base_theme.dart';
4 import 'package:cake_wallet/utils/address_formatter.dart';
5 import 'package:cake_wallet/view_model/send/output.dart';
6 import 'package:cw_core/crypto_currency.dart';
@@ -16,7 +12,7 @@ import 'base_bottom_sheet_widget.dart';
12
13 class ConfirmSendingBottomSheet extends BaseBottomSheet {
14 final CryptoCurrency currency;
19 - final ThemeBase currentTheme;
15 + final MaterialThemeBase currentTheme;
16 final String? paymentId;
17 final String? paymentIdValue;
18 final String? expirationTime;
@@ -60,28 +56,18 @@ class ConfirmSendingBottomSheet extends BaseBottomSheet {
56
57 @override
58 Widget contentWidget(BuildContext context) {
63 - final itemTitleTextStyle = TextStyle(
64 - fontSize: 16,
65 - fontFamily: 'Lato',
66 - fontWeight: FontWeight.w500,
67 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
68 - decoration: TextDecoration.none,
69 - );
70 - final itemSubTitleTextStyle = TextStyle(
71 - fontSize: 12,
72 - fontFamily: 'Lato',
73 - fontWeight: FontWeight.w600,
74 - color: currentTheme.type == ThemeType.bright
75 - ? Theme.of(context).extension<CakeTextTheme>()!.titleColor
76 - : Theme.of(context).extension<BalancePageTheme>()!.labelTextColor,
77 - decoration: TextDecoration.none,
78 - );
59 + final itemTitleTextStyle = Theme.of(context).textTheme.bodyMedium!.copyWith(
60 + fontSize: 16,
61 + fontWeight: FontWeight.w500,
62 + decoration: TextDecoration.none,
63 + );
64 + final itemSubTitleTextStyle = Theme.of(context).textTheme.bodySmall!.copyWith(
65 + fontWeight: FontWeight.w600,
66 + color: Theme.of(context).colorScheme.onSurfaceVariant,
67 + decoration: TextDecoration.none,
68 + );
69
80 - final tileBackgroundColor = currentTheme.type == ThemeType.light
81 - ? Theme.of(context).extension<SyncIndicatorTheme>()!.syncedBackgroundColor
82 - : currentTheme.type == ThemeType.oled
83 - ? Colors.black.withOpacity(0.5)
84 - : Theme.of(context).extension<FilterTheme>()!.buttonColor;
70 + final tileBackgroundColor = Theme.of(context).colorScheme.surfaceContainer;
71
72 Widget content = Padding(
73 padding: EdgeInsets.fromLTRB(8, 0, showScrollbar ? 16 : 8, 8),
@@ -92,7 +78,6 @@ class ConfirmSendingBottomSheet extends BaseBottomSheet {
78 padding: const EdgeInsets.only(bottom: 8),
79 child: AddressTile(
80 itemTitle: paymentId!,
95 - currentTheme: currentTheme,
81 itemTitleTextStyle: itemTitleTextStyle,
82 walletType: walletType,
83 isBatchSending: false,
@@ -139,7 +124,6 @@ class ConfirmSendingBottomSheet extends BaseBottomSheet {
124 return isBatchSending || contactName.isNotEmpty
125 ? AddressExpansionTile(
126 contactType: isOpenCryptoPay ? 'Open CryptoPay' : S.of(context).contact,
142 - currentTheme: currentTheme,
127 name: isBatchSending ? batchContactTitle : contactName,
128 address: _address,
129 amount: _amount,
@@ -151,7 +135,6 @@ class ConfirmSendingBottomSheet extends BaseBottomSheet {
135 )
136 : AddressTile(
137 itemTitle: S.of(context).address,
154 - currentTheme: currentTheme,
138 itemTitleTextStyle: itemTitleTextStyle,
139 isBatchSending: isBatchSending,
140 walletType: walletType,
@@ -167,7 +150,6 @@ class ConfirmSendingBottomSheet extends BaseBottomSheet {
150 padding: const EdgeInsets.only(top: 8),
151 child: AddressExpansionTile(
152 contactType: 'Change',
170 - currentTheme: currentTheme,
153 name: S.of(context).send_change_to_you,
154 address: change!.address,
155 amount: change!.amount + ' ${currency.title}',
@@ -208,11 +190,11 @@ class ConfirmSendingBottomSheet extends BaseBottomSheet {
190 return Container(
191 padding: const EdgeInsets.fromLTRB(40, 12, 40, 34),
192 decoration: BoxDecoration(
211 - color: Theme.of(context).dialogBackgroundColor,
193 + color: Theme.of(context).colorScheme.surface,
194 boxShadow: [
195 if (showScrollbar)
196 BoxShadow(
215 - color: Colors.black.withOpacity(0.5),
197 + color: Theme.of(context).colorScheme.outlineVariant,
198 spreadRadius: 2,
199 blurRadius: 10,
200 offset: const Offset(0, 0),
@@ -254,8 +236,10 @@ class StandardTile extends StatelessWidget {
236 label: itemTitle,
237 child: Container(
238 padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 8),
257 - decoration:
258 - BoxDecoration(borderRadius: BorderRadius.circular(10), color: tileBackgroundColor),
239 + decoration: BoxDecoration(
240 + borderRadius: BorderRadius.circular(10),
241 + color: tileBackgroundColor,
242 + ),
243 child: Row(
244 mainAxisAlignment: MainAxisAlignment.spaceBetween,
245 children: [
@@ -280,7 +264,6 @@ class AddressTile extends StatelessWidget {
264 const AddressTile({
265 super.key,
266 required this.itemTitle,
283 - required this.currentTheme,
267 required this.itemTitleTextStyle,
268 required this.isBatchSending,
269 required this.amount,
@@ -291,7 +274,6 @@ class AddressTile extends StatelessWidget {
274 });
275
276 final String itemTitle;
294 - final ThemeBase currentTheme;
277 final TextStyle itemTitleTextStyle;
278 final bool isBatchSending;
279 final String amount;
@@ -321,12 +303,10 @@ class AddressTile extends StatelessWidget {
303 AddressFormatter.buildSegmentedAddress(
304 address: address,
305 walletType: walletType,
324 - evenTextStyle: TextStyle(
325 - fontSize: 12,
326 - fontFamily: 'Lato',
327 - fontWeight: FontWeight.w600,
328 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
329 - decoration: TextDecoration.none)
306 + evenTextStyle: Theme.of(context).textTheme.bodySmall!.copyWith(
307 + fontWeight: FontWeight.w600,
308 + decoration: TextDecoration.none,
309 + ),
310 ),
311 ],
312 ),
@@ -338,7 +318,6 @@ class AddressExpansionTile extends StatelessWidget {
318 const AddressExpansionTile({
319 super.key,
320 required this.contactType,
341 - required this.currentTheme,
321 required this.name,
322 required this.address,
323 required this.amount,
@@ -350,7 +329,6 @@ class AddressExpansionTile extends StatelessWidget {
329 });
330
331 final String contactType;
353 - final ThemeBase currentTheme;
332 final String name;
333 final String address;
334 final String amount;
@@ -378,21 +356,25 @@ class AddressExpansionTile extends StatelessWidget {
356 childrenPadding: isBatchSending ? const EdgeInsets.only(bottom: 8) : EdgeInsets.zero,
357 tilePadding: EdgeInsets.zero,
358 dense: true,
359 + iconColor: Theme.of(context).colorScheme.onSurfaceVariant,
360 visualDensity: VisualDensity.compact,
361 title: Row(
362 mainAxisAlignment: MainAxisAlignment.spaceBetween,
363 children: [
364 Expanded(
386 - child: Text(isBatchSending ? name : contactType,
387 - style: itemTitleTextStyle, softWrap: true)),
388 - Text(isBatchSending ? amount : name,
389 - style: TextStyle(
390 - fontSize: 14,
391 - fontFamily: 'Lato',
392 - fontWeight: FontWeight.w600,
393 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
394 - decoration: TextDecoration.none,
395 - )),
365 + child: Text(
366 + isBatchSending ? name : contactType,
367 + style: itemTitleTextStyle,
368 + softWrap: true,
369 + ),
370 + ),
371 + Text(
372 + isBatchSending ? amount : name,
373 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
374 + fontWeight: FontWeight.w600,
375 + decoration: TextDecoration.none,
376 + ),
377 + ),
378 ],
379 ),
380 children: [
@@ -400,14 +382,12 @@ class AddressExpansionTile extends StatelessWidget {
382 children: [
383 Expanded(
384 child: AddressFormatter.buildSegmentedAddress(
403 - address: address,
404 - walletType: walletType,
405 - evenTextStyle: TextStyle(
406 - fontSize: 12,
407 - fontFamily: 'Lato',
385 + address: address,
386 + walletType: walletType,
387 + evenTextStyle: Theme.of(context).textTheme.bodySmall!.copyWith(
388 fontWeight: FontWeight.w600,
409 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
410 - decoration: TextDecoration.none)
389 + decoration: TextDecoration.none,
390 + ),
391 ),
392 ),
393 ],
lib/src/widgets/bottom_sheet/info_bottom_sheet_widget.dart
+29 -34
@@ -1,9 +1,6 @@
1 import 'package:auto_size_text/auto_size_text.dart';
2 import 'package:cake_wallet/src/widgets/primary_button.dart';
3 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
4 -import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
5 -import 'package:cake_wallet/themes/extensions/menu_theme.dart';
6 -import 'package:cake_wallet/themes/theme_base.dart';
3 +import 'package:cake_wallet/themes/core/material_base_theme.dart';
4 import 'package:flutter/material.dart';
5 import 'package:flutter_svg/svg.dart';
6
@@ -26,7 +23,7 @@ class LoadingBottomSheet extends BaseBottomSheet {
23 }
24
25 class InfoBottomSheet extends BaseBottomSheet {
29 - final ThemeBase currentTheme;
26 + final MaterialThemeBase currentTheme;
27 final String? contentImage;
28 final Color? contentImageColor;
29 final String? content;
@@ -89,13 +86,13 @@ class InfoBottomSheet extends BaseBottomSheet {
86 child: AutoSizeText(
87 content!,
88 textAlign: TextAlign.center,
92 - style: TextStyle(
93 - fontSize: 16,
94 - fontFamily: 'Lato',
95 - fontWeight: FontWeight.w500,
96 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
97 - decoration: TextDecoration.none,
98 - ),
89 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
90 + fontSize: 16,
91 +
92 + fontWeight: FontWeight.w500,
93 + color: Theme.of(context).colorScheme.onSurfaceVariant,
94 + decoration: TextDecoration.none,
95 + ),
96 ),
97 ),
98 const Spacer(flex: 2),
@@ -112,13 +109,11 @@ class InfoBottomSheet extends BaseBottomSheet {
109 Text(
110 'Don’t ask me next time',
111 textAlign: TextAlign.center,
115 - style: TextStyle(
116 - fontSize: 14,
117 - fontFamily: 'Lato',
118 - fontWeight: FontWeight.w500,
119 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
120 - decoration: TextDecoration.none,
121 - ),
112 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
113 + fontWeight: FontWeight.w500,
114 + color: Theme.of(context).colorScheme.onSurfaceVariant,
115 + decoration: TextDecoration.none,
116 + ),
117 ),
118 ],
119 ),
@@ -143,12 +138,12 @@ class InfoBottomSheet extends BaseBottomSheet {
138 key: leftActionButtonKey,
139 onPressed: actionLeftButton,
140 text: leftButtonText ?? '',
146 - color: currentTheme.type == ThemeType.dark
147 - ? Theme.of(context).extension<CakeMenuTheme>()!.backgroundColor
148 - : Theme.of(context).cardColor,
149 - textColor: currentTheme.type == ThemeType.dark
150 - ? Theme.of(context).extension<DashboardPageTheme>()!.textColor
151 - : Theme.of(context).extension<CakeTextTheme>()!.buttonTextColor,
141 + color: currentTheme.isDark
142 + ? Theme.of(context).colorScheme.surfaceContainerLow
143 + : Theme.of(context).colorScheme.surfaceContainer,
144 + textColor: currentTheme.isDark
145 + ? Theme.of(context).colorScheme.onSurfaceVariant
146 + : Theme.of(context).colorScheme.onPrimary,
147 ),
148 ),
149 ),
@@ -159,10 +154,10 @@ class InfoBottomSheet extends BaseBottomSheet {
154 key: rightActionButtonKey,
155 onPressed: actionRightButton,
156 text: rightButtonText ?? '',
162 - color: Theme.of(context).primaryColor,
163 - textColor: currentTheme.type == ThemeType.dark
164 - ? Theme.of(context).extension<DashboardPageTheme>()!.textColor
165 - : Theme.of(context).extension<CakeTextTheme>()!.buttonTextColor,
157 + color: Theme.of(context).colorScheme.primary,
158 + textColor: currentTheme.isDark
159 + ? Theme.of(context).colorScheme.onSurfaceVariant
160 + : Theme.of(context).colorScheme.onPrimary,
161 ),
162 ),
163 ),
@@ -176,8 +171,8 @@ class InfoBottomSheet extends BaseBottomSheet {
171 key: actionButtonKey,
172 onPressed: actionButton ?? () {},
173 text: actionButtonText ?? '',
179 - color: Theme.of(context).primaryColor,
180 - textColor: Colors.white,
174 + color: Theme.of(context).colorScheme.primary,
175 + textColor: Theme.of(context).colorScheme.onPrimary,
176 isLoading: false,
177 isDisabled: false,
178 ),
@@ -221,11 +216,11 @@ class _SimpleCheckboxState extends State<SimpleCheckbox> {
216 initialValue = value!;
217 widget.onChanged?.call(value);
218 }),
224 - checkColor: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
219 + checkColor: Theme.of(context).colorScheme.onSurfaceVariant,
220 activeColor: Colors.transparent,
221 materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
227 - side: WidgetStateBorderSide.resolveWith((states) => BorderSide(
228 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor, width: 1.0)),
222 + side: WidgetStateBorderSide.resolveWith((states) =>
223 + BorderSide(color: Theme.of(context).colorScheme.onSurfaceVariant, width: 1.0)),
224 ),
225 );
226 }
lib/src/widgets/cake_image_widget.dart
+80 -41
@@ -1,59 +1,98 @@
1 -import 'package:flutter/cupertino.dart';
1 import 'package:flutter/material.dart';
2 import 'package:flutter_svg/flutter_svg.dart';
3
4 class CakeImageWidget extends StatelessWidget {
6 - CakeImageWidget({
7 - required this.imageUrl,
8 - Widget? displayOnError,
5 + const CakeImageWidget({
6 + super.key,
7 + this.imageUrl,
8 this.height,
9 this.width,
11 - }) : _displayOnError = displayOnError ?? Icon(Icons.error);
10 + this.fit = BoxFit.cover,
11 + this.loadingWidget,
12 + this.errorWidget,
13 + this.color,
14 + });
15
16 final String? imageUrl;
17 final double? height;
18 final double? width;
16 - final Widget? _displayOnError;
19 + final BoxFit fit;
20 + final Widget? loadingWidget;
21 + final Widget? errorWidget;
22 + final Color? color;
23
24 @override
25 Widget build(BuildContext context) {
20 - try {
21 - if (imageUrl == null || imageUrl!.isEmpty) return _displayOnError!;
22 -
23 - if (imageUrl!.contains('assets/images')) {
24 - return Image.asset(
25 - imageUrl!,
26 - height: height,
27 - width: width,
28 - errorBuilder: (_, __, ___) => Icon(Icons.error),
29 - );
30 - }
26 + if (imageUrl == null || imageUrl!.isEmpty) {
27 + return _buildErrorWidget(context);
28 + }
29
32 - if (imageUrl!.contains('.svg')) {
33 - return SvgPicture.network(
34 - imageUrl!,
35 - height: height,
36 - width: width,
37 - placeholderBuilder: (_) => Icon(Icons.error),
38 - );
39 - }
30 + final isSvg = imageUrl!.toLowerCase().endsWith('.svg');
31 + final isAsset = imageUrl!.startsWith('assets/');
32
41 - return Image.network(
42 - imageUrl!,
43 - fit: BoxFit.cover,
44 - height: height,
45 - width: width,
46 - loadingBuilder: (BuildContext _, Widget child, ImageChunkEvent? loadingProgress) {
47 - if (loadingProgress == null) {
48 - return child;
49 - } else {
50 - return CupertinoActivityIndicator(animating: true);
51 - }
52 - },
53 - errorBuilder: (_, __, ___) => Icon(Icons.error),
54 - );
55 - } catch (_) {
56 - return _displayOnError!;
33 + Widget imageWidget;
34 + if (isAsset) {
35 + imageWidget = isSvg
36 + ? SvgPicture.asset(
37 + imageUrl!,
38 + height: height,
39 + width: width,
40 + fit: fit,
41 + color: color,
42 + )
43 + : Image.asset(
44 + imageUrl!,
45 + height: height,
46 + width: width,
47 + fit: fit,
48 + color: color,
49 + );
50 + } else {
51 + imageWidget = isSvg
52 + ? SvgPicture.network(
53 + imageUrl!,
54 + height: height,
55 + width: width,
56 + fit: fit,
57 + color: color,
58 + placeholderBuilder: (_) {
59 + return loadingWidget ?? const Center(child: CircularProgressIndicator());
60 + },
61 + errorBuilder: (_, __, ___) => _buildErrorWidget(context),
62 + )
63 + : Image.network(
64 + imageUrl!,
65 + height: height,
66 + width: width,
67 + fit: fit,
68 + color: color,
69 + loadingBuilder: (_, Widget child, ImageChunkEvent? progress) {
70 + if (progress == null) return child;
71 + return loadingWidget ?? const Center(child: CircularProgressIndicator());
72 + },
73 + errorBuilder: (_, __, ___) => _buildErrorWidget(context),
74 + );
75 }
76 +
77 + return imageWidget;
78 + }
79 +
80 + Widget _buildErrorWidget(BuildContext context) {
81 + return Container(
82 + height: height,
83 + width: width,
84 + decoration: BoxDecoration(
85 + borderRadius: BorderRadius.circular(24.0),
86 + color: Theme.of(context).colorScheme.surfaceContainerHighest,
87 + ),
88 + child: Center(
89 + child: errorWidget ??
90 + Icon(
91 + Icons.error_outline,
92 + color: Theme.of(context).colorScheme.error,
93 + size: 24,
94 + ),
95 + ),
96 + );
97 }
98 }
lib/src/widgets/cake_scrollbar.dart
+2 -5
@@ -1,4 +1,3 @@
1 -import 'package:cake_wallet/themes/extensions/cake_scrollbar_theme.dart';
1 import 'package:flutter/material.dart';
2
3 class CakeScrollbar extends StatelessWidget {
@@ -28,8 +27,7 @@ class CakeScrollbar extends StatelessWidget {
27 height: backgroundHeight,
28 width: width,
29 decoration: BoxDecoration(
31 - color: backgroundColor ??
32 - Theme.of(context).extension<CakeScrollbarTheme>()!.trackColor,
30 + color: backgroundColor ?? Theme.of(context).colorScheme.surfaceContainerHighest,
31 borderRadius: BorderRadius.all(Radius.circular(3))),
32 child: Stack(
33 children: <Widget>[
@@ -40,8 +38,7 @@ class CakeScrollbar extends StatelessWidget {
38 height: thumbHeight,
39 width: width,
40 decoration: BoxDecoration(
43 - color: thumbColor ??
44 - Theme.of(context).extension<CakeScrollbarTheme>()!.thumbColor,
41 + color: thumbColor ?? Theme.of(context).colorScheme.primary,
42 borderRadius: BorderRadius.all(Radius.circular(3))),
43 ),
44 )
lib/src/widgets/check_box_picker.dart
+16 -22
@@ -1,11 +1,7 @@
1 import 'package:cake_wallet/src/widgets/standard_checkbox.dart';
2 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
3 -import 'package:cake_wallet/palette.dart';
2 import 'package:cake_wallet/utils/responsive_layout_util.dart';
3 import 'package:flutter/material.dart';
4 import 'package:cake_wallet/src/widgets/picker_wrapper_widget.dart';
7 -import 'package:cake_wallet/themes/extensions/filter_theme.dart';
8 -import 'package:cake_wallet/themes/extensions/picker_theme.dart';
5
6 class CheckBoxPicker extends StatefulWidget {
7 CheckBoxPicker({
@@ -43,12 +39,12 @@ class CheckBoxPickerState extends State<CheckBoxPicker> {
39 child: Text(
40 widget.title,
41 textAlign: TextAlign.center,
46 - style: TextStyle(
42 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
43 fontSize: 18,
48 - fontFamily: 'Lato',
44 +
45 fontWeight: FontWeight.bold,
46 decoration: TextDecoration.none,
51 - color: Colors.white,
47 + color: Theme.of(context).colorScheme.onSurface,
48 ),
49 ),
50 ),
@@ -57,7 +53,7 @@ class CheckBoxPickerState extends State<CheckBoxPicker> {
53 child: ClipRRect(
54 borderRadius: BorderRadius.all(Radius.circular(30)),
55 child: Container(
60 - color: Theme.of(context).dialogTheme.backgroundColor,
56 + color: Theme.of(context).colorScheme.surfaceContainer,
57 child: ConstrainedBox(
58 constraints: BoxConstraints(
59 maxHeight: MediaQuery.of(context).size.height * 0.65,
@@ -91,14 +87,14 @@ class CheckBoxPickerState extends State<CheckBoxPicker> {
87
88 Widget itemsList() {
89 return Container(
94 - color: Theme.of(context).extension<PickerTheme>()!.dividerColor,
90 + color: Theme.of(context).colorScheme.outlineVariant,
91 child: ListView.separated(
92 padding: EdgeInsets.zero,
93 controller: controller,
94 shrinkWrap: true,
95 separatorBuilder: (context, index) => widget.isSeparated
96 ? Divider(
101 - color: Theme.of(context).extension<PickerTheme>()!.dividerColor,
97 + color: Theme.of(context).colorScheme.outlineVariant,
98 height: 1,
99 )
100 : const SizedBox(),
@@ -120,15 +116,15 @@ class CheckBoxPickerState extends State<CheckBoxPicker> {
116 },
117 child: Container(
118 height: 55,
123 - color: Theme.of(context).dialogTheme.backgroundColor,
119 + color: Theme.of(context).colorScheme.surfaceContainer,
120 padding: EdgeInsets.only(left: 24, right: 24),
121 child: Row(
122 children: [
123 StandardCheckbox(
124 value: item.value,
125 gradientBackground: true,
130 - borderColor: Theme.of(context).dividerColor,
131 - iconColor: Colors.white,
126 + borderColor: Theme.of(context).colorScheme.outlineVariant,
127 + iconColor: Theme.of(context).colorScheme.onPrimary,
128 onChanged: (bool? value) {
129 if (value == null) {
130 return;
@@ -143,15 +139,13 @@ class CheckBoxPickerState extends State<CheckBoxPicker> {
139 widget.displayItem?.call(item) ??
140 Text(
141 item.title,
146 - style: TextStyle(
147 - fontSize: 14,
148 - fontFamily: 'Lato',
149 - fontWeight: FontWeight.w600,
150 - color: item.isDisabled
151 - ? Colors.grey.withOpacity(0.5)
152 - : Theme.of(context).extension<CakeTextTheme>()!.titleColor,
153 - decoration: TextDecoration.none,
154 - ),
142 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
143 + fontWeight: FontWeight.w600,
144 + color: item.isDisabled
145 + ? Theme.of(context).colorScheme.onSurfaceVariant.withOpacity(0.5)
146 + : Theme.of(context).colorScheme.onSurface,
147 + decoration: TextDecoration.none,
148 + ),
149 )
150 ],
151 ),
lib/src/widgets/checkbox_widget.dart
+8 -18
@@ -1,8 +1,4 @@
1 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
2 -import 'package:cake_wallet/palette.dart';
1 import 'package:flutter/material.dart';
4 -import 'package:cake_wallet/themes/extensions/filter_theme.dart';
5 -
2 class CheckboxWidget extends StatefulWidget {
3 CheckboxWidget({required this.value, required this.caption, required this.onChanged});
4
@@ -38,20 +34,16 @@ class CheckboxWidgetState extends State<CheckboxWidget> {
34 margin: EdgeInsets.only(right: 10.0),
35 decoration: BoxDecoration(
36 border: Border.all(
41 - color: value
42 - ? Palette.blueCraiola
43 - : Theme.of(context).extension<FilterTheme>()!.checkboxBoundsColor,
37 + color: Theme.of(context).colorScheme.outline,
38 width: 1.0,
39 ),
46 - borderRadius: BorderRadius.all(
47 - Radius.circular(8.0),
48 - ),
49 - color: Theme.of(context).colorScheme.background,
40 + borderRadius: BorderRadius.all(Radius.circular(8.0)),
41 + color: Theme.of(context).colorScheme.surface,
42 ),
43 child: value
44 ? Icon(
45 Icons.check,
54 - color: Colors.blue,
46 + color: Theme.of(context).colorScheme.primary,
47 size: 20.0,
48 )
49 : null,
@@ -59,15 +51,13 @@ class CheckboxWidgetState extends State<CheckboxWidget> {
51 Expanded(
52 child: Text(
53 caption,
62 - style: TextStyle(
63 - fontWeight: FontWeight.bold,
64 - fontSize: 14.0,
65 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
66 - ),
54 + style: Theme.of(context).textTheme.bodyLarge?.copyWith(
55 + color: Theme.of(context).colorScheme.onSurfaceVariant,
56 + ),
57 ),
58 )
59 ],
70 - )
60 + ),
61 );
62 }
63 }
lib/src/widgets/dashboard_card_widget.dart
+35 -28
@@ -1,9 +1,8 @@
1 -import 'package:cake_wallet/themes/extensions/balance_page_theme.dart';
2 -import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart';
1 import 'package:flutter/material.dart';
4 -import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
2 import 'package:flutter_svg/flutter_svg.dart';
3
4 +import '../../themes/utils/custom_theme_colors.dart';
5 +
6 class DashBoardRoundedCardWidget extends StatelessWidget {
7 DashBoardRoundedCardWidget({
8 this.onTap,
@@ -20,6 +19,7 @@ class DashBoardRoundedCardWidget extends StatelessWidget {
19 super.key,
20 this.marginV,
21 this.marginH,
22 + required this.isDarkTheme,
23 });
24
25 final VoidCallback? onTap;
@@ -35,17 +35,29 @@ class DashBoardRoundedCardWidget extends StatelessWidget {
35 final double? marginH;
36 final double? shadowSpread;
37 final double? shadowBlur;
38 + final bool isDarkTheme;
39
40 @override
41 Widget build(BuildContext context) {
42 return Stack(
43 children: [
44 Container(
44 - margin: EdgeInsets.symmetric(horizontal: marginH ?? 20, vertical: marginV ?? 8),
45 - //padding: EdgeInsets.all(20),
45 + margin: EdgeInsets.symmetric(horizontal: marginH ?? 20, vertical: marginV ?? 5),
46 width: double.infinity,
47 decoration: BoxDecoration(
48 - borderRadius: BorderRadius.circular(customBorder ?? 20),
48 + borderRadius: BorderRadius.circular(15),
49 + gradient: LinearGradient(
50 + colors: [
51 + isDarkTheme
52 + ? CustomThemeColors.cardGradientColorPrimaryDark
53 + : CustomThemeColors.cardGradientColorPrimaryLight,
54 + isDarkTheme
55 + ? CustomThemeColors.cardGradientColorSecondaryDark
56 + : CustomThemeColors.cardGradientColorSecondaryLight,
57 + ],
58 + begin: Alignment.topCenter,
59 + end: Alignment.bottomCenter,
60 + ),
61 // border: Border.all(
62 // color: Theme.of(context).extension<BalancePageTheme>()!.cardBorderColor,
63 // width: 1
@@ -59,15 +71,14 @@ class DashBoardRoundedCardWidget extends StatelessWidget {
71 // )
72 // ],
73 ),
62 - child: OutlinedButton(
74 + child: TextButton(
75 onPressed: onTap,
64 - style: OutlinedButton.styleFrom(
65 - side: BorderSide(width: 1, color: Theme.of(context).extension<BalancePageTheme>()!.cardBorderColor),
66 - backgroundColor:
67 - Theme.of(context).extension<SyncIndicatorTheme>()!.syncedBackgroundColor,
68 - shape: RoundedRectangleBorder(
69 - borderRadius: BorderRadius.circular(customBorder ?? 20)),
70 - padding: EdgeInsets.all(24)),
76 + style: TextButton.styleFrom(
77 + shape: RoundedRectangleBorder(
78 + borderRadius: BorderRadius.circular(15),
79 + ),
80 + padding: EdgeInsets.only(left: 24, top: 24, right: 20, bottom: 24),
81 + ),
82 child: Column(
83 children: [
84 Row(
@@ -79,24 +90,20 @@ class DashBoardRoundedCardWidget extends StatelessWidget {
90 children: [
91 Text(
92 title,
82 - style: TextStyle(
83 - color: Theme.of(context)
84 - .extension<DashboardPageTheme>()!
85 - .cardTextColor,
86 - fontSize: 24,
87 - fontWeight: FontWeight.w900,
88 - ),
93 + style: Theme.of(context).textTheme.titleLarge?.copyWith(
94 + color: Theme.of(context).colorScheme.onSurface,
95 + fontWeight: FontWeight.w800,
96 + fontSize: 24,
97 + ),
98 softWrap: true,
99 ),
100 SizedBox(height: 5),
101 Text(
102 subTitle,
94 - style: TextStyle(
95 - color: Theme.of(context)
96 - .extension<DashboardPageTheme>()!
97 - .cardTextColor,
98 - fontWeight: FontWeight.w500,
99 - fontFamily: 'Lato'),
103 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
104 + color: Theme.of(context).colorScheme.onSurfaceVariant,
105 + fontWeight: FontWeight.w500,
106 + ),
107 softWrap: true,
108 ),
109 ],
@@ -121,7 +128,7 @@ class DashBoardRoundedCardWidget extends StatelessWidget {
128 child: IconButton(
129 icon: Icon(Icons.close),
130 onPressed: onClose,
124 - color: Theme.of(context).extension<DashboardPageTheme>()!.cardTextColor,
131 + //color: Theme.of(context).colorScheme.onSurface,
132 ),
133 ),
134 ],
lib/src/widgets/discount_badge.dart
+6 -7
@@ -18,13 +18,12 @@ class DiscountBadge extends StatelessWidget {
18 return Container(
19 padding: EdgeInsets.symmetric(horizontal: 8, vertical: 4),
20 child: Text(
21 - isAmount ? '\$${percentage.toStringAsFixed(2)}' : S.of(context).discount(percentage.toStringAsFixed(2)),
22 - style: TextStyle(
23 - color: Colors.white,
24 - fontSize: 12,
25 - fontWeight: FontWeight.w500,
26 - fontFamily: 'Lato',
27 - ),
21 + isAmount
22 + ? '\$${percentage.toStringAsFixed(2)}'
23 + : S.of(context).discount(percentage.toStringAsFixed(2)),
24 + style: Theme.of(context).textTheme.bodySmall?.copyWith(
25 + fontWeight: FontWeight.w500,
26 + ),
27 ),
28 decoration: BoxDecoration(
29 image: DecorationImage(
lib/src/widgets/gradient_background.dart
+14 -16
@@ -1,4 +1,4 @@
1 -import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
1 +import 'package:cake_wallet/themes/utils/custom_theme_colors.dart';
2 import 'package:flutter/material.dart';
3
4 class GradientBackground extends StatelessWidget {
@@ -9,22 +9,20 @@ class GradientBackground extends StatelessWidget {
9 @override
10 Widget build(BuildContext context) {
11 return Container(
12 - decoration: BoxDecoration(
13 - gradient: LinearGradient(
12 + decoration: BoxDecoration(
13 + color: Theme.of(context).colorScheme.surface,
14 + gradient: LinearGradient(
15 colors: [
15 - Theme.of(context)
16 - .extension<DashboardPageTheme>()!
17 - .firstGradientBackgroundColor,
18 - Theme.of(context)
19 - .extension<DashboardPageTheme>()!
20 - .secondGradientBackgroundColor,
21 - Theme.of(context)
22 - .extension<DashboardPageTheme>()!
23 - .thirdGradientBackgroundColor,
16 + Theme.of(context).colorScheme.surface,
17 + Theme.of(context).brightness == Brightness.dark
18 + ? CustomThemeColors.backgroundGradientColorDark
19 + : CustomThemeColors.backgroundGradientColorLight,
20 ],
25 - begin: Alignment.topRight,
26 - end: Alignment.bottomLeft,
27 - )),
28 - child: scaffold);
21 + begin: Alignment.topCenter,
22 + end: Alignment.bottomCenter,
23 + ),
24 + ),
25 + child: scaffold,
26 + );
27 }
28 }
lib/src/widgets/haven_wallet_removal_popup.dart
+8 -13
@@ -1,6 +1,5 @@
1 import 'package:cake_wallet/src/widgets/alert_background.dart';
2 import 'package:cake_wallet/src/widgets/alert_close_button.dart';
3 -import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
3 import 'package:flutter/material.dart';
4
5 class HavenWalletRemovalPopup extends StatelessWidget {
@@ -23,10 +22,8 @@ class HavenWalletRemovalPopup extends StatelessWidget {
22 decoration: BoxDecoration(
23 borderRadius: BorderRadius.circular(30.0),
24 gradient: LinearGradient(colors: [
26 - Theme.of(context).extension<DashboardPageTheme>()!.firstGradientBackgroundColor,
27 - Theme.of(context)
28 - .extension<DashboardPageTheme>()!
29 - .secondGradientBackgroundColor,
25 + Theme.of(context).colorScheme.primaryContainer,
26 + Theme.of(context).colorScheme.secondaryContainer,
27 ], begin: Alignment.centerLeft, end: Alignment.centerRight)),
28 child: Padding(
29 padding: const EdgeInsets.symmetric(horizontal: 24.0),
@@ -38,12 +35,12 @@ class HavenWalletRemovalPopup extends StatelessWidget {
35 child: Container(
36 alignment: Alignment.bottomCenter,
37 child: DefaultTextStyle(
41 - style: TextStyle(
38 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
39 decoration: TextDecoration.none,
40 fontSize: 24.0,
41 fontWeight: FontWeight.bold,
45 - fontFamily: 'Lato',
46 - color: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
42 +
43 + color: Theme.of(context).colorScheme.onSurfaceVariant,
44 ),
45 child: Text("Emergency Notice"),
46 ),
@@ -63,13 +60,11 @@ class HavenWalletRemovalPopup extends StatelessWidget {
60 ),
61 child: Text(
62 "It looks like you have Haven wallets in your list. Haven is getting removed in next release of Cake Wallet, and you currently have Haven in the following wallets:\n\n[${affectedWalletNames.join(", ")}]\n\nPlease move your funds to other wallet, as you will lose access to your Haven funds in next update.\n\nFor assistance, please use the in-app support or email support@cakewallet.com",
66 - style: TextStyle(
63 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
64 decoration: TextDecoration.none,
65 fontSize: 16.0,
69 - fontFamily: 'Lato',
70 - color: Theme.of(context)
71 - .extension<DashboardPageTheme>()!
72 - .textColor,
66 +
67 + color: Theme.of(context).colorScheme.onSurfaceVariant,
68 ),
69 ),
70 )
lib/src/widgets/introducing_card.dart
+35 -36
@@ -1,15 +1,12 @@
1 import 'package:auto_size_text/auto_size_text.dart';
2 -import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart';
2 import 'package:flutter/material.dart';
4 -import 'package:cake_wallet/palette.dart';
5 -import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
3 import 'package:cake_wallet/generated/i18n.dart';
4
5 class IntroducingCard extends StatelessWidget {
6 IntroducingCard(
10 - {required this.borderColor,
11 - required this.closeCard,
12 - required this.title,
7 + {required this.borderColor,
8 + required this.closeCard,
9 + required this.title,
10 required this.subTitle});
11
12 final String title;
@@ -20,16 +17,17 @@ class IntroducingCard extends StatelessWidget {
17 @override
18 Widget build(BuildContext context) {
19 return Padding(
23 - padding: const EdgeInsets.fromLTRB(16,0,16,16),
20 + padding: const EdgeInsets.fromLTRB(16, 0, 16, 16),
21 child: Container(
22 width: double.infinity,
23 decoration: BoxDecoration(
27 - borderRadius: BorderRadius.circular(30.0),
28 - border: Border.all(
29 - color: borderColor,
30 - width: 1,
31 - ),
32 - color: Theme.of(context).extension<SyncIndicatorTheme>()!.syncedBackgroundColor),
24 + borderRadius: BorderRadius.circular(30.0),
25 + border: Border.all(
26 + color: borderColor,
27 + width: 1,
28 + ),
29 + color: Theme.of(context).colorScheme.surfaceContainer,
30 + ),
31 child: Row(
32 mainAxisAlignment: MainAxisAlignment.spaceBetween,
33 crossAxisAlignment: CrossAxisAlignment.start,
@@ -42,30 +40,28 @@ class IntroducingCard extends StatelessWidget {
40 child: Column(
41 crossAxisAlignment: CrossAxisAlignment.start,
42 children: [
45 - AutoSizeText(title ?? '',
46 - style: TextStyle(
47 - fontSize: 24,
48 - fontFamily: 'Lato',
43 + AutoSizeText(
44 + title,
45 + style: Theme.of(context).textTheme.headlineSmall?.copyWith(
46 fontWeight: FontWeight.bold,
50 - color: Theme.of(context).extension<DashboardPageTheme>()!.cardTextColor,
51 - height: 1),
52 - maxLines: 1,
53 - textAlign: TextAlign.center),
47 + height: 1,
48 + ),
49 + maxLines: 1,
50 + textAlign: TextAlign.center,
51 + ),
52 SizedBox(height: 14),
55 - Text(subTitle ?? '',
56 - textAlign: TextAlign.left,
57 - style: TextStyle(
58 - fontSize: 12,
59 - fontFamily: 'Lato',
60 - color: Theme.of(context).extension<DashboardPageTheme>()!.cardTextColor,
61 - height: 1)),
53 + Text(
54 + subTitle,
55 + textAlign: TextAlign.left,
56 + style: Theme.of(context).textTheme.bodySmall,
57 + ),
58 ],
59 ),
60 ),
61 ),
62 ),
63 Padding(
68 - padding: const EdgeInsets.fromLTRB(0,16,16,0),
64 + padding: const EdgeInsets.fromLTRB(0, 16, 16, 0),
65 child: Semantics(
66 label: S.of(context).close,
67 child: GestureDetector(
@@ -74,14 +70,17 @@ class IntroducingCard extends StatelessWidget {
70 height: 23,
71 width: 23,
72 decoration: BoxDecoration(
77 - color: Colors.white, shape: BoxShape.circle),
73 + color: Theme.of(context).colorScheme.surfaceContainer,
74 + shape: BoxShape.circle,
75 + ),
76 child: Center(
79 - child: Image.asset(
80 - 'assets/images/x.png',
81 - color: Palette.darkBlueCraiola,
82 - height: 15,
83 - width: 15,
84 - )),
77 + child: Image.asset(
78 + 'assets/images/x.png',
79 + color: Theme.of(context).colorScheme.onSurface,
80 + height: 15,
81 + width: 15,
82 + ),
83 + ),
84 ),
85 ),
86 ),
lib/src/widgets/keyboard_done_button.dart
+7 -4
@@ -1,19 +1,22 @@
1 +import 'package:cake_wallet/generated/i18n.dart';
2 import 'package:flutter/cupertino.dart';
3 import 'package:flutter/material.dart';
4
5 class KeyboardDoneButton extends StatelessWidget {
6 @override
7 Widget build(BuildContext context) {
7 - // FIXME: Add translation
8 return CupertinoButton(
9 padding: EdgeInsets.only(right: 24.0, top: 8.0, bottom: 8.0),
10 onPressed: () {
11 FocusScope.of(context).requestFocus(FocusNode());
12 },
13 child: Text(
14 - 'Done',
15 - style: TextStyle(color: Colors.blueAccent,fontWeight: FontWeight.bold)
14 + S.of(context).done,
15 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
16 + color: Theme.of(context).colorScheme.primary,
17 + fontWeight: FontWeight.bold,
18 + ),
19 ),
20 );
21 }
19 -}
\ No newline at end of file
22 +}
lib/src/widgets/list_row.dart
+48 -49
@@ -1,20 +1,17 @@
1 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
1 import 'package:flutter/material.dart';
3 -import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart';
2
3 class ListRow extends StatelessWidget {
6 - ListRow({
7 - required this.title,
8 - required this.value,
9 - this.titleFontSize = 14,
10 - this.valueFontSize = 16,
11 - this.image,
12 - this.padding,
13 - this.color,
14 - this.hintTextColor,
15 - this.mainTextColor,
16 - this.textWidget
17 - });
4 + ListRow(
5 + {required this.title,
6 + required this.value,
7 + this.titleFontSize = 14,
8 + this.valueFontSize = 16,
9 + this.image,
10 + this.padding,
11 + this.color,
12 + this.hintTextColor,
13 + this.mainTextColor,
14 + this.textWidget});
15
16 final String title;
17 final String value;
@@ -27,50 +24,52 @@ class ListRow extends StatelessWidget {
24 final Color? mainTextColor;
25 final Widget? textWidget;
26
30 - Widget _getTextWidget (BuildContext context) => textWidget ?? Text(
31 - value,
32 - style: TextStyle(
33 - fontSize: valueFontSize,
34 - fontWeight: FontWeight.w500,
35 - color: mainTextColor ?? Theme.of(context).extension<CakeTextTheme>()!.titleColor
36 - ),
37 - );
27 + Widget _getTextWidget(BuildContext context) =>
28 + textWidget ??
29 + Text(
30 + value,
31 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
32 + fontSize: valueFontSize,
33 + fontWeight: FontWeight.w500,
34 + color: mainTextColor,
35 + ),
36 + );
37
38 @override
39 Widget build(BuildContext context) {
40 return Container(
41 width: double.infinity,
43 - color: color ?? Theme.of(context).colorScheme.background,
42 + color: color ?? Theme.of(context).colorScheme.surface,
43 child: Padding(
44 padding: padding ?? const EdgeInsets.only(left: 24, top: 16, bottom: 16, right: 24),
46 - child: Column(
47 - crossAxisAlignment: CrossAxisAlignment.start,
48 - children: <Widget>[
49 - Text(title,
50 - style: TextStyle(
51 - fontSize: titleFontSize,
52 - fontWeight: FontWeight.w500,
53 - color: hintTextColor ?? Theme.of(context).extension<TransactionTradeTheme>()!.detailsTitlesColor),
54 - textAlign: TextAlign.left),
55 - Padding(
56 - padding: const EdgeInsets.only(top: 12),
57 - child: Row(
58 - mainAxisSize: MainAxisSize.max,
59 - mainAxisAlignment: MainAxisAlignment.spaceBetween,
60 - crossAxisAlignment: CrossAxisAlignment.start,
61 - children: <Widget>[
62 - Expanded(
63 - child: _getTextWidget(context)),
64 - image != null
45 + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
46 + Text(
47 + title,
48 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
49 + fontSize: titleFontSize,
50 + fontWeight: FontWeight.w500,
51 + color: hintTextColor,
52 + ),
53 + textAlign: TextAlign.left,
54 + ),
55 + Padding(
56 + padding: const EdgeInsets.only(top: 12),
57 + child: Row(
58 + mainAxisSize: MainAxisSize.max,
59 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
60 + crossAxisAlignment: CrossAxisAlignment.start,
61 + children: <Widget>[
62 + Expanded(child: _getTextWidget(context)),
63 + image != null
64 ? Padding(
66 - padding: EdgeInsets.only(left: 24),
67 - child: image,
68 - )
65 + padding: EdgeInsets.only(left: 24),
66 + child: image,
67 + )
68 : Offstage()
70 - ],
71 - ),
72 - )
73 - ]),
69 + ],
70 + ),
71 + )
72 + ]),
73 ),
74 );
75 }
lib/src/widgets/number_text_fild_widget.dart
+51 -36
@@ -1,4 +1,3 @@
1 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
1 import 'package:cake_wallet/typography.dart';
2 import 'package:flutter/material.dart';
3 import 'package:flutter/services.dart';
@@ -57,16 +56,16 @@ class _NumberTextFieldState extends State<NumberTextField> {
56
57 @override
58 Widget build(BuildContext context) => TextField(
60 - style: textMediumSemiBold(color: Theme.of(context).extension<CakeTextTheme>()!.titleColor),
61 - enableInteractiveSelection: false,
62 - textAlign: TextAlign.center,
63 - textAlignVertical: TextAlignVertical.bottom,
64 - controller: _controller,
65 - focusNode: _focusNode,
66 - textInputAction: TextInputAction.done,
67 - keyboardType: TextInputType.number,
68 - maxLength: widget.max.toString().length + (widget.min.isNegative ? 1 : 0),
69 - decoration: InputDecoration(
59 + style: textMediumSemiBold(color: Theme.of(context).colorScheme.onSurfaceVariant),
60 + enableInteractiveSelection: false,
61 + textAlign: TextAlign.center,
62 + textAlignVertical: TextAlignVertical.bottom,
63 + controller: _controller,
64 + focusNode: _focusNode,
65 + textInputAction: TextInputAction.done,
66 + keyboardType: TextInputType.number,
67 + maxLength: widget.max.toString().length + (widget.min.isNegative ? 1 : 0),
68 + decoration: InputDecoration(
69 border: InputBorder.none,
70 contentPadding: EdgeInsets.all(0),
71 fillColor: Colors.transparent,
@@ -74,34 +73,50 @@ class _NumberTextFieldState extends State<NumberTextField> {
73 isDense: true,
74 filled: true,
75 suffixIconConstraints: BoxConstraints(
77 - maxHeight: widget.arrowsHeight,
78 - maxWidth: widget.arrowsWidth + widget.contentPadding.right),
76 + maxHeight: widget.arrowsHeight,
77 + maxWidth: widget.arrowsWidth + widget.contentPadding.right,
78 + ),
79 prefixIconConstraints: BoxConstraints(
80 - maxHeight: widget.arrowsHeight,
81 - maxWidth: widget.arrowsWidth + widget.contentPadding.left),
80 + maxHeight: widget.arrowsHeight,
81 + maxWidth: widget.arrowsWidth + widget.contentPadding.left,
82 + ),
83 prefixIcon: Material(
83 - type: MaterialType.transparency,
84 - child: InkWell(
85 - child: Container(
86 - width: widget.arrowsWidth,
87 - alignment: Alignment.bottomCenter,
88 - child: Icon(Icons.arrow_left_outlined, size: widget.arrowsWidth)),
89 - onTap: _canGoDown ? () => _update(false) : null)),
84 + type: MaterialType.transparency,
85 + child: InkWell(
86 + child: Container(
87 + width: widget.arrowsWidth,
88 + alignment: Alignment.bottomCenter,
89 + child: Icon(
90 + Icons.arrow_left_outlined,
91 + size: widget.arrowsWidth,
92 + ),
93 + ),
94 + onTap: _canGoDown ? () => _update(false) : null,
95 + ),
96 + ),
97 suffixIcon: Material(
91 - type: MaterialType.transparency,
92 - child: InkWell(
93 - child: Container(
94 - width: widget.arrowsWidth,
95 - alignment: Alignment.bottomCenter,
96 - child: Icon(Icons.arrow_right_outlined, size: widget.arrowsWidth)),
97 - onTap: _canGoUp ? () => _update(true) : null))),
98 - maxLines: 1,
99 - onChanged: (value) {
100 - final intValue = int.tryParse(value);
101 - widget.onChanged?.call(intValue);
102 - _updateArrows(intValue);
103 - },
104 - inputFormatters: [_NumberTextInputFormatter(widget.min, widget.max)]);
98 + type: MaterialType.transparency,
99 + child: InkWell(
100 + child: Container(
101 + width: widget.arrowsWidth,
102 + alignment: Alignment.bottomCenter,
103 + child: Icon(
104 + Icons.arrow_right_outlined,
105 + size: widget.arrowsWidth,
106 + ),
107 + ),
108 + onTap: _canGoUp ? () => _update(true) : null,
109 + ),
110 + ),
111 + ),
112 + maxLines: 1,
113 + onChanged: (value) {
114 + final intValue = int.tryParse(value);
115 + widget.onChanged?.call(intValue);
116 + _updateArrows(intValue);
117 + },
118 + inputFormatters: [_NumberTextInputFormatter(widget.min, widget.max)],
119 + );
120
121 void _update(bool up) {
122 var intValue = int.tryParse(_controller.text);
lib/src/widgets/option_tile.dart
+12 -20
@@ -1,4 +1,3 @@
1 -import 'package:cake_wallet/themes/extensions/option_tile_theme.dart';
1 import 'package:flutter/material.dart';
2
3 class OptionTile extends StatelessWidget {
@@ -21,13 +20,12 @@ class OptionTile extends StatelessWidget {
20 Widget build(BuildContext context) {
21 return Container(
22 width: double.infinity,
24 - padding: EdgeInsets.only(left: 6, right: 6),
23 alignment: Alignment.center,
26 - child: TextButton(
24 + child: ElevatedButton(
25 style: TextButton.styleFrom(
28 - backgroundColor: Theme.of(context).cardColor,
29 - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
30 - padding: EdgeInsets.all(24)
26 + backgroundColor: Theme.of(context).colorScheme.surfaceContainer,
27 + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
28 + padding: EdgeInsets.all(24),
29 ),
30 onPressed: onPressed,
31 child: Row(
@@ -46,25 +44,19 @@ class OptionTile extends StatelessWidget {
44 children: <Widget>[
45 Text(
46 title,
49 - style: TextStyle(
50 - fontSize: 20,
51 - fontWeight: FontWeight.w500,
52 - color: Theme.of(context)
53 - .extension<OptionTileTheme>()!
54 - .titleColor,
55 - ),
47 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
48 + fontSize: 20,
49 + fontWeight: FontWeight.w500,
50 + color: Theme.of(context).colorScheme.onSurface,
51 + ),
52 ),
53 Padding(
54 padding: EdgeInsets.only(top: 5),
55 child: Text(
56 description,
61 - style: TextStyle(
62 - fontSize: 14,
63 - fontWeight: FontWeight.normal,
64 - color: Theme.of(context)
65 - .extension<OptionTileTheme>()!
66 - .descriptionColor,
67 - ),
57 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
58 + color: Theme.of(context).colorScheme.onSurfaceVariant,
59 + ),
60 ),
61 )
62 ],
lib/src/widgets/picker.dart
+50 -59
@@ -9,11 +9,7 @@ import 'package:cw_core/transaction_priority.dart';
9 import 'package:flutter/material.dart';
10 import 'package:cw_core/currency.dart';
11 import 'package:cake_wallet/src/widgets/picker_wrapper_widget.dart';
12 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
13 -import 'package:cake_wallet/themes/extensions/cake_scrollbar_theme.dart';
14 -import 'package:cake_wallet/themes/extensions/picker_theme.dart';
12
16 -//TODO(David): PickerWidget is intertwined and confusing as is, find a way to optimize?
13 class Picker<Item> extends StatefulWidget {
14 Picker({
15 required this.selectedAtIndex,
@@ -159,13 +155,13 @@ class _PickerState<Item> extends State<Picker<Item>> {
155 key: ValueKey('picker_title_text_key'),
156 widget.title!,
157 textAlign: TextAlign.center,
162 - style: TextStyle(
163 - fontSize: 18,
164 - fontFamily: 'Lato',
165 - fontWeight: FontWeight.bold,
166 - decoration: TextDecoration.none,
167 - color: Colors.white,
168 - ),
158 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
159 + fontSize: 18,
160 +
161 + fontWeight: FontWeight.bold,
162 + decoration: TextDecoration.none,
163 + color: Theme.of(context).colorScheme.onSurface,
164 + ),
165 ),
166 ),
167 Padding(
@@ -180,7 +176,7 @@ class _PickerState<Item> extends State<Picker<Item>> {
176 child: ClipRRect(
177 borderRadius: BorderRadius.all(Radius.circular(30)),
178 child: Container(
183 - color: Theme.of(context).dialogTheme.backgroundColor,
179 + color: Theme.of(context).colorScheme.surface,
180 child: ConstrainedBox(
181 constraints: BoxConstraints(
182 maxHeight: containerHeight,
@@ -189,7 +185,7 @@ class _PickerState<Item> extends State<Picker<Item>> {
185 child: Column(
186 mainAxisSize: MainAxisSize.min,
187 children: [
192 - if (widget.hintText != null)
188 + if (widget.hintText != null) ...[
189 Padding(
190 padding: const EdgeInsets.all(16),
191 child: SearchBarWidget(
@@ -198,10 +194,11 @@ class _PickerState<Item> extends State<Picker<Item>> {
194 hintText: widget.hintText,
195 ),
196 ),
201 - Divider(
202 - color: Theme.of(context).extension<PickerTheme>()!.dividerColor,
203 - height: 1,
204 - ),
197 + Divider(
198 + color: Theme.of(context).colorScheme.outlineVariant,
199 + height: 1,
200 + ),
201 + ],
202 if (widget.selectedAtIndex != -1 && widget.headerEnabled)
203 buildSelectedItem(widget.selectedAtIndex),
204 Flexible(
@@ -224,15 +221,10 @@ class _PickerState<Item> extends State<Picker<Item>> {
221 key: ValueKey('picker_descriptinon_text_key'),
222 widget.description!,
223 textAlign: TextAlign.center,
227 - style: TextStyle(
228 - fontSize: 12,
229 - fontWeight: FontWeight.w500,
230 - fontFamily: 'Lato',
231 - decoration: TextDecoration.none,
232 - color: Theme.of(context)
233 - .extension<CakeTextTheme>()!
234 - .titleColor,
235 - ),
224 + style: Theme.of(context).textTheme.bodySmall!.copyWith(
225 + fontWeight: FontWeight.w500,
226 + decoration: TextDecoration.none,
227 + ),
228 ),
229 )
230 : Offstage(),
@@ -267,7 +259,7 @@ class _PickerState<Item> extends State<Picker<Item>> {
259 ? 0
260 : filteredItems.length;
261 return Container(
270 - color: Theme.of(context).extension<PickerTheme>()!.dividerColor,
262 + color: Theme.of(context).colorScheme.outlineVariant,
263 child: widget.isGridView
264 ? GridView.builder(
265 key: ValueKey('picker_items_grid_view_key'),
@@ -292,7 +284,7 @@ class _PickerState<Item> extends State<Picker<Item>> {
284 shrinkWrap: true,
285 separatorBuilder: (context, index) => widget.isSeparated
286 ? Divider(
295 - color: Theme.of(context).extension<PickerTheme>()!.dividerColor,
287 + color: Theme.of(context).colorScheme.outlineVariant,
288 height: 1,
289 )
290 : const SizedBox(),
@@ -348,13 +340,10 @@ class _PickerState<Item> extends State<Picker<Item>> {
340 key: ValueKey('picker_items_index_${itemName}_text_key'),
341 widget.displayItem?.call(item) ?? item.toString(),
342 softWrap: true,
351 - style: TextStyle(
352 - fontSize: 14,
353 - fontFamily: 'Lato',
354 - fontWeight: FontWeight.w600,
355 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
356 - decoration: TextDecoration.none,
357 - ),
343 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
344 + fontWeight: FontWeight.w600,
345 + decoration: TextDecoration.none,
346 + ),
347 ),
348 ),
349 if (tag != null)
@@ -367,17 +356,17 @@ class _PickerState<Item> extends State<Picker<Item>> {
356 child: Text(
357 key: ValueKey('picker_items_index_${index}_tag_key'),
358 tag,
370 - style: TextStyle(
371 - fontSize: 7.0,
372 - fontFamily: 'Lato',
373 - color: Theme.of(context).extension<CakeScrollbarTheme>()!.thumbColor,
374 - ),
359 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
360 + fontSize: 7.0,
361 +
362 + color: Theme.of(context).colorScheme.primary,
363 + ),
364 ),
365 ),
366 decoration: BoxDecoration(
367 borderRadius: BorderRadius.circular(6.0),
368 //border: Border.all(color: ),
380 - color: Theme.of(context).extension<CakeScrollbarTheme>()!.trackColor,
369 + color: Theme.of(context).colorScheme.surfaceVariant,
370 ),
371 ),
372 ),
@@ -396,7 +385,7 @@ class _PickerState<Item> extends State<Picker<Item>> {
385 },
386 child: Container(
387 height: isCustomItem ? 95 : 55,
399 - color: Theme.of(context).dialogTheme.backgroundColor,
388 + color: Theme.of(context).colorScheme.surface,
389 padding: EdgeInsets.symmetric(horizontal: 24),
390 child: isCustomItem
391 ? Column(
@@ -439,13 +428,13 @@ class _PickerState<Item> extends State<Picker<Item>> {
428 key: ValueKey('picker_items_index_${itemName}_selected_item_text_key'),
429 widget.displayItem?.call(item) ?? item.toString(),
430 softWrap: true,
442 - style: TextStyle(
443 - fontSize: 16,
444 - fontFamily: 'Lato',
445 - fontWeight: FontWeight.w700,
446 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
447 - decoration: TextDecoration.none,
448 - ),
431 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
432 + fontSize: 16,
433 +
434 + fontWeight: FontWeight.w700,
435 + color: Theme.of(context).colorScheme.onSurface,
436 + decoration: TextDecoration.none,
437 + ),
438 ),
439 ),
440 if (tag != null)
@@ -457,17 +446,17 @@ class _PickerState<Item> extends State<Picker<Item>> {
446 child: Center(
447 child: Text(
448 tag,
460 - style: TextStyle(
461 - fontSize: 7.0,
462 - fontFamily: 'Lato',
463 - color: Theme.of(context).extension<CakeScrollbarTheme>()!.thumbColor,
464 - ),
449 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
450 + fontSize: 7.0,
451 +
452 + color: Theme.of(context).colorScheme.primary,
453 + ),
454 ),
455 ),
456 decoration: BoxDecoration(
457 borderRadius: BorderRadius.circular(6.0),
458 //border: Border.all(color: ),
470 - color: Theme.of(context).extension<CakeScrollbarTheme>()!.trackColor,
459 + color: Theme.of(context).colorScheme.surfaceVariant,
460 ),
461 ),
462 ),
@@ -475,7 +464,7 @@ class _PickerState<Item> extends State<Picker<Item>> {
464 ),
465 ),
466 ),
478 - Icon(Icons.check_circle, color: Theme.of(context).primaryColor),
467 + Icon(Icons.check_circle, color: Theme.of(context).colorScheme.primary),
468 ],
469 );
470
@@ -486,7 +475,7 @@ class _PickerState<Item> extends State<Picker<Item>> {
475 },
476 child: Container(
477 height: isCustomItem ? 95 : 55,
489 - color: Theme.of(context).dialogTheme.backgroundColor,
478 + color: Theme.of(context).colorScheme.surface,
479 padding: EdgeInsets.symmetric(horizontal: 24),
480 child: isCustomItem
481 ? Column(
@@ -516,12 +505,14 @@ class _PickerState<Item> extends State<Picker<Item>> {
505 child: Center(
506 child: Text(
507 item.name.substring(0, min(item.name.length, 2)).toUpperCase(),
519 - style: TextStyle(fontSize: 11),
508 + style: Theme.of(context).textTheme.bodySmall?.copyWith(
509 + fontSize: 11,
510 + ),
511 ),
512 ),
513 decoration: BoxDecoration(
514 shape: BoxShape.circle,
524 - color: Colors.grey.shade400,
515 + color: Theme.of(context).colorScheme.surfaceContainer,
516 ),
517 );
518 }
lib/src/widgets/picker_inner_wrapper_widget.dart
+10 -10
@@ -1,7 +1,6 @@
1 -import 'package:cake_wallet/themes/extensions/account_list_theme.dart';
2 -import 'package:cake_wallet/utils/responsive_layout_util.dart';
1 import 'package:flutter/material.dart';
2 import 'package:cake_wallet/src/widgets/picker_wrapper_widget.dart';
3 +import 'package:cake_wallet/utils/responsive_layout_util.dart';
4
5 class PickerInnerWrapperWidget extends StatelessWidget {
6 PickerInnerWrapperWidget(
@@ -32,20 +31,21 @@ class PickerInnerWrapperWidget extends StatelessWidget {
31 child: Text(
32 title!,
33 textAlign: TextAlign.center,
35 - style: TextStyle(
36 - fontSize: 18,
37 - fontWeight: FontWeight.bold,
38 - fontFamily: 'Lato',
39 - decoration: TextDecoration.none,
40 - color: Colors.white),
34 + style: Theme.of(context).textTheme.titleMedium?.copyWith(
35 + fontWeight: FontWeight.bold,
36 + fontSize: 18,
37 + decoration: TextDecoration.none,
38 + color: Theme.of(context).colorScheme.onSurface,
39 + ),
40 ),
41 ),
42 + SizedBox(height: 8),
43 Padding(
44 padding: EdgeInsets.symmetric(horizontal: 24),
45 child: ClipRRect(
46 borderRadius: BorderRadius.all(Radius.circular(14)),
47 child: Container(
48 - color: Theme.of(context).dialogTheme.backgroundColor,
48 + color: Theme.of(context).colorScheme.surfaceContainerHighest,
49 child: ConstrainedBox(
50 constraints: BoxConstraints(
51 maxHeight:
@@ -73,7 +73,7 @@ class PickerInnerWrapperWidget extends StatelessWidget {
73 child: ClipRRect(
74 borderRadius: BorderRadius.all(Radius.circular(14)),
75 child: Container(
76 - color: Theme.of(context).dialogTheme.backgroundColor,
76 + color: Theme.of(context).colorScheme.surfaceContainerHighest,
77 child: ConstrainedBox(
78 constraints: BoxConstraints(
79 maxHeight: containerHeight,
lib/src/widgets/primary_button.dart
+113 -83
@@ -13,6 +13,7 @@ class PrimaryButton extends StatelessWidget {
13 this.isDottedBorder = false,
14 this.borderColor = Colors.black,
15 this.onDisabledPressed,
16 + this.borderRadius,
17 super.key,
18 });
19
@@ -24,33 +25,40 @@ class PrimaryButton extends StatelessWidget {
25 final String text;
26 final bool isDisabled;
27 final bool isDottedBorder;
28 + final BorderRadius? borderRadius;
29
30 @override
31 Widget build(BuildContext context) {
32 final content = ConstrainedBox(
33 constraints: BoxConstraints(maxWidth: ResponsiveLayoutUtilBase.kDesktopMaxWidthConstraint),
34 child: SizedBox(
33 - width: double.infinity,
34 - height: 52.0,
35 - child: TextButton(
36 - onPressed:
37 - isDisabled ? (onDisabledPressed != null ? onDisabledPressed : null) : onPressed,
38 - style: ButtonStyle(
39 - backgroundColor:
40 - MaterialStateProperty.all(isDisabled ? color.withOpacity(0.5) : color),
41 - shape: MaterialStateProperty.all<RoundedRectangleBorder>(
42 - RoundedRectangleBorder(
43 - borderRadius: BorderRadius.circular(26.0),
44 - ),
45 - ),
46 - overlayColor: MaterialStateProperty.all(Colors.transparent)),
47 - child: Text(text,
48 - textAlign: TextAlign.center,
49 - style: TextStyle(
50 - fontSize: 15.0,
51 - fontWeight: FontWeight.w600,
52 - color: isDisabled ? textColor.withOpacity(0.5) : textColor)),
53 - )),
35 + width: double.infinity,
36 + height: 52.0,
37 + child: TextButton(
38 + onPressed:
39 + isDisabled ? (onDisabledPressed != null ? onDisabledPressed : null) : onPressed,
40 + style: ButtonStyle(
41 + backgroundColor: WidgetStateProperty.all(
42 + isDisabled ? color.withOpacity(0.5) : color,
43 + ),
44 + shape: WidgetStateProperty.all<RoundedRectangleBorder>(
45 + RoundedRectangleBorder(
46 + borderRadius: borderRadius ?? BorderRadius.circular(12.0),
47 + ),
48 + ),
49 + overlayColor: WidgetStateProperty.all(Colors.transparent),
50 + ),
51 + child: Text(
52 + text,
53 + textAlign: TextAlign.center,
54 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
55 + fontSize: 15.0,
56 + fontWeight: FontWeight.w600,
57 + color: isDisabled ? textColor.withOpacity(0.5) : textColor,
58 + ),
59 + ),
60 + ),
61 + ),
62 );
63
64 return isDottedBorder
@@ -59,7 +67,7 @@ class PrimaryButton extends StatelessWidget {
67 dashPattern: [6, 4],
68 color: borderColor,
69 strokeWidth: 2,
62 - radius: Radius.circular(26),
70 + radius: Radius.circular(15),
71 child: content)
72 : content;
73 }
@@ -88,45 +96,52 @@ class LoadingPrimaryButton extends StatelessWidget {
96 return ConstrainedBox(
97 constraints: BoxConstraints(maxWidth: ResponsiveLayoutUtilBase.kDesktopMaxWidthConstraint),
98 child: SizedBox(
91 - width: double.infinity,
92 - height: 52.0,
93 - child: TextButton(
94 - onPressed: (isLoading || isDisabled) ? null : () {
95 - FocusScope.of(context).unfocus();
96 - onPressed.call();
97 - },
98 - style: ButtonStyle(
99 - backgroundColor:
100 - MaterialStateProperty.all(isDisabled ? color.withOpacity(0.5) : color),
101 - shape: MaterialStateProperty.all<RoundedRectangleBorder>(
102 - RoundedRectangleBorder(
103 - borderRadius: BorderRadius.circular(26.0),
99 + width: double.infinity,
100 + height: 52.0,
101 + child: TextButton(
102 + onPressed: (isLoading || isDisabled)
103 + ? null
104 + : () {
105 + FocusScope.of(context).unfocus();
106 + onPressed.call();
107 + },
108 + style: ButtonStyle(
109 + backgroundColor: WidgetStateProperty.all(isDisabled ? color.withOpacity(0.5) : color),
110 + shape: WidgetStateProperty.all<RoundedRectangleBorder>(
111 + RoundedRectangleBorder(
112 + borderRadius: BorderRadius.circular(12.0),
113 + ),
114 + )),
115 + child: isLoading
116 + ? CupertinoActivityIndicator(animating: true, color: textColor)
117 + : Text(
118 + text,
119 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
120 + fontSize: 15.0,
121 + fontWeight: FontWeight.w600,
122 + color: isDisabled ? textColor.withOpacity(0.5) : textColor,
123 ),
105 - )),
106 - child: isLoading
107 - ? CupertinoActivityIndicator(animating: true, color: textColor)
108 - : Text(text,
109 - style: TextStyle(
110 - fontSize: 15.0,
111 - fontWeight: FontWeight.w600,
112 - color: isDisabled ? textColor.withOpacity(0.5) : textColor)),
113 - )),
124 + ),
125 + ),
126 + ),
127 );
128 }
129 }
130
131 class PrimaryIconButton extends StatelessWidget {
119 - const PrimaryIconButton(
120 - {required this.onPressed,
121 - required this.iconData,
122 - required this.text,
123 - required this.color,
124 - required this.borderColor,
125 - required this.iconColor,
126 - required this.iconBackgroundColor,
127 - required this.textColor,
128 - this.mainAxisAlignment = MainAxisAlignment.start,
129 - this.radius = 26, super.key});
132 + const PrimaryIconButton({
133 + required this.onPressed,
134 + required this.iconData,
135 + required this.text,
136 + required this.color,
137 + required this.borderColor,
138 + required this.iconColor,
139 + required this.iconBackgroundColor,
140 + required this.textColor,
141 + this.mainAxisAlignment = MainAxisAlignment.start,
142 + this.radius = 12,
143 + super.key,
144 + });
145
146 final VoidCallback onPressed;
147 final IconData iconData;
@@ -149,8 +164,8 @@ class PrimaryIconButton extends StatelessWidget {
164 child: TextButton(
165 onPressed: onPressed,
166 style: ButtonStyle(
152 - backgroundColor: MaterialStateProperty.all(color),
153 - shape: MaterialStateProperty.all<RoundedRectangleBorder>(
167 + backgroundColor: WidgetStateProperty.all(color),
168 + shape: WidgetStateProperty.all<RoundedRectangleBorder>(
169 RoundedRectangleBorder(
170 borderRadius: BorderRadius.circular(radius),
171 ),
@@ -164,14 +179,22 @@ class PrimaryIconButton extends StatelessWidget {
179 width: 26.0,
180 height: 52.0,
181 decoration: BoxDecoration(shape: BoxShape.circle, color: iconBackgroundColor),
167 - child: Center(child: Icon(iconData, color: iconColor, size: 22.0)),
182 + child: Center(
183 + child: Icon(iconData, color: iconColor, size: 22.0),
184 + ),
185 ),
186 ],
187 ),
188 Container(
189 height: 52.0,
190 child: Center(
174 - child: Text(text, style: TextStyle(fontSize: 16.0, color: textColor)),
191 + child: Text(
192 + text,
193 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
194 + fontSize: 16,
195 + color: textColor,
196 + ),
197 + ),
198 ),
199 )
200 ],
@@ -188,7 +211,8 @@ class PrimaryImageButton extends StatelessWidget {
211 required this.text,
212 required this.color,
213 required this.textColor,
191 - this.borderColor = Colors.transparent, super.key});
214 + this.borderColor = Colors.transparent,
215 + super.key});
216
217 final VoidCallback onPressed;
218 final Image image;
@@ -202,30 +226,36 @@ class PrimaryImageButton extends StatelessWidget {
226 return ConstrainedBox(
227 constraints: BoxConstraints(maxWidth: ResponsiveLayoutUtilBase.kDesktopMaxWidthConstraint),
228 child: SizedBox(
205 - width: double.infinity,
206 - height: 52.0,
207 - child: TextButton(
208 - onPressed: onPressed,
209 - style: ButtonStyle(
210 - backgroundColor: MaterialStateProperty.all(color),
211 - shape: MaterialStateProperty.all<RoundedRectangleBorder>(
212 - RoundedRectangleBorder(
213 - borderRadius: BorderRadius.circular(26.0),
214 - ),
215 - )),
216 - child: Center(
217 - child: Row(
218 - mainAxisSize: MainAxisSize.min,
219 - children: <Widget>[
220 - image,
221 - SizedBox(width: 15),
222 - Text(
223 - text,
224 - style: TextStyle(fontSize: 15, fontWeight: FontWeight.w600, color: textColor),
225 - )
226 - ],
229 + width: double.infinity,
230 + height: 52.0,
231 + child: ElevatedButton(
232 + onPressed: onPressed,
233 + style: ButtonStyle(
234 + backgroundColor: WidgetStateProperty.all(color),
235 + shape: WidgetStateProperty.all<RoundedRectangleBorder>(
236 + RoundedRectangleBorder(
237 + borderRadius: BorderRadius.circular(12.0),
238 ),
228 - ))),
239 + )),
240 + child: Center(
241 + child: Row(
242 + mainAxisSize: MainAxisSize.min,
243 + children: <Widget>[
244 + image,
245 + SizedBox(width: 15),
246 + Text(
247 + text,
248 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
249 + fontSize: 15,
250 + fontWeight: FontWeight.w600,
251 + color: textColor,
252 + ),
253 + )
254 + ],
255 + ),
256 + ),
257 + ),
258 + ),
259 );
260 }
261 }
lib/src/widgets/provider_optoin_tile.dart
+75 -66
@@ -1,6 +1,3 @@
1 -import 'package:cake_wallet/themes/extensions/option_tile_theme.dart';
2 -import 'package:cake_wallet/themes/extensions/receive_page_theme.dart';
3 -import 'package:cake_wallet/typography.dart';
1 import 'package:flutter/material.dart';
2 import 'package:flutter_svg/svg.dart';
3
@@ -60,40 +57,36 @@ class ProviderOptionTile extends StatelessWidget {
57 @override
58 Widget build(BuildContext context) {
59 final backgroundColor = isSelected
63 - ? isLightMode
64 - ? Theme.of(context).extension<ReceivePageTheme>()!.currentTileBackgroundColor
65 - : Theme.of(context).extension<OptionTileTheme>()!.titleColor
66 - : Theme.of(context).cardColor;
60 + ? Theme.of(context).colorScheme.primary
61 + : Theme.of(context).colorScheme.surfaceContainer;
62
63 final textColor = isSelected
69 - ? isLightMode
70 - ? Colors.white
71 - : Theme.of(context).cardColor
72 - : Theme.of(context).extension<OptionTileTheme>()!.titleColor;
64 + ? Theme.of(context).colorScheme.onPrimary
65 + : Theme.of(context).colorScheme.onSurface;
66
67 final badgeColor = isSelected
75 - ? Theme.of(context).cardColor
76 - : Theme.of(context).extension<OptionTileTheme>()!.titleColor;
68 + ? Theme.of(context).colorScheme.surfaceContainer
69 + : Theme.of(context).colorScheme.onSurface;
70
71 final badgeTextColor = isSelected
79 - ? Theme.of(context).extension<OptionTileTheme>()!.titleColor
80 - : Theme.of(context).cardColor;
72 + ? Theme.of(context).colorScheme.onSurface
73 + : Theme.of(context).colorScheme.surfaceContainer;
74
75 final imagePath = isSelected
83 - ? isLightMode
76 + ? !isLightMode
77 ? darkImagePath
78 : lightImagePath
86 - : isLightMode
87 - ? lightImagePath
88 - : darkImagePath;
79 + : !isLightMode
80 + ? darkImagePath
81 + : lightImagePath;
82
83 final rightSubTitleIconPath = isSelected
91 - ? isLightMode
84 + ? !isLightMode
85 ? rightSubTitleDarkIconPath
86 : rightSubTitleLightIconPath
94 - : isLightMode
95 - ? rightSubTitleLightIconPath
96 - : rightSubTitleDarkIconPath;
87 + : !isLightMode
88 + ? rightSubTitleDarkIconPath
89 + : rightSubTitleLightIconPath;
90
91 return GestureDetector(
92 onTap: onPressed,
@@ -112,15 +105,24 @@ class ProviderOptionTile extends StatelessWidget {
105 children: [
106 Row(
107 children: [
115 - getImage(imagePath, height: imageHeight, width: imageWidth),
108 + getImage(imagePath,
109 + height: imageHeight, width: imageWidth, imageColor: textColor),
110 SizedBox(width: 8),
111 Expanded(
112 child: Container(
113 child: Row(
114 children: [
115 Expanded(
122 - child: Text(title,
123 - style: titleTextStyle ?? textLargeBold(color: textColor))),
116 + child: Text(
117 + title,
118 + style: titleTextStyle ??
119 + Theme.of(context).textTheme.bodyLarge?.copyWith(
120 + color: textColor,
121 + fontWeight: FontWeight.w700,
122 + fontSize: 18,
123 + ),
124 + ),
125 + ),
126 Row(
127 children: [
128 if (leadingIcon != null)
@@ -142,18 +144,26 @@ class ProviderOptionTile extends StatelessWidget {
144 rightSubTitleIconPath: rightSubTitleIconPath),
145 if (bottomLeftSubTitle != null || bottomRightSubTitle != null)
146 subTitleWidget(
145 - leftSubTitle: bottomLeftSubTitle,
146 - textColor: textColor,
147 - subTitleFontSize: 12),
147 + leftSubTitle: bottomLeftSubTitle,
148 + textColor: textColor,
149 + subTitleFontSize: 12,
150 + ),
151 if (badges != null && badges!.isNotEmpty)
152 Padding(
153 padding: const EdgeInsets.only(top: 12),
151 - child: Row(children: [
152 - ...badges!
153 - .map((badge) => Badge(
154 - title: badge, textColor: badgeTextColor, backgroundColor: badgeColor))
155 - .toList()
156 - ]),
154 + child: Row(
155 + children: [
156 + ...badges!
157 + .map(
158 + (badge) => Badge(
159 + title: badge,
160 + textColor: badgeTextColor,
161 + backgroundColor: badgeColor,
162 + ),
163 + )
164 + .toList()
165 + ],
166 + ),
167 )
168 ],
169 ),
@@ -188,21 +198,19 @@ class subTitleWidget extends StatelessWidget {
198 children: [
199 leftSubTitle != null || subTitleIconPath != null
200 ? Row(
191 - children: [
192 - if (subTitleIconPath != null && subTitleIconPath!.isNotEmpty)
193 - Padding(
194 - padding: const EdgeInsets.only(right: 6),
195 - child: getImage(subTitleIconPath!),
201 + children: [
202 + if (subTitleIconPath != null && subTitleIconPath!.isNotEmpty)
203 + Padding(
204 + padding: const EdgeInsets.only(right: 6),
205 + child: getImage(subTitleIconPath!),
206 + ),
207 + Text(
208 + leftSubTitle ?? '',
209 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
210 + fontSize: subTitleFontSize, fontWeight: FontWeight.w700, color: textColor),
211 ),
197 - Text(
198 - leftSubTitle ?? '',
199 - style: TextStyle(
200 - fontSize: subTitleFontSize,
201 - fontWeight: FontWeight.w700,
202 - color: textColor),
203 - ),
204 - ],
205 - )
212 + ],
213 + )
214 : Offstage(),
215 rightSubTitle != null || rightSubTitleIconPath != null
216 ? Row(
@@ -214,7 +222,7 @@ class subTitleWidget extends StatelessWidget {
222 ),
223 Text(
224 rightSubTitle ?? '',
217 - style: TextStyle(
225 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
226 fontSize: subTitleFontSize, fontWeight: FontWeight.w700, color: textColor),
227 ),
228 ],
@@ -245,11 +253,10 @@ class Badge extends StatelessWidget {
253 alignment: Alignment.center,
254 child: Text(
255 title,
248 - style: TextStyle(
249 - color: textColor,
250 - fontSize: 12,
251 - fontWeight: FontWeight.w600,
252 - ),
256 + style: Theme.of(context).textTheme.bodySmall!.copyWith(
257 + color: textColor,
258 + fontWeight: FontWeight.w600,
259 + ),
260 ),
261 ),
262 ),
@@ -373,8 +380,8 @@ class _OptionTilePlaceholderState extends State<OptionTilePlaceholder>
380
381 @override
382 Widget build(BuildContext context) {
376 - final backgroundColor = Theme.of(context).cardColor;
377 - final titleColor = Theme.of(context).extension<OptionTileTheme>()!.titleColor.withOpacity(0.4);
383 + final backgroundColor = Theme.of(context).colorScheme.surfaceContainer;
384 + final titleColor = Theme.of(context).colorScheme.onSurface.withOpacity(0.4);
385
386 return widget.errorText != null
387 ? Container(
@@ -382,25 +389,27 @@ class _OptionTilePlaceholderState extends State<OptionTilePlaceholder>
389 padding: widget.padding ?? EdgeInsets.all(16),
390 alignment: Alignment.center,
391 decoration: BoxDecoration(
385 - borderRadius: BorderRadius.all(Radius.circular(widget.borderRadius ?? 12)),
392 + borderRadius: BorderRadius.all(
393 + Radius.circular(widget.borderRadius ?? 12),
394 + ),
395 color: backgroundColor,
396 ),
397 child: Column(
398 children: [
399 Text(
400 widget.errorText!,
392 - style: TextStyle(
393 - color: titleColor,
394 - fontSize: 16,
395 - ),
401 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
402 + color: titleColor,
403 + fontSize: 16,
404 + ),
405 ),
406 if (widget.withSubtitle) SizedBox(height: 8),
407 Text(
408 '',
400 - style: TextStyle(
401 - color: titleColor,
402 - fontSize: 16,
403 - ),
409 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
410 + color: titleColor,
411 + fontSize: 16,
412 + ),
413 ),
414 ],
415 ),
lib/src/widgets/search_bar_widget.dart
+14 -26
@@ -1,4 +1,4 @@
1 -import 'package:cake_wallet/themes/extensions/picker_theme.dart';
1 +import 'package:cake_wallet/src/widgets/base_text_form_field.dart';
2 import 'package:flutter/material.dart';
3 import 'package:cake_wallet/generated/i18n.dart';
4
@@ -6,41 +6,29 @@ class SearchBarWidget extends StatelessWidget {
6 const SearchBarWidget({
7 required this.searchController,
8 this.hintText,
9 - this.borderRadius = 14,
9 super.key,
10 });
11
12 final TextEditingController searchController;
13 final String? hintText;
15 - final double borderRadius;
14
15 @override
16 Widget build(BuildContext context) {
19 - return TextFormField(
17 + return BaseTextFormField(
18 key: ValueKey('search_bar_widget_key'),
19 controller: searchController,
22 - style: TextStyle(color: Theme.of(context).extension<PickerTheme>()!.searchHintColor),
23 - decoration: InputDecoration(
24 - hintText: hintText ?? S.of(context).search,
25 - hintStyle: TextStyle(color: Theme.of(context).extension<PickerTheme>()!.searchHintColor),
26 - prefixIcon: Icon( Icons.search,
27 - color: Theme.of(context).primaryColor),
28 - filled: true,
29 - fillColor: Theme.of(context).extension<PickerTheme>()!.searchBackgroundFillColor,
30 - alignLabelWithHint: false,
31 - contentPadding: const EdgeInsets.symmetric(vertical: 4, horizontal: 16),
32 - enabledBorder: OutlineInputBorder(
33 - borderRadius: BorderRadius.circular(borderRadius),
34 - borderSide: BorderSide(
35 - color: Theme.of(context).extension<PickerTheme>()!.searchBorderColor ??
36 - Colors.transparent,
37 - )),
38 - focusedBorder: OutlineInputBorder(
39 - borderRadius: BorderRadius.circular(borderRadius),
40 - borderSide: const BorderSide(
41 - color: Colors.transparent,
42 - )),
43 - ),
20 + textStyle: Theme.of(context)
21 + .textTheme
22 + .bodyMedium!
23 + .copyWith(color: Theme.of(context).colorScheme.onSurfaceVariant),
24 + hintText: hintText ?? S.of(context).search,
25 + placeholderTextStyle: Theme.of(context)
26 + .textTheme
27 + .bodyMedium!
28 + .copyWith(color: Theme.of(context).colorScheme.onSurfaceVariant),
29 + prefixIcon: Icon(Icons.search, color: Theme.of(context).colorScheme.primary),
30 + alignLabelWithHint: false,
31 + contentPadding: const EdgeInsets.symmetric(vertical: 4, horizontal: 16),
32 );
33 }
34 }
lib/src/widgets/section_divider.dart
+8 -5
@@ -1,26 +1,29 @@
1 import 'package:flutter/material.dart';
2
3 class SectionDivider extends StatelessWidget {
4 - const SectionDivider({required this.direction});
4 + const SectionDivider({required this.direction, this.margin});
5
6 final Axis direction;
7 -
7 + final EdgeInsets? margin;
8 @override
9 Widget build(BuildContext context) {
10 return Container(
11 height: direction == Axis.horizontal ? 1 : null,
12 width: direction == Axis.vertical ? 1 : null,
13 - color: Theme.of(context).dividerColor,
13 + color: Theme.of(context).colorScheme.outlineVariant.withOpacity(0.5),
14 + margin: margin,
15 );
16 }
17 }
18
19 class HorizontalSectionDivider extends StatelessWidget {
19 - const HorizontalSectionDivider();
20 + const HorizontalSectionDivider({this.margin});
21 +
22 + final EdgeInsets? margin;
23
24 @override
25 Widget build(BuildContext context) {
23 - return SectionDivider(direction: Axis.horizontal);
26 + return SectionDivider(direction: Axis.horizontal, margin: margin);
27 }
28 }
29
lib/src/widgets/seed_language_selector.dart
+3
@@ -10,12 +10,14 @@ class SeedLanguageSelector extends StatefulWidget {
10 required this.initialSelected,
11 this.seedType = MoneroSeedType.defaultSeedType,
12 this.buttonKey,
13 + this.borderRadius,
14 Key? key,
15 }) : super(key: key);
16
17 final String initialSelected;
18 final MoneroSeedType seedType;
19 final Key? buttonKey;
20 + final BorderRadius? borderRadius;
21
22 @override
23 SeedLanguageSelectorState createState() => SeedLanguageSelectorState(selected: initialSelected);
@@ -29,6 +31,7 @@ class SeedLanguageSelectorState extends State<SeedLanguageSelector> {
31 @override
32 Widget build(BuildContext context) {
33 return SelectButton(
34 + borderRadius: widget.borderRadius,
35 key: widget.buttonKey,
36 image: null,
37 text:
lib/src/widgets/seed_widget.dart
+98 -64
@@ -1,8 +1,6 @@
1 import 'package:cake_wallet/core/seed_validator.dart';
2 import 'package:cake_wallet/generated/i18n.dart';
3 import 'package:cake_wallet/src/widgets/validable_annotated_editable_text.dart';
4 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
5 -import 'package:cake_wallet/themes/extensions/send_page_theme.dart';
4 import 'package:cw_core/wallet_type.dart';
5 import 'package:flutter/material.dart';
6 import 'package:flutter/services.dart';
@@ -80,69 +78,105 @@ class SeedWidgetState extends State<SeedWidget> {
78 @override
79 Widget build(BuildContext context) {
80 return Container(
83 - child: Column(
84 - crossAxisAlignment: CrossAxisAlignment.start,
85 - mainAxisAlignment: MainAxisAlignment.start,
86 - children: [
87 - Stack(children: [
88 - SizedBox(height: 35),
89 - if (_showPlaceholder)
90 - Positioned(
91 - top: 10,
92 - left: 0,
93 - child: Text(S.of(context).enter_seed_phrase,
94 - style: TextStyle(fontSize: 16.0, color: Theme.of(context).hintColor))),
95 - Padding(
96 - padding: EdgeInsets.only(right: 40, top: 10),
97 - child: ValidatableAnnotatedEditableText(
98 - key: widget.seedTextFieldKey,
99 - cursorColor: Colors.blue,
100 - backgroundCursorColor: Colors.blue,
101 - validStyle: TextStyle(
102 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
103 - backgroundColor: Colors.transparent,
104 - fontWeight: FontWeight.normal,
105 - fontSize: 16),
106 - invalidStyle: TextStyle(
107 - fontSize: 16,
108 - color: Colors.red,
109 - fontWeight: FontWeight.normal,
110 - backgroundColor: Colors.transparent),
111 - focusNode: focusNode,
112 - controller: controller,
113 - words: words,
114 - normalizeSeed: normalizeSeed,
115 - textStyle: TextStyle(
116 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
117 - backgroundColor: Colors.transparent,
118 - fontWeight: FontWeight.normal,
119 - fontSize: 16),
120 - )),
121 - Positioned(
122 - top: 0,
123 - right: 8,
124 - child: Container(
125 - width: 32,
126 - height: 32,
127 - child: InkWell(
128 - key: widget.pasteButtonKey,
129 - onTap: () async => _pasteText(),
130 - child: Container(
131 - padding: EdgeInsets.all(8),
132 - decoration: BoxDecoration(
133 - color: Theme.of(context).hintColor,
134 - borderRadius: BorderRadius.all(Radius.circular(6))),
135 - child: Image.asset('assets/images/paste_ios.png',
136 - color: Theme.of(context)
137 - .extension<SendPageTheme>()!
138 - .textFieldButtonIconColor)),
139 - )))
140 - ]),
81 + child: Column(
82 + crossAxisAlignment: CrossAxisAlignment.start,
83 + mainAxisAlignment: MainAxisAlignment.start,
84 + children: [
85 Container(
142 - margin: EdgeInsets.only(top: 15),
143 - height: 1.0,
144 - color: Theme.of(context).extension<CakeTextTheme>()!.textfieldUnderlineColor),
145 - ]));
86 + decoration: BoxDecoration(
87 + color: Theme.of(context).colorScheme.surfaceContainer,
88 + borderRadius: BorderRadius.circular(12),
89 + ),
90 + child: Stack(
91 + children: [
92 + Padding(
93 + padding: EdgeInsets.only(left: 12, right: 8, top: 8, bottom: 8),
94 + child: Row(
95 + children: [
96 + Expanded(
97 + child: Stack(
98 + children: [
99 + Container(
100 + constraints: BoxConstraints(minHeight: 40),
101 + child: Align(
102 + alignment: Alignment.centerLeft,
103 + child: ValidatableAnnotatedEditableText(
104 + key: widget.seedTextFieldKey,
105 + cursorColor: Theme.of(context).colorScheme.primary,
106 + backgroundCursorColor: Theme.of(context).colorScheme.primary,
107 + validStyle: Theme.of(context).textTheme.bodyMedium!.copyWith(
108 + color: Theme.of(context).colorScheme.onSurfaceVariant,
109 + backgroundColor: Colors.transparent,
110 + fontWeight: FontWeight.normal,
111 + fontSize: 16,
112 + ),
113 + invalidStyle: Theme.of(context).textTheme.bodyMedium!.copyWith(
114 + color: Theme.of(context).colorScheme.errorContainer,
115 + backgroundColor: Colors.transparent,
116 + fontWeight: FontWeight.normal,
117 + fontSize: 16,
118 + ),
119 + focusNode: focusNode,
120 + controller: controller,
121 + words: words,
122 + normalizeSeed: normalizeSeed,
123 + textStyle: Theme.of(context).textTheme.bodyMedium!.copyWith(
124 + color: Theme.of(context).colorScheme.onSurfaceVariant,
125 + backgroundColor: Colors.transparent,
126 + fontWeight: FontWeight.normal,
127 + fontSize: 16,
128 + ),
129 + ),
130 + ),
131 + ),
132 + if (_showPlaceholder)
133 + Positioned.fill(
134 + child: IgnorePointer(
135 + child: Align(
136 + alignment: Alignment.centerLeft,
137 + child: Text(
138 + S.of(context).enter_seed_phrase,
139 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
140 + color: Theme.of(context).colorScheme.onSurfaceVariant,
141 + fontSize: 16,
142 + ),
143 + ),
144 + ),
145 + ),
146 + ),
147 + ],
148 + ),
149 + ),
150 + Container(
151 + width: 32,
152 + height: 32,
153 + child: InkWell(
154 + key: widget.pasteButtonKey,
155 + onTap: () async => _pasteText(),
156 + child: Container(
157 + padding: EdgeInsets.all(6),
158 + decoration: BoxDecoration(
159 + color: Theme.of(context).colorScheme.surface,
160 + borderRadius: BorderRadius.all(
161 + Radius.circular(6),
162 + ),
163 + ),
164 + child: Image.asset(
165 + 'assets/images/paste_ios.png',
166 + color: Theme.of(context).colorScheme.onSurfaceVariant,
167 + ),
168 + ),
169 + ),
170 + ),
171 + ],
172 + ),
173 + ),
174 + ],
175 + ),
176 + ),
177 + ],
178 + ),
179 + );
180 }
181
182 Future<void> _pasteText() async {
lib/src/widgets/seedphrase_grid_widget.dart
+11 -16
@@ -1,4 +1,3 @@
1 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
1 import 'package:flutter/material.dart';
2
3 class SeedPhraseGridWidget extends StatelessWidget {
@@ -28,35 +27,31 @@ class SeedPhraseGridWidget extends StatelessWidget {
27 alignment: Alignment.center,
28 decoration: BoxDecoration(
29 borderRadius: BorderRadius.circular(8),
31 - color: Theme.of(context).cardColor,
30 + color: Theme.of(context).colorScheme.surfaceContainerHighest,
31 ),
32 child: Row(
33 crossAxisAlignment: CrossAxisAlignment.center,
34 children: [
35 SizedBox(
36 child: Text(
38 - //maxLines: 1,
37 numberCount.toString(),
38 textAlign: TextAlign.center,
41 - style: TextStyle(
42 - fontSize: 12,
43 - height: 1,
44 - fontWeight: FontWeight.w800,
45 - color: Theme.of(context)
46 - .extension<CakeTextTheme>()!
47 - .buttonTextColor
48 - .withOpacity(0.5)),
39 + style: Theme.of(context).textTheme.bodyLarge?.copyWith(
40 + height: 1.9,
41 + fontWeight: FontWeight.w700,
42 + color: Theme.of(context).colorScheme.onSurface.withOpacity(0.5),
43 + ),
44 ),
45 ),
46 const SizedBox(width: 6),
47 Expanded(
48 child: Text(
49 '${item[0].toLowerCase()}${item.substring(1)}',
55 - style: TextStyle(
56 - fontSize: 14,
57 - height: 0.8,
58 - fontWeight: FontWeight.w700,
59 - color: Theme.of(context).extension<CakeTextTheme>()!.buttonTextColor),
50 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
51 + height: 1.9,
52 + fontWeight: FontWeight.w700,
53 + color: Theme.of(context).colorScheme.onSurface,
54 + ),
55 ),
56 ),
57 ],
lib/src/widgets/service_status_tile.dart
+7 -4
@@ -1,5 +1,6 @@
1 import 'package:auto_size_text/auto_size_text.dart';
2 import 'package:cake_wallet/entities/service_status.dart';
3 +import 'package:cake_wallet/themes/utils/custom_theme_colors.dart';
4 import 'package:flutter/material.dart';
5 import 'package:intl/intl.dart';
6
@@ -20,9 +21,9 @@ class ServiceStatusTile extends StatelessWidget {
21 Expanded(
22 child: AutoSizeText(
23 "${status.title}${status.status != null ? " - ${status.status}" : ""}",
23 - style: TextStyle(
24 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
25 fontSize: 16,
25 - fontFamily: 'Lato',
26 +
27 fontWeight: FontWeight.w800,
28 height: 1,
29 ),
@@ -32,7 +33,7 @@ class ServiceStatusTile extends StatelessWidget {
33 ),
34 Text(
35 _getTimeString(status.date),
35 - style: TextStyle(fontSize: 12),
36 + style: Theme.of(context).textTheme.bodySmall,
37 ),
38 ],
39 ),
@@ -40,7 +41,9 @@ class ServiceStatusTile extends StatelessWidget {
41 leading: RotatedBox(
42 child: Icon(
43 Icons.info,
43 - color: status.status == "resolved" ? Colors.green : Colors.red,
44 + color: status.status == "resolved"
45 + ? CustomThemeColors.syncGreen
46 + : Theme.of(context).colorScheme.errorContainer,
47 ),
48 quarterTurns: 2,
49 ),
lib/src/widgets/services_updates_widget.dart
+22 -22
@@ -5,8 +5,6 @@ import 'package:cake_wallet/generated/i18n.dart';
5 import 'package:cake_wallet/src/widgets/alert_with_one_action.dart';
6 import 'package:cake_wallet/src/widgets/primary_button.dart';
7 import 'package:cake_wallet/src/widgets/service_status_tile.dart';
8 -import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
9 -import 'package:cake_wallet/themes/extensions/wallet_list_theme.dart';
8 import 'package:cake_wallet/utils/show_pop_up.dart';
9 import 'package:flutter/material.dart';
10 import 'package:flutter_svg/flutter_svg.dart';
@@ -44,14 +42,14 @@ class _ServicesUpdatesWidgetState extends State<ServicesUpdatesWidget> {
42 },
43 child: SvgPicture.asset(
44 "assets/images/notification_icon.svg",
47 - color: Theme.of(context).extension<DashboardPageTheme>()!.pageTitleTextColor,
45 + color: Theme.of(context).colorScheme.onSurface,
46 width: 30,
47 placeholderBuilder: (_) => Icon(Icons.error),
48 ),
49 );
50 }
51 return Padding(
54 - padding: const EdgeInsets.all(8.0),
52 + padding: const EdgeInsets.only(left: 16, top: 12, right: 8, bottom: 8),
53 child: FutureBuilder<ServicesResponse>(
54 future: widget.servicesResponse,
55 builder: (context, state) {
@@ -66,6 +64,7 @@ class _ServicesUpdatesWidgetState extends State<ServicesUpdatesWidget> {
64 setState(() => wasOpened = true);
65
66 showModalBottomSheet(
67 + backgroundColor: Theme.of(context).colorScheme.surface,
68 context: context,
69 shape: RoundedRectangleBorder(
70 borderRadius: BorderRadius.only(
@@ -81,14 +80,18 @@ class _ServicesUpdatesWidgetState extends State<ServicesUpdatesWidget> {
80 Widget body;
81 if (state.data!.servicesStatus.isEmpty) {
82 body = Center(
84 - child: Text("Everything is up and running as expected"),
83 + child: Text(
84 + "Everything is up and running as expected",
85 + style: Theme.of(context).textTheme.bodyMedium,
86 + ),
87 );
88 } else {
89 body = SingleChildScrollView(
90 child: Column(
89 - children: state.data!.servicesStatus
90 - .map((status) => ServiceStatusTile(status))
91 - .toList()),
91 + children: state.data!.servicesStatus
92 + .map((status) => ServiceStatusTile(status))
93 + .toList(),
94 + ),
95 );
96 }
97 return Padding(
@@ -100,29 +103,26 @@ class _ServicesUpdatesWidgetState extends State<ServicesUpdatesWidget> {
103 alignment: Alignment.bottomCenter,
104 child: Padding(
105 padding: EdgeInsets.symmetric(
103 - horizontal: MediaQuery.of(context).size.width / 8,
106 + horizontal: 24,
107 vertical: 20,
108 ),
109 child: PrimaryImageButton(
110 onPressed: () {
111 try {
109 - launchUrl(Uri.parse("https://status.cakewallet.com/"),
112 + launchUrl(
113 + Uri.parse(
114 + "https://status.cakewallet.com/",
115 + ),
116 mode: LaunchMode.externalApplication);
117 } catch (_) {}
118 },
119 image: Image.asset(
120 "assets/images/status_website_image.png",
115 - color: Theme.of(context).brightness == Brightness.light
116 - ? Colors.white
117 - : null,
121 + color: Theme.of(context).colorScheme.onPrimary,
122 ),
123 text: "Status Website",
120 - color: Theme.of(context)
121 - .extension<WalletListTheme>()!
122 - .createNewWalletButtonBackgroundColor,
123 - textColor: Theme.of(context)
124 - .extension<WalletListTheme>()!
125 - .restoreWalletButtonTextColor,
124 + color: Theme.of(context).colorScheme.primary,
125 + textColor: Theme.of(context).colorScheme.onPrimary,
126 ),
127 ),
128 )
@@ -137,8 +137,8 @@ class _ServicesUpdatesWidgetState extends State<ServicesUpdatesWidget> {
137 children: [
138 SvgPicture.asset(
139 "assets/images/notification_icon.svg",
140 - color: Theme.of(context).extension<DashboardPageTheme>()!.pageTitleTextColor,
141 - width: 30,
140 + color: Theme.of(context).colorScheme.onSurface,
141 + width: 20,
142 placeholderBuilder: (_) => Icon(Icons.error),
143 ),
144 if (state.hasData && state.data!.hasUpdates && !wasOpened)
@@ -147,7 +147,7 @@ class _ServicesUpdatesWidgetState extends State<ServicesUpdatesWidget> {
147 width: 7,
148 margin: EdgeInsetsDirectional.only(start: 15),
149 decoration: BoxDecoration(
150 - color: Colors.red,
150 + color: Theme.of(context).colorScheme.errorContainer,
151 shape: BoxShape.circle,
152 ),
153 ),
lib/src/widgets/setting_action_button.dart
+16 -23
@@ -1,10 +1,4 @@
1 -import 'package:cake_wallet/palette.dart';
2 -import 'package:cake_wallet/themes/extensions/menu_theme.dart';
1 import 'package:flutter/material.dart';
4 -import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart';
5 -import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
6 -import 'package:cake_wallet/themes/extensions/balance_page_theme.dart';
7 -import 'package:cake_wallet/themes/extensions/option_tile_theme.dart';
2
3 class SettingActionButton extends StatelessWidget {
4 final bool isLastTile;
@@ -33,19 +27,20 @@ class SettingActionButton extends StatelessWidget {
27
28 @override
29 Widget build(BuildContext context) {
36 - final isLightMode = Theme.of(context).extension<OptionTileTheme>()?.useDarkImage ?? false;
30 Color? color = isSelected
38 - ? Theme.of(context).extension<CakeMenuTheme>()!.settingTitleColor
31 + ? Theme.of(context).colorScheme.primary
32 : selectionActive
40 - ? Palette.darkBlue
41 - : Theme.of(context).extension<CakeMenuTheme>()!.settingTitleColor;
33 + ? Theme.of(context).colorScheme.primary
34 + : Theme.of(context).colorScheme.onSurface;
35 return Container(
36 //padding: EdgeInsets.only(top: 5, left: 15, bottom: 5),
37 margin: EdgeInsets.only(top: 10, left: 20, bottom: 0, right: 20),
38 child: TextButton(
39 style: ButtonStyle(
47 - backgroundColor: MaterialStateProperty.all(isLightMode ? Theme.of(context).cardColor : Colors.black12),
48 - shape: MaterialStateProperty.all(
40 + backgroundColor: WidgetStateProperty.all(
41 + Theme.of(context).colorScheme.surfaceContainer,
42 + ),
43 + shape: WidgetStateProperty.all(
44 RoundedRectangleBorder(
45 borderRadius: BorderRadius.circular(20),
46 ),
@@ -66,25 +61,23 @@ class SettingActionButton extends StatelessWidget {
61 image,
62 height: 16,
63 width: 16,
69 - color: Theme.of(context)
70 - .extension<CakeMenuTheme>()!
71 - .settingActionsIconColor,
64 + color: Theme.of(context).colorScheme.primary,
65 ),
66 SizedBox(width: 16),
67 Expanded(
68 child: Text(
69 title,
77 - style: TextStyle(
78 - color: color,
79 - fontSize: 16,
80 - fontWeight: FontWeight.bold,
81 - ),
70 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
71 + color: color,
72 + fontSize: 16,
73 + fontWeight: FontWeight.w800,
74 + ),
75 ),
76 ),
84 - if(isArrowVisible)
77 + if (isArrowVisible)
78 Icon(
79 Icons.arrow_forward_ios,
87 - color: Colors.grey,
80 + color: Theme.of(context).colorScheme.primary,
81 size: 16,
82 )
83 ],
@@ -93,4 +86,4 @@ class SettingActionButton extends StatelessWidget {
86 ),
87 );
88 }
96 -}
\ No newline at end of file
89 +}
lib/src/widgets/standard_checkbox.dart
+12 -13
@@ -1,5 +1,3 @@
1 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
2 -import 'package:cake_wallet/themes/extensions/filter_theme.dart';
1 import 'package:flutter/material.dart';
2
3 class StandardCheckbox extends StatelessWidget {
@@ -23,19 +21,20 @@ class StandardCheckbox extends StatelessWidget {
21 @override
22 Widget build(BuildContext context) {
23 final baseGradient = LinearGradient(colors: [
26 - Theme.of(context).extension<FilterTheme>()!.checkboxFirstGradientColor,
27 - Theme.of(context).extension<FilterTheme>()!.checkboxSecondGradientColor,
24 + Theme.of(context).colorScheme.primary,
25 + Theme.of(context).colorScheme.primary.withOpacity(0.7),
26 ], begin: Alignment.centerLeft, end: Alignment.centerRight);
27
28 final boxBorder = Border.all(
31 - color: borderColor ?? Theme.of(context).extension<CakeTextTheme>()!.secondaryTextColor,
32 - width: 1.0,
29 + color: borderColor ?? Theme.of(context).colorScheme.outline,
30 + width: 2.0,
31 );
32
33 final checkedBoxDecoration = BoxDecoration(
36 - gradient: gradientBackground ? baseGradient : null,
37 - border: gradientBackground ? null : boxBorder,
38 - borderRadius: BorderRadius.all(Radius.circular(8.0)));
34 + gradient: gradientBackground ? baseGradient : null,
35 + border: gradientBackground ? null : boxBorder,
36 + borderRadius: BorderRadius.all(Radius.circular(8.0)),
37 + );
38
39 final uncheckedBoxDecoration =
40 BoxDecoration(border: boxBorder, borderRadius: BorderRadius.all(Radius.circular(8.0)));
@@ -54,7 +53,7 @@ class StandardCheckbox extends StatelessWidget {
53 child: value
54 ? Icon(
55 Icons.check,
57 - color: iconColor ?? Theme.of(context).primaryColor,
56 + color: iconColor ?? Theme.of(context).colorScheme.primary,
57 size: 20.0,
58 )
59 : Offstage(),
@@ -66,11 +65,11 @@ class StandardCheckbox extends StatelessWidget {
65 child: Text(
66 caption,
67 softWrap: true,
69 - style: TextStyle(
68 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
69 fontSize: 16.0,
71 - fontFamily: 'Lato',
70 +
71 fontWeight: FontWeight.normal,
73 - color: captionColor ?? Theme.of(context).extension<CakeTextTheme>()!.titleColor,
72 + color: captionColor ?? Theme.of(context).colorScheme.onSurface,
73 decoration: TextDecoration.none,
74 ),
75 ),
lib/src/widgets/standard_expandable_list.dart
+8 -13
@@ -1,5 +1,3 @@
1 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
2 -import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart';
1 import 'package:flutter/material.dart';
2
3 class StandardExpandableList<T> extends StatelessWidget {
@@ -18,21 +16,18 @@ class StandardExpandableList<T> extends StatelessWidget {
16 return Container(
17 decoration: decoration ??
18 BoxDecoration(
21 - color: Theme.of(context).colorScheme.background,
19 + color: Theme.of(context).colorScheme.surface,
20 ),
21 child: Theme(
22 data: Theme.of(context).copyWith(dividerColor: Colors.transparent),
23 child: ExpansionTile(
26 - iconColor: Theme.of(context).extension<TransactionTradeTheme>()!.detailsTitlesColor,
27 - collapsedIconColor:
28 - Theme.of(context).extension<TransactionTradeTheme>()!.detailsTitlesColor,
24 + iconColor: Theme.of(context).colorScheme.onSurface,
25 + collapsedIconColor: Theme.of(context).colorScheme.onSurface,
26 title: Text(
27 title,
31 - style: TextStyle(
32 - fontSize: 14,
33 - fontWeight: FontWeight.w500,
34 - color: Theme.of(context).extension<TransactionTradeTheme>()!.detailsTitlesColor,
35 - ),
28 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
29 + fontWeight: FontWeight.w500,
30 + ),
31 textAlign: TextAlign.left,
32 ),
33 children: expandableItems.map((item) {
@@ -43,10 +38,10 @@ class StandardExpandableList<T> extends StatelessWidget {
38 child: Text(
39 item.toString(),
40 maxLines: 1,
46 - style: TextStyle(
41 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
42 fontSize: 16,
43 fontWeight: FontWeight.w500,
49 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor),
44 + color: Theme.of(context).colorScheme.primary),
45 ),
46 ),
47 );
lib/src/widgets/standard_list.dart
+12 -16
@@ -1,4 +1,3 @@
1 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
1 import 'package:cake_wallet/src/widgets/standard_list_card.dart';
2 import 'package:cake_wallet/src/widgets/standard_list_status_row.dart';
3 import 'package:flutter/material.dart';
@@ -22,16 +21,15 @@ class StandardListRow extends StatelessWidget {
21 final leading = buildLeading(context);
22 final trailing = buildTrailing(context);
23 return Container(
25 - height: 56,
26 - padding: EdgeInsets.only(left: 12, right: 12),
24 + height: 56,
25 + padding: EdgeInsets.only(left: 12, right: 12),
26 child: TextButton(
27 onPressed: () => onTap?.call(context),
28 style: ButtonStyle(
30 - //backgroundColor: MaterialStateProperty.all(Theme.of(context).cardColor),
31 - shape: MaterialStateProperty.all(
29 + //backgroundColor: MaterialStateProperty.all(Theme.of(context).colorScheme.surfaceContainer),
30 + shape: WidgetStateProperty.all(
31 RoundedRectangleBorder(
33 - borderRadius: BorderRadius.all(Radius.circular(10)
34 - ),
32 + borderRadius: BorderRadius.all(Radius.circular(10)),
33 ),
34 ),
35 ),
@@ -58,11 +56,10 @@ class StandardListRow extends StatelessWidget {
56 Expanded(
57 child: Text(
58 title,
61 - style: TextStyle(
62 - fontSize: 14,
63 - fontWeight: FontWeight.normal,
64 - color: titleColor(context),
65 - ),
59 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
60 + color: titleColor(context),
61 + fontWeight: isSelected ? FontWeight.w800 : FontWeight.w400,
62 + ),
63 ),
64 )
65 ],
@@ -72,9 +69,8 @@ class StandardListRow extends StatelessWidget {
69
70 Widget? buildTrailing(BuildContext context) => null;
71
75 - Color titleColor(BuildContext context) => isSelected
76 - ? Theme.of(context).primaryColor
77 - : Theme.of(context).extension<CakeTextTheme>()!.titleColor;
72 + Color titleColor(BuildContext context) =>
73 + isSelected ? Theme.of(context).colorScheme.primary : Theme.of(context).colorScheme.onSurface;
74 }
75
76 class SectionHeaderListRow extends StatelessWidget {
@@ -84,7 +80,7 @@ class SectionHeaderListRow extends StatelessWidget {
80 Container(
81 width: double.infinity,
82 height: 40,
87 - color: Theme.of(context).colorScheme.background,
83 + color: Theme.of(context).colorScheme.surface,
84 ),
85 //StandardListSeparator(padding: EdgeInsets.only(left: 24))
86 ]);
lib/src/widgets/standard_list_card.dart
+50 -62
@@ -1,16 +1,15 @@
1 -import 'package:cake_wallet/palette.dart';
2 -import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart';
1 import 'package:flutter/material.dart';
4 -import 'package:cake_wallet/themes/theme_base.dart';
2 +import 'package:cake_wallet/themes/core/material_base_theme.dart';
3
4 class TradeDetailsStandardListCard extends StatelessWidget {
7 - TradeDetailsStandardListCard(
8 - {required this.id,
9 - this.extraId,
10 - required this.create,
11 - required this.pair,
12 - required this.onTap,
13 - required this.currentTheme});
5 + TradeDetailsStandardListCard({
6 + required this.id,
7 + this.extraId,
8 + required this.create,
9 + required this.pair,
10 + required this.onTap,
11 + required this.currentTheme,
12 + });
13
14 final String id;
15 final String? extraId;
@@ -21,70 +20,59 @@ class TradeDetailsStandardListCard extends StatelessWidget {
20
21 @override
22 Widget build(BuildContext context) {
24 - final darkTheme = currentTheme == ThemeType.dark;
25 -
26 - final baseGradient = LinearGradient(colors: [
27 - Theme.of(context).extension<ExchangePageTheme>()!.firstGradientTopPanelColor,
28 - Theme.of(context).extension<ExchangePageTheme>()!.secondGradientTopPanelColor,
29 - ], begin: Alignment.centerLeft, end: Alignment.centerRight);
30 -
31 - final gradient = LinearGradient(colors: [
32 - PaletteDark.wildNightBlue,
33 - PaletteDark.oceanBlue,
34 - ], begin: Alignment.bottomCenter, end: Alignment.topCenter);
35 -
36 - final textColor = Colors.white;
37 -
23 return Padding(
24 padding: const EdgeInsets.symmetric(horizontal: 24.0, vertical: 12.0),
25 child: GestureDetector(
26 onTap: () => onTap(context),
27 child: Container(
28 decoration: BoxDecoration(
44 - borderRadius: BorderRadius.circular(15.0),
45 - gradient: darkTheme ? gradient : baseGradient),
29 + borderRadius: BorderRadius.circular(15.0),
30 + color: Theme.of(context).colorScheme.surfaceContainerHighest,
31 + ),
32 child: Padding(
47 - padding:
48 - const EdgeInsets.symmetric(horizontal: 20.0, vertical: 16.0),
33 + padding: const EdgeInsets.symmetric(horizontal: 20.0, vertical: 16.0),
34 child: Column(
50 - mainAxisSize: MainAxisSize.min,
51 - crossAxisAlignment: CrossAxisAlignment.start,
52 - children: [
53 - Text(id,
54 - style: TextStyle(
55 - fontSize: 16,
56 - fontFamily: 'Lato',
57 - fontWeight: FontWeight.w400,
58 - color: textColor)),
59 - SizedBox(
60 - height: 8,
61 - ),
62 - if (extraId != null && extraId!.isNotEmpty)
35 + mainAxisSize: MainAxisSize.min,
36 + crossAxisAlignment: CrossAxisAlignment.start,
37 + children: [
38 + Text(
39 + id,
40 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
41 + fontSize: 16,
42 + fontWeight: FontWeight.w600,
43 + ),
44 + ),
45 + SizedBox(
46 + height: 8,
47 + ),
48 + if (extraId != null && extraId!.isNotEmpty)
49 Padding(
50 padding: const EdgeInsets.only(bottom: 8.0),
65 - child: Text(extraId!,
66 - style: TextStyle(
51 + child: Text(
52 + extraId!,
53 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
54 fontSize: 16,
68 - fontFamily: 'Lato',
69 - fontWeight: FontWeight.w400,
70 - color: textColor)),
71 - ),
72 - Text(create,
73 - style: TextStyle(
74 - fontSize: 12,
75 - fontFamily: 'Lato',
76 - fontWeight: FontWeight.w400,
77 - color: textColor)),
78 - SizedBox(
79 - height: 35,
55 + ),
56 + ),
57 ),
81 - Text(pair,
82 - style: TextStyle(
83 - fontSize: 24,
84 - fontFamily: 'Lato',
85 - fontWeight: FontWeight.bold,
86 - color: textColor)),
87 - ]),
58 + Text(
59 + create,
60 + style: Theme.of(context).textTheme.bodySmall?.copyWith(
61 + color: Theme.of(context).colorScheme.onSurface,
62 + ),
63 + ),
64 + SizedBox(
65 + height: 35,
66 + ),
67 + Text(
68 + pair,
69 + style: Theme.of(context).textTheme.bodyLarge?.copyWith(
70 + fontSize: 24,
71 + fontWeight: FontWeight.bold,
72 + ),
73 + ),
74 + ],
75 + ),
76 ),
77 ),
78 ),
lib/src/widgets/standard_list_status_row.dart
+42 -45
@@ -1,9 +1,5 @@
1 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
1 import 'package:cake_wallet/src/screens/dashboard/widgets/sync_indicator_icon.dart';
3 -import 'package:flutter/cupertino.dart';
2 import 'package:flutter/material.dart';
5 -import 'package:cake_wallet/themes/extensions/address_theme.dart';
6 -import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart';
3
4 class StandardListStatusRow extends StatelessWidget {
5 StandardListStatusRow({required this.title, required this.value, this.status});
@@ -16,50 +12,51 @@ class StandardListStatusRow extends StatelessWidget {
12 Widget build(BuildContext context) {
13 return Container(
14 width: double.infinity,
19 - color: Theme.of(context).colorScheme.background,
15 + color: Theme.of(context).colorScheme.surface,
16 child: Padding(
21 - padding:
22 - const EdgeInsets.only(left: 24, top: 16, bottom: 16, right: 24),
23 - child: Column(
24 - crossAxisAlignment: CrossAxisAlignment.start,
25 - children: <Widget>[
26 - Text(title,
27 - style: TextStyle(
28 - fontSize: 14,
29 - fontWeight: FontWeight.w500,
30 - color: Theme.of(context).extension<TransactionTradeTheme>()!.detailsTitlesColor),
31 - textAlign: TextAlign.left),
32 - Padding(
33 - padding: const EdgeInsets.only(top: 12),
34 - child: Container(
35 - decoration: BoxDecoration(
36 - color: Theme.of(context).extension<AddressTheme>()!.actionButtonColor,
37 - borderRadius: BorderRadius.circular(30.0),
38 - ),
39 - child: Padding(
40 - padding: const EdgeInsets.symmetric(horizontal: 8.0, vertical: 4.0),
41 - child: Row(
42 - mainAxisSize: MainAxisSize.min,
43 - children: <Widget>[
44 - SyncIndicatorIcon(
45 - boolMode: false,
46 - value: status ?? value,
47 - size: 6,
48 - ),
49 - SizedBox(
50 - width: 5,
51 - ),
52 - Text(value,
53 - style: TextStyle(
54 - fontSize: 16,
55 - fontWeight: FontWeight.w500,
56 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor))
57 - ],
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 ),
59 - ),
47 + Text(
48 + value,
49 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
50 + fontSize: 16,
51 + fontWeight: FontWeight.w500,
52 + ),
53 + )
54 + ],
55 ),
61 - )
62 - ]),
56 + ),
57 + ),
58 + )
59 + ]),
60 ),
61 );
62 }
lib/src/widgets/standard_picker_list.dart
+1 -2
@@ -1,6 +1,5 @@
1 import 'package:cake_wallet/src/widgets/list_row.dart';
2 import 'package:cake_wallet/src/widgets/picker.dart';
3 -import 'package:cake_wallet/themes/extensions/picker_theme.dart';
3 import 'package:flutter/material.dart';
4
5 class StandardPickerList<T> extends StatefulWidget {
@@ -68,7 +67,7 @@ class _StandardPickerListState<T> extends State<StandardPickerList<T>> {
67 mainAxisAlignment: MainAxisAlignment.center,
68 sliderValue: customValue,
69 isWrapped: false,
71 - borderColor: Theme.of(context).extension<PickerTheme>()!.dividerColor,
70 + borderColor: Theme.of(context).colorScheme.outlineVariant,
71 onSliderChanged: (newValue) {
72 setState(() => customValue = newValue);
73 value = widget.onSliderChanged(newValue).toString();
lib/src/widgets/standard_slide_button_widget.dart
+65 -66
@@ -1,9 +1,5 @@
1 import 'package:cake_wallet/src/widgets/primary_button.dart';
2 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
3 -import 'package:cake_wallet/themes/extensions/filter_theme.dart';
4 -import 'package:cake_wallet/themes/extensions/menu_theme.dart';
5 -import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart';
6 -import 'package:cake_wallet/themes/theme_base.dart';
2 +import 'package:cake_wallet/themes/core/material_base_theme.dart';
3 import 'package:flutter/material.dart';
4
5 class StandardSlideButton extends StatefulWidget {
@@ -19,7 +15,7 @@ class StandardSlideButton extends StatefulWidget {
15 final VoidCallback onSlideComplete;
16 final String buttonText;
17 final double height;
22 - final ThemeBase currentTheme;
18 + final MaterialThemeBase currentTheme;
19 final String accessibleNavigationModeButtonText;
20
21 @override
@@ -33,75 +29,78 @@ class _StandardSlideButtonState extends State<StandardSlideButton> {
29 Widget build(BuildContext context) {
30 final bool accessible = MediaQuery.of(context).accessibleNavigation;
31
36 - final tileBackgroundColor = widget.currentTheme.type == ThemeType.light
37 - ? Theme.of(context).extension<SyncIndicatorTheme>()!.syncedBackgroundColor
38 - : widget.currentTheme.type == ThemeType.oled
39 - ? Colors.black.withOpacity(0.5)
40 - : Theme.of(context).extension<FilterTheme>()!.buttonColor;
32 + final tileBackgroundColor = Theme.of(context).colorScheme.surfaceContainer;
33
34 return accessible
35 ? PrimaryButton(
36 text: widget.accessibleNavigationModeButtonText,
45 - color: Theme.of(context).primaryColor,
46 - textColor: Colors.white,
47 - onPressed: () => widget.onSlideComplete())
48 - : LayoutBuilder(builder: (context, constraints) {
49 - final double maxWidth = constraints.maxWidth;
50 - const double sideMargin = 4.0;
51 - final double effectiveMaxWidth = maxWidth - 2 * sideMargin;
52 - const double sliderWidth = 42.0;
37 + color: Theme.of(context).colorScheme.primary,
38 + textColor: Theme.of(context).colorScheme.onPrimary,
39 + onPressed: () => widget.onSlideComplete(),
40 + )
41 + : LayoutBuilder(
42 + builder: (context, constraints) {
43 + final double maxWidth = constraints.maxWidth;
44 + const double sideMargin = 4.0;
45 + final double effectiveMaxWidth = maxWidth - 2 * sideMargin;
46 + const double sliderWidth = 42.0;
47
54 - return Container(
55 - height: widget.height,
56 - decoration: BoxDecoration(
57 - borderRadius: BorderRadius.circular(10), color: tileBackgroundColor),
58 - child: Stack(
59 - alignment: Alignment.centerLeft,
60 - children: [
61 - Center(
62 - child: Text(widget.buttonText,
63 - style: TextStyle(
48 + return Container(
49 + height: widget.height,
50 + decoration: BoxDecoration(
51 + borderRadius: BorderRadius.circular(10),
52 + color: tileBackgroundColor,
53 + ),
54 + child: Stack(
55 + alignment: Alignment.centerLeft,
56 + children: [
57 + Center(
58 + child: Text(
59 + widget.buttonText,
60 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
61 fontSize: 16,
65 - fontFamily: 'Lato',
62 fontWeight: FontWeight.w600,
67 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor))),
68 - Positioned(
69 - left: sideMargin + _dragPosition,
70 - child: GestureDetector(
71 - onHorizontalDragUpdate: (details) {
72 - setState(() {
73 - _dragPosition += details.delta.dx;
74 - if (_dragPosition < 0) _dragPosition = 0;
75 - if (_dragPosition > effectiveMaxWidth - sliderWidth) {
76 - _dragPosition = effectiveMaxWidth - sliderWidth;
63 + ),
64 + ),
65 + ),
66 + Positioned(
67 + left: sideMargin + _dragPosition,
68 + child: GestureDetector(
69 + onHorizontalDragUpdate: (details) {
70 + setState(() {
71 + _dragPosition += details.delta.dx;
72 + if (_dragPosition < 0) _dragPosition = 0;
73 + if (_dragPosition > effectiveMaxWidth - sliderWidth) {
74 + _dragPosition = effectiveMaxWidth - sliderWidth;
75 + }
76 + });
77 + },
78 + onHorizontalDragEnd: (details) {
79 + if (_dragPosition >= effectiveMaxWidth - sliderWidth - 10) {
80 + widget.onSlideComplete();
81 + } else {
82 + setState(() => _dragPosition = 0);
83 }
78 - });
79 - },
80 - onHorizontalDragEnd: (details) {
81 - if (_dragPosition >= effectiveMaxWidth - sliderWidth - 10) {
82 - widget.onSlideComplete();
83 - } else {
84 - setState(() => _dragPosition = 0);
85 - }
86 - },
87 - child: Container(
88 - width: sliderWidth,
89 - height: widget.height - 8,
90 - decoration: BoxDecoration(
91 - borderRadius: BorderRadius.circular(10),
92 - color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
84 + },
85 + child: Container(
86 + width: sliderWidth,
87 + height: widget.height - 8,
88 + decoration: BoxDecoration(
89 + borderRadius: BorderRadius.circular(10),
90 + color: Theme.of(context).colorScheme.primary,
91 + ),
92 + alignment: Alignment.center,
93 + child: Icon(
94 + Icons.arrow_forward,
95 + color: Theme.of(context).colorScheme.onSurface,
96 + ),
97 ),
94 - alignment: Alignment.center,
95 - child: Icon(Icons.arrow_forward,
96 - color: widget.currentTheme.type == ThemeType.bright
97 - ? Theme.of(context).extension<CakeMenuTheme>()!.backgroundColor
98 - : Theme.of(context).extension<FilterTheme>()!.buttonColor),
98 ),
100 - ),
101 - )
102 - ],
103 - ),
104 - );
105 - });
99 + )
100 + ],
101 + ),
102 + );
103 + },
104 + );
105 }
106 }
lib/src/widgets/standard_switch.dart
+10 -7
@@ -14,7 +14,6 @@ class StandardSwitch extends StatefulWidget {
14 class StandardSwitchState extends State<StandardSwitch> {
15 @override
16 Widget build(BuildContext context) {
17 -
17 return Semantics(
18 toggled: widget.value,
19 child: GestureDetector(
@@ -26,16 +25,20 @@ class StandardSwitchState extends State<StandardSwitch> {
25 width: 50,
26 height: 28,
27 decoration: BoxDecoration(
29 - color: widget.value
30 - ? Theme.of(context).primaryColor
31 - : Theme.of(context).disabledColor,
32 - borderRadius: BorderRadius.all(Radius.circular(14.0))),
28 + color: widget.value
29 + ? Theme.of(context).colorScheme.surfaceContainerHighest
30 + : Theme.of(context).colorScheme.surfaceContainerLowest,
31 + borderRadius: BorderRadius.all(
32 + Radius.circular(14.0),
33 + ),
34 + ),
35 child: Container(
36 width: 24.0,
37 height: 24.0,
38 decoration: BoxDecoration(
37 - color: Colors.white,
38 - shape: BoxShape.circle),
39 + color: Theme.of(context).colorScheme.primary,
40 + shape: BoxShape.circle,
41 + ),
42 ),
43 ),
44 ),
lib/src/widgets/template_tile.dart
+89 -91
@@ -1,7 +1,5 @@
1 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
1 +import 'package:cake_wallet/themes/utils/custom_theme_colors.dart';
2 import 'package:flutter/material.dart';
3 -import 'package:cake_wallet/palette.dart';
4 -import 'package:cake_wallet/themes/extensions/send_page_theme.dart';
3
4 class TemplateTile extends StatefulWidget {
5 TemplateTile({
@@ -22,87 +20,83 @@ class TemplateTile extends StatefulWidget {
20 final bool? hasMultipleRecipients;
21
22 @override
25 - TemplateTileState createState() => TemplateTileState(
26 - to,
27 - amount,
28 - from,
29 - onTap,
30 - onRemove
31 - );
23 + TemplateTileState createState() => TemplateTileState(to, amount, from, onTap, onRemove);
24 }
25
26 class TemplateTileState extends State<TemplateTile> {
35 - TemplateTileState(
36 - this.to,
37 - this.amount,
38 - this.from,
39 - this.onTap,
40 - this.onRemove
41 - );
27 + TemplateTileState(this.to, this.amount, this.from, this.onTap, this.onRemove);
28
29 final String to;
30 final String amount;
31 final String from;
32 final VoidCallback onTap;
33 final VoidCallback onRemove;
48 - final trash = Image.asset('assets/images/trash.png', height: 16, width: 16, color: Colors.white);
34
35 bool isRemovable = false;
36
37 @override
38 Widget build(BuildContext context) {
54 - final color = isRemovable
55 - ? Colors.white
56 - : Theme.of(context).extension<SendPageTheme>()!.templateTitleColor;
57 - final toIcon = Image.asset('assets/images/to_icon.png', color: color);
39 + final toIcon = Image.asset(
40 + 'assets/images/to_icon.png',
41 + color: Theme.of(context).colorScheme.onSurface,
42 + );
43
44 final content = Row(
60 - mainAxisAlignment: MainAxisAlignment.start,
61 - mainAxisSize: MainAxisSize.min,
62 - children: widget.hasMultipleRecipients ?? false
63 - ? [
64 - Text(
65 - to,
66 - style: TextStyle(
67 - fontSize: 16, fontWeight: FontWeight.w600, color: color),
68 - ),
69 - ]
70 - : [
71 - Text(
72 - amount,
73 - style: TextStyle(
74 - fontSize: 16, fontWeight: FontWeight.w600, color: color),
75 - ),
76 - Padding(
77 - padding: EdgeInsets.only(left: 5),
78 - child: Text(
79 - from,
80 - style: TextStyle(
45 + mainAxisAlignment: MainAxisAlignment.start,
46 + mainAxisSize: MainAxisSize.min,
47 + children: widget.hasMultipleRecipients ?? false
48 + ? [
49 + Text(
50 + to,
51 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
52 + fontSize: 16,
53 + fontWeight: FontWeight.w600,
54 + color: Theme.of(context).colorScheme.onSurface,
55 + ),
56 + ),
57 + ]
58 + : [
59 + Text(
60 + amount,
61 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
62 + fontSize: 16,
63 + fontWeight: FontWeight.w600,
64 + color: Theme.of(context).colorScheme.onSurface,
65 + ),
66 + ),
67 + Padding(
68 + padding: EdgeInsets.only(left: 5),
69 + child: Text(
70 + from,
71 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
72 fontSize: 16,
73 fontWeight: FontWeight.w600,
83 - color: color),
84 - ),
74 + color: Theme.of(context).colorScheme.onSurface,
75 + ),
76 ),
86 - Padding(
87 - padding: EdgeInsets.only(left: 5),
88 - child: toIcon,
89 - ),
90 - Padding(
91 - padding: EdgeInsets.only(left: 5),
92 - child: Text(
93 - to,
94 - style: TextStyle(
77 + ),
78 + Padding(
79 + padding: EdgeInsets.only(left: 5),
80 + child: toIcon,
81 + ),
82 + Padding(
83 + padding: EdgeInsets.only(left: 5),
84 + child: Text(
85 + to,
86 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
87 fontSize: 16,
88 fontWeight: FontWeight.w600,
97 - color: color),
98 - ),
89 + color: Theme.of(context).colorScheme.onSurface,
90 + ),
91 ),
100 - ]);
92 + ),
93 + ],
94 + );
95
96 final tile = Container(
97 padding: EdgeInsets.only(right: 10),
98 child: ClipRRect(
105 - borderRadius: BorderRadius.all(Radius.circular(20)),
99 + borderRadius: BorderRadius.all(Radius.circular(12)),
100 child: GestureDetector(
101 onTap: onTap,
102 onLongPress: () {
@@ -113,47 +107,51 @@ class TemplateTileState extends State<TemplateTile> {
107 child: Container(
108 height: 40,
109 padding: EdgeInsets.only(left: 24, right: 24),
116 - color: Theme.of(context).extension<SendPageTheme>()!.templateBackgroundColor,
110 + color: Theme.of(context).colorScheme.surfaceContainerHighest,
111 child: content,
112 ),
113 ),
120 - )
121 - );
114 + ));
115
116 final removableTile = Container(
124 - padding: EdgeInsets.only(right: 10),
125 - child: ClipRRect(
126 - borderRadius: BorderRadius.all(Radius.circular(20)),
127 - child: Row(
128 - mainAxisSize: MainAxisSize.min,
129 - children: <Widget>[
130 - GestureDetector(
131 - onTap: () {
132 - setState(() {
133 - isRemovable = false;
134 - });
135 - },
136 - child: Container(
137 - height: 40,
138 - padding: EdgeInsets.only(left: 24, right: 10),
139 - color: Colors.orange,
140 - child: content,
117 + padding: EdgeInsets.only(right: 10),
118 + child: ClipRRect(
119 + borderRadius: BorderRadius.all(Radius.circular(12)),
120 + child: Row(
121 + mainAxisSize: MainAxisSize.min,
122 + children: <Widget>[
123 + GestureDetector(
124 + onTap: () {
125 + setState(() {
126 + isRemovable = false;
127 + });
128 + },
129 + child: Container(
130 + height: 40,
131 + padding: EdgeInsets.only(left: 24, right: 10),
132 + color: CustomThemeColors.syncYellow,
133 + child: content,
134 + ),
135 + ),
136 + GestureDetector(
137 + onTap: onRemove,
138 + child: Container(
139 + height: 40,
140 + width: 44,
141 + color: Theme.of(context).colorScheme.errorContainer,
142 + child: Center(
143 + child: Image.asset(
144 + 'assets/images/trash.png',
145 + height: 16,
146 + width: 16,
147 + color: Theme.of(context).colorScheme.onErrorContainer,
148 ),
149 ),
143 - GestureDetector(
144 - onTap: onRemove,
145 - child: Container(
146 - height: 40,
147 - width: 44,
148 - color: Palette.darkRed,
149 - child: Center(
150 - child: trash,
151 - ),
152 - ),
153 - )
154 - ],
150 + ),
151 )
156 - )
152 + ],
153 + ),
154 + ),
155 );
156
157 return isRemovable ? removableTile : tile;
lib/src/widgets/text_info_box.dart
+16 -17
@@ -1,4 +1,3 @@
1 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
1 import 'package:flutter/material.dart';
2
3 class TextInfoBox extends StatelessWidget {
@@ -15,7 +14,7 @@ class TextInfoBox extends StatelessWidget {
14 padding: const EdgeInsets.all(12),
15 decoration: BoxDecoration(
16 borderRadius: BorderRadius.circular(8),
18 - color: Theme.of(context).cardColor,
17 + color: Theme.of(context).colorScheme.surfaceContainer,
18 ),
19 child: Column(
20 crossAxisAlignment: CrossAxisAlignment.start,
@@ -23,27 +22,27 @@ class TextInfoBox extends StatelessWidget {
22 Row(
23 mainAxisAlignment: MainAxisAlignment.spaceBetween,
24 children: [
26 - Text(title,
27 - style: TextStyle(
28 - fontSize: 14,
25 + Text(
26 + title,
27 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
28 fontWeight: FontWeight.w500,
30 - color: Theme.of(context)
31 - .extension<CakeTextTheme>()!
32 - .buttonTextColor
33 - .withOpacity(0.5))),
29 + color: Theme.of(context).colorScheme.onSurface.withOpacity(0.5),
30 + ),
31 + ),
32 GestureDetector(
35 - onTap: onCopy != null ? () => onCopy!(context) : null,
36 - child: Icon(Icons.copy,
37 - size: 13,
38 - color: Theme.of(context).textTheme.bodyLarge?.color?.withOpacity(0.7))),
33 + onTap: onCopy != null ? () => onCopy!(context) : null,
34 + child: Icon(Icons.copy, size: 13, color: Theme.of(context).colorScheme.onSurface),
35 + ),
36 ],
37 ),
38 const SizedBox(height: 4),
42 - Text(value,
43 - style: TextStyle(
44 - fontSize: 16,
39 + Text(
40 + value,
41 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
42 fontWeight: FontWeight.w500,
46 - color: Theme.of(context).extension<CakeTextTheme>()!.buttonTextColor)),
43 + color: Theme.of(context).colorScheme.onSurface,
44 + ),
45 + ),
46 ],
47 ),
48 );
lib/src/widgets/trail_button.dart
+12 -16
@@ -1,12 +1,7 @@
1 -import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart';
1 import 'package:flutter/material.dart';
3 -import 'package:cake_wallet/palette.dart';
2
3 class TrailButton extends StatelessWidget {
6 - TrailButton({
7 - required this.caption,
8 - required this.onPressed,
9 - this.textColor});
4 + TrailButton({required this.caption, required this.onPressed, this.textColor});
5
6 final String caption;
7 final VoidCallback onPressed;
@@ -19,17 +14,18 @@ class TrailButton extends StatelessWidget {
14 highlightColor: Colors.transparent,
15 splashColor: Colors.transparent,
16 child: TextButton(
22 - // FIX-ME: ignored padding
23 - //padding: EdgeInsets.all(0),
24 - child: Text(
25 - caption,
26 - style: TextStyle(
27 - color: textColor ??
28 - Theme.of(context).extension<ExchangePageTheme>()!.hintTextColor,
17 + // FIX-ME: ignored padding
18 + //padding: EdgeInsets.all(0),
19 + child: Text(
20 + caption,
21 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
22 fontWeight: FontWeight.w600,
30 - fontSize: 14),
31 - ),
32 - onPressed: onPressed),
23 + color: textColor ?? Theme.of(context).colorScheme.primary,
24 + height: 1.8,
25 + ),
26 + ),
27 + onPressed: onPressed,
28 + ),
29 );
30 }
31 }
lib/src/widgets/validable_annotated_editable_text.dart
+68 -47
@@ -41,39 +41,42 @@ class ValidatableAnnotatedEditableText extends EditableText {
41 required this.words,
42 this.normalizeSeed = false,
43 TextStyle textStyle = const TextStyle(
44 - color: Colors.black,
45 - backgroundColor: Colors.transparent,
46 - fontWeight: FontWeight.normal,
47 - fontSize: 16),
44 + color: Colors.black,
45 + backgroundColor: Colors.transparent,
46 + fontWeight: FontWeight.normal,
47 + fontSize: 16,
48 + ),
49 TextSelectionControls? selectionControls,
50 Color? selectionColor,
51 ValueChanged<String>? onChanged,
52 ValueChanged<String>? onSubmitted,
53 }) : super(
53 - maxLines: null,
54 - key: key,
55 - focusNode: focusNode,
56 - controller: controller,
57 - cursorColor: cursorColor,
58 - style: validStyle,
59 - keyboardType: TextInputType.visiblePassword,
60 - autocorrect: false,
61 - autofocus: false,
62 - selectionColor: selectionColor,
63 - selectionControls: selectionControls,
64 - backgroundCursorColor: backgroundCursorColor,
65 - onChanged: onChanged,
66 - onSubmitted: onSubmitted,
67 - toolbarOptions: const ToolbarOptions(
68 - copy: true,
69 - cut: true,
70 - paste: true,
71 - selectAll: true,
72 - ),
73 - enableSuggestions: false,
74 - enableInteractiveSelection: true,
75 - showSelectionHandles: true,
76 - showCursor: true);
54 + maxLines: null,
55 + key: key,
56 + focusNode: focusNode,
57 + controller: controller,
58 + cursorColor: cursorColor,
59 + style: validStyle,
60 + keyboardType: TextInputType.visiblePassword,
61 + autocorrect: false,
62 + autofocus: false,
63 + selectionColor: selectionColor,
64 + selectionControls: selectionControls,
65 + backgroundCursorColor: backgroundCursorColor,
66 + onChanged: onChanged,
67 + onSubmitted: onSubmitted,
68 +
69 + toolbarOptions: const ToolbarOptions(
70 + copy: true,
71 + cut: true,
72 + paste: true,
73 + selectAll: true,
74 + ),
75 + enableSuggestions: false,
76 + enableInteractiveSelection: true,
77 + showSelectionHandles: true,
78 + showCursor: true,
79 + );
80
81 final bool normalizeSeed;
82 final List<String> words;
@@ -81,14 +84,12 @@ class ValidatableAnnotatedEditableText extends EditableText {
84 final TextStyle invalidStyle;
85
86 @override
84 - ValidatableAnnotatedEditableTextState createState() =>
85 - ValidatableAnnotatedEditableTextState();
87 + ValidatableAnnotatedEditableTextState createState() => ValidatableAnnotatedEditableTextState();
88 }
89
90 class ValidatableAnnotatedEditableTextState extends EditableTextState {
91 @override
90 - ValidatableAnnotatedEditableText get widget =>
91 - super.widget as ValidatableAnnotatedEditableText;
92 + ValidatableAnnotatedEditableText get widget => super.widget as ValidatableAnnotatedEditableText;
93
94 List<Annotation> getRanges() {
95 final result = <Annotation>[];
@@ -100,9 +101,12 @@ class ValidatableAnnotatedEditableTextState extends EditableTextState {
101 final ranges = range(word, text);
102 final isValid = validate(word);
103
103 - return ranges.map((range) => Annotation(
104 + return ranges.map(
105 + (range) => Annotation(
106 style: isValid ? widget.validStyle : widget.invalidStyle,
105 - range: range));
107 + range: range,
108 + ),
109 + );
110 })
111 .expand((e) => e)
112 .toList();
@@ -114,14 +118,20 @@ class ValidatableAnnotatedEditableTextState extends EditableTextState {
118
119 if (prev == null) {
120 annotation = Annotation(
117 - range: TextRange(start: 0, end: item.range.start),
118 - style: TextStyle(
119 - color: Colors.black, backgroundColor: Colors.transparent));
121 + range: TextRange(start: 0, end: item.range.start),
122 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
123 + color: Theme.of(context).colorScheme.onSurfaceVariant,
124 + backgroundColor: Colors.transparent,
125 + ),
126 + );
127 } else if (prev.range.end < item.range.start) {
128 annotation = Annotation(
122 - range: TextRange(start: prev.range.end, end: item.range.start),
123 - style: TextStyle(
124 - color: Colors.red, backgroundColor: Colors.transparent));
129 + range: TextRange(start: prev.range.end, end: item.range.start),
130 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
131 + color: Theme.of(context).colorScheme.onError,
132 + backgroundColor: Colors.transparent,
133 + ),
134 + );
135 }
136
137 if (annotation != null) {
@@ -132,9 +142,15 @@ class ValidatableAnnotatedEditableTextState extends EditableTextState {
142 }
143
144 if (result.length > 0 && result.last.range.end < text.length) {
135 - result.add(Annotation(
145 + result.add(
146 + Annotation(
147 range: TextRange(start: result.last.range.end, end: text.length),
137 - style: TextStyle(backgroundColor: Colors.transparent)));
148 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
149 + color: Theme.of(context).colorScheme.onSurfaceVariant,
150 + backgroundColor: Colors.transparent,
151 + ),
152 + ),
153 + );
154 }
155
156 return result;
@@ -168,11 +184,16 @@ class ValidatableAnnotatedEditableTextState extends EditableTextState {
184
185 if (ranges.isNotEmpty) {
186 return TextSpan(
171 - style: widget.style,
172 - children: ranges
173 - .map((item) => TextSpan(
174 - style: item.style, text: item.range.textInside(text)))
175 - .toList());
187 + style: widget.style,
188 + children: ranges
189 + .map(
190 + (item) => TextSpan(
191 + style: item.style,
192 + text: item.range.textInside(text),
193 + ),
194 + )
195 + .toList(),
196 + );
197 }
198
199 return TextSpan(style: widget.style, text: text);
lib/src/widgets/vulnerable_seeds_popup.dart
+8 -12
@@ -1,6 +1,5 @@
1 import 'package:cake_wallet/src/widgets/alert_background.dart';
2 import 'package:cake_wallet/src/widgets/alert_close_button.dart';
3 -import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
3 import 'package:flutter/material.dart';
4
5 class VulnerableSeedsPopup extends StatelessWidget {
@@ -23,10 +22,8 @@ class VulnerableSeedsPopup extends StatelessWidget {
22 decoration: BoxDecoration(
23 borderRadius: BorderRadius.circular(30.0),
24 gradient: LinearGradient(colors: [
26 - Theme.of(context).extension<DashboardPageTheme>()!.firstGradientBackgroundColor,
27 - Theme.of(context)
28 - .extension<DashboardPageTheme>()!
29 - .secondGradientBackgroundColor,
25 + Theme.of(context).colorScheme.primaryContainer,
26 + Theme.of(context).colorScheme.secondaryContainer,
27 ], begin: Alignment.centerLeft, end: Alignment.centerRight)),
28 child: Padding(
29 padding: const EdgeInsets.symmetric(horizontal: 24.0),
@@ -38,12 +35,12 @@ class VulnerableSeedsPopup extends StatelessWidget {
35 child: Container(
36 alignment: Alignment.bottomCenter,
37 child: DefaultTextStyle(
41 - style: TextStyle(
38 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
39 decoration: TextDecoration.none,
40 fontSize: 24.0,
41 fontWeight: FontWeight.bold,
45 - fontFamily: 'Lato',
46 - color: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
42 +
43 + color: Theme.of(context).colorScheme.onSurface,
44 ),
45 child: Text("Emergency Notice"),
46 ),
@@ -63,13 +60,12 @@ class VulnerableSeedsPopup extends StatelessWidget {
60 ),
61 child: Text(
62 "Your Bitcoin wallet(s) below use a legacy seed format that is vulnerable, which MAY result in you losing money from these wallet(s) if no action is taken.\nWe recommend that you IMMEDIATELY create wallet(s) in Cake Wallet and immediately transfer the funds to these wallet(s).\nVulnerable wallet name(s):\n\n[${affectedWalletNames.join(", ")}]\n\nFor assistance, please use the in-app support or email support@cakewallet.com",
66 - style: TextStyle(
63 + style: Theme.of(context).textTheme.bodyMedium!.copyWith(
64 decoration: TextDecoration.none,
65 fontSize: 16.0,
69 - fontFamily: 'Lato',
66 +
67 color: Theme.of(context)
71 - .extension<DashboardPageTheme>()!
72 - .textColor,
68 + .colorScheme.onSurface,
69 ),
70 ),
71 )
lib/src/widgets/warning_box_widget.dart
+20 -22
@@ -1,47 +1,45 @@
1 -import 'package:cake_wallet/themes/theme_base.dart';
1 +import 'package:cake_wallet/themes/core/material_base_theme.dart';
2 +import 'package:cake_wallet/themes/utils/custom_theme_colors.dart';
3 import 'package:flutter/material.dart';
4
5 class WarningBox extends StatelessWidget {
5 - const WarningBox({required this.content, required this.currentTheme, Key? key})
6 - : super(key: key);
6 + const WarningBox({required this.content, required this.currentTheme, Key? key}) : super(key: key);
7
8 final String content;
9 - final ThemeBase currentTheme;
9 + final MaterialThemeBase currentTheme;
10
11 @override
12 Widget build(BuildContext context) {
13 return Container(
14 padding: EdgeInsets.symmetric(horizontal: 12, vertical: 8),
15 decoration: BoxDecoration(
16 - color: currentTheme.type == ThemeType.dark
17 - ? Color.fromRGBO(132, 110, 64, 1)
18 - : Color.fromRGBO(194, 165, 94, 1),
19 - borderRadius: BorderRadius.all(Radius.circular(12)),
20 - border: Border.all(
21 - color: currentTheme.type == ThemeType.dark
22 - ? Color.fromRGBO(177, 147, 41, 1)
23 - : Color.fromRGBO(125, 122, 15, 1),
24 - width: 2.0,
25 - )),
16 + color: currentTheme.isDark
17 + ? CustomThemeColors.warningContainerColorDark
18 + : CustomThemeColors.warningContainerColorLight,
19 + borderRadius: BorderRadius.all(Radius.circular(12)),
20 + border: Border.all(
21 + color: currentTheme.isDark
22 + ? CustomThemeColors.warningOutlineColorDark
23 + : CustomThemeColors.warningOutlineColorLight,
24 + width: 2.0,
25 + ),
26 + ),
27 child: Row(
28 children: [
29 Icon(
30 Icons.warning_amber_rounded,
31 size: 64,
31 - color: Colors.white.withOpacity(0.75),
32 + color: Theme.of(context).colorScheme.onSurface,
33 ),
34 SizedBox(width: 6),
35 Expanded(
36 child: Text(
37 content,
38 textAlign: TextAlign.center,
38 - style: TextStyle(
39 - fontSize: 12,
40 - fontWeight: FontWeight.w800,
41 - color: currentTheme.type == ThemeType.dark
42 - ? Colors.white.withOpacity(0.75)
43 - : Colors.white.withOpacity(0.85),
44 - ),
39 + style: Theme.of(context).textTheme.bodySmall?.copyWith(
40 + fontWeight: FontWeight.w800,
41 + color: Theme.of(context).colorScheme.onSurface,
42 + ),
43 ),
44 ),
45 ],
lib/store/app_store.dart
+5 -1
@@ -3,6 +3,7 @@ import 'package:cake_wallet/di.dart';
3 import 'package:cake_wallet/entities/preferences_key.dart';
4 import 'package:cake_wallet/reactions/wallet_connect.dart';
5 import 'package:cake_wallet/src/screens/wallet_connect/services/walletkit_service.dart';
6 +import 'package:cake_wallet/themes/core/theme_store.dart';
7 import 'package:cake_wallet/utils/exception_handler.dart';
8 import 'package:cw_core/transaction_info.dart';
9 import 'package:cw_core/wallet_type.dart';
@@ -25,7 +26,8 @@ abstract class AppStoreBase with Store {
26 {required this.authenticationStore,
27 required this.walletList,
28 required this.settingsStore,
28 - required this.nodeListStore});
29 + required this.nodeListStore,
30 + required this.themeStore});
31
32 AuthenticationStore authenticationStore;
33
@@ -38,6 +40,8 @@ abstract class AppStoreBase with Store {
40
41 NodeListStore nodeListStore;
42
43 + ThemeStore themeStore;
44 +
45 @action
46 Future<void> changeCurrentWallet(
47 WalletBase<Balance, TransactionHistoryBase<TransactionInfo>, TransactionInfo> wallet) async {
lib/store/settings_store.dart
+3 -31
@@ -26,15 +26,12 @@ import 'package:cake_wallet/entities/seed_type.dart';
26 import 'package:cake_wallet/entities/sort_balance_types.dart';
27 import 'package:cake_wallet/entities/wallet_list_order_types.dart';
28 import 'package:cake_wallet/ethereum/ethereum.dart';
29 -import 'package:cake_wallet/wallet_type_utils.dart';
29 import 'package:cake_wallet/wownero/wownero.dart';
30 import 'package:cake_wallet/zano/zano.dart';
31 import 'package:cw_core/transaction_priority.dart';
32 import 'package:cake_wallet/exchange/provider/trocador_exchange_provider.dart';
33 import 'package:cake_wallet/monero/monero.dart';
34 import 'package:cake_wallet/polygon/polygon.dart';
36 -import 'package:cake_wallet/themes/theme_base.dart';
37 -import 'package:cake_wallet/themes/theme_list.dart';
35 import 'package:cake_wallet/utils/device_info.dart';
36 import 'package:cake_wallet/utils/package_info.dart';
37 import 'package:cake_wallet/view_model/settings/sync_mode.dart';
@@ -43,7 +40,6 @@ import 'package:cw_core/set_app_secure_native.dart';
40 import 'package:cw_core/utils/print_verbose.dart';
41 import 'package:cw_core/wallet_type.dart';
42 import 'package:device_info_plus/device_info_plus.dart';
46 -import 'package:flutter/material.dart';
43 import 'package:flutter_daemon/flutter_daemon.dart';
44 import 'package:hive/hive.dart';
45 import 'package:mobx/mobx.dart';
@@ -79,7 +75,6 @@ abstract class SettingsStoreBase with Store {
75 required bool initialUseTOTP2FA,
76 required int initialFailedTokenTrial,
77 required ExchangeApiMode initialExchangeStatus,
82 - required ThemeBase initialTheme,
78 required int initialPinLength,
79 required String initialLanguageCode,
80 required SyncMode initialSyncMode,
@@ -169,7 +164,6 @@ abstract class SettingsStoreBase with Store {
164 shouldShowMarketPlaceInDashboard = initialShouldShowMarketPlaceInDashboard,
165 showAddressBookPopupEnabled = initialShowAddressBookPopupEnabled,
166 exchangeStatus = initialExchangeStatus,
172 - currentTheme = initialTheme,
167 pinCodeLength = initialPinLength,
168 languageCode = initialLanguageCode,
169 shouldRequireTOTP2FAForAccessingWallet = initialShouldRequireTOTP2FAForAccessingWallet,
@@ -363,9 +357,6 @@ abstract class SettingsStoreBase with Store {
357 (FiatApiMode mode) =>
358 sharedPreferences.setInt(PreferencesKey.currentFiatApiModeKey, mode.serialize()));
359
366 - reaction((_) => currentTheme,
367 - (ThemeBase theme) => sharedPreferences.setInt(PreferencesKey.currentTheme, theme.raw));
368 -
360 reaction(
361 (_) => numberOfFailedTokenTrials,
362 (int failedTokenTrail) =>
@@ -622,6 +613,8 @@ abstract class SettingsStoreBase with Store {
613 _saveCurrentPowNode(change.newValue!, change.key!);
614 }
615 });
616 +
617 +
618 }
619
620 static const defaultPinLength = 4;
@@ -742,9 +735,6 @@ abstract class SettingsStoreBase with Store {
735 @observable
736 ExchangeApiMode exchangeStatus;
737
745 - @observable
746 - ThemeBase currentTheme;
747 -
738 @observable
739 int pinCodeLength;
740
@@ -754,9 +744,6 @@ abstract class SettingsStoreBase with Store {
744 @observable
745 SeedPhraseLength seedPhraseLength;
746
757 - @computed
758 - ThemeData get theme => currentTheme.themeData;
759 -
747 @observable
748 String languageCode;
749
@@ -893,8 +880,7 @@ abstract class SettingsStoreBase with Store {
880 required Box<Node> powNodeSource,
881 required bool isBitcoinBuyEnabled,
882 FiatCurrency initialFiatCurrency = FiatCurrency.usd,
896 - BalanceDisplayMode initialBalanceDisplayMode = BalanceDisplayMode.availableBalance,
897 - ThemeBase? initialTheme}) async {
883 + BalanceDisplayMode initialBalanceDisplayMode = BalanceDisplayMode.availableBalance}) async {
884 final sharedPreferences = await getIt.getAsync<SharedPreferences>();
885 final secureStorage = await getIt.get<SecureStorage>();
886 final currentFiatCurrency = FiatCurrency.deserialize(
@@ -990,16 +976,6 @@ abstract class SettingsStoreBase with Store {
976 final exchangeStatus = ExchangeApiMode.deserialize(
977 raw: sharedPreferences.getInt(PreferencesKey.exchangeStatusKey) ??
978 ExchangeApiMode.enabled.raw);
993 - final bool isNewInstall = sharedPreferences.getBool(PreferencesKey.isNewInstall) ?? true;
994 - final int defaultTheme;
995 - if (isNewInstall) {
996 - defaultTheme = isMoneroOnly ? ThemeList.moneroDarkTheme.raw : ThemeList.brightTheme.raw;
997 - } else {
998 - defaultTheme = ThemeType.bright.index;
999 - }
1000 - final savedTheme = initialTheme ??
1001 - ThemeList.deserialize(
1002 - raw: sharedPreferences.getInt(PreferencesKey.currentTheme) ?? defaultTheme);
979 final actionListDisplayMode = ObservableList<ActionListDisplayMode>();
980 actionListDisplayMode.addAll(deserializeActionlistDisplayModes(
981 sharedPreferences.getInt(PreferencesKey.displayActionListModeKey) ?? defaultActionsMode));
@@ -1309,7 +1285,6 @@ abstract class SettingsStoreBase with Store {
1285 initialTotpSecretKey: totpSecretKey,
1286 initialFailedTokenTrial: tokenTrialNumber,
1287 initialExchangeStatus: exchangeStatus,
1312 - initialTheme: savedTheme,
1288 actionlistDisplayMode: actionListDisplayMode,
1289 initialPinLength: pinLength,
1290 pinTimeOutDuration: pinCodeTimeOutDuration,
@@ -1478,9 +1453,6 @@ abstract class SettingsStoreBase with Store {
1453 exchangeStatus = ExchangeApiMode.deserialize(
1454 raw: sharedPreferences.getInt(PreferencesKey.exchangeStatusKey) ??
1455 ExchangeApiMode.enabled.raw);
1481 - currentTheme = ThemeList.deserialize(
1482 - raw: sharedPreferences.getInt(PreferencesKey.currentTheme) ??
1483 - (isMoneroOnly ? ThemeList.moneroDarkTheme.raw : ThemeList.brightTheme.raw));
1456 actionlistDisplayMode = ObservableList<ActionListDisplayMode>();
1457 actionlistDisplayMode.addAll(deserializeActionlistDisplayModes(
1458 sharedPreferences.getInt(PreferencesKey.displayActionListModeKey) ?? defaultActionsMode));
lib/themes/README.md new
+82
@@ -0,0 +1,82 @@
1 +# Material 3 Theming System
2 +
3 +This directory contains the Material 3 (M3) theming implementation for Cake Wallet. The theming system is now fully based on Material 3 color tokens and patterns, with all custom theme extensions removed for simplicity, maintainability, and compliance with Material Design 3 guidelines.
4 +
5 +## Directory Structure
6 +
7 +```
8 +lib/themes/
9 +├── core/ # Theme state management and base theme logic
10 +├── theme_classes/ # Light and dark theme data definitions
11 +├── extensions/ # (Optional) Theme extensions for specific widgets/pages
12 +├── utils/ # Utilities for theme management
13 +└── README.md # This file
14 +```
15 +
16 +## Key Features
17 +
18 +- Material 3 color system with semantic color tokens
19 +- Dynamic color support (when available)
20 +- MobX-based state management
21 +- Simplified theme management
22 +- Consistent design language across the app
23 +
24 +## Usage
25 +
26 +### Accessing Theme Colors
27 +
28 +```dart
29 +final colorScheme = Theme.of(context).colorScheme;
30 +final primaryColor = colorScheme.primary;
31 +final onSurfaceVariant = colorScheme.onSurfaceVariant;
32 +```
33 +
34 +### Available Color Tokens
35 +
36 +Material 3 provides a comprehensive set of semantic color tokens that adapt to light/dark themes:
37 +
38 +- `primary` / `onPrimary`
39 +- `secondary` / `onSecondary`
40 +- `tertiary` / `onTertiary`
41 +- `error` / `onError`
42 +- `background` / `onBackground`
43 +- `surface` / `onSurface`
44 +- `surfaceVariant` / `onSurfaceVariant`
45 +- `outline`, `outlineVariant`
46 +- ...and more (see Flutter's ColorScheme)
47 +
48 +### Theme Management
49 +
50 +Theme mode state (light/dark/system) and switching is handled via MobX stores in `core/`. Use the provided store to get/set the current theme mode and listen for changes.
51 +
52 +```dart
53 +// Example: Getting the current theme mode
54 +final themeStore = ... // Obtain from provider or context
55 +final isDark = themeStore.isDark;
56 +
57 +// Example: Switching theme mode
58 +await themeStore.setThemeMode(ThemeMode.dark);
59 +```
60 +
61 +## Best Practices
62 +
63 +1. **Always use semantic color tokens** from `ColorScheme` instead of hardcoded colors.
64 +2. **Leverage Material 3 components** wherever possible for consistency and accessibility.
65 +3. **Use the MobX theme store** for all theme-related state and switching.
66 +4. **Test in both light and dark modes** to ensure good contrast and appearance.
67 +5. **Keep any theme extensions minimal and focused** (if used at all).
68 +6. **Do not reintroduce custom theme extensions** unless absolutely necessary and not covered by Material 3.
69 +
70 +## Adding or Modifying Themes
71 +
72 +- To update theme colors, edit the files in `theme_classes/` (e.g., `light_theme.dart`, `dark_theme.dart`).
73 +- To add a new theme variant, create a new file in `theme_classes/` and update the MobX store in `core/` to support it.
74 +- For widget-specific theming, prefer using Material 3's built-in tokens. Only use a theme extension if there is no Material 3 equivalent.
75 +
76 +## Contributing
77 +
78 +- Follow Material 3 color system and accessibility guidelines.
79 +- Ensure proper contrast ratios for accessibility.
80 +- Test all changes in both light and dark modes.
81 +- Update this documentation if you add new color tokens or theme variants.
82 +- Keep theme files organized and focused.
\ No newline at end of file
lib/themes/bitcoin_dark_theme.dart deleted
-14
@@ -1,14 +0,0 @@
1 -import 'package:cake_wallet/generated/i18n.dart';
2 -import 'package:cake_wallet/palette.dart';
3 -import 'package:cake_wallet/themes/monero_dark_theme.dart';
4 -import 'package:flutter/material.dart';
5 -
6 -class BitcoinDarkTheme extends MoneroDarkTheme {
7 - BitcoinDarkTheme({required int raw}) : super(raw: raw);
8 -
9 - @override
10 - String get title => S.current.bitcoin_dark_theme;
11 - @override
12 - Color get primaryColor => Palette.bitcoinOrange;
13 -}
14 -
lib/themes/bitcoin_light_theme.dart deleted
-13
@@ -1,13 +0,0 @@
1 -import 'package:cake_wallet/generated/i18n.dart';
2 -import 'package:cake_wallet/palette.dart';
3 -import 'package:cake_wallet/themes/monero_light_theme.dart';
4 -import 'package:flutter/material.dart';
5 -
6 -class BitcoinLightTheme extends MoneroLightTheme {
7 - BitcoinLightTheme({required int raw}) : super(raw: raw);
8 -
9 - @override
10 - String get title => S.current.bitcoin_light_theme;
11 - @override
12 - Color get primaryColor => Palette.bitcoinOrange;
13 -}
lib/themes/bright_theme.dart deleted
-126
@@ -1,126 +0,0 @@
1 -import 'package:cake_wallet/themes/extensions/balance_page_theme.dart';
2 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
3 -import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
4 -import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart';
5 -import 'package:cake_wallet/themes/extensions/filter_theme.dart';
6 -import 'package:cake_wallet/themes/extensions/indicator_dot_theme.dart';
7 -import 'package:cake_wallet/themes/extensions/menu_theme.dart';
8 -import 'package:cake_wallet/themes/extensions/new_wallet_theme.dart';
9 -import 'package:cake_wallet/themes/extensions/order_theme.dart';
10 -import 'package:cake_wallet/themes/extensions/placeholder_theme.dart';
11 -import 'package:cake_wallet/themes/extensions/qr_code_theme.dart';
12 -import 'package:cake_wallet/themes/extensions/receive_page_theme.dart';
13 -import 'package:cake_wallet/themes/extensions/send_page_theme.dart';
14 -import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart';
15 -import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart';
16 -import 'package:cake_wallet/themes/extensions/wallet_list_theme.dart';
17 -import 'package:cake_wallet/themes/light_theme.dart';
18 -import 'package:cake_wallet/themes/theme_base.dart';
19 -import 'package:cake_wallet/generated/i18n.dart';
20 -import 'package:cake_wallet/palette.dart';
21 -import 'package:flutter/material.dart';
22 -
23 -class BrightTheme extends LightTheme {
24 - BrightTheme({required int raw}) : super(raw: raw);
25 -
26 - @override
27 - String get title => S.current.bright_theme;
28 - @override
29 - ThemeType get type => ThemeType.bright;
30 - @override
31 - Color get primaryColor => Palette.moderateSlateBlue;
32 - @override
33 - Color get containerColor => Palette.moderateLavender;
34 -
35 - @override
36 - DashboardPageTheme get dashboardPageTheme =>
37 - super.dashboardPageTheme.copyWith(
38 - firstGradientBackgroundColor: Palette.blueCraiola,
39 - secondGradientBackgroundColor: Palette.pinkFlamingo,
40 - thirdGradientBackgroundColor: Palette.redHat,
41 - pageTitleTextColor: Colors.white,
42 - mainActionsIconColor: Colors.white,
43 - textColor: Colors.white,
44 - cardTextColor: Colors.white,
45 - indicatorDotTheme: IndicatorDotTheme(
46 - indicatorColor: Colors.white.withOpacity(0.5),
47 - activeIndicatorColor: Colors.white));
48 -
49 - @override
50 - SyncIndicatorTheme get syncIndicatorStyle =>
51 - super.syncIndicatorStyle.copyWith(
52 - textColor: Colors.white,
53 - syncedBackgroundColor: Colors.white.withOpacity(0.2),
54 - notSyncedBackgroundColor: Colors.white.withOpacity(0.15));
55 -
56 - @override
57 - ExchangePageTheme get exchangePageTheme => super.exchangePageTheme.copyWith(
58 - secondGradientBottomPanelColor: Palette.pinkFlamingo.withOpacity(0.7),
59 - firstGradientBottomPanelColor: Palette.blueCraiola.withOpacity(0.7),
60 - secondGradientTopPanelColor: Palette.pinkFlamingo,
61 - firstGradientTopPanelColor: Palette.blueCraiola);
62 -
63 - @override
64 - NewWalletTheme get newWalletTheme => super.newWalletTheme.copyWith(
65 - hintTextColor: Palette.darkGray,
66 - underlineColor: Palette.periwinkleCraiola);
67 -
68 - @override
69 - BalancePageTheme get balancePageTheme => super
70 - .balancePageTheme
71 - .copyWith(labelTextColor: Colors.white.withOpacity(0.5));
72 -
73 - @override
74 - CakeMenuTheme get menuTheme =>
75 - super.menuTheme.copyWith(headerSecondGradientColor: Palette.pinkFlamingo);
76 -
77 - @override
78 - FilterTheme get filterTheme => super.filterTheme.copyWith(
79 - checkboxSecondGradientColor: Palette.pinkFlamingo,
80 - checkboxBackgroundColor: Colors.white,
81 - buttonColor: Palette.darkGray.withOpacity(0.2),
82 - iconColor: Colors.white);
83 -
84 - @override
85 - WalletListTheme get walletListTheme => super.walletListTheme.copyWith(
86 - createNewWalletButtonBackgroundColor: Palette.moderateSlateBlue);
87 -
88 - @override
89 - OrderTheme get orderTheme => OrderTheme(iconColor: Colors.white);
90 -
91 - @override
92 - SendPageTheme get sendPageTheme => super.sendPageTheme.copyWith(
93 - templateBackgroundColor: Palette.shadowWhite,
94 - templateDottedBorderColor: Palette.shadowWhite,
95 - secondGradientColor: Palette.pinkFlamingo);
96 -
97 - @override
98 - PlaceholderTheme get placeholderTheme =>
99 - PlaceholderTheme(color: Colors.white.withOpacity(0.5));
100 -
101 - @override
102 - TransactionTradeTheme get transactionTradeTheme => super
103 - .transactionTradeTheme
104 - .copyWith(rowsColor: Colors.white.withOpacity(0.2));
105 -
106 - @override
107 - ReceivePageTheme get receivePageTheme => super.receivePageTheme.copyWith(
108 - currentTileBackgroundColor: Palette.moderateSlateBlue,
109 - tilesBackgroundColor: Colors.white,
110 - iconsBackgroundColor: Palette.lavender,
111 - amountBottomBorderColor: Colors.white.withOpacity(0.5),
112 - amountHintTextColor: Colors.white,
113 - );
114 -
115 - @override
116 - QRCodeTheme get qrCodeTheme => super
117 - .qrCodeTheme
118 - .copyWith(qrWidgetCopyButtonColor: Colors.white.withOpacity(0.4));
119 -
120 - @override
121 - CakeTextTheme get cakeTextTheme => super.cakeTextTheme.copyWith(
122 - buttonSecondaryTextColor: super.cakeTextTheme.secondaryTextColor,
123 - buttonTextColor: super.cakeTextTheme.titleColor,
124 - addressButtonBorderColor: Colors.white.withOpacity(0.4),
125 - dateSectionRowColor: Colors.white.withOpacity(0.5));
126 -}
lib/themes/cake_dark_theme.dart deleted
-24
@@ -1,24 +0,0 @@
1 -import 'package:cake_wallet/generated/i18n.dart';
2 -import 'package:cake_wallet/palette.dart';
3 -import 'package:cake_wallet/themes/monero_dark_theme.dart';
4 -import 'package:flutter/material.dart';
5 -import 'package:cake_wallet/themes/extensions/menu_theme.dart';
6 -
7 -class CakeDarkTheme extends MoneroDarkTheme {
8 - CakeDarkTheme({required int raw}) : super(raw: raw);
9 -
10 - @override
11 - String get title => S.current.cake_dark_theme;
12 - @override
13 - Color get primaryColor => PaletteDark.cakeBlue;
14 -
15 - @override
16 - CakeMenuTheme get menuTheme => super.menuTheme.copyWith(
17 - headerFirstGradientColor: PaletteDark.darkBlue,
18 - headerSecondGradientColor: containerColor,
19 - backgroundColor: containerColor,
20 - subnameTextColor: Colors.grey,
21 - dividerColor: colorScheme.secondaryContainer,
22 - iconColor: Colors.white,
23 - settingActionsIconColor: colorScheme.secondaryContainer);
24 -}
\ No newline at end of file
lib/themes/core/material_base_theme.dart new
+35
@@ -0,0 +1,35 @@
1 +import 'package:flutter/material.dart';
2 +
3 +enum ThemeType { light, dark }
4 +
5 +/// Abstract base class for theme data in the app.
6 +/// This class defines the contract that all theme implementations must follow.
7 +abstract class MaterialThemeBase {
8 + int get raw;
9 +
10 + String get title;
11 +
12 + ThemeMode get themeMode;
13 +
14 + ThemeType get type;
15 +
16 + Color get errorColor;
17 +
18 + Color get surfaceColor;
19 +
20 + Color get primaryColor;
21 +
22 + Color get secondaryColor;
23 +
24 + Brightness get brightness;
25 +
26 + ColorScheme get colorScheme;
27 +
28 + Color get tertiaryColor;
29 +
30 + TextTheme get textTheme;
31 +
32 + ThemeData get themeData;
33 +
34 + bool get isDark => brightness == Brightness.dark;
35 +}
lib/themes/core/theme_store.dart new
+160
@@ -0,0 +1,160 @@
1 +import 'package:cake_wallet/entities/preferences_key.dart';
2 +import 'package:cake_wallet/utils/device_info.dart';
3 +import 'package:cake_wallet/utils/responsive_layout_util.dart';
4 +import 'package:flutter/material.dart';
5 +import 'package:mobx/mobx.dart';
6 +import 'package:cake_wallet/themes/utils/theme_list.dart';
7 +import 'package:shared_preferences/shared_preferences.dart';
8 +
9 +import 'material_base_theme.dart';
10 +
11 +part 'theme_store.g.dart';
12 +
13 +/// MobX store for managing theme state
14 +class ThemeStore = ThemeStoreBase with _$ThemeStore;
15 +
16 +abstract class ThemeStoreBase with Store {
17 + @observable
18 + MaterialThemeBase _currentTheme = ThemeList.lightTheme;
19 +
20 + @observable
21 + ThemeMode _themeMode = ThemeMode.system;
22 +
23 + @computed
24 + MaterialThemeBase get currentTheme => _currentTheme;
25 +
26 + @computed
27 + ThemeMode get themeMode => _themeMode;
28 +
29 + @computed
30 + bool get isDarkMode => _currentTheme.isDark;
31 +
32 + late SharedPreferences sharedPreferences;
33 +
34 + @action
35 + Future<void> setTheme(MaterialThemeBase theme) async {
36 + if (_currentTheme == theme) return;
37 +
38 + _currentTheme = theme;
39 + await sharedPreferences.setInt(PreferencesKey.currentTheme, theme.raw);
40 + }
41 +
42 + @action
43 + Future<void> setThemeMode(ThemeMode mode, {bool shouldRefreshTheme = true}) async {
44 + if (_themeMode == mode) return;
45 +
46 + _themeMode = mode;
47 + await sharedPreferences.setString(PreferencesKey.themeMode, mode.toString());
48 +
49 + if (mode == ThemeMode.system && shouldRefreshTheme) {
50 + setTheme(getThemeFromSystem());
51 + }
52 + }
53 +
54 + /// Loads the saved theme preferences
55 + Future<void> loadThemePreferences() async {
56 + sharedPreferences = await SharedPreferences.getInstance();
57 +
58 + await _loadThemeMode();
59 + await _loadAndSetTheme();
60 +
61 + _setupThemeReaction();
62 + }
63 +
64 + /// Loads the saved theme mode from SharedPreferences
65 + Future<void> _loadThemeMode() async {
66 + final savedThemeMode = sharedPreferences.getString(PreferencesKey.themeMode);
67 + if (savedThemeMode != null) {
68 + _themeMode = ThemeMode.values.firstWhere(
69 + (mode) => mode.toString() == savedThemeMode,
70 + orElse: () => ThemeMode.system,
71 + );
72 + }
73 + }
74 +
75 + /// Loads and sets the appropriate theme based on platform and installation status
76 + Future<void> _loadAndSetTheme() async {
77 + final bool isNewInstall = sharedPreferences.getBool(PreferencesKey.isNewInstall) ?? true;
78 +
79 + bool shouldUseMobileTheme =
80 + responsiveLayoutUtil.shouldRenderMobileUI && DeviceInfo.instance.isMobile;
81 +
82 + if (shouldUseMobileTheme) {
83 + await _handleMobileTheme(isNewInstall);
84 + } else {
85 + await _handleNonMobileTheme();
86 + }
87 + }
88 +
89 + /// Handles theme loading for non-mobile platforms
90 + Future<void> _handleNonMobileTheme() async {
91 + await setTheme(ThemeList.darkTheme);
92 + await setThemeMode(ThemeMode.dark);
93 + }
94 +
95 + /// Handles theme loading for mobile platforms
96 + Future<void> _handleMobileTheme(bool isNewInstall) async {
97 + if (isNewInstall) {
98 + await _setSystemTheme();
99 + } else {
100 + await loadSavedTheme();
101 + }
102 + }
103 +
104 + /// Loads the saved theme from SharedPreferences
105 + Future<void> loadSavedTheme({bool isFromBackup = false}) async {
106 + try {
107 + final savedTheme = sharedPreferences.getInt(PreferencesKey.currentTheme);
108 + if (savedTheme == null) {
109 + await _setSystemTheme();
110 + return;
111 + }
112 +
113 + final theme = ThemeList.deserialize(raw: savedTheme);
114 +
115 + if (_currentTheme != theme) {
116 + await setTheme(theme);
117 + }
118 +
119 + final newThemeMode = _getThemeModeOnStartUp(theme, isFromBackup);
120 +
121 + if (_themeMode != newThemeMode) {
122 + await setThemeMode(newThemeMode, shouldRefreshTheme: false);
123 + }
124 + } catch (e) {
125 + await _setSystemTheme();
126 + }
127 + }
128 +
129 + Future<void> _setSystemTheme() async {
130 + final systemTheme = getThemeFromSystem();
131 +
132 + if (_currentTheme != systemTheme) {
133 + await setTheme(systemTheme);
134 + }
135 +
136 + if (_themeMode != ThemeMode.system) {
137 + await setThemeMode(ThemeMode.system);
138 + }
139 + }
140 +
141 + ThemeMode _getThemeModeOnStartUp(MaterialThemeBase theme, bool isFromBackup) {
142 + if (isFromBackup || _themeMode != ThemeMode.system) {
143 + return theme.isDark ? ThemeMode.dark : ThemeMode.light;
144 + }
145 +
146 + return ThemeMode.system;
147 + }
148 +
149 + void _setupThemeReaction() {
150 + reaction(
151 + (_) => currentTheme,
152 + (MaterialThemeBase theme) => sharedPreferences.setInt(PreferencesKey.currentTheme, theme.raw),
153 + );
154 + }
155 +
156 + MaterialThemeBase getThemeFromSystem() {
157 + final systemBrightness = WidgetsBinding.instance.window.platformBrightness;
158 + return systemBrightness == Brightness.dark ? ThemeList.darkTheme : ThemeList.lightTheme;
159 + }
160 +}
lib/themes/dark_theme.dart deleted
-232
@@ -1,232 +0,0 @@
1 -import 'package:cake_wallet/themes/extensions/account_list_theme.dart';
2 -import 'package:cake_wallet/themes/extensions/address_theme.dart';
3 -import 'package:cake_wallet/themes/extensions/alert_theme.dart';
4 -import 'package:cake_wallet/themes/extensions/balance_page_theme.dart';
5 -import 'package:cake_wallet/themes/extensions/cake_scrollbar_theme.dart';
6 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
7 -import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
8 -import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart';
9 -import 'package:cake_wallet/themes/extensions/filter_theme.dart';
10 -import 'package:cake_wallet/themes/extensions/indicator_dot_theme.dart';
11 -import 'package:cake_wallet/themes/extensions/info_theme.dart';
12 -import 'package:cake_wallet/themes/extensions/keyboard_theme.dart';
13 -import 'package:cake_wallet/themes/extensions/menu_theme.dart';
14 -import 'package:cake_wallet/themes/extensions/new_wallet_theme.dart';
15 -import 'package:cake_wallet/themes/extensions/option_tile_theme.dart';
16 -import 'package:cake_wallet/themes/extensions/order_theme.dart';
17 -import 'package:cake_wallet/themes/extensions/picker_theme.dart';
18 -import 'package:cake_wallet/themes/extensions/pin_code_theme.dart';
19 -import 'package:cake_wallet/themes/extensions/placeholder_theme.dart';
20 -import 'package:cake_wallet/themes/extensions/qr_code_theme.dart';
21 -import 'package:cake_wallet/themes/extensions/receive_page_theme.dart';
22 -import 'package:cake_wallet/themes/extensions/seed_widget_theme.dart';
23 -import 'package:cake_wallet/themes/extensions/send_page_theme.dart';
24 -import 'package:cake_wallet/themes/extensions/support_page_theme.dart';
25 -import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart';
26 -import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart';
27 -import 'package:cake_wallet/themes/extensions/wallet_list_theme.dart';
28 -import 'package:cake_wallet/themes/theme_base.dart';
29 -import 'package:cake_wallet/generated/i18n.dart';
30 -import 'package:cake_wallet/palette.dart';
31 -import 'package:flutter/material.dart';
32 -
33 -class DarkTheme extends ThemeBase {
34 - DarkTheme({required int raw}) : super(raw: raw);
35 -
36 - @override
37 - String get title => S.current.dark_theme;
38 - @override
39 - ThemeType get type => ThemeType.dark;
40 - @override
41 - Brightness get brightness => Brightness.dark;
42 - @override
43 - Color get backgroundColor => PaletteDark.backgroundColor;
44 - @override
45 - Color get primaryColor => Palette.blueCraiola;
46 - @override
47 - Color get primaryTextColor => Colors.white;
48 - @override
49 - Color get containerColor => PaletteDark.nightBlue;
50 - @override
51 - Color get dialogBackgroundColor => PaletteDark.darkNightBlue;
52 -
53 - @override
54 - CakeScrollbarTheme get scrollbarTheme => CakeScrollbarTheme(
55 - thumbColor: PaletteDark.wildBlueGrey, trackColor: PaletteDark.violetBlue);
56 -
57 - @override
58 - SyncIndicatorTheme get syncIndicatorStyle => SyncIndicatorTheme(
59 - textColor: PaletteDark.wildBlue,
60 - syncedBackgroundColor: PaletteDark.lightNightBlue,
61 - notSyncedIconColor: PaletteDark.orangeYellow,
62 - notSyncedBackgroundColor: PaletteDark.oceanBlue);
63 -
64 - @override
65 - KeyboardTheme get keyboardTheme =>
66 - KeyboardTheme(keyboardBarColor: PaletteDark.granite);
67 -
68 - @override
69 - PinCodeTheme get pinCodeTheme => PinCodeTheme(
70 - indicatorsColor: PaletteDark.indicatorVioletBlue,
71 - switchColor: PaletteDark.lightPurpleBlue);
72 -
73 - @override
74 - SupportPageTheme get supportPageTheme =>
75 - SupportPageTheme(iconColor: Colors.white);
76 -
77 - @override
78 - ExchangePageTheme get exchangePageTheme => ExchangePageTheme(
79 - hintTextColor: PaletteDark.lightBlueGrey,
80 - dividerCodeColor: PaletteDark.deepVioletBlue,
81 - qrCodeColor: primaryTextColor,
82 - buttonBackgroundColor: PaletteDark.deepVioletBlue,
83 - textFieldButtonColor: PaletteDark.moderateBlue,
84 - textFieldBorderBottomPanelColor: PaletteDark.moderateVioletBlue,
85 - textFieldBorderTopPanelColor: PaletteDark.blueGrey,
86 - secondGradientBottomPanelColor: PaletteDark.darkNightBlue,
87 - firstGradientBottomPanelColor: PaletteDark.darkNightBlue,
88 - secondGradientTopPanelColor: PaletteDark.wildVioletBlue,
89 - firstGradientTopPanelColor: PaletteDark.wildVioletBlue,
90 - receiveAmountColor: PaletteDark.darkCyanBlue);
91 -
92 - @override
93 - NewWalletTheme get newWalletTheme => NewWalletTheme(
94 - hintTextColor: PaletteDark.cyanBlue,
95 - underlineColor: PaletteDark.darkGrey);
96 -
97 - @override
98 - AddressTheme get addressTheme =>
99 - AddressTheme(actionButtonColor: PaletteDark.nightBlue);
100 -
101 - @override
102 - DashboardPageTheme get dashboardPageTheme =>
103 - super.dashboardPageTheme.copyWith(
104 - cardTextColor: super.dashboardPageTheme.textColor,
105 - indicatorDotTheme: IndicatorDotTheme(
106 - indicatorColor: PaletteDark.cyanBlue,
107 - activeIndicatorColor: Colors.white));
108 -
109 - @override
110 - BalancePageTheme get balancePageTheme => BalancePageTheme(
111 - textColor: dashboardPageTheme.textColor,
112 - labelTextColor: PaletteDark.cyanBlue);
113 -
114 - @override
115 - CakeMenuTheme get menuTheme => CakeMenuTheme(
116 - headerFirstGradientColor: PaletteDark.deepPurpleBlue,
117 - headerSecondGradientColor: PaletteDark.deepPurpleBlue,
118 - backgroundColor: PaletteDark.deepPurpleBlue,
119 - subnameTextColor: PaletteDark.darkCyanBlue,
120 - dividerColor: PaletteDark.darkOceanBlue,
121 - settingTitleColor: receivePageTheme.tilesTextColor,
122 - settingActionsIconColor: PaletteDark.pigeonBlue,
123 - iconColor: PaletteDark.darkCyanBlue);
124 -
125 - @override
126 - FilterTheme get filterTheme => FilterTheme(
127 - checkboxFirstGradientColor: PaletteDark.darkNightBlue,
128 - checkboxSecondGradientColor: PaletteDark.darkNightBlue,
129 - checkboxBoundsColor: PaletteDark.wildVioletBlue,
130 - checkboxBackgroundColor: PaletteDark.wildVioletBlue.withOpacity(0.3),
131 - titlesColor: Colors.white,
132 - buttonColor: PaletteDark.oceanBlue,
133 - iconColor: PaletteDark.wildBlue);
134 -
135 - @override
136 - WalletListTheme get walletListTheme => WalletListTheme(
137 - restoreWalletButtonTextColor: Palette.darkBlueCraiola,
138 - createNewWalletButtonBackgroundColor: Colors.white);
139 -
140 - @override
141 - InfoTheme get infoTheme => InfoTheme(textColor: Palette.darkLavender);
142 -
143 - @override
144 - PickerTheme get pickerTheme => PickerTheme(
145 - dividerColor: PaletteDark.dividerColor,
146 - searchTextColor: cakeTextTheme.textfieldUnderlineColor,
147 - searchBackgroundFillColor: addressTheme.actionButtonColor);
148 -
149 - @override
150 - AlertTheme get alertTheme => AlertTheme(
151 - backdropColor: PaletteDark.darkNightBlue.withOpacity(0.75),
152 - leftButtonTextColor: Palette.alizarinRed);
153 -
154 - @override
155 - OrderTheme get orderTheme => OrderTheme(iconColor: Colors.white);
156 -
157 - @override
158 - SendPageTheme get sendPageTheme => SendPageTheme(
159 - templateTitleColor: PaletteDark.cyanBlue,
160 - templateBackgroundColor: PaletteDark.darkVioletBlue,
161 - templateNewTextColor: PaletteDark.darkCyanBlue,
162 - templateDottedBorderColor: PaletteDark.darkCyanBlue,
163 - templateSelectedCurrencyBackgroundColor: primaryColor,
164 - templateSelectedCurrencyTitleColor: Colors.white,
165 - estimatedFeeColor: Colors.white,
166 - textFieldButtonIconColor: PaletteDark.gray,
167 - textFieldButtonColor: PaletteDark.buttonNightBlue,
168 - textFieldHintColor: PaletteDark.darkCyanBlue,
169 - textFieldBorderColor: PaletteDark.lightVioletBlue,
170 - secondGradientColor: PaletteDark.darkNightBlue,
171 - firstGradientColor: PaletteDark.darkNightBlue,
172 - indicatorDotColor: PaletteDark.cyanBlue);
173 -
174 - @override
175 - SeedWidgetTheme get seedWidgetTheme =>
176 - SeedWidgetTheme(hintTextColor: PaletteDark.darkCyanBlue);
177 -
178 - @override
179 - PlaceholderTheme get placeholderTheme => PlaceholderTheme(color: Colors.grey);
180 -
181 - @override
182 - TransactionTradeTheme get transactionTradeTheme => TransactionTradeTheme(
183 - detailsTitlesColor: PaletteDark.lightBlueGrey,
184 - rowsColor: PaletteDark.wildNightBlue);
185 -
186 - @override
187 - CakeTextTheme get cakeTextTheme => CakeTextTheme(
188 - secondaryTextColor: PaletteDark.darkCyanBlue,
189 - textfieldUnderlineColor: PaletteDark.darkOceanBlue,
190 - titleColor: Colors.white,
191 - addressButtonBorderColor: PaletteDark.nightBlue,
192 - dateSectionRowColor: PaletteDark.darkCyanBlue);
193 -
194 - @override
195 - AccountListTheme get accountListTheme => AccountListTheme(
196 - currentAccountBackgroundColor: dialogBackgroundColor,
197 - currentAccountTextColor: primaryColor,
198 - currentAccountAmountColor: receivePageTheme.iconsColor,
199 - tilesAmountColor: receivePageTheme.iconsColor,
200 - tilesBackgroundColor: PaletteDark.darkOceanBlue,
201 - tilesTextColor: Colors.white);
202 -
203 - @override
204 - ReceivePageTheme get receivePageTheme => ReceivePageTheme(
205 - currentTileBackgroundColor: PaletteDark.lightOceanBlue,
206 - currentTileTextColor: Palette.blueCraiola,
207 - tilesBackgroundColor: PaletteDark.nightBlue,
208 - tilesTextColor: Colors.white,
209 - iconsBackgroundColor: PaletteDark.distantNightBlue,
210 - iconsColor: Colors.white,
211 - amountBottomBorderColor: PaletteDark.darkGrey,
212 - amountHintTextColor: PaletteDark.cyanBlue);
213 -
214 - @override
215 - QRCodeTheme get qrCodeTheme => QRCodeTheme(
216 - qrCodeColor: PaletteDark.lightBlueGrey,
217 - qrWidgetCopyButtonColor: PaletteDark.lightBlueGrey);
218 -
219 - @override
220 - OptionTileTheme get optionTileTheme => OptionTileTheme(
221 - titleColor: primaryTextColor, descriptionColor: primaryTextColor, useDarkImage: false);
222 -
223 - @override
224 - ThemeData get themeData => super.themeData.copyWith(
225 - dividerColor: PaletteDark.dividerColor,
226 - hintColor: PaletteDark.pigeonBlue,
227 - disabledColor: PaletteDark.deepVioletBlue,
228 - dialogTheme: super
229 - .themeData
230 - .dialogTheme
231 - .copyWith(backgroundColor: PaletteDark.nightBlue));
232 -}
lib/themes/extensions/account_list_theme.dart deleted
-58
@@ -1,58 +0,0 @@
1 -import 'package:flutter/material.dart';
2 -
3 -class AccountListTheme extends ThemeExtension<AccountListTheme> {
4 - final Color tilesTextColor;
5 - final Color tilesAmountColor;
6 - final Color tilesBackgroundColor;
7 - final Color currentAccountBackgroundColor;
8 - final Color currentAccountTextColor;
9 - final Color currentAccountAmountColor;
10 -
11 - AccountListTheme(
12 - {required this.tilesTextColor,
13 - required this.tilesAmountColor,
14 - required this.tilesBackgroundColor,
15 - required this.currentAccountBackgroundColor,
16 - required this.currentAccountTextColor,
17 - required this.currentAccountAmountColor});
18 -
19 - @override
20 - AccountListTheme copyWith(
21 - {Color? tilesTextColor,
22 - Color? tilesAmountColor,
23 - Color? tilesBackgroundColor,
24 - Color? currentAccountBackgroundColor,
25 - Color? currentAccountTextColor,
26 - Color? currentAccountAmountColor}) =>
27 - AccountListTheme(
28 - tilesTextColor: tilesTextColor ?? this.tilesTextColor,
29 - tilesAmountColor: tilesAmountColor ?? this.tilesAmountColor,
30 - tilesBackgroundColor:
31 - tilesBackgroundColor ?? this.tilesBackgroundColor,
32 - currentAccountBackgroundColor: currentAccountBackgroundColor ??
33 - this.currentAccountBackgroundColor,
34 - currentAccountTextColor:
35 - currentAccountTextColor ?? this.currentAccountTextColor,
36 - currentAccountAmountColor:
37 - currentAccountAmountColor ?? this.currentAccountAmountColor);
38 -
39 - @override
40 - AccountListTheme lerp(ThemeExtension<AccountListTheme>? other, double t) {
41 - if (other is! AccountListTheme) {
42 - return this;
43 - }
44 -
45 - return AccountListTheme(
46 - tilesTextColor: Color.lerp(tilesTextColor, other.tilesTextColor, t)!,
47 - tilesAmountColor:
48 - Color.lerp(tilesAmountColor, other.tilesAmountColor, t)!,
49 - tilesBackgroundColor:
50 - Color.lerp(tilesBackgroundColor, other.tilesBackgroundColor, t)!,
51 - currentAccountBackgroundColor: Color.lerp(currentAccountBackgroundColor,
52 - other.currentAccountBackgroundColor, t)!,
53 - currentAccountTextColor: Color.lerp(
54 - currentAccountTextColor, other.currentAccountTextColor, t)!,
55 - currentAccountAmountColor: Color.lerp(
56 - currentAccountAmountColor, other.currentAccountAmountColor, t)!);
57 - }
58 -}
lib/themes/extensions/address_theme.dart deleted
-24
@@ -1,24 +0,0 @@
1 -import 'package:flutter/material.dart';
2 -
3 -class AddressTheme extends ThemeExtension<AddressTheme> {
4 - final Color actionButtonColor;
5 -
6 - AddressTheme({required this.actionButtonColor});
7 -
8 - @override
9 - AddressTheme copyWith({Color? actionButtonColor}) => AddressTheme(
10 - actionButtonColor: actionButtonColor ?? this.actionButtonColor);
11 -
12 - @override
13 - AddressTheme lerp(ThemeExtension<AddressTheme>? other, double t) {
14 - if (other is! AddressTheme) {
15 - return this;
16 - }
17 -
18 - return AddressTheme(
19 - actionButtonColor:
20 - Color.lerp(actionButtonColor, other.actionButtonColor, t) ??
21 - actionButtonColor,
22 - );
23 - }
24 -}
lib/themes/extensions/alert_theme.dart deleted
-28
@@ -1,28 +0,0 @@
1 -import 'package:flutter/material.dart';
2 -
3 -class AlertTheme extends ThemeExtension<AlertTheme> {
4 - final Color leftButtonTextColor;
5 - final Color backdropColor;
6 -
7 - AlertTheme({required this.leftButtonTextColor, required this.backdropColor});
8 -
9 - @override
10 - AlertTheme copyWith({Color? leftButtonTextColor, Color? backdropColor}) =>
11 - AlertTheme(
12 - leftButtonTextColor: leftButtonTextColor ?? this.leftButtonTextColor,
13 - backdropColor: backdropColor ?? this.backdropColor);
14 -
15 - @override
16 - AlertTheme lerp(ThemeExtension<AlertTheme>? other, double t) {
17 - if (other is! AlertTheme) {
18 - return this;
19 - }
20 -
21 - return AlertTheme(
22 - leftButtonTextColor:
23 - Color.lerp(leftButtonTextColor, other.leftButtonTextColor, t) ??
24 - leftButtonTextColor,
25 - backdropColor:
26 - Color.lerp(backdropColor, other.backdropColor, t) ?? backdropColor);
27 - }
28 -}
lib/themes/extensions/balance_page_theme.dart deleted
-53
@@ -1,53 +0,0 @@
1 -import 'package:flutter/material.dart';
2 -
3 -class BalancePageTheme extends ThemeExtension<BalancePageTheme> {
4 - final Color textColor;
5 - final Color labelTextColor;
6 - final Color balanceAmountColor;
7 - final Color assetTitleColor;
8 - final Color cardBorderColor;
9 -
10 - BalancePageTheme(
11 - {required this.labelTextColor,
12 - required this.textColor,
13 - Color? balanceAmountColor,
14 - Color? assetTitleColor,
15 - this.cardBorderColor = Colors.transparent})
16 - : this.balanceAmountColor = balanceAmountColor ?? textColor,
17 - this.assetTitleColor = assetTitleColor ?? textColor;
18 -
19 - @override
20 - BalancePageTheme copyWith(
21 - {Color? textColor,
22 - Color? labelTextColor,
23 - Color? balanceAmountColor,
24 - Color? assetTitleColor,
25 - Color? cardBorderColor}) =>
26 - BalancePageTheme(
27 - textColor: textColor ?? this.textColor,
28 - labelTextColor: labelTextColor ?? this.labelTextColor,
29 - balanceAmountColor: balanceAmountColor ?? this.balanceAmountColor,
30 - assetTitleColor: assetTitleColor ?? this.assetTitleColor,
31 - cardBorderColor: cardBorderColor ?? this.cardBorderColor);
32 -
33 - @override
34 - BalancePageTheme lerp(ThemeExtension<BalancePageTheme>? other, double t) {
35 - if (other is! BalancePageTheme) {
36 - return this;
37 - }
38 -
39 - return BalancePageTheme(
40 - textColor: Color.lerp(textColor, other.textColor, t) ?? textColor,
41 - labelTextColor: Color.lerp(labelTextColor, other.labelTextColor, t) ??
42 - labelTextColor,
43 - balanceAmountColor:
44 - Color.lerp(balanceAmountColor, other.balanceAmountColor, t) ??
45 - balanceAmountColor,
46 - assetTitleColor:
47 - Color.lerp(assetTitleColor, other.assetTitleColor, t) ??
48 - assetTitleColor,
49 - cardBorderColor:
50 - Color.lerp(cardBorderColor, other.cardBorderColor, t) ??
51 - cardBorderColor);
52 - }
53 -}
lib/themes/extensions/cake_scrollbar_theme.dart deleted
-28
@@ -1,28 +0,0 @@
1 -import 'package:flutter/material.dart';
2 -
3 -class CakeScrollbarTheme extends ThemeExtension<CakeScrollbarTheme> {
4 - final Color thumbColor;
5 - final Color trackColor;
6 -
7 - CakeScrollbarTheme({required this.thumbColor, required this.trackColor});
8 -
9 - @override
10 - Object get type => CakeScrollbarTheme;
11 -
12 - @override
13 - CakeScrollbarTheme copyWith({Color? thumbColor, Color? trackColor}) =>
14 - CakeScrollbarTheme(
15 - thumbColor: thumbColor ?? this.thumbColor,
16 - trackColor: trackColor ?? this.trackColor);
17 -
18 - @override
19 - CakeScrollbarTheme lerp(ThemeExtension<CakeScrollbarTheme>? other, double t) {
20 - if (other is! CakeScrollbarTheme) {
21 - return this;
22 - }
23 -
24 - return CakeScrollbarTheme(
25 - thumbColor: Color.lerp(thumbColor, other.thumbColor, t) ?? thumbColor,
26 - trackColor: Color.lerp(trackColor, other.trackColor, t) ?? trackColor);
27 - }
28 -}
lib/themes/extensions/cake_text_theme.dart deleted
-65
@@ -1,65 +0,0 @@
1 -import 'package:flutter/material.dart';
2 -
3 -class CakeTextTheme extends ThemeExtension<CakeTextTheme> {
4 - final Color secondaryTextColor;
5 - final Color textfieldUnderlineColor;
6 - final Color titleColor;
7 - final Color addressButtonBorderColor;
8 - final Color dateSectionRowColor;
9 - final Color buttonTextColor;
10 - final Color buttonSecondaryTextColor;
11 -
12 - CakeTextTheme(
13 - {required this.secondaryTextColor,
14 - required this.textfieldUnderlineColor,
15 - required this.titleColor,
16 - required this.addressButtonBorderColor,
17 - required this.dateSectionRowColor,
18 - Color? buttonTextColor,
19 - Color? buttonSecondaryTextColor})
20 - : buttonTextColor = buttonTextColor ?? titleColor,
21 - buttonSecondaryTextColor =
22 - buttonSecondaryTextColor ?? secondaryTextColor;
23 -
24 - @override
25 - CakeTextTheme copyWith(
26 - {Color? secondaryTextColor,
27 - Color? textfieldUnderlineColor,
28 - Color? titleColor,
29 - Color? addressButtonBorderColor,
30 - Color? dateSectionRowColor,
31 - Color? buttonTextColor,
32 - Color? buttonSecondaryTextColor}) =>
33 - CakeTextTheme(
34 - secondaryTextColor: secondaryTextColor ?? this.secondaryTextColor,
35 - textfieldUnderlineColor:
36 - textfieldUnderlineColor ?? this.textfieldUnderlineColor,
37 - titleColor: titleColor ?? this.titleColor,
38 - addressButtonBorderColor:
39 - addressButtonBorderColor ?? this.addressButtonBorderColor,
40 - dateSectionRowColor: dateSectionRowColor ?? this.dateSectionRowColor,
41 - buttonTextColor: buttonTextColor ?? this.buttonTextColor,
42 - buttonSecondaryTextColor:
43 - buttonSecondaryTextColor ?? this.buttonSecondaryTextColor);
44 -
45 - @override
46 - CakeTextTheme lerp(ThemeExtension<CakeTextTheme>? other, double t) {
47 - if (other is! CakeTextTheme) {
48 - return this;
49 - }
50 -
51 - return CakeTextTheme(
52 - secondaryTextColor:
53 - Color.lerp(secondaryTextColor, other.secondaryTextColor, t)!,
54 - textfieldUnderlineColor: Color.lerp(
55 - textfieldUnderlineColor, other.textfieldUnderlineColor, t)!,
56 - titleColor: Color.lerp(titleColor, other.titleColor, t)!,
57 - addressButtonBorderColor: Color.lerp(
58 - addressButtonBorderColor, other.addressButtonBorderColor, t)!,
59 - dateSectionRowColor:
60 - Color.lerp(dateSectionRowColor, other.dateSectionRowColor, t)!,
61 - buttonTextColor: Color.lerp(buttonTextColor, other.buttonTextColor, t)!,
62 - buttonSecondaryTextColor: Color.lerp(
63 - buttonSecondaryTextColor, other.buttonSecondaryTextColor, t)!);
64 - }
65 -}
lib/themes/extensions/dashboard_page_theme.dart deleted
-79
@@ -1,79 +0,0 @@
1 -import 'package:cake_wallet/themes/extensions/indicator_dot_theme.dart';
2 -import 'package:flutter/material.dart';
3 -
4 -class DashboardPageTheme extends ThemeExtension<DashboardPageTheme> {
5 - final Color firstGradientBackgroundColor;
6 - final Color secondGradientBackgroundColor;
7 - final Color thirdGradientBackgroundColor;
8 - final Color textColor;
9 - final Color cardTextColor;
10 - final Color pageTitleTextColor;
11 - final Color mainActionsIconColor;
12 -
13 - final IndicatorDotTheme indicatorDotTheme;
14 -
15 - DashboardPageTheme(
16 - {required this.firstGradientBackgroundColor,
17 - required this.secondGradientBackgroundColor,
18 - required this.thirdGradientBackgroundColor,
19 - required this.textColor,
20 - required this.indicatorDotTheme,
21 - Color? mainActionsIconColor,
22 - Color? pageTitleTextColor,
23 - Color? cardTextColor})
24 - : pageTitleTextColor = pageTitleTextColor ?? textColor,
25 - mainActionsIconColor = mainActionsIconColor ?? textColor,
26 - cardTextColor = cardTextColor ?? textColor;
27 -
28 - @override
29 - DashboardPageTheme copyWith(
30 - {Color? firstGradientBackgroundColor,
31 - Color? secondGradientBackgroundColor,
32 - Color? thirdGradientBackgroundColor,
33 - Color? textColor,
34 - IndicatorDotTheme? indicatorDotTheme,
35 - Color? pageTitleTextColor,
36 - Color? mainActionsIconColor,
37 - Color? cardTextColor}) =>
38 - DashboardPageTheme(
39 - firstGradientBackgroundColor:
40 - firstGradientBackgroundColor ?? this.firstGradientBackgroundColor,
41 - secondGradientBackgroundColor: secondGradientBackgroundColor ??
42 - this.secondGradientBackgroundColor,
43 - thirdGradientBackgroundColor:
44 - thirdGradientBackgroundColor ?? this.thirdGradientBackgroundColor,
45 - textColor: textColor ?? this.textColor,
46 - indicatorDotTheme: indicatorDotTheme ?? this.indicatorDotTheme,
47 - pageTitleTextColor: pageTitleTextColor ?? this.pageTitleTextColor,
48 - mainActionsIconColor:
49 - mainActionsIconColor ?? this.mainActionsIconColor,
50 - cardTextColor: cardTextColor ?? this.cardTextColor);
51 -
52 - @override
53 - DashboardPageTheme lerp(ThemeExtension<DashboardPageTheme>? other, double t) {
54 - if (other is! DashboardPageTheme) {
55 - return this;
56 - }
57 -
58 - return DashboardPageTheme(
59 - firstGradientBackgroundColor: Color.lerp(firstGradientBackgroundColor,
60 - other.firstGradientBackgroundColor, t) ??
61 - firstGradientBackgroundColor,
62 - secondGradientBackgroundColor: Color.lerp(secondGradientBackgroundColor,
63 - other.secondGradientBackgroundColor, t) ??
64 - secondGradientBackgroundColor,
65 - thirdGradientBackgroundColor: Color.lerp(thirdGradientBackgroundColor,
66 - other.thirdGradientBackgroundColor, t) ??
67 - thirdGradientBackgroundColor,
68 - textColor: Color.lerp(textColor, other.textColor, t) ?? textColor,
69 - indicatorDotTheme: indicatorDotTheme.lerp(other.indicatorDotTheme, t),
70 - pageTitleTextColor:
71 - Color.lerp(pageTitleTextColor, other.pageTitleTextColor, t) ??
72 - pageTitleTextColor,
73 - mainActionsIconColor:
74 - Color.lerp(mainActionsIconColor, other.mainActionsIconColor, t) ??
75 - mainActionsIconColor,
76 - cardTextColor:
77 - Color.lerp(cardTextColor, other.cardTextColor, t) ?? cardTextColor);
78 - }
79 -}
lib/themes/extensions/exchange_page_theme.dart deleted
-88
@@ -1,88 +0,0 @@
1 -import 'package:flutter/material.dart';
2 -
3 -class ExchangePageTheme extends ThemeExtension<ExchangePageTheme> {
4 - final Color hintTextColor;
5 - final Color receiveAmountColor;
6 - final Color firstGradientTopPanelColor;
7 - final Color secondGradientTopPanelColor;
8 - final Color firstGradientBottomPanelColor;
9 - final Color secondGradientBottomPanelColor;
10 - final Color textFieldBorderTopPanelColor;
11 - final Color textFieldBorderBottomPanelColor;
12 - final Color textFieldButtonColor;
13 - final Color buttonBackgroundColor;
14 - final Color qrCodeColor;
15 - final Color dividerCodeColor;
16 -
17 - ExchangePageTheme(
18 - {required this.hintTextColor,
19 - required this.receiveAmountColor,
20 - required this.firstGradientTopPanelColor,
21 - required this.secondGradientTopPanelColor,
22 - required this.firstGradientBottomPanelColor,
23 - required this.secondGradientBottomPanelColor,
24 - required this.textFieldBorderTopPanelColor,
25 - required this.textFieldBorderBottomPanelColor,
26 - required this.textFieldButtonColor,
27 - required this.buttonBackgroundColor,
28 - required this.qrCodeColor,
29 - required this.dividerCodeColor});
30 -
31 - @override
32 - ExchangePageTheme copyWith({
33 - Color? hintTextColor,
34 - Color? receiveAmountColor,
35 - Color? firstGradientTopPanelColor,
36 - Color? secondGradientTopPanelColor,
37 - Color? firstGradientBottomPanelColor,
38 - Color? secondGradientBottomPanelColor,
39 - Color? textFieldBorderTopPanelColor,
40 - Color? textFieldBorderBottomPanelColor,
41 - Color? textFieldButtonColor,
42 - Color? buttonBackgroundColor,
43 - Color? qrCodeColor,
44 - Color? dividerCodeColor,
45 - }) =>
46 - ExchangePageTheme(
47 - hintTextColor: hintTextColor ?? this.hintTextColor,
48 - receiveAmountColor: receiveAmountColor ?? this.receiveAmountColor,
49 - firstGradientTopPanelColor:
50 - firstGradientTopPanelColor ?? this.firstGradientTopPanelColor,
51 - secondGradientTopPanelColor:
52 - secondGradientTopPanelColor ?? this.secondGradientTopPanelColor,
53 - firstGradientBottomPanelColor: firstGradientBottomPanelColor ??
54 - this.firstGradientBottomPanelColor,
55 - secondGradientBottomPanelColor: secondGradientBottomPanelColor ??
56 - this.secondGradientBottomPanelColor,
57 - textFieldBorderTopPanelColor:
58 - textFieldBorderTopPanelColor ?? this.textFieldBorderTopPanelColor,
59 - textFieldBorderBottomPanelColor: textFieldBorderBottomPanelColor ??
60 - this.textFieldBorderBottomPanelColor,
61 - textFieldButtonColor:
62 - textFieldButtonColor ?? this.textFieldButtonColor,
63 - buttonBackgroundColor:
64 - buttonBackgroundColor ?? this.buttonBackgroundColor,
65 - qrCodeColor: qrCodeColor ?? this.qrCodeColor,
66 - dividerCodeColor: dividerCodeColor ?? this.dividerCodeColor);
67 -
68 - @override
69 - ExchangePageTheme lerp(ThemeExtension<ExchangePageTheme>? other, double t) {
70 - if (other is! ExchangePageTheme) {
71 - return this;
72 - }
73 -
74 - return ExchangePageTheme(
75 - hintTextColor: Color.lerp(hintTextColor, other.hintTextColor, t) ?? hintTextColor,
76 - receiveAmountColor: Color.lerp(receiveAmountColor, other.receiveAmountColor, t) ?? receiveAmountColor,
77 - firstGradientTopPanelColor: Color.lerp(firstGradientTopPanelColor, other.firstGradientTopPanelColor, t) ?? firstGradientTopPanelColor,
78 - secondGradientTopPanelColor: Color.lerp(secondGradientTopPanelColor, other.secondGradientTopPanelColor, t) ?? secondGradientTopPanelColor,
79 - firstGradientBottomPanelColor: Color.lerp(firstGradientBottomPanelColor, other.firstGradientBottomPanelColor, t) ?? firstGradientBottomPanelColor,
80 - secondGradientBottomPanelColor: Color.lerp(secondGradientBottomPanelColor, other.secondGradientBottomPanelColor, t) ?? secondGradientBottomPanelColor,
81 - textFieldBorderTopPanelColor: Color.lerp(textFieldBorderTopPanelColor, other.textFieldBorderTopPanelColor, t) ?? textFieldBorderTopPanelColor,
82 - textFieldBorderBottomPanelColor: Color.lerp(textFieldBorderBottomPanelColor, other.textFieldBorderBottomPanelColor, t) ?? textFieldBorderBottomPanelColor,
83 - textFieldButtonColor: Color.lerp(textFieldButtonColor, other.textFieldButtonColor, t) ?? textFieldButtonColor,
84 - buttonBackgroundColor: Color.lerp(buttonBackgroundColor, other.buttonBackgroundColor, t) ?? buttonBackgroundColor,
85 - qrCodeColor: Color.lerp(qrCodeColor, other.qrCodeColor, t) ?? qrCodeColor,
86 - dividerCodeColor: Color.lerp(dividerCodeColor, other.dividerCodeColor, t) ?? dividerCodeColor);
87 - }
88 -}
lib/themes/extensions/filter_theme.dart deleted
-68
@@ -1,68 +0,0 @@
1 -import 'package:flutter/material.dart';
2 -
3 -class FilterTheme extends ThemeExtension<FilterTheme> {
4 - final Color checkboxFirstGradientColor;
5 - final Color checkboxSecondGradientColor;
6 - final Color checkboxBoundsColor;
7 - final Color checkboxBackgroundColor;
8 - final Color titlesColor;
9 - final Color buttonColor;
10 - final Color iconColor;
11 -
12 - FilterTheme(
13 - {required this.checkboxFirstGradientColor,
14 - required this.checkboxSecondGradientColor,
15 - required this.checkboxBoundsColor,
16 - required this.checkboxBackgroundColor,
17 - required this.titlesColor,
18 - required this.buttonColor,
19 - required this.iconColor});
20 -
21 - @override
22 - FilterTheme copyWith({
23 - Color? checkboxFirstGradientColor,
24 - Color? checkboxSecondGradientColor,
25 - Color? checkboxBoundsColor,
26 - Color? checkboxBackgroundColor,
27 - Color? titlesColor,
28 - Color? buttonColor,
29 - Color? iconColor,
30 - }) =>
31 - FilterTheme(
32 - checkboxFirstGradientColor:
33 - checkboxFirstGradientColor ?? this.checkboxFirstGradientColor,
34 - checkboxSecondGradientColor:
35 - checkboxSecondGradientColor ?? this.checkboxSecondGradientColor,
36 - checkboxBoundsColor: checkboxBoundsColor ?? this.checkboxBoundsColor,
37 - checkboxBackgroundColor:
38 - checkboxBackgroundColor ?? this.checkboxBackgroundColor,
39 - titlesColor: titlesColor ?? this.titlesColor,
40 - buttonColor: buttonColor ?? this.buttonColor,
41 - iconColor: iconColor ?? this.iconColor);
42 -
43 - @override
44 - FilterTheme lerp(ThemeExtension<FilterTheme>? other, double t) {
45 - if (other is! FilterTheme) {
46 - return this;
47 - }
48 -
49 - return FilterTheme(
50 - checkboxFirstGradientColor: Color.lerp(checkboxFirstGradientColor,
51 - other.checkboxFirstGradientColor, t) ??
52 - this.checkboxFirstGradientColor,
53 - checkboxSecondGradientColor: Color.lerp(checkboxSecondGradientColor,
54 - other.checkboxSecondGradientColor, t) ??
55 - this.checkboxSecondGradientColor,
56 - checkboxBoundsColor:
57 - Color.lerp(checkboxBoundsColor, other.checkboxBoundsColor, t) ??
58 - this.checkboxBoundsColor,
59 - checkboxBackgroundColor: Color.lerp(
60 - checkboxBackgroundColor, other.checkboxBackgroundColor, t) ??
61 - this.checkboxBackgroundColor,
62 - titlesColor:
63 - Color.lerp(titlesColor, other.titlesColor, t) ?? this.titlesColor,
64 - buttonColor:
65 - Color.lerp(buttonColor, other.buttonColor, t) ?? this.buttonColor,
66 - iconColor: Color.lerp(iconColor, other.iconColor, t) ?? this.iconColor);
67 - }
68 -}
lib/themes/extensions/indicator_dot_theme.dart deleted
-30
@@ -1,30 +0,0 @@
1 -import 'package:flutter/material.dart';
2 -
3 -class IndicatorDotTheme extends ThemeExtension<IndicatorDotTheme> {
4 - final Color indicatorColor;
5 - final Color activeIndicatorColor;
6 -
7 - IndicatorDotTheme(
8 - {required this.indicatorColor, required this.activeIndicatorColor});
9 -
10 - @override
11 - IndicatorDotTheme copyWith(
12 - {Color? indicatorColor, Color? actionButtonColor}) =>
13 - IndicatorDotTheme(
14 - indicatorColor: indicatorColor ?? this.indicatorColor,
15 - activeIndicatorColor: actionButtonColor ?? this.activeIndicatorColor);
16 -
17 - @override
18 - IndicatorDotTheme lerp(ThemeExtension<IndicatorDotTheme>? other, double t) {
19 - if (other is! IndicatorDotTheme) {
20 - return this;
21 - }
22 -
23 - return IndicatorDotTheme(
24 - indicatorColor: Color.lerp(indicatorColor, other.indicatorColor, t) ??
25 - indicatorColor,
26 - activeIndicatorColor:
27 - Color.lerp(activeIndicatorColor, other.activeIndicatorColor, t) ??
28 - activeIndicatorColor);
29 - }
30 -}
lib/themes/extensions/info_theme.dart deleted
-21
@@ -1,21 +0,0 @@
1 -import 'package:flutter/material.dart';
2 -
3 -class InfoTheme extends ThemeExtension<InfoTheme> {
4 - final Color textColor;
5 -
6 - InfoTheme({required this.textColor});
7 -
8 - @override
9 - InfoTheme copyWith({Color? textColor}) =>
10 - InfoTheme(textColor: textColor ?? this.textColor);
11 -
12 - @override
13 - InfoTheme lerp(ThemeExtension<InfoTheme>? other, double t) {
14 - if (other is! InfoTheme) {
15 - return this;
16 - }
17 -
18 - return InfoTheme(
19 - textColor: Color.lerp(textColor, other.textColor, t) ?? textColor);
20 - }
21 -}
lib/themes/extensions/keyboard_theme.dart deleted
-26
@@ -1,26 +0,0 @@
1 -import 'package:flutter/material.dart';
2 -
3 -class KeyboardTheme extends ThemeExtension<KeyboardTheme> {
4 - final Color keyboardBarColor;
5 -
6 - KeyboardTheme({required this.keyboardBarColor});
7 -
8 - @override
9 - Object get type => KeyboardTheme;
10 -
11 - @override
12 - KeyboardTheme copyWith({Color? keyboardBarColor}) => KeyboardTheme(
13 - keyboardBarColor: keyboardBarColor ?? this.keyboardBarColor);
14 -
15 - @override
16 - KeyboardTheme lerp(ThemeExtension<KeyboardTheme>? other, double t) {
17 - if (other is! KeyboardTheme) {
18 - return this;
19 - }
20 -
21 - return KeyboardTheme(
22 - keyboardBarColor:
23 - Color.lerp(keyboardBarColor, other.keyboardBarColor, t) ??
24 - keyboardBarColor);
25 - }
26 -}
lib/themes/extensions/menu_theme.dart deleted
-75
@@ -1,75 +0,0 @@
1 -import 'package:flutter/material.dart';
2 -
3 -class CakeMenuTheme extends ThemeExtension<CakeMenuTheme> {
4 - final Color headerFirstGradientColor;
5 - final Color headerSecondGradientColor;
6 - final Color subnameTextColor;
7 - final Color dividerColor;
8 - final Color backgroundColor;
9 - final Color iconColor;
10 - final Color settingActionsIconColor;
11 - final Color settingTitleColor;
12 -
13 - CakeMenuTheme(
14 - {required this.headerFirstGradientColor,
15 - required this.headerSecondGradientColor,
16 - required this.backgroundColor,
17 - required this.subnameTextColor,
18 - required this.dividerColor,
19 - required this.iconColor,
20 - required this.settingActionsIconColor,
21 - required this.settingTitleColor});
22 -
23 - @override
24 - CakeMenuTheme copyWith(
25 - {Color? headerFirstGradientColor,
26 - Color? headerSecondGradientColor,
27 - Color? backgroundColor,
28 - Color? subnameTextColor,
29 - Color? dividerColor,
30 - Color? iconColor,
31 - Color? settingActionsIconColor,
32 - Color? settingTitleColor}) =>
33 - CakeMenuTheme(
34 - headerFirstGradientColor:
35 - headerFirstGradientColor ?? this.headerFirstGradientColor,
36 - headerSecondGradientColor:
37 - headerSecondGradientColor ?? this.headerSecondGradientColor,
38 - backgroundColor: backgroundColor ?? this.backgroundColor,
39 - subnameTextColor: subnameTextColor ?? this.subnameTextColor,
40 - dividerColor: dividerColor ?? this.dividerColor,
41 - iconColor: iconColor ?? this.iconColor,
42 - settingActionsIconColor:
43 - settingActionsIconColor ?? this.settingActionsIconColor,
44 - settingTitleColor: settingTitleColor ?? this.settingTitleColor);
45 -
46 - @override
47 - CakeMenuTheme lerp(ThemeExtension<CakeMenuTheme>? other, double t) {
48 - if (other is! CakeMenuTheme) {
49 - return this;
50 - }
51 -
52 - return CakeMenuTheme(
53 - headerFirstGradientColor: Color.lerp(
54 - headerFirstGradientColor, other.headerFirstGradientColor, t) ??
55 - headerFirstGradientColor,
56 - headerSecondGradientColor: Color.lerp(headerSecondGradientColor,
57 - other.headerSecondGradientColor, t) ??
58 - headerSecondGradientColor,
59 - backgroundColor:
60 - Color.lerp(backgroundColor, other.backgroundColor, t) ??
61 - backgroundColor,
62 - subnameTextColor:
63 - Color.lerp(subnameTextColor, other.subnameTextColor, t) ??
64 - subnameTextColor,
65 - dividerColor:
66 - Color.lerp(dividerColor, other.dividerColor, t) ?? dividerColor,
67 - iconColor: Color.lerp(iconColor, other.iconColor, t) ?? iconColor,
68 - settingActionsIconColor: Color.lerp(
69 - settingActionsIconColor, other.settingActionsIconColor, t) ??
70 - settingActionsIconColor,
71 - settingTitleColor: Color.lerp(
72 - settingTitleColor, other.settingTitleColor, t) ??
73 - settingTitleColor);
74 - }
75 -}
lib/themes/extensions/new_wallet_theme.dart deleted
-30
@@ -1,30 +0,0 @@
1 -import 'package:flutter/material.dart';
2 -
3 -class NewWalletTheme extends ThemeExtension<NewWalletTheme> {
4 - final Color hintTextColor;
5 - final Color underlineColor;
6 -
7 - NewWalletTheme({required this.hintTextColor, required this.underlineColor});
8 -
9 - @override
10 - Object get type => NewWalletTheme;
11 -
12 - @override
13 - NewWalletTheme copyWith({Color? hintTextColor, Color? underlineColor}) =>
14 - NewWalletTheme(
15 - hintTextColor: hintTextColor ?? this.hintTextColor,
16 - underlineColor: underlineColor ?? this.underlineColor);
17 -
18 - @override
19 - NewWalletTheme lerp(ThemeExtension<NewWalletTheme>? other, double t) {
20 - if (other is! NewWalletTheme) {
21 - return this;
22 - }
23 -
24 - return NewWalletTheme(
25 - hintTextColor:
26 - Color.lerp(hintTextColor, other.hintTextColor, t) ?? hintTextColor,
27 - underlineColor: Color.lerp(underlineColor, other.underlineColor, t) ??
28 - underlineColor);
29 - }
30 -}
lib/themes/extensions/option_tile_theme.dart deleted
-30
@@ -1,30 +0,0 @@
1 -import 'package:flutter/material.dart';
2 -
3 -class OptionTileTheme extends ThemeExtension<OptionTileTheme> {
4 - final Color titleColor;
5 - final Color descriptionColor;
6 - final bool useDarkImage;
7 -
8 - OptionTileTheme(
9 - {required this.titleColor, required this.descriptionColor, this.useDarkImage = false});
10 -
11 - @override
12 - OptionTileTheme copyWith({Color? titleColor, Color? descriptionColor, bool? useDarkImage}) =>
13 - OptionTileTheme(
14 - titleColor: titleColor ?? this.titleColor,
15 - descriptionColor: descriptionColor ?? this.descriptionColor,
16 - useDarkImage: useDarkImage ?? this.useDarkImage);
17 -
18 - @override
19 - OptionTileTheme lerp(ThemeExtension<OptionTileTheme>? other, double t) {
20 - if (other is! OptionTileTheme) {
21 - return this;
22 - }
23 -
24 - return OptionTileTheme(
25 - titleColor: Color.lerp(titleColor, other.titleColor, t) ?? titleColor,
26 - descriptionColor:
27 - Color.lerp(descriptionColor, other.descriptionColor, t) ?? descriptionColor,
28 - useDarkImage: other.useDarkImage);
29 - }
30 -}
lib/themes/extensions/order_theme.dart deleted
-21
@@ -1,21 +0,0 @@
1 -import 'package:flutter/material.dart';
2 -
3 -class OrderTheme extends ThemeExtension<OrderTheme> {
4 - final Color iconColor;
5 -
6 - OrderTheme({required this.iconColor});
7 -
8 - @override
9 - OrderTheme copyWith({Color? iconColor}) =>
10 - OrderTheme(iconColor: iconColor ?? this.iconColor);
11 -
12 - @override
13 - OrderTheme lerp(ThemeExtension<OrderTheme>? other, double t) {
14 - if (other is! OrderTheme) {
15 - return this;
16 - }
17 -
18 - return OrderTheme(
19 - iconColor: Color.lerp(iconColor, other.iconColor, t) ?? iconColor);
20 - }
21 -}
lib/themes/extensions/picker_theme.dart deleted
-52
@@ -1,52 +0,0 @@
1 -import 'package:flutter/material.dart';
2 -
3 -class PickerTheme extends ThemeExtension<PickerTheme> {
4 - final Color dividerColor;
5 - final Color? searchIconColor;
6 - final Color searchBackgroundFillColor;
7 - final Color searchTextColor;
8 - final Color? searchHintColor;
9 - final Color? searchBorderColor;
10 -
11 - PickerTheme(
12 - {required this.dividerColor,
13 - this.searchIconColor,
14 - required this.searchBackgroundFillColor,
15 - required this.searchTextColor,
16 - this.searchHintColor,
17 - this.searchBorderColor});
18 -
19 - @override
20 - PickerTheme copyWith(
21 - {Color? dividerColor,
22 - Color? searchIconColor,
23 - Color? searchBackgroundFillColor,
24 - Color? searchTextColor,
25 - Color? searchHintColor,
26 - Color? searchBorderColor}) =>
27 - PickerTheme(
28 - dividerColor: dividerColor ?? this.dividerColor,
29 - searchIconColor: searchIconColor ?? this.searchIconColor,
30 - searchBackgroundFillColor: searchBackgroundFillColor ?? this.searchBackgroundFillColor,
31 - searchTextColor: searchTextColor ?? this.searchTextColor,
32 - searchHintColor: searchHintColor ?? this.searchHintColor,
33 - searchBorderColor: searchBorderColor ?? this.searchBorderColor);
34 -
35 - @override
36 - PickerTheme lerp(ThemeExtension<PickerTheme>? other, double t) {
37 - if (other is! PickerTheme) {
38 - return this;
39 - }
40 -
41 - return PickerTheme(
42 - dividerColor: Color.lerp(dividerColor, other.dividerColor, t) ?? dividerColor,
43 - searchIconColor: Color.lerp(searchIconColor, other.searchIconColor, t) ?? searchIconColor,
44 - searchBackgroundFillColor:
45 - Color.lerp(searchBackgroundFillColor, other.searchBackgroundFillColor, t) ??
46 - searchBackgroundFillColor,
47 - searchTextColor: Color.lerp(searchTextColor, other.searchTextColor, t) ?? searchTextColor,
48 - searchHintColor: Color.lerp(searchHintColor, other.searchHintColor, t) ?? searchHintColor,
49 - searchBorderColor:
50 - Color.lerp(searchBorderColor, other.searchBorderColor, t) ?? searchBorderColor);
51 - }
52 -}
lib/themes/extensions/pin_code_theme.dart deleted
-28
@@ -1,28 +0,0 @@
1 -import 'package:flutter/material.dart';
2 -
3 -class PinCodeTheme extends ThemeExtension<PinCodeTheme> {
4 - final Color indicatorsColor;
5 - final Color switchColor;
6 -
7 - PinCodeTheme({required this.indicatorsColor, required this.switchColor});
8 -
9 - @override
10 - PinCodeTheme copyWith({Color? indicatorsColor, Color? switchColor}) =>
11 - PinCodeTheme(
12 - indicatorsColor: indicatorsColor ?? this.indicatorsColor,
13 - switchColor: switchColor ?? this.switchColor);
14 -
15 - @override
16 - PinCodeTheme lerp(ThemeExtension<PinCodeTheme>? other, double t) {
17 - if (other is! PinCodeTheme) {
18 - return this;
19 - }
20 -
21 - return PinCodeTheme(
22 - indicatorsColor:
23 - Color.lerp(indicatorsColor, other.indicatorsColor, t) ??
24 - indicatorsColor,
25 - switchColor:
26 - Color.lerp(switchColor, other.switchColor, t) ?? switchColor);
27 - }
28 -}
lib/themes/extensions/placeholder_theme.dart deleted
-20
@@ -1,20 +0,0 @@
1 -import 'package:flutter/material.dart';
2 -
3 -class PlaceholderTheme extends ThemeExtension<PlaceholderTheme> {
4 - final Color color;
5 -
6 - PlaceholderTheme({required this.color});
7 -
8 - @override
9 - PlaceholderTheme copyWith({Color? color}) =>
10 - PlaceholderTheme(color: color ?? this.color);
11 -
12 - @override
13 - PlaceholderTheme lerp(ThemeExtension<PlaceholderTheme>? other, double t) {
14 - if (other is! PlaceholderTheme) {
15 - return this;
16 - }
17 -
18 - return PlaceholderTheme(color: Color.lerp(color, other.color, t) ?? color);
19 - }
20 -}
lib/themes/extensions/qr_code_theme.dart deleted
-28
@@ -1,28 +0,0 @@
1 -import 'package:flutter/material.dart';
2 -
3 -class QRCodeTheme extends ThemeExtension<QRCodeTheme> {
4 - final Color qrCodeColor;
5 - final Color qrWidgetCopyButtonColor;
6 -
7 - QRCodeTheme(
8 - {required this.qrCodeColor, required this.qrWidgetCopyButtonColor});
9 -
10 - @override
11 - QRCodeTheme copyWith({Color? qrCodeColor, Color? qrWidgetCopyButtonColor}) =>
12 - QRCodeTheme(
13 - qrCodeColor: qrCodeColor ?? this.qrCodeColor,
14 - qrWidgetCopyButtonColor:
15 - qrWidgetCopyButtonColor ?? this.qrWidgetCopyButtonColor);
16 -
17 - @override
18 - QRCodeTheme lerp(ThemeExtension<QRCodeTheme>? other, double t) {
19 - if (other is! QRCodeTheme) {
20 - return this;
21 - }
22 -
23 - return QRCodeTheme(
24 - qrCodeColor: Color.lerp(qrCodeColor, other.qrCodeColor, t)!,
25 - qrWidgetCopyButtonColor: Color.lerp(
26 - qrWidgetCopyButtonColor, other.qrWidgetCopyButtonColor, t)!);
27 - }
28 -}
lib/themes/extensions/receive_page_theme.dart deleted
-70
@@ -1,70 +0,0 @@
1 -import 'package:flutter/material.dart';
2 -
3 -class ReceivePageTheme extends ThemeExtension<ReceivePageTheme> {
4 - final Color currentTileBackgroundColor;
5 - final Color currentTileTextColor;
6 - final Color tilesBackgroundColor;
7 - final Color tilesTextColor;
8 - final Color iconsBackgroundColor;
9 - final Color iconsColor;
10 - final Color amountBottomBorderColor;
11 - final Color amountHintTextColor;
12 -
13 - ReceivePageTheme(
14 - {required this.currentTileBackgroundColor,
15 - required this.currentTileTextColor,
16 - required this.tilesBackgroundColor,
17 - required this.tilesTextColor,
18 - required this.iconsBackgroundColor,
19 - required this.iconsColor,
20 - required this.amountBottomBorderColor,
21 - required this.amountHintTextColor});
22 -
23 - @override
24 - ReceivePageTheme copyWith(
25 - {Color? currentTileBackgroundColor,
26 - Color? currentTileTextColor,
27 - Color? tilesBackgroundColor,
28 - Color? tilesTextColor,
29 - Color? iconsBackgroundColor,
30 - Color? iconsColor,
31 - Color? amountBottomBorderColor,
32 - Color? amountHintTextColor}) =>
33 - ReceivePageTheme(
34 - currentTileBackgroundColor:
35 - currentTileBackgroundColor ?? this.currentTileBackgroundColor,
36 - currentTileTextColor:
37 - currentTileTextColor ?? this.currentTileTextColor,
38 - tilesBackgroundColor:
39 - tilesBackgroundColor ?? this.tilesBackgroundColor,
40 - tilesTextColor: tilesTextColor ?? this.tilesTextColor,
41 - iconsBackgroundColor:
42 - iconsBackgroundColor ?? this.iconsBackgroundColor,
43 - iconsColor: iconsColor ?? this.iconsColor,
44 - amountBottomBorderColor:
45 - amountBottomBorderColor ?? this.amountBottomBorderColor,
46 - amountHintTextColor: amountHintTextColor ?? this.amountHintTextColor);
47 -
48 - @override
49 - ReceivePageTheme lerp(ThemeExtension<ReceivePageTheme>? other, double t) {
50 - if (other is! ReceivePageTheme) {
51 - return this;
52 - }
53 -
54 - return ReceivePageTheme(
55 - currentTileBackgroundColor: Color.lerp(
56 - currentTileBackgroundColor, other.currentTileBackgroundColor, t)!,
57 - currentTileTextColor:
58 - Color.lerp(currentTileTextColor, other.currentTileTextColor, t)!,
59 - tilesBackgroundColor:
60 - Color.lerp(tilesBackgroundColor, other.tilesBackgroundColor, t)!,
61 - tilesTextColor: Color.lerp(tilesTextColor, other.tilesTextColor, t)!,
62 - iconsBackgroundColor:
63 - Color.lerp(iconsBackgroundColor, other.iconsBackgroundColor, t)!,
64 - iconsColor: Color.lerp(iconsColor, other.iconsColor, t)!,
65 - amountBottomBorderColor: Color.lerp(
66 - amountBottomBorderColor, other.amountBottomBorderColor, t)!,
67 - amountHintTextColor:
68 - Color.lerp(amountHintTextColor, other.amountHintTextColor, t)!);
69 - }
70 -}
lib/themes/extensions/seed_widget_theme.dart deleted
-22
@@ -1,22 +0,0 @@
1 -import 'package:flutter/material.dart';
2 -
3 -class SeedWidgetTheme extends ThemeExtension<SeedWidgetTheme> {
4 - final Color hintTextColor;
5 -
6 - SeedWidgetTheme({required this.hintTextColor});
7 -
8 - @override
9 - SeedWidgetTheme copyWith({Color? hintTextColor}) =>
10 - SeedWidgetTheme(hintTextColor: hintTextColor ?? this.hintTextColor);
11 -
12 - @override
13 - SeedWidgetTheme lerp(ThemeExtension<SeedWidgetTheme>? other, double t) {
14 - if (other is! SeedWidgetTheme) {
15 - return this;
16 - }
17 -
18 - return SeedWidgetTheme(
19 - hintTextColor:
20 - Color.lerp(hintTextColor, other.hintTextColor, t) ?? hintTextColor);
21 - }
22 -}
lib/themes/extensions/send_page_theme.dart deleted
-117
@@ -1,117 +0,0 @@
1 -import 'package:flutter/material.dart';
2 -
3 -class SendPageTheme extends ThemeExtension<SendPageTheme> {
4 - final Color templateTitleColor;
5 - final Color templateBackgroundColor;
6 - final Color templateNewTextColor;
7 - final Color templateSelectedCurrencyBackgroundColor;
8 - final Color templateSelectedCurrencyTitleColor;
9 - final Color templateDottedBorderColor;
10 - final Color estimatedFeeColor;
11 - final Color textFieldButtonIconColor;
12 - final Color textFieldButtonColor;
13 - final Color textFieldHintColor;
14 - final Color textFieldBorderColor;
15 - final Color firstGradientColor;
16 - final Color secondGradientColor;
17 - final Color indicatorDotColor;
18 -
19 - SendPageTheme(
20 - {required this.templateTitleColor,
21 - required this.templateBackgroundColor,
22 - required this.templateNewTextColor,
23 - required this.templateSelectedCurrencyBackgroundColor,
24 - required this.templateSelectedCurrencyTitleColor,
25 - required this.templateDottedBorderColor,
26 - required this.estimatedFeeColor,
27 - required this.textFieldButtonIconColor,
28 - required this.textFieldButtonColor,
29 - required this.textFieldHintColor,
30 - required this.textFieldBorderColor,
31 - required this.firstGradientColor,
32 - required this.secondGradientColor,
33 - required this.indicatorDotColor});
34 -
35 - @override
36 - SendPageTheme copyWith(
37 - {Color? templateTitleColor,
38 - Color? templateBackgroundColor,
39 - Color? templateNewTextColor,
40 - Color? templateSelectedCurrencyBackgroundColor,
41 - Color? templateSelectedCurrencyTitleColor,
42 - Color? templateDottedBorderColor,
43 - Color? estimatedFeeColor,
44 - Color? textFieldButtonIconColor,
45 - Color? textFieldButtonColor,
46 - Color? textFieldHintColor,
47 - Color? textFieldBorderColor,
48 - Color? firstGradientColor,
49 - Color? secondGradientColor,
50 - Color? indicatorDotColor}) =>
51 - SendPageTheme(
52 - templateTitleColor: templateTitleColor ?? this.templateTitleColor,
53 - templateBackgroundColor:
54 - templateBackgroundColor ?? this.templateBackgroundColor,
55 - templateNewTextColor:
56 - templateNewTextColor ?? this.templateNewTextColor,
57 - templateSelectedCurrencyBackgroundColor:
58 - templateSelectedCurrencyBackgroundColor ??
59 - this.templateSelectedCurrencyBackgroundColor,
60 - templateSelectedCurrencyTitleColor:
61 - templateSelectedCurrencyTitleColor ??
62 - this.templateSelectedCurrencyTitleColor,
63 - templateDottedBorderColor:
64 - templateDottedBorderColor ?? this.templateDottedBorderColor,
65 - estimatedFeeColor: estimatedFeeColor ?? this.estimatedFeeColor,
66 - textFieldButtonIconColor:
67 - textFieldButtonIconColor ?? this.textFieldButtonIconColor,
68 - textFieldButtonColor:
69 - textFieldButtonColor ?? this.textFieldButtonColor,
70 - textFieldHintColor: textFieldHintColor ?? this.textFieldHintColor,
71 - textFieldBorderColor:
72 - textFieldBorderColor ?? this.textFieldBorderColor,
73 - firstGradientColor: firstGradientColor ?? this.firstGradientColor,
74 - secondGradientColor: secondGradientColor ?? this.secondGradientColor,
75 - indicatorDotColor: indicatorDotColor ?? this.indicatorDotColor);
76 -
77 - @override
78 - SendPageTheme lerp(ThemeExtension<SendPageTheme>? other, double t) {
79 - if (other is! SendPageTheme) {
80 - return this;
81 - }
82 -
83 - return SendPageTheme(
84 - templateTitleColor:
85 - Color.lerp(templateTitleColor, other.templateTitleColor, t)!,
86 - templateBackgroundColor: Color.lerp(
87 - templateBackgroundColor, other.templateBackgroundColor, t)!,
88 - templateNewTextColor:
89 - Color.lerp(templateNewTextColor, other.templateNewTextColor, t)!,
90 - templateSelectedCurrencyBackgroundColor: Color.lerp(
91 - templateSelectedCurrencyBackgroundColor,
92 - other.templateSelectedCurrencyBackgroundColor,
93 - t)!,
94 - templateSelectedCurrencyTitleColor: Color.lerp(
95 - templateSelectedCurrencyTitleColor,
96 - other.templateSelectedCurrencyTitleColor,
97 - t)!,
98 - templateDottedBorderColor: Color.lerp(
99 - templateDottedBorderColor, other.templateDottedBorderColor, t)!,
100 - estimatedFeeColor:
101 - Color.lerp(estimatedFeeColor, other.estimatedFeeColor, t)!,
102 - textFieldButtonIconColor: Color.lerp(
103 - textFieldButtonIconColor, other.textFieldButtonIconColor, t)!,
104 - textFieldButtonColor:
105 - Color.lerp(textFieldButtonColor, other.textFieldButtonColor, t)!,
106 - textFieldHintColor:
107 - Color.lerp(textFieldHintColor, other.textFieldHintColor, t)!,
108 - textFieldBorderColor:
109 - Color.lerp(textFieldBorderColor, other.textFieldBorderColor, t)!,
110 - firstGradientColor:
111 - Color.lerp(firstGradientColor, other.firstGradientColor, t)!,
112 - secondGradientColor:
113 - Color.lerp(secondGradientColor, other.secondGradientColor, t)!,
114 - indicatorDotColor:
115 - Color.lerp(indicatorDotColor, other.indicatorDotColor, t)!);
116 - }
117 -}
lib/themes/extensions/support_page_theme.dart deleted
-21
@@ -1,21 +0,0 @@
1 -import 'package:flutter/material.dart';
2 -
3 -class SupportPageTheme extends ThemeExtension<SupportPageTheme> {
4 - final Color iconColor;
5 -
6 - SupportPageTheme({required this.iconColor});
7 -
8 - @override
9 - SupportPageTheme copyWith({Color? iconColor}) =>
10 - SupportPageTheme(iconColor: iconColor ?? this.iconColor);
11 -
12 - @override
13 - SupportPageTheme lerp(ThemeExtension<SupportPageTheme>? other, double t) {
14 - if (other is! SupportPageTheme) {
15 - return this;
16 - }
17 -
18 - return SupportPageTheme(
19 - iconColor: Color.lerp(iconColor, other.iconColor, t) ?? iconColor);
20 - }
21 -}
lib/themes/extensions/sync_indicator_theme.dart deleted
-48
@@ -1,48 +0,0 @@
1 -import 'package:flutter/material.dart';
2 -
3 -class SyncIndicatorTheme extends ThemeExtension<SyncIndicatorTheme> {
4 - final Color textColor;
5 - final Color syncedBackgroundColor;
6 - final Color notSyncedIconColor;
7 - final Color notSyncedBackgroundColor;
8 -
9 - SyncIndicatorTheme(
10 - {required this.textColor,
11 - required this.syncedBackgroundColor,
12 - required this.notSyncedIconColor,
13 - required this.notSyncedBackgroundColor});
14 -
15 - @override
16 - SyncIndicatorTheme copyWith({
17 - Color? textColor,
18 - Color? syncedBackgroundColor,
19 - Color? notSyncedIconColor,
20 - Color? notSyncedBackgroundColor,
21 - }) =>
22 - SyncIndicatorTheme(
23 - textColor: textColor ?? this.textColor,
24 - syncedBackgroundColor:
25 - syncedBackgroundColor ?? this.syncedBackgroundColor,
26 - notSyncedIconColor: notSyncedIconColor ?? this.notSyncedIconColor,
27 - notSyncedBackgroundColor:
28 - notSyncedBackgroundColor ?? this.notSyncedBackgroundColor);
29 -
30 - @override
31 - SyncIndicatorTheme lerp(ThemeExtension<SyncIndicatorTheme>? other, double t) {
32 - if (other is! SyncIndicatorTheme) {
33 - return this;
34 - }
35 -
36 - return SyncIndicatorTheme(
37 - textColor: Color.lerp(textColor, other.textColor, t) ?? textColor,
38 - syncedBackgroundColor:
39 - Color.lerp(syncedBackgroundColor, other.syncedBackgroundColor, t) ??
40 - syncedBackgroundColor,
41 - notSyncedIconColor:
42 - Color.lerp(notSyncedIconColor, other.notSyncedIconColor, t) ??
43 - notSyncedIconColor,
44 - notSyncedBackgroundColor: Color.lerp(
45 - notSyncedBackgroundColor, other.notSyncedBackgroundColor, t) ??
46 - notSyncedBackgroundColor);
47 - }
48 -}
lib/themes/extensions/theme_type_images.dart deleted
-14
@@ -1,14 +0,0 @@
1 -import 'package:cake_wallet/themes/theme_base.dart';
2 -
3 -extension ThemeTypeImages on ThemeType {
4 - String get walletGroupImage {
5 - switch (this) {
6 - case ThemeType.bright:
7 - return 'assets/images/wallet_group_bright.png';
8 - case ThemeType.light:
9 - return 'assets/images/wallet_group_light.png';
10 - default:
11 - return 'assets/images/wallet_group_dark.png';
12 - }
13 - }
14 -}
lib/themes/extensions/transaction_trade_theme.dart deleted
-29
@@ -1,29 +0,0 @@
1 -import 'package:flutter/material.dart';
2 -
3 -class TransactionTradeTheme extends ThemeExtension<TransactionTradeTheme> {
4 - final Color detailsTitlesColor;
5 - final Color rowsColor;
6 -
7 - TransactionTradeTheme(
8 - {required this.detailsTitlesColor, required this.rowsColor});
9 -
10 - @override
11 - TransactionTradeTheme copyWith(
12 - {Color? detailsTitlesColor, Color? rowsColor}) =>
13 - TransactionTradeTheme(
14 - detailsTitlesColor: detailsTitlesColor ?? this.detailsTitlesColor,
15 - rowsColor: rowsColor ?? this.rowsColor);
16 -
17 - @override
18 - TransactionTradeTheme lerp(
19 - ThemeExtension<TransactionTradeTheme>? other, double t) {
20 - if (other is! TransactionTradeTheme) {
21 - return this;
22 - }
23 -
24 - return TransactionTradeTheme(
25 - detailsTitlesColor:
26 - Color.lerp(detailsTitlesColor, other.detailsTitlesColor, t)!,
27 - rowsColor: Color.lerp(rowsColor, other.rowsColor, t)!);
28 - }
29 -}
lib/themes/extensions/wallet_list_theme.dart deleted
-38
@@ -1,38 +0,0 @@
1 -import 'package:flutter/material.dart';
2 -
3 -class WalletListTheme extends ThemeExtension<WalletListTheme> {
4 - final Color restoreWalletButtonTextColor;
5 - final Color createNewWalletButtonBackgroundColor;
6 -
7 - WalletListTheme(
8 - {required this.restoreWalletButtonTextColor,
9 - required this.createNewWalletButtonBackgroundColor});
10 -
11 - @override
12 - WalletListTheme copyWith(
13 - {Color? restoreWalletButtonTextColor,
14 - Color? createNewWalletButtonBackgroundColor}) =>
15 - WalletListTheme(
16 - restoreWalletButtonTextColor:
17 - restoreWalletButtonTextColor ?? this.restoreWalletButtonTextColor,
18 - createNewWalletButtonBackgroundColor:
19 - createNewWalletButtonBackgroundColor ??
20 - this.createNewWalletButtonBackgroundColor);
21 -
22 - @override
23 - WalletListTheme lerp(ThemeExtension<WalletListTheme>? other, double t) {
24 - if (other is! WalletListTheme) {
25 - return this;
26 - }
27 -
28 - return WalletListTheme(
29 - restoreWalletButtonTextColor: Color.lerp(restoreWalletButtonTextColor,
30 - other.restoreWalletButtonTextColor, t) ??
31 - restoreWalletButtonTextColor,
32 - createNewWalletButtonBackgroundColor: Color.lerp(
33 - createNewWalletButtonBackgroundColor,
34 - other.createNewWalletButtonBackgroundColor,
35 - t) ??
36 - createNewWalletButtonBackgroundColor);
37 - }
38 -}
lib/themes/high_contrast_theme.dart deleted
-115
@@ -1,115 +0,0 @@
1 -import 'package:cake_wallet/generated/i18n.dart';
2 -import 'package:cake_wallet/palette.dart';
3 -import 'package:cake_wallet/themes/extensions/account_list_theme.dart';
4 -import 'package:cake_wallet/themes/extensions/address_theme.dart';
5 -import 'package:cake_wallet/themes/extensions/balance_page_theme.dart';
6 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
7 -import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
8 -import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart';
9 -import 'package:cake_wallet/themes/extensions/filter_theme.dart';
10 -import 'package:cake_wallet/themes/extensions/indicator_dot_theme.dart';
11 -import 'package:cake_wallet/themes/extensions/menu_theme.dart';
12 -import 'package:cake_wallet/themes/extensions/option_tile_theme.dart';
13 -import 'package:cake_wallet/themes/extensions/picker_theme.dart';
14 -import 'package:cake_wallet/themes/extensions/receive_page_theme.dart';
15 -import 'package:cake_wallet/themes/extensions/send_page_theme.dart';
16 -import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart';
17 -import 'package:cake_wallet/themes/monero_light_theme.dart';
18 -import 'package:flutter/material.dart';
19 -
20 -class HighContrastTheme extends MoneroLightTheme {
21 - HighContrastTheme({required int raw}) : super(raw: raw) {
22 - colorScheme = ColorScheme.fromSwatch(
23 - primarySwatch: Colors.grey,
24 - accentColor: primaryColor,
25 - backgroundColor: Colors.white,
26 - cardColor: containerColor,
27 - brightness: Brightness.light);
28 - }
29 -
30 - @override
31 - String get title => S.current.high_contrast_theme;
32 - @override
33 - Color get primaryColor => Colors.black;
34 - @override
35 - Color get containerColor => Palette.highContrastGray;
36 - @override
37 - Color get primaryTextColor => colorScheme.onBackground;
38 - @override
39 - Color get dialogBackgroundColor => Colors.white;
40 -
41 - @override
42 - CakeTextTheme get cakeTextTheme => super.cakeTextTheme.copyWith(
43 - buttonTextColor: Colors.white, buttonSecondaryTextColor: Colors.white.withOpacity(0.5));
44 -
45 - @override
46 - SyncIndicatorTheme get syncIndicatorStyle => super
47 - .syncIndicatorStyle
48 - .copyWith(textColor: colorScheme.background, syncedBackgroundColor: containerColor);
49 -
50 - @override
51 - BalancePageTheme get balancePageTheme => super.balancePageTheme.copyWith(
52 - textColor: Colors.white,
53 - labelTextColor: Colors.grey,
54 - assetTitleColor: Colors.white,
55 - balanceAmountColor: Colors.white);
56 -
57 - @override
58 - DashboardPageTheme get dashboardPageTheme => super.dashboardPageTheme.copyWith(
59 - textColor: Colors.black,
60 - cardTextColor: Colors.white,
61 - mainActionsIconColor: Colors.white,
62 - indicatorDotTheme:
63 - IndicatorDotTheme(indicatorColor: Colors.grey, activeIndicatorColor: Colors.black));
64 -
65 - @override
66 - ExchangePageTheme get exchangePageTheme => super.exchangePageTheme.copyWith(
67 - firstGradientTopPanelColor: primaryColor, firstGradientBottomPanelColor: containerColor);
68 -
69 - @override
70 - SendPageTheme get sendPageTheme => super.sendPageTheme.copyWith(
71 - templateTitleColor: Colors.white,
72 - templateBackgroundColor: Colors.black,
73 - firstGradientColor: primaryColor);
74 -
75 - @override
76 - AddressTheme get addressTheme => super.addressTheme.copyWith(actionButtonColor: Colors.grey);
77 -
78 - @override
79 - FilterTheme get filterTheme => super.filterTheme.copyWith(iconColor: Colors.white);
80 -
81 - @override
82 - CakeMenuTheme get menuTheme => super.menuTheme.copyWith(
83 - settingTitleColor: Colors.black,
84 - headerFirstGradientColor: containerColor,
85 - iconColor: Colors.white);
86 -
87 - @override
88 - PickerTheme get pickerTheme => super.pickerTheme.copyWith(
89 - searchIconColor: primaryColor,
90 - searchHintColor: primaryColor,
91 - searchTextColor: primaryColor,
92 - searchBackgroundFillColor: Colors.white,
93 - searchBorderColor: primaryColor);
94 -
95 - @override
96 - AccountListTheme get accountListTheme => super.accountListTheme.copyWith(
97 - tilesTextColor: Colors.black,
98 - tilesBackgroundColor: Colors.white,
99 - currentAccountBackgroundColor: containerColor,
100 - currentAccountTextColor: Colors.white,
101 - currentAccountAmountColor: Colors.white);
102 -
103 - @override
104 - ReceivePageTheme get receivePageTheme => super.receivePageTheme.copyWith(
105 - tilesTextColor: Colors.white, iconsBackgroundColor: Colors.grey, iconsColor: Colors.black);
106 -
107 - @override
108 - OptionTileTheme get optionTileTheme => OptionTileTheme(
109 - titleColor: Colors.white, descriptionColor: Colors.white, useDarkImage: false);
110 -
111 - @override
112 - ThemeData get themeData => super.themeData.copyWith(
113 - disabledColor: Colors.grey,
114 - dialogTheme: super.themeData.dialogTheme.copyWith(backgroundColor: Colors.white));
115 -}
lib/themes/light_theme.dart deleted
-230
@@ -1,230 +0,0 @@
1 -import 'package:cake_wallet/themes/extensions/account_list_theme.dart';
2 -import 'package:cake_wallet/themes/extensions/address_theme.dart';
3 -import 'package:cake_wallet/themes/extensions/alert_theme.dart';
4 -import 'package:cake_wallet/themes/extensions/balance_page_theme.dart';
5 -import 'package:cake_wallet/themes/extensions/cake_scrollbar_theme.dart';
6 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
7 -import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
8 -import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart';
9 -import 'package:cake_wallet/themes/extensions/filter_theme.dart';
10 -import 'package:cake_wallet/themes/extensions/indicator_dot_theme.dart';
11 -import 'package:cake_wallet/themes/extensions/info_theme.dart';
12 -import 'package:cake_wallet/themes/extensions/keyboard_theme.dart';
13 -import 'package:cake_wallet/themes/extensions/menu_theme.dart';
14 -import 'package:cake_wallet/themes/extensions/new_wallet_theme.dart';
15 -import 'package:cake_wallet/themes/extensions/option_tile_theme.dart';
16 -import 'package:cake_wallet/themes/extensions/order_theme.dart';
17 -import 'package:cake_wallet/themes/extensions/picker_theme.dart';
18 -import 'package:cake_wallet/themes/extensions/pin_code_theme.dart';
19 -import 'package:cake_wallet/themes/extensions/placeholder_theme.dart';
20 -import 'package:cake_wallet/themes/extensions/qr_code_theme.dart';
21 -import 'package:cake_wallet/themes/extensions/receive_page_theme.dart';
22 -import 'package:cake_wallet/themes/extensions/seed_widget_theme.dart';
23 -import 'package:cake_wallet/themes/extensions/send_page_theme.dart';
24 -import 'package:cake_wallet/themes/extensions/support_page_theme.dart';
25 -import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart';
26 -import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart';
27 -import 'package:cake_wallet/themes/extensions/wallet_list_theme.dart';
28 -import 'package:cake_wallet/themes/theme_base.dart';
29 -import 'package:cake_wallet/generated/i18n.dart';
30 -import 'package:cake_wallet/palette.dart';
31 -import 'package:flutter/material.dart';
32 -
33 -class LightTheme extends ThemeBase {
34 - LightTheme({required int raw}) : super(raw: raw);
35 -
36 - @override
37 - String get title => S.current.light_theme;
38 - @override
39 - ThemeType get type => ThemeType.light;
40 - @override
41 - Brightness get brightness => Brightness.light;
42 - @override
43 - Color get backgroundColor => Colors.white;
44 - @override
45 - Color get primaryColor => Palette.protectiveBlue;
46 - @override
47 - Color get primaryTextColor => Palette.darkBlueCraiola;
48 - @override
49 - Color get containerColor => Palette.blueAlice;
50 - @override
51 - Color get dialogBackgroundColor => Colors.white;
52 -
53 - @override
54 - CakeScrollbarTheme get scrollbarTheme => CakeScrollbarTheme(
55 - thumbColor: Palette.moderatePurpleBlue,
56 - trackColor: Palette.periwinkleCraiola);
57 -
58 - @override
59 - SyncIndicatorTheme get syncIndicatorStyle => SyncIndicatorTheme(
60 - textColor: Palette.darkBlueCraiola,
61 - syncedBackgroundColor: Palette.blueAlice,
62 - notSyncedIconColor: Palette.shineOrange,
63 - notSyncedBackgroundColor: Palette.blueAlice.withOpacity(0.75));
64 -
65 - @override
66 - KeyboardTheme get keyboardTheme =>
67 - KeyboardTheme(keyboardBarColor: Palette.dullGray);
68 -
69 - @override
70 - PinCodeTheme get pinCodeTheme => PinCodeTheme(
71 - indicatorsColor: Palette.darkGray, switchColor: Palette.darkGray);
72 -
73 - @override
74 - SupportPageTheme get supportPageTheme =>
75 - SupportPageTheme(iconColor: Colors.black);
76 -
77 - @override
78 - ExchangePageTheme get exchangePageTheme => ExchangePageTheme(
79 - hintTextColor: Colors.white.withOpacity(0.4),
80 - dividerCodeColor: Palette.wildPeriwinkle,
81 - qrCodeColor: primaryTextColor,
82 - buttonBackgroundColor: containerColor,
83 - textFieldButtonColor: Colors.white.withOpacity(0.2),
84 - textFieldBorderBottomPanelColor: Colors.white.withOpacity(0.5),
85 - textFieldBorderTopPanelColor: Colors.white.withOpacity(0.5),
86 - secondGradientBottomPanelColor: Palette.blueGreyCraiola.withOpacity(0.7),
87 - firstGradientBottomPanelColor: Palette.blueCraiola.withOpacity(0.7),
88 - secondGradientTopPanelColor: Palette.blueGreyCraiola,
89 - firstGradientTopPanelColor: Palette.blueCraiola,
90 - receiveAmountColor: Palette.niagara);
91 -
92 - @override
93 - NewWalletTheme get newWalletTheme => NewWalletTheme(
94 - hintTextColor: Palette.darkGray,
95 - underlineColor: Palette.periwinkleCraiola);
96 -
97 - @override
98 - AddressTheme get addressTheme =>
99 - AddressTheme(actionButtonColor: Palette.shadowWhite);
100 -
101 - @override
102 - DashboardPageTheme get dashboardPageTheme =>
103 - super.dashboardPageTheme.copyWith(
104 - cardTextColor: super.dashboardPageTheme.textColor,
105 - indicatorDotTheme: IndicatorDotTheme(
106 - indicatorColor: PaletteDark.darkCyanBlue.withOpacity(0.67),
107 - activeIndicatorColor: PaletteDark.darkNightBlue));
108 -
109 - @override
110 - BalancePageTheme get balancePageTheme => BalancePageTheme(
111 - textColor: dashboardPageTheme.textColor,
112 - labelTextColor: Palette.darkBlueCraiola.withOpacity(0.67));
113 -
114 - @override
115 - CakeMenuTheme get menuTheme => CakeMenuTheme(
116 - headerFirstGradientColor: Palette.blueCraiola,
117 - headerSecondGradientColor: Palette.blueGreyCraiola,
118 - backgroundColor: Colors.white,
119 - subnameTextColor: Colors.white,
120 - dividerColor: Palette.wildLavender,
121 - iconColor: Colors.white,
122 - settingTitleColor: receivePageTheme.tilesTextColor,
123 - settingActionsIconColor: Palette.gray);
124 -
125 - @override
126 - FilterTheme get filterTheme => FilterTheme(
127 - checkboxFirstGradientColor: Palette.blueCraiola,
128 - checkboxSecondGradientColor: Palette.blueGreyCraiola,
129 - checkboxBoundsColor: Palette.wildPeriwinkle,
130 - checkboxBackgroundColor: Colors.white,
131 - titlesColor: Palette.darkGray,
132 - buttonColor: Palette.blueAlice,
133 - iconColor: PaletteDark.wildBlue);
134 -
135 - @override
136 - WalletListTheme get walletListTheme => WalletListTheme(
137 - restoreWalletButtonTextColor: Colors.white,
138 - createNewWalletButtonBackgroundColor: Palette.protectiveBlue);
139 -
140 - @override
141 - InfoTheme get infoTheme => InfoTheme(textColor: Palette.darkBlueCraiola);
142 -
143 - @override
144 - PickerTheme get pickerTheme => PickerTheme(
145 - dividerColor: Palette.periwinkleCraiola,
146 - searchTextColor: cakeTextTheme.textfieldUnderlineColor,
147 - searchBackgroundFillColor: addressTheme.actionButtonColor);
148 -
149 - @override
150 - AlertTheme get alertTheme => AlertTheme(
151 - backdropColor: PaletteDark.darkNightBlue.withOpacity(0.75),
152 - leftButtonTextColor: Palette.brightOrange);
153 -
154 - @override
155 - OrderTheme get orderTheme => OrderTheme(iconColor: Colors.black);
156 -
157 - @override
158 - SendPageTheme get sendPageTheme => SendPageTheme(
159 - templateTitleColor: Palette.darkBlueCraiola,
160 - templateBackgroundColor: Palette.blueAlice,
161 - templateNewTextColor: Palette.darkBlueCraiola,
162 - templateDottedBorderColor: Palette.moderateLavender,
163 - templateSelectedCurrencyBackgroundColor: Colors.white,
164 - templateSelectedCurrencyTitleColor: primaryColor,
165 - estimatedFeeColor: Colors.white.withOpacity(0.5),
166 - textFieldButtonIconColor: Colors.white,
167 - textFieldButtonColor: Colors.white.withOpacity(0.2),
168 - textFieldHintColor: Colors.white.withOpacity(0.5),
169 - textFieldBorderColor: Colors.white.withOpacity(0.5),
170 - secondGradientColor: Palette.blueGreyCraiola,
171 - firstGradientColor: Palette.blueCraiola,
172 - indicatorDotColor: PaletteDark.darkCyanBlue.withOpacity(0.67));
173 -
174 - @override
175 - SeedWidgetTheme get seedWidgetTheme =>
176 - SeedWidgetTheme(hintTextColor: Palette.darkGray);
177 -
178 - @override
179 - PlaceholderTheme get placeholderTheme =>
180 - PlaceholderTheme(color: PaletteDark.darkCyanBlue);
181 -
182 - @override
183 - TransactionTradeTheme get transactionTradeTheme => TransactionTradeTheme(
184 - detailsTitlesColor: Palette.darkGray, rowsColor: Palette.blueAlice);
185 -
186 - @override
187 - CakeTextTheme get cakeTextTheme => CakeTextTheme(
188 - secondaryTextColor: PaletteDark.pigeonBlue,
189 - textfieldUnderlineColor: Palette.wildPeriwinkle,
190 - titleColor: Palette.violetBlue,
191 - addressButtonBorderColor: Palette.blueAlice,
192 - dateSectionRowColor: PaletteDark.darkCyanBlue);
193 -
194 - @override
195 - AccountListTheme get accountListTheme => AccountListTheme(
196 - currentAccountBackgroundColor: dialogBackgroundColor,
197 - currentAccountTextColor: primaryColor,
198 - currentAccountAmountColor: receivePageTheme.iconsColor,
199 - tilesBackgroundColor: Colors.white,
200 - tilesAmountColor: receivePageTheme.iconsColor,
201 - tilesTextColor: Palette.violetBlue);
202 -
203 - @override
204 - ReceivePageTheme get receivePageTheme => ReceivePageTheme(
205 - currentTileBackgroundColor: Palette.blueCraiola,
206 - currentTileTextColor: Colors.white,
207 - tilesBackgroundColor: Palette.blueAlice,
208 - tilesTextColor: Palette.darkBlueCraiola,
209 - iconsBackgroundColor: Palette.moderateLavender,
210 - iconsColor: PaletteDark.lightBlueGrey,
211 - amountBottomBorderColor: Palette.darkBlueCraiola,
212 - amountHintTextColor: Palette.darkBlueCraiola);
213 -
214 - @override
215 - QRCodeTheme get qrCodeTheme => QRCodeTheme(
216 - qrCodeColor: Colors.white,
217 - qrWidgetCopyButtonColor: PaletteDark.lightBlueGrey);
218 -
219 - @override
220 - OptionTileTheme get optionTileTheme => OptionTileTheme(
221 - titleColor: primaryTextColor, descriptionColor: primaryTextColor, useDarkImage: true);
222 -
223 - @override
224 - ThemeData get themeData => super.themeData.copyWith(
225 - dividerColor: Palette.paleBlue,
226 - hintColor: Palette.gray,
227 - disabledColor: Palette.darkGray,
228 - dialogTheme:
229 - super.themeData.dialogTheme.copyWith(backgroundColor: Colors.white));
230 -}
lib/themes/matrix_green_theme.dart deleted
-14
@@ -1,14 +0,0 @@
1 -import 'package:cake_wallet/generated/i18n.dart';
2 -import 'package:cake_wallet/palette.dart';
3 -import 'package:cake_wallet/themes/monero_dark_theme.dart';
4 -import 'package:flutter/material.dart';
5 -
6 -class MatrixGreenTheme extends MoneroDarkTheme {
7 - MatrixGreenTheme({required int raw}) : super(raw: raw);
8 -
9 - @override
10 - String get title => S.current.matrix_green_dark_theme;
11 - @override
12 - Color get primaryColor => PaletteDark.matrixGreen;
13 -}
14 -
lib/themes/monero_dark_theme.dart deleted
-197
@@ -1,197 +0,0 @@
1 -import 'package:cake_wallet/themes/dark_theme.dart';
2 -import 'package:cake_wallet/themes/extensions/account_list_theme.dart';
3 -import 'package:cake_wallet/themes/extensions/address_theme.dart';
4 -import 'package:cake_wallet/themes/extensions/alert_theme.dart';
5 -import 'package:cake_wallet/themes/extensions/balance_page_theme.dart';
6 -import 'package:cake_wallet/themes/extensions/cake_scrollbar_theme.dart';
7 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
8 -import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
9 -import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart';
10 -import 'package:cake_wallet/themes/extensions/filter_theme.dart';
11 -import 'package:cake_wallet/themes/extensions/indicator_dot_theme.dart';
12 -import 'package:cake_wallet/themes/extensions/info_theme.dart';
13 -import 'package:cake_wallet/themes/extensions/menu_theme.dart';
14 -import 'package:cake_wallet/themes/extensions/new_wallet_theme.dart';
15 -import 'package:cake_wallet/themes/extensions/picker_theme.dart';
16 -import 'package:cake_wallet/themes/extensions/pin_code_theme.dart';
17 -import 'package:cake_wallet/themes/extensions/qr_code_theme.dart';
18 -import 'package:cake_wallet/themes/extensions/receive_page_theme.dart';
19 -import 'package:cake_wallet/themes/extensions/seed_widget_theme.dart';
20 -import 'package:cake_wallet/themes/extensions/send_page_theme.dart';
21 -import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart';
22 -import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart';
23 -import 'package:cake_wallet/themes/extensions/wallet_list_theme.dart';
24 -import 'package:cake_wallet/themes/theme_base.dart';
25 -import 'package:cake_wallet/generated/i18n.dart';
26 -import 'package:cake_wallet/palette.dart';
27 -import 'package:flutter/material.dart';
28 -
29 -class MoneroDarkTheme extends DarkTheme {
30 - MoneroDarkTheme({required int raw}) : super(raw: raw);
31 -
32 - @override
33 - ThemeType get type => ThemeType.oled;
34 - @override
35 - String get title => S.current.monero_dark_theme;
36 - @override
37 - Color get backgroundColor => Colors.black;
38 - @override
39 - Color get primaryColor => PaletteDark.moneroOrange;
40 - @override
41 - Color get containerColor => PaletteDark.moneroCard;
42 - @override
43 - Color get dialogBackgroundColor => containerColor;
44 -
45 - @override
46 - CakeScrollbarTheme get scrollbarTheme =>
47 - super.scrollbarTheme.copyWith(thumbColor: Colors.grey);
48 -
49 - @override
50 - SyncIndicatorTheme get syncIndicatorStyle =>
51 - super.syncIndicatorStyle.copyWith(
52 - textColor: Colors.white,
53 - notSyncedBackgroundColor: Colors.grey.withOpacity(0.2),
54 - syncedBackgroundColor: containerColor);
55 -
56 - @override
57 - PinCodeTheme get pinCodeTheme => super
58 - .pinCodeTheme
59 - .copyWith(indicatorsColor: primaryColor, switchColor: Colors.grey);
60 -
61 - @override
62 - ExchangePageTheme get exchangePageTheme => super.exchangePageTheme.copyWith(
63 - hintTextColor: Colors.grey,
64 - qrCodeColor: primaryTextColor,
65 - buttonBackgroundColor: colorScheme.surfaceVariant,
66 - textFieldButtonColor: colorScheme.onInverseSurface,
67 - textFieldBorderBottomPanelColor: colorScheme.surfaceVariant,
68 - textFieldBorderTopPanelColor: colorScheme.surfaceVariant,
69 - secondGradientBottomPanelColor: containerColor,
70 - firstGradientBottomPanelColor: containerColor,
71 - secondGradientTopPanelColor: colorScheme.surface,
72 - firstGradientTopPanelColor: colorScheme.surface,
73 - receiveAmountColor: colorScheme.surfaceVariant);
74 -
75 - @override
76 - NewWalletTheme get newWalletTheme => super
77 - .newWalletTheme
78 - .copyWith(hintTextColor: Colors.grey, underlineColor: Colors.grey);
79 -
80 - @override
81 - AddressTheme get addressTheme =>
82 - super.addressTheme.copyWith(actionButtonColor: containerColor);
83 -
84 - @override
85 - DashboardPageTheme get dashboardPageTheme =>
86 - super.dashboardPageTheme.copyWith(
87 - pageTitleTextColor: primaryColor,
88 - mainActionsIconColor: primaryColor,
89 - indicatorDotTheme: IndicatorDotTheme(
90 - indicatorColor: colorScheme.secondaryContainer,
91 - activeIndicatorColor: colorScheme.inversePrimary));
92 - @override
93 - BalancePageTheme get balancePageTheme => super.balancePageTheme.copyWith(
94 - cardBorderColor: primaryColor.withOpacity(0.2),
95 - labelTextColor: Colors.grey,
96 - balanceAmountColor: primaryColor,
97 - assetTitleColor: primaryColor);
98 -
99 - @override
100 - CakeMenuTheme get menuTheme => super.menuTheme.copyWith(
101 - headerFirstGradientColor: primaryColor,
102 - headerSecondGradientColor: containerColor,
103 - backgroundColor: containerColor,
104 - subnameTextColor: Colors.grey,
105 - dividerColor: colorScheme.secondaryContainer,
106 - iconColor: Colors.white,
107 - settingActionsIconColor: colorScheme.secondaryContainer);
108 -
109 - @override
110 - FilterTheme get filterTheme => super.filterTheme.copyWith(
111 - checkboxFirstGradientColor: colorScheme.secondaryContainer,
112 - checkboxSecondGradientColor: colorScheme.inversePrimary,
113 - checkboxBoundsColor: PaletteDark.wildVioletBlue,
114 - checkboxBackgroundColor: PaletteDark.wildVioletBlue.withOpacity(0.3),
115 - buttonColor: containerColor,
116 - iconColor: Colors.grey);
117 -
118 - @override
119 - WalletListTheme get walletListTheme => super.walletListTheme.copyWith(
120 - restoreWalletButtonTextColor: Colors.white,
121 - createNewWalletButtonBackgroundColor: primaryColor);
122 -
123 - @override
124 - InfoTheme get infoTheme => super.infoTheme.copyWith(textColor: Colors.grey);
125 -
126 - @override
127 - PickerTheme get pickerTheme =>
128 - super.pickerTheme.copyWith(dividerColor: Colors.grey.withOpacity(0.5));
129 -
130 - @override
131 - SendPageTheme get sendPageTheme => super.sendPageTheme.copyWith(
132 - templateNewTextColor:
133 - dashboardPageTheme.indicatorDotTheme.activeIndicatorColor,
134 - templateTitleColor: primaryTextColor,
135 - templateBackgroundColor: containerColor,
136 - templateDottedBorderColor: colorScheme.primaryContainer,
137 - templateSelectedCurrencyTitleColor: Colors.black,
138 - textFieldButtonIconColor: colorScheme.inverseSurface,
139 - textFieldButtonColor: colorScheme.onInverseSurface,
140 - textFieldHintColor: Colors.grey.withOpacity(0.5),
141 - textFieldBorderColor: Colors.grey.withOpacity(0.5),
142 - secondGradientColor: containerColor,
143 - firstGradientColor: containerColor,
144 - indicatorDotColor: dashboardPageTheme.indicatorDotTheme.indicatorColor);
145 -
146 - @override
147 - SeedWidgetTheme get seedWidgetTheme =>
148 - super.seedWidgetTheme.copyWith(hintTextColor: Colors.grey);
149 -
150 - @override
151 - TransactionTradeTheme get transactionTradeTheme => super
152 - .transactionTradeTheme
153 - .copyWith(detailsTitlesColor: Colors.grey, rowsColor: containerColor);
154 -
155 - @override
156 - CakeTextTheme get cakeTextTheme => super.cakeTextTheme.copyWith(
157 - secondaryTextColor: Colors.grey,
158 - addressButtonBorderColor: primaryColor.withOpacity(0.2),
159 - dateSectionRowColor: Colors.grey,
160 - textfieldUnderlineColor: Colors.grey.withOpacity(0.5));
161 -
162 - @override
163 - AccountListTheme get accountListTheme =>
164 - super.accountListTheme.copyWith(tilesBackgroundColor: containerColor);
165 -
166 - @override
167 - ReceivePageTheme get receivePageTheme => super.receivePageTheme.copyWith(
168 - currentTileBackgroundColor: primaryColor,
169 - currentTileTextColor: Colors.white,
170 - tilesBackgroundColor: containerColor,
171 - iconsBackgroundColor: colorScheme.onInverseSurface,
172 - iconsColor: colorScheme.inverseSurface,
173 - amountBottomBorderColor: Colors.grey,
174 - amountHintTextColor: Colors.grey);
175 -
176 - @override
177 - QRCodeTheme get qrCodeTheme => QRCodeTheme(
178 - qrCodeColor: Colors.grey, qrWidgetCopyButtonColor: Colors.grey);
179 -
180 - @override
181 - AlertTheme get alertTheme => super
182 - .alertTheme
183 - .copyWith(backdropColor: colorScheme.surface.withOpacity(0.75));
184 -
185 - @override
186 - ThemeData get themeData => super.themeData.copyWith(
187 - dividerColor: pickerTheme.dividerColor,
188 - hintColor: Colors.grey,
189 - dialogTheme:
190 - super.themeData.dialogTheme.copyWith(backgroundColor: containerColor),
191 - appBarTheme: super.themeData.appBarTheme.copyWith(
192 - titleTextStyle: super
193 - .themeData
194 - .appBarTheme
195 - .titleTextStyle!
196 - .copyWith(color: primaryColor)));
197 -}
lib/themes/monero_light_theme.dart deleted
-159
@@ -1,159 +0,0 @@
1 -import 'package:cake_wallet/themes/extensions/account_list_theme.dart';
2 -import 'package:cake_wallet/themes/extensions/address_theme.dart';
3 -import 'package:cake_wallet/themes/extensions/alert_theme.dart';
4 -import 'package:cake_wallet/themes/extensions/balance_page_theme.dart';
5 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
6 -import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
7 -import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart';
8 -import 'package:cake_wallet/themes/extensions/filter_theme.dart';
9 -import 'package:cake_wallet/themes/extensions/indicator_dot_theme.dart';
10 -import 'package:cake_wallet/themes/extensions/menu_theme.dart';
11 -import 'package:cake_wallet/themes/extensions/new_wallet_theme.dart';
12 -import 'package:cake_wallet/themes/extensions/qr_code_theme.dart';
13 -import 'package:cake_wallet/themes/extensions/receive_page_theme.dart';
14 -import 'package:cake_wallet/themes/extensions/seed_widget_theme.dart';
15 -import 'package:cake_wallet/themes/extensions/send_page_theme.dart';
16 -import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart';
17 -import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart';
18 -import 'package:cake_wallet/themes/extensions/wallet_list_theme.dart';
19 -import 'package:cake_wallet/themes/light_theme.dart';
20 -import 'package:cake_wallet/palette.dart';
21 -import 'package:cake_wallet/generated/i18n.dart';
22 -import 'package:flutter/material.dart';
23 -
24 -class MoneroLightTheme extends LightTheme {
25 - MoneroLightTheme({required int raw}) : super(raw: raw);
26 -
27 - @override
28 - String get title => S.current.monero_light_theme;
29 - @override
30 - Color get primaryColor => Palette.moneroOrange;
31 - @override
32 - Color get containerColor => Palette.moneroLightOrange;
33 - @override
34 - Color get primaryTextColor => colorScheme.onPrimaryContainer;
35 - @override
36 - Color get dialogBackgroundColor => containerColor;
37 -
38 - @override
39 - SyncIndicatorTheme get syncIndicatorStyle =>
40 - super.syncIndicatorStyle.copyWith(
41 - textColor: primaryTextColor,
42 - syncedBackgroundColor: colorScheme.primaryContainer,
43 - notSyncedBackgroundColor: containerColor.withOpacity(0.75));
44 -
45 - @override
46 - ExchangePageTheme get exchangePageTheme => super.exchangePageTheme.copyWith(
47 - qrCodeColor: primaryTextColor,
48 - buttonBackgroundColor: containerColor,
49 - secondGradientBottomPanelColor: primaryColor.withOpacity(0.7),
50 - firstGradientBottomPanelColor: colorScheme.primary.withOpacity(0.7),
51 - secondGradientTopPanelColor: primaryColor,
52 - firstGradientTopPanelColor: colorScheme.primary,
53 - textFieldBorderBottomPanelColor: colorScheme.surfaceVariant,
54 - textFieldBorderTopPanelColor: colorScheme.surfaceVariant,
55 - receiveAmountColor: colorScheme.surfaceVariant);
56 -
57 - @override
58 - NewWalletTheme get newWalletTheme => super.newWalletTheme.copyWith(
59 - hintTextColor: colorScheme.secondary,
60 - underlineColor: colorScheme.secondary);
61 -
62 - @override
63 - AddressTheme get addressTheme =>
64 - super.addressTheme.copyWith(actionButtonColor: containerColor);
65 -
66 - @override
67 - DashboardPageTheme get dashboardPageTheme =>
68 - super.dashboardPageTheme.copyWith(
69 - indicatorDotTheme: IndicatorDotTheme(
70 - indicatorColor: colorScheme.secondaryContainer,
71 - activeIndicatorColor: colorScheme.inversePrimary));
72 - @override
73 - BalancePageTheme get balancePageTheme => super.balancePageTheme.copyWith(
74 - textColor: primaryTextColor.withOpacity(0.67),
75 - labelTextColor: colorScheme.secondary);
76 -
77 - @override
78 - CakeMenuTheme get menuTheme => super.menuTheme.copyWith(
79 - headerFirstGradientColor: colorScheme.primary,
80 - headerSecondGradientColor: primaryColor,
81 - dividerColor: colorScheme.secondaryContainer,
82 - iconColor: colorScheme.secondaryContainer,
83 - settingActionsIconColor: colorScheme.secondary);
84 -
85 - @override
86 - FilterTheme get filterTheme => super.filterTheme.copyWith(
87 - checkboxFirstGradientColor: colorScheme.secondaryContainer,
88 - checkboxSecondGradientColor: colorScheme.inversePrimary,
89 - checkboxBoundsColor: PaletteDark.wildVioletBlue,
90 - checkboxBackgroundColor: PaletteDark.wildVioletBlue.withOpacity(0.3),
91 - buttonColor: containerColor,
92 - iconColor: colorScheme.secondary);
93 -
94 - @override
95 - WalletListTheme get walletListTheme => super.walletListTheme.copyWith(
96 - restoreWalletButtonTextColor: Colors.white,
97 - createNewWalletButtonBackgroundColor: primaryColor);
98 -
99 - @override
100 - SendPageTheme get sendPageTheme => super.sendPageTheme.copyWith(
101 - templateTitleColor: primaryTextColor,
102 - templateBackgroundColor: containerColor,
103 - templateNewTextColor: primaryTextColor,
104 - templateDottedBorderColor: colorScheme.primaryContainer,
105 - secondGradientColor: primaryColor,
106 - firstGradientColor: colorScheme.primary,
107 - indicatorDotColor: dashboardPageTheme.indicatorDotTheme.indicatorColor);
108 -
109 - @override
110 - SeedWidgetTheme get seedWidgetTheme =>
111 - super.seedWidgetTheme.copyWith(hintTextColor: colorScheme.secondary);
112 -
113 - @override
114 - TransactionTradeTheme get transactionTradeTheme =>
115 - super.transactionTradeTheme.copyWith(
116 - detailsTitlesColor: colorScheme.secondary, rowsColor: containerColor);
117 -
118 - @override
119 - CakeTextTheme get cakeTextTheme => super.cakeTextTheme.copyWith(
120 - titleColor: primaryTextColor,
121 - secondaryTextColor: colorScheme.secondary,
122 - addressButtonBorderColor: primaryColor.withOpacity(0.2),
123 - dateSectionRowColor: colorScheme.secondary,
124 - textfieldUnderlineColor: colorScheme.secondary.withOpacity(0.5));
125 -
126 - @override
127 - AccountListTheme get accountListTheme =>
128 - super.accountListTheme.copyWith(tilesBackgroundColor: containerColor);
129 -
130 - @override
131 - ReceivePageTheme get receivePageTheme => super.receivePageTheme.copyWith(
132 - currentTileBackgroundColor: primaryColor,
133 - tilesBackgroundColor: containerColor,
134 - tilesTextColor: primaryTextColor,
135 - iconsBackgroundColor: colorScheme.surfaceVariant,
136 - iconsColor: colorScheme.onSurfaceVariant,
137 - amountBottomBorderColor: primaryTextColor,
138 - amountHintTextColor: primaryTextColor,
139 - currentTileTextColor: Colors.white);
140 -
141 - @override
142 - QRCodeTheme get qrCodeTheme => super
143 - .qrCodeTheme
144 - .copyWith(qrWidgetCopyButtonColor: colorScheme.secondary);
145 -
146 - @override
147 - AlertTheme get alertTheme => super
148 - .alertTheme
149 - .copyWith(backdropColor: colorScheme.inverseSurface.withOpacity(0.75));
150 -
151 - @override
152 - ThemeData get themeData => super.themeData.copyWith(
153 - dividerColor: pickerTheme.dividerColor,
154 - hintColor: colorScheme.secondary,
155 - dialogTheme: super
156 - .themeData
157 - .dialogTheme
158 - .copyWith(backgroundColor: containerColor));
159 -}
lib/themes/red_dark_theme.dart deleted
-13
@@ -1,13 +0,0 @@
1 -import 'package:cake_wallet/generated/i18n.dart';
2 -import 'package:cake_wallet/palette.dart';
3 -import 'package:cake_wallet/themes/monero_dark_theme.dart';
4 -import 'package:flutter/material.dart';
5 -
6 -class RedDarkTheme extends MoneroDarkTheme {
7 - RedDarkTheme({required int raw}) : super(raw: raw);
8 -
9 - @override
10 - String get title => S.current.red_dark_theme;
11 - @override
12 - Color get primaryColor => PaletteDark.red;
13 -}
\ No newline at end of file
lib/themes/red_light_theme.dart deleted
-13
@@ -1,13 +0,0 @@
1 -import 'package:cake_wallet/generated/i18n.dart';
2 -import 'package:cake_wallet/palette.dart';
3 -import 'package:cake_wallet/themes/monero_light_theme.dart';
4 -import 'package:flutter/material.dart';
5 -
6 -class RedLightTheme extends MoneroLightTheme {
7 - RedLightTheme({required int raw}) : super(raw: raw);
8 -
9 - @override
10 - String get title => S.current.red_light_theme;
11 - @override
12 - Color get primaryColor => Palette.darkRed;
13 -}
\ No newline at end of file
lib/themes/theme_base.dart deleted
-161
@@ -1,161 +0,0 @@
1 -import 'package:cake_wallet/themes/extensions/account_list_theme.dart';
2 -import 'package:cake_wallet/themes/extensions/address_theme.dart';
3 -import 'package:cake_wallet/themes/extensions/alert_theme.dart';
4 -import 'package:cake_wallet/themes/extensions/balance_page_theme.dart';
5 -import 'package:cake_wallet/themes/extensions/cake_scrollbar_theme.dart';
6 -import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
7 -import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
8 -import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart';
9 -import 'package:cake_wallet/themes/extensions/filter_theme.dart';
10 -import 'package:cake_wallet/themes/extensions/indicator_dot_theme.dart';
11 -import 'package:cake_wallet/themes/extensions/info_theme.dart';
12 -import 'package:cake_wallet/themes/extensions/keyboard_theme.dart';
13 -import 'package:cake_wallet/themes/extensions/menu_theme.dart';
14 -import 'package:cake_wallet/themes/extensions/new_wallet_theme.dart';
15 -import 'package:cake_wallet/themes/extensions/option_tile_theme.dart';
16 -import 'package:cake_wallet/themes/extensions/order_theme.dart';
17 -import 'package:cake_wallet/themes/extensions/picker_theme.dart';
18 -import 'package:cake_wallet/themes/extensions/pin_code_theme.dart';
19 -import 'package:cake_wallet/themes/extensions/placeholder_theme.dart';
20 -import 'package:cake_wallet/themes/extensions/qr_code_theme.dart';
21 -import 'package:cake_wallet/themes/extensions/receive_page_theme.dart';
22 -import 'package:cake_wallet/themes/extensions/seed_widget_theme.dart';
23 -import 'package:cake_wallet/themes/extensions/send_page_theme.dart';
24 -import 'package:cake_wallet/themes/extensions/support_page_theme.dart';
25 -import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart';
26 -import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart';
27 -import 'package:cake_wallet/themes/extensions/wallet_list_theme.dart';
28 -import 'package:flutter/material.dart';
29 -
30 -enum ThemeType { light, bright, dark, oled}
31 -
32 -abstract class ThemeBase {
33 - ThemeBase({required this.raw}) {
34 - colorScheme = ColorScheme.fromSeed(
35 - brightness: brightness,
36 - seedColor: primaryColor,
37 - background: backgroundColor);
38 - }
39 -
40 - final int raw;
41 - String get title;
42 - ThemeType get type;
43 -
44 - @override
45 - String toString() {
46 - return title;
47 - }
48 -
49 - Brightness get brightness;
50 - Color get backgroundColor;
51 - Color get primaryColor;
52 - Color get primaryTextColor;
53 - Color get containerColor;
54 - Color get dialogBackgroundColor;
55 -
56 - ColorScheme colorScheme = ColorScheme.light();
57 -
58 - ThemeData get generatedThemeData => ThemeData.from(
59 - colorScheme: colorScheme,
60 - textTheme: TextTheme().apply(fontFamily: 'Lato'));
61 -
62 - DashboardPageTheme get dashboardPageTheme => DashboardPageTheme(
63 - firstGradientBackgroundColor: backgroundColor,
64 - secondGradientBackgroundColor: backgroundColor,
65 - thirdGradientBackgroundColor: backgroundColor,
66 - textColor: primaryTextColor,
67 - indicatorDotTheme: IndicatorDotTheme(
68 - indicatorColor: primaryColor, activeIndicatorColor: backgroundColor));
69 -
70 - CakeScrollbarTheme get scrollbarTheme;
71 -
72 - SyncIndicatorTheme get syncIndicatorStyle;
73 -
74 - KeyboardTheme get keyboardTheme;
75 -
76 - PinCodeTheme get pinCodeTheme;
77 -
78 - SupportPageTheme get supportPageTheme;
79 -
80 - ExchangePageTheme get exchangePageTheme;
81 -
82 - NewWalletTheme get newWalletTheme;
83 -
84 - BalancePageTheme get balancePageTheme;
85 -
86 - AddressTheme get addressTheme;
87 -
88 - CakeMenuTheme get menuTheme;
89 -
90 - FilterTheme get filterTheme;
91 -
92 - WalletListTheme get walletListTheme;
93 -
94 - InfoTheme get infoTheme;
95 -
96 - PickerTheme get pickerTheme;
97 -
98 - AlertTheme get alertTheme;
99 -
100 - OrderTheme get orderTheme;
101 -
102 - SendPageTheme get sendPageTheme;
103 -
104 - SeedWidgetTheme get seedWidgetTheme;
105 -
106 - PlaceholderTheme get placeholderTheme;
107 -
108 - TransactionTradeTheme get transactionTradeTheme;
109 -
110 - CakeTextTheme get cakeTextTheme;
111 -
112 - AccountListTheme get accountListTheme;
113 -
114 - ReceivePageTheme get receivePageTheme;
115 -
116 - QRCodeTheme get qrCodeTheme;
117 -
118 - OptionTileTheme get optionTileTheme;
119 -
120 - ThemeData get themeData => generatedThemeData.copyWith(
121 - primaryColor: primaryColor,
122 - cardColor: containerColor,
123 - dialogBackgroundColor: dialogBackgroundColor,
124 - extensions: [
125 - dashboardPageTheme,
126 - scrollbarTheme,
127 - syncIndicatorStyle,
128 - keyboardTheme,
129 - pinCodeTheme,
130 - supportPageTheme,
131 - exchangePageTheme,
132 - newWalletTheme,
133 - balancePageTheme,
134 - addressTheme,
135 - menuTheme,
136 - filterTheme,
137 - walletListTheme,
138 - infoTheme,
139 - pickerTheme,
140 - alertTheme,
141 - orderTheme,
142 - sendPageTheme,
143 - seedWidgetTheme,
144 - placeholderTheme,
145 - transactionTradeTheme,
146 - cakeTextTheme,
147 - accountListTheme,
148 - receivePageTheme,
149 - qrCodeTheme,
150 - optionTileTheme
151 - ],
152 - scrollbarTheme: generatedThemeData.scrollbarTheme.copyWith(
153 - thumbColor: MaterialStateProperty.all(scrollbarTheme.thumbColor),
154 - trackColor: MaterialStateProperty.all(scrollbarTheme.trackColor),
155 - radius: Radius.circular(3),
156 - thickness: MaterialStateProperty.all(6),
157 - thumbVisibility: MaterialStateProperty.all(true),
158 - crossAxisMargin: 6),
159 - appBarTheme: generatedThemeData.appBarTheme.copyWith(
160 - titleTextStyle: TextStyle(color: cakeTextTheme.titleColor)));
161 -}
lib/themes/theme_classes/dark_theme.dart new
+234
@@ -0,0 +1,234 @@
1 +import 'package:flutter/material.dart';
2 +import 'package:cake_wallet/themes/core/material_base_theme.dart';
3 +
4 +class DarkTheme extends MaterialThemeBase {
5 + @override
6 + Brightness get brightness => Brightness.dark;
7 +
8 + @override
9 + ThemeMode get themeMode => ThemeMode.dark;
10 +
11 + @override
12 + Color get primaryColor => const Color(0xFF91B0FF);
13 +
14 + @override
15 + Color get secondaryColor => const Color(0xFFA1B9FF);
16 +
17 + @override
18 + Color get errorColor => const Color(0xFFFFB4AB);
19 +
20 + @override
21 + Color get surfaceColor => const Color(0xFF1B284A);
22 +
23 + @override
24 + Color get tertiaryColor => const Color(0xFF162028);
25 +
26 + @override
27 + ColorScheme get colorScheme => ColorScheme.dark(
28 + primary: primaryColor,
29 + onPrimary: const Color(0xFF002860),
30 + primaryContainer: const Color(0xFF004C9E),
31 + onPrimaryContainer: const Color(0xFFFFF3F0),
32 + secondary: secondaryColor,
33 + onSecondary: const Color(0xFF0C1C58),
34 + secondaryContainer: const Color(0xFF1A3C6C),
35 + onSecondaryContainer: const Color(0xFFBACBFF),
36 + tertiary: tertiaryColor,
37 + onTertiary: const Color(0xFF2B373F),
38 + tertiaryContainer: const Color(0xFF1F2832),
39 + onTertiaryContainer: const Color(0xFFA8B3C6),
40 + error: errorColor,
41 + onError: const Color(0xFF690005),
42 + errorContainer: const Color(0xFFB71919),
43 + onErrorContainer: const Color(0xFFFFDAD6),
44 + surface: surfaceColor,
45 + onSurface: const Color(0xFFD7E2F7),
46 + onSurfaceVariant: const Color(0xFF8C9FBB),
47 + surfaceContainerLowest: Color(0xFF171C30),
48 + surfaceContainerLow: Color(0xFF2D385C),
49 + surfaceContainer: Color(0xFF24335B),
50 + surfaceContainerHigh: Color(0xFF212C47),
51 + surfaceContainerHighest: Color(0xFF2A3B67),
52 + outline: const Color(0xFF9EACC1),
53 + outlineVariant: const Color(0xFF3E5579),
54 + );
55 + static const String fontFamily = 'Lato';
56 + @override
57 + TextTheme get textTheme => TextTheme(
58 + displayLarge: TextStyle(
59 + fontSize: 57,
60 + fontWeight: FontWeight.w400,
61 + letterSpacing: -0.25,
62 + color: colorScheme.onSurface,
63 + ),
64 + displayMedium: TextStyle(
65 + fontSize: 45,
66 + fontWeight: FontWeight.w400,
67 + letterSpacing: 0,
68 + color: colorScheme.onSurface,
69 + ),
70 + displaySmall: TextStyle(
71 + fontSize: 36,
72 + fontWeight: FontWeight.w400,
73 + letterSpacing: 0,
74 + color: colorScheme.onSurface,
75 + ),
76 + headlineLarge: TextStyle(
77 + fontSize: 32,
78 + fontWeight: FontWeight.w400,
79 + letterSpacing: 0,
80 + color: colorScheme.onSurface,
81 + ),
82 + headlineMedium: TextStyle(
83 + fontSize: 28,
84 + fontWeight: FontWeight.w400,
85 + letterSpacing: 0,
86 + color: colorScheme.onSurface,
87 + ),
88 + headlineSmall: TextStyle(
89 + fontSize: 24,
90 + fontWeight: FontWeight.w400,
91 + letterSpacing: 0,
92 + color: colorScheme.onSurface,
93 + ),
94 + titleLarge: TextStyle(
95 + fontSize: 22,
96 + fontWeight: FontWeight.w400,
97 + letterSpacing: 0,
98 + color: colorScheme.onSurface,
99 + ),
100 + titleMedium: TextStyle(
101 + fontSize: 16,
102 + fontWeight: FontWeight.w500,
103 + letterSpacing: 0.15,
104 + color: colorScheme.onSurface,
105 + ),
106 + titleSmall: TextStyle(
107 + fontSize: 14,
108 + fontWeight: FontWeight.w500,
109 + letterSpacing: 0.1,
110 + color: colorScheme.onSurface,
111 + ),
112 + bodyLarge: TextStyle(
113 + fontSize: 16,
114 + fontWeight: FontWeight.w400,
115 + letterSpacing: 0.5,
116 + color: colorScheme.onSurface,
117 + ),
118 + bodyMedium: TextStyle(
119 + fontSize: 14,
120 + fontWeight: FontWeight.w400,
121 + letterSpacing: 0.25,
122 + color: colorScheme.onSurface,
123 + ),
124 + bodySmall: TextStyle(
125 + fontSize: 12,
126 + fontWeight: FontWeight.w400,
127 + letterSpacing: 0.4,
128 + color: colorScheme.onSurface,
129 + ),
130 + labelLarge: TextStyle(
131 + fontSize: 14,
132 + fontWeight: FontWeight.w500,
133 + letterSpacing: 0.1,
134 + color: colorScheme.onSurface,
135 + ),
136 + labelMedium: TextStyle(
137 + fontSize: 12,
138 + fontWeight: FontWeight.w500,
139 + letterSpacing: 0.5,
140 + color: colorScheme.onSurface,
141 + ),
142 + labelSmall: TextStyle(
143 + fontSize: 10,
144 + fontWeight: FontWeight.w500,
145 + letterSpacing: 0.5,
146 + color: colorScheme.onSurface,
147 + ),
148 + );
149 +
150 + @override
151 + ThemeData get themeData => ThemeData(
152 + useMaterial3: true,
153 + fontFamily: fontFamily,
154 + brightness: brightness,
155 + colorScheme: colorScheme,
156 + textTheme: textTheme,
157 + appBarTheme: AppBarTheme(
158 + backgroundColor: colorScheme.surface,
159 + foregroundColor: colorScheme.onSurface,
160 + elevation: 0,
161 + ),
162 + cardTheme: CardTheme(
163 + color: colorScheme.surface,
164 + elevation: 1,
165 + shape: RoundedRectangleBorder(
166 + borderRadius: BorderRadius.circular(12),
167 + ),
168 + ),
169 + elevatedButtonTheme: ElevatedButtonThemeData(
170 + style: ElevatedButton.styleFrom(
171 + backgroundColor: colorScheme.primary,
172 + foregroundColor: colorScheme.onPrimary,
173 + elevation: 0,
174 + shape: RoundedRectangleBorder(
175 + borderRadius: BorderRadius.circular(10),
176 + ),
177 + ),
178 + ),
179 + outlinedButtonTheme: OutlinedButtonThemeData(
180 + style: OutlinedButton.styleFrom(
181 + foregroundColor: colorScheme.primary,
182 + side: BorderSide(color: colorScheme.outline),
183 + shape: RoundedRectangleBorder(
184 + borderRadius: BorderRadius.circular(10),
185 + ),
186 + ),
187 + ),
188 + textButtonTheme: TextButtonThemeData(
189 + style: TextButton.styleFrom(
190 + foregroundColor: colorScheme.primary,
191 + shape: RoundedRectangleBorder(
192 + borderRadius: BorderRadius.circular(10),
193 + ),
194 + ),
195 + ),
196 + inputDecorationTheme: InputDecorationTheme(
197 + filled: true,
198 + fillColor: colorScheme.surfaceContainer,
199 + border: OutlineInputBorder(
200 + borderRadius: BorderRadius.circular(10),
201 + borderSide: BorderSide.none,
202 + ),
203 + enabledBorder: OutlineInputBorder(
204 + borderRadius: BorderRadius.circular(10),
205 + borderSide: BorderSide.none,
206 + ),
207 + focusedBorder: OutlineInputBorder(
208 + borderRadius: BorderRadius.circular(10),
209 + borderSide: BorderSide(color: colorScheme.primary),
210 + ),
211 + errorBorder: OutlineInputBorder(
212 + borderRadius: BorderRadius.circular(10),
213 + borderSide: BorderSide(color: colorScheme.error),
214 + ),
215 + focusedErrorBorder: OutlineInputBorder(
216 + borderRadius: BorderRadius.circular(10),
217 + borderSide: BorderSide(color: colorScheme.error),
218 + ),
219 + disabledBorder: OutlineInputBorder(
220 + borderRadius: BorderRadius.circular(10),
221 + borderSide: BorderSide.none,
222 + ),
223 + ),
224 + );
225 +
226 + @override
227 + String get title => 'Dark Theme';
228 +
229 + @override
230 + ThemeType get type => ThemeType.dark;
231 +
232 + @override
233 + int get raw => 1;
234 +}
lib/themes/theme_classes/light_theme.dart new
+231
@@ -0,0 +1,231 @@
1 +import 'package:flutter/material.dart';
2 +import 'package:cake_wallet/themes/core/material_base_theme.dart';
3 +
4 +class LightTheme extends MaterialThemeBase {
5 + @override
6 + Brightness get brightness => Brightness.light;
7 +
8 + @override
9 + ThemeMode get themeMode => ThemeMode.light;
10 +
11 + @override
12 + Color get primaryColor => const Color(0xFF4EBEFF);
13 +
14 + @override
15 + Color get secondaryColor => const Color(0xFF625C64);
16 +
17 + @override
18 + Color get tertiaryColor => const Color(0xFFBFCBDE);
19 +
20 + @override
21 + Color get errorColor => const Color(0xFFBA1A1A);
22 +
23 + @override
24 + Color get surfaceColor => const Color(0xFFEFEFF8);
25 +
26 + @override
27 + ColorScheme get colorScheme => ColorScheme.light(
28 + primary: primaryColor,
29 + onPrimary: const Color(0xFFFFFFFF),
30 + primaryContainer: const Color(0xFF403747),
31 + onPrimaryContainer: const Color(0xFFD5C8DC),
32 + secondary: secondaryColor,
33 + onSecondary: const Color(0xFFFFFFFF),
34 + secondaryContainer: const Color(0xFFE1E4EA),
35 + onSecondaryContainer: const Color(0xFF4C474E),
36 + tertiary: tertiaryColor,
37 + onTertiary: const Color(0xFFFFFFFF),
38 + tertiaryContainer: const Color(0xFF35404A),
39 + onTertiaryContainer: const Color(0xFFC5D7E5),
40 + error: errorColor,
41 + onError: const Color(0xFFFFFFFF),
42 + errorContainer: const Color(0xFFFFBDBD),
43 + onErrorContainer: const Color(0xFFE43D3D),
44 + surface: surfaceColor,
45 + onSurface: const Color(0xFF312938),
46 + onSurfaceVariant: const Color(0xFF6C6772),
47 + surfaceContainerLowest: Color(0xFFE4E4E4),
48 + surfaceContainerLow: Color(0xFFECECED),
49 + surfaceContainer: Color(0xFFFBFBFD),
50 + surfaceContainerHigh: Color(0xFFFDFDFE),
51 + surfaceContainerHighest: Color(0xFFFFFFFF),
52 + outline: const Color(0xFF7B757C),
53 + outlineVariant: const Color(0xFFCBC4CB),
54 + );
55 +
56 + @override
57 + TextTheme get textTheme => TextTheme(
58 + displayLarge: TextStyle(
59 + fontSize: 57,
60 + fontWeight: FontWeight.w400,
61 + letterSpacing: -0.25,
62 + color: colorScheme.onSurface,
63 + ),
64 + displayMedium: TextStyle(
65 + fontSize: 45,
66 + fontWeight: FontWeight.w400,
67 + letterSpacing: 0,
68 + color: colorScheme.onSurface,
69 + ),
70 + displaySmall: TextStyle(
71 + fontSize: 36,
72 + fontWeight: FontWeight.w400,
73 + letterSpacing: 0,
74 + color: colorScheme.onSurface,
75 + ),
76 + headlineLarge: TextStyle(
77 + fontSize: 32,
78 + fontWeight: FontWeight.w400,
79 + letterSpacing: 0,
80 + color: colorScheme.onSurface,
81 + ),
82 + headlineMedium: TextStyle(
83 + fontSize: 28,
84 + fontWeight: FontWeight.w400,
85 + letterSpacing: 0,
86 + color: colorScheme.onSurface,
87 + ),
88 + headlineSmall: TextStyle(
89 + fontSize: 24,
90 + fontWeight: FontWeight.w400,
91 + letterSpacing: 0,
92 + color: colorScheme.onSurface,
93 + ),
94 + titleLarge: TextStyle(
95 + fontSize: 22,
96 + fontWeight: FontWeight.w400,
97 + letterSpacing: 0,
98 + color: colorScheme.onSurface,
99 + ),
100 + titleMedium: TextStyle(
101 + fontSize: 16,
102 + fontWeight: FontWeight.w500,
103 + letterSpacing: 0.15,
104 + color: colorScheme.onSurface,
105 + ),
106 + titleSmall: TextStyle(
107 + fontSize: 14,
108 + fontWeight: FontWeight.w500,
109 + letterSpacing: 0.1,
110 + color: colorScheme.onSurface,
111 + ),
112 + bodyLarge: TextStyle(
113 + fontSize: 16,
114 + fontWeight: FontWeight.w400,
115 + letterSpacing: 0.5,
116 + color: colorScheme.onSurface,
117 + ),
118 + bodyMedium: TextStyle(
119 + fontSize: 14,
120 + fontWeight: FontWeight.w400,
121 + letterSpacing: 0.25,
122 + color: colorScheme.onSurface,
123 + ),
124 + bodySmall: TextStyle(
125 + fontSize: 12,
126 + fontWeight: FontWeight.w400,
127 + letterSpacing: 0.4,
128 + color: colorScheme.onSurface,
129 + ),
130 + labelLarge: TextStyle(
131 + fontSize: 14,
132 + fontWeight: FontWeight.w500,
133 + letterSpacing: 0.1,
134 + color: colorScheme.onSurface,
135 + ),
136 + labelMedium: TextStyle(
137 + fontSize: 12,
138 + fontWeight: FontWeight.w500,
139 + letterSpacing: 0.5,
140 + color: colorScheme.onSurface,
141 + ),
142 + labelSmall: TextStyle(
143 + fontSize: 11,
144 + fontWeight: FontWeight.w500,
145 + letterSpacing: 0.5,
146 + color: colorScheme.onSurface,
147 + ),
148 + );
149 +
150 + static const String fontFamily = 'Lato';
151 + @override
152 + ThemeData get themeData => ThemeData(
153 + useMaterial3: true,
154 + brightness: brightness,
155 + colorScheme: colorScheme,
156 + fontFamily: fontFamily,
157 + textTheme: textTheme,
158 + appBarTheme: AppBarTheme(
159 + backgroundColor: colorScheme.surface,
160 + foregroundColor: colorScheme.onSurface,
161 + elevation: 0,
162 + ),
163 + cardTheme: CardTheme(
164 + color: colorScheme.surface,
165 + elevation: 1,
166 + shape: RoundedRectangleBorder(
167 + borderRadius: BorderRadius.circular(12),
168 + ),
169 + ),
170 + elevatedButtonTheme: ElevatedButtonThemeData(
171 + style: ElevatedButton.styleFrom(
172 + backgroundColor: colorScheme.primary,
173 + foregroundColor: colorScheme.onPrimary,
174 + elevation: 0,
175 + shape: RoundedRectangleBorder(
176 + borderRadius: BorderRadius.circular(20),
177 + ),
178 + ),
179 + ),
180 + outlinedButtonTheme: OutlinedButtonThemeData(
181 + style: OutlinedButton.styleFrom(
182 + foregroundColor: colorScheme.primary,
183 + side: BorderSide(color: colorScheme.outline),
184 + shape: RoundedRectangleBorder(
185 + borderRadius: BorderRadius.circular(20),
186 + ),
187 + ),
188 + ),
189 + textButtonTheme: TextButtonThemeData(
190 + style: TextButton.styleFrom(
191 + foregroundColor: colorScheme.primary,
192 + shape: RoundedRectangleBorder(
193 + borderRadius: BorderRadius.circular(20),
194 + ),
195 + ),
196 + ),
197 + inputDecorationTheme: InputDecorationTheme(
198 + filled: true,
199 + fillColor: colorScheme.surfaceContainer,
200 + border: OutlineInputBorder(
201 + borderRadius: BorderRadius.circular(10),
202 + borderSide: BorderSide.none,
203 + ),
204 + enabledBorder: OutlineInputBorder(
205 + borderRadius: BorderRadius.circular(10),
206 + borderSide: BorderSide.none,
207 + ),
208 + focusedBorder: OutlineInputBorder(
209 + borderRadius: BorderRadius.circular(10),
210 + borderSide: BorderSide(color: colorScheme.primary),
211 + ),
212 + errorBorder: OutlineInputBorder(
213 + borderRadius: BorderRadius.circular(10),
214 + borderSide: BorderSide(color: colorScheme.error),
215 + ),
216 + focusedErrorBorder: OutlineInputBorder(
217 + borderRadius: BorderRadius.circular(10),
218 + borderSide: BorderSide(color: colorScheme.error),
219 + ),
220 + ),
221 + );
222 +
223 + @override
224 + String get title => 'Light Theme';
225 +
226 + @override
227 + ThemeType get type => ThemeType.light;
228 +
229 + @override
230 + int get raw => 0;
231 +}
lib/themes/theme_list.dart deleted
-75
@@ -1,75 +0,0 @@
1 -import 'package:cake_wallet/themes/bright_theme.dart';
2 -import 'package:cake_wallet/themes/dark_theme.dart';
3 -import 'package:cake_wallet/themes/light_theme.dart';
4 -import 'package:cake_wallet/themes/monero_light_theme.dart';
5 -import 'package:cake_wallet/themes/monero_dark_theme.dart';
6 -import 'package:cake_wallet/themes/cake_dark_theme.dart';
7 -import 'package:cake_wallet/themes/matrix_green_theme.dart';
8 -import 'package:cake_wallet/themes/bitcoin_dark_theme.dart';
9 -import 'package:cake_wallet/themes/bitcoin_light_theme.dart';
10 -import 'package:cake_wallet/themes/high_contrast_theme.dart';
11 -import 'package:cake_wallet/themes/red_dark_theme.dart';
12 -import 'package:cake_wallet/themes/red_light_theme.dart';
13 -import 'package:cake_wallet/themes/theme_base.dart';
14 -
15 -class ThemeList {
16 - static final all = [
17 - cakeDarkTheme,
18 - darkTheme,
19 - lightTheme,
20 - moneroDarkTheme,
21 - moneroLightTheme,
22 - brightTheme,
23 - bitcoinDarkTheme,
24 - bitcoinLightTheme,
25 - matrixGreenTheme,
26 - redDarkTheme,
27 - redLightTheme,
28 - highContrastTheme,
29 - ];
30 -
31 - static final lightTheme = LightTheme(raw: 0);
32 - static final brightTheme = BrightTheme(raw: 1);
33 - static final darkTheme = DarkTheme(raw: 2);
34 - static final moneroDarkTheme = MoneroDarkTheme(raw: 3);
35 - static final moneroLightTheme = MoneroLightTheme(raw: 4);
36 - static final matrixGreenTheme = MatrixGreenTheme(raw: 5);
37 - static final bitcoinDarkTheme = BitcoinDarkTheme(raw: 6);
38 - static final bitcoinLightTheme = BitcoinLightTheme(raw: 7);
39 - static final highContrastTheme = HighContrastTheme(raw: 8);
40 - static final redLightTheme = RedLightTheme(raw: 9);
41 - static final redDarkTheme = RedDarkTheme(raw: 10);
42 - static final cakeDarkTheme = CakeDarkTheme(raw: 11);
43 -
44 - static ThemeBase deserialize({required int raw}) {
45 - switch (raw) {
46 - case 0:
47 - return lightTheme;
48 - case 1:
49 - return brightTheme;
50 - case 2:
51 - return darkTheme;
52 - case 3:
53 - return moneroDarkTheme;
54 - case 4:
55 - return moneroLightTheme;
56 - case 5:
57 - return matrixGreenTheme;
58 - case 6:
59 - return bitcoinDarkTheme;
60 - case 7:
61 - return bitcoinLightTheme;
62 - case 8:
63 - return highContrastTheme;
64 - case 9:
65 - return redLightTheme;
66 - case 10:
67 - return redDarkTheme;
68 - case 11:
69 - return cakeDarkTheme;
70 - default:
71 - throw Exception(
72 - 'Unexpected token raw: $raw for deserialization of ThemeBase');
73 - }
74 - }
75 -}
\ No newline at end of file
lib/themes/utils/custom_theme_colors.dart new
+19
@@ -0,0 +1,19 @@
1 +import 'dart:ui';
2 +
3 +class CustomThemeColors {
4 + static const syncGreen = Color(0xFFFF12A439);
5 + static const syncYellow = Color(0xFFFFFB84E);
6 +
7 + static const warningOutlineColorDark = Color(0xFFFFB84E);
8 + static const warningContainerColorDark = Color(0xFF8E5800);
9 + static const warningContainerColorLight = Color(0xFFFFCC00);
10 + static const warningOutlineColorLight = Color(0xFF312938);
11 +
12 + static const backgroundGradientColorDark = Color(0xFF0F1A36);
13 + static const backgroundGradientColorLight = Color(0xFFE7E7FD);
14 +
15 + static const cardGradientColorPrimaryDark = Color(0xFF2B3A67);
16 + static const cardGradientColorPrimaryLight = Color(0xFFFFFFFF);
17 + static const cardGradientColorSecondaryDark = Color(0xFF1C2A4F);
18 + static const cardGradientColorSecondaryLight = Color(0xFFF3F3FF);
19 +}
lib/themes/utils/theme_list.dart new
+33
@@ -0,0 +1,33 @@
1 +import 'package:cake_wallet/themes/core/material_base_theme.dart';
2 +import 'package:cake_wallet/themes/theme_classes/dark_theme.dart';
3 +import 'package:cake_wallet/themes/theme_classes/light_theme.dart';
4 +
5 +class ThemeList {
6 + static final all = [
7 + darkTheme,
8 + lightTheme,
9 + ];
10 +
11 + static final lightTheme = LightTheme();
12 + static final darkTheme = DarkTheme();
13 +
14 + static MaterialThemeBase deserialize({required int raw}) {
15 + switch (raw) {
16 + case 0:
17 + case 2:
18 + case 4:
19 + case 5:
20 + case 7:
21 + case 10:
22 + case 11:
23 + return lightTheme;
24 + case 1:
25 + case 3:
26 + case 6:
27 + case 8:
28 + case 9:
29 + default:
30 + return darkTheme;
31 + }
32 + }
33 +}
lib/themes/utils/theme_provider.dart new
+30
@@ -0,0 +1,30 @@
1 +import 'package:cake_wallet/themes/core/theme_store.dart';
2 +import 'package:cake_wallet/themes/utils/theme_list.dart';
3 +import 'package:flutter/material.dart';
4 +import 'package:flutter_mobx/flutter_mobx.dart';
5 +
6 +/// A widget that provides theme management to its descendants.
7 +/// This widget would wrap the [MaterialApp] in the widget tree.
8 +class ThemeProvider extends StatelessWidget {
9 + final ThemeStore themeStore;
10 + final MaterialApp Function(BuildContext, ThemeData, ThemeData?, ThemeMode) materialAppBuilder;
11 +
12 + const ThemeProvider({
13 + Key? key,
14 + required this.themeStore,
15 + required this.materialAppBuilder,
16 + }) : super(key: key);
17 +
18 + @override
19 + Widget build(BuildContext context) {
20 + return Observer(
21 + builder: (_) {
22 + final theme = themeStore.currentTheme.themeData;
23 + final darkTheme = ThemeList.darkTheme.themeData;
24 + final themeMode = themeStore.themeMode;
25 +
26 + return materialAppBuilder(context, theme, darkTheme, themeMode);
27 + },
28 + );
29 + }
30 +}
lib/utils/show_bar.dart
+28 -21
@@ -3,38 +3,37 @@ import 'package:flutter/material.dart';
3
4 Future<T?> showBar<T>(BuildContext context, String messageText,
5 {bool isDark = false,
6 - Duration? duration = const Duration(seconds: 1), // pass explicitly by null to make the duration indefinite
6 + Duration? duration =
7 + const Duration(seconds: 1), // pass explicitly by null to make the duration indefinite
8 bool isDismissible = true,
9 String? titleText}) async {
10 final bar = Flushbar<T>(
11 boxShadows: [
12 BoxShadow(
12 - color: Colors.black.withOpacity(0.09),
13 + color: Theme.of(context).colorScheme.surface,
14 blurRadius: 8,
15 offset: Offset(0, 2),
16 )
17 ],
17 - backgroundColor: isDark ? Colors.black : Colors.white,
18 + backgroundColor: Theme.of(context).colorScheme.surfaceContainer,
19 borderRadius: BorderRadius.circular(35),
20 margin: EdgeInsets.all(50),
21 titleText: titleText != null
22 ? Text(
23 titleText,
24 textAlign: TextAlign.center,
24 - style: TextStyle(
25 - color: isDark ? Colors.white : Colors.black,
26 - fontWeight: FontWeight.bold,
27 - fontSize: 24.0,
28 - ),
25 + style: Theme.of(context).textTheme.bodyLarge?.copyWith(
26 + fontWeight: FontWeight.bold,
27 + fontSize: 24.0,
28 + ),
29 )
30 : null,
31 messageText: Text(
32 messageText,
33 textAlign: TextAlign.center,
34 - style: TextStyle(
35 - color: isDark ? Colors.white : Colors.black,
36 - fontSize: 16,
37 - ),
34 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
35 + fontSize: 16,
36 + ),
37 ),
38 duration: duration,
39 isDismissible: isDismissible,
@@ -45,24 +44,32 @@ Future<T?> showBar<T>(BuildContext context, String messageText,
44 return bar.show(context);
45 }
46
48 -Flushbar<T> createBar<T>(String text,
49 - {bool isDark = false,
50 - Duration? duration = const Duration(seconds: 1), // pass explicitly by null to make the duration indefinite
51 - bool isDismissible = true}) {
47 +Flushbar<T> createBar<T>(
48 + String text,
49 + BuildContext context, {
50 + bool isDark = false,
51 + Duration? duration =
52 + const Duration(seconds: 1), // pass explicitly by null to make the duration indefinite
53 + bool isDismissible = true,
54 +}) {
55 return Flushbar<T>(
56 boxShadows: [
57 BoxShadow(
55 - color: Colors.black.withOpacity(0.09),
58 + color: Theme.of(context).colorScheme.surface,
59 blurRadius: 8,
60 offset: Offset(0, 2),
61 )
62 ],
60 - backgroundColor: isDark ? Colors.black : Colors.white,
63 + backgroundColor: Theme.of(context).colorScheme.surfaceContainer,
64 borderRadius: BorderRadius.circular(35),
65 margin: EdgeInsets.all(50),
63 - messageText: Text(text,
64 - textAlign: TextAlign.center,
65 - style: TextStyle(color: isDark ? Colors.white : Colors.black)),
66 + messageText: Text(
67 + text,
68 + textAlign: TextAlign.center,
69 + style: Theme.of(context).textTheme.bodyMedium?.copyWith(
70 + color: Theme.of(context).colorScheme.onSurface,
71 + ),
72 + ),
73 duration: duration,
74 isDismissible: isDismissible,
75 flushbarPosition: FlushbarPosition.TOP,
lib/view_model/anonpay_details_view_model.dart
+3 -3
@@ -7,7 +7,7 @@ import 'package:cake_wallet/src/screens/trade_details/track_trade_list_item.dart
7 import 'package:cake_wallet/src/screens/trade_details/trade_details_list_card.dart';
8 import 'package:cake_wallet/src/screens/trade_details/trade_details_status_item.dart';
9 import 'package:cake_wallet/src/screens/transaction_details/standart_list_item.dart';
10 -import 'package:cake_wallet/store/settings_store.dart';
10 +import 'package:cake_wallet/themes/core/theme_store.dart';
11 import 'package:cake_wallet/utils/date_formatter.dart';
12 import 'package:cake_wallet/utils/show_bar.dart';
13 import 'package:cw_core/crypto_currency.dart';
@@ -25,7 +25,7 @@ abstract class AnonpayDetailsViewModelBase with Store {
25 AnonpayDetailsViewModelBase(
26 {required this.anonPayApi,
27 required AnonpayInvoiceInfo anonpayInvoiceInfo,
28 - required this.settingsStore})
28 + required this.themeStore})
29 : items = ObservableList<StandartListItem>(),
30 invoiceDetail = anonpayInvoiceInfo {
31 _updateItems();
@@ -34,7 +34,7 @@ abstract class AnonpayDetailsViewModelBase with Store {
34 }
35
36 final AnonPayApi anonPayApi;
37 - final SettingsStore settingsStore;
37 + final ThemeStore themeStore;
38 final AnonpayInvoiceInfo invoiceDetail;
39
40 final ObservableList<StandartListItem> items;
lib/view_model/buy/buy_sell_view_model.dart
+5 -6
@@ -12,8 +12,7 @@ import 'package:cake_wallet/entities/provider_types.dart';
12 import 'package:cake_wallet/generated/i18n.dart';
13 import 'package:cake_wallet/routes.dart';
14 import 'package:cake_wallet/store/app_store.dart';
15 -import 'package:cake_wallet/store/settings_store.dart';
16 -import 'package:cake_wallet/themes/theme_base.dart';
15 +import 'package:cake_wallet/themes/core/material_base_theme.dart';
16 import 'package:cw_core/crypto_currency.dart';
17 import 'package:flutter/cupertino.dart';
18 import 'package:intl/intl.dart';
@@ -41,7 +40,7 @@ abstract class BuySellViewModelBase extends WalletChangeListenerViewModel with S
40 sortedRecommendedQuotes = ObservableList<Quote>(),
41 sortedQuotes = ObservableList<Quote>(),
42 paymentMethods = ObservableList<PaymentMethod>(),
44 - settingsStore = appStore.settingsStore,
43 + _appStore = appStore,
44 super(appStore: appStore) {
45 const excludeFiatCurrencies = [];
46 const excludeCryptoCurrencies = [];
@@ -80,7 +79,7 @@ abstract class BuySellViewModelBase extends WalletChangeListenerViewModel with S
79 cryptoCurrency = wallet.currency;
80 }
81
83 - bool get isDarkTheme => settingsStore.currentTheme.type == ThemeType.dark;
82 + bool get isDarkTheme => _appStore.themeStore.currentTheme.isDark;
83
84 double get amount {
85 final formattedFiatAmount = double.tryParse(fiatAmount) ?? 200.0;
@@ -90,7 +89,7 @@ abstract class BuySellViewModelBase extends WalletChangeListenerViewModel with S
89 return isBuyAction ? formattedFiatAmount : formattedCryptoAmount;
90 }
91
93 - SettingsStore settingsStore;
92 + AppStore _appStore;
93
94 Quote? bestRateQuote;
95
@@ -166,7 +165,7 @@ abstract class BuySellViewModelBase extends WalletChangeListenerViewModel with S
165 @action
166 void reset() {
167 cryptoCurrency = wallet.currency;
169 - fiatCurrency = settingsStore.fiatCurrency;
168 + fiatCurrency = _appStore.settingsStore.fiatCurrency;
169 isCryptoCurrencyAddressEnabled = !(cryptoCurrency == wallet.currency);
170 _initialize();
171 }
lib/view_model/dashboard/dashboard_view_model.dart
+22 -31
@@ -23,6 +23,7 @@ import 'package:cake_wallet/store/dashboard/trades_store.dart';
23 import 'package:cake_wallet/store/dashboard/transaction_filter_store.dart';
24 import 'package:cake_wallet/store/settings_store.dart';
25 import 'package:cake_wallet/store/yat/yat_store.dart';
26 +import 'package:cake_wallet/themes/core/material_base_theme.dart';
27 import 'package:cake_wallet/view_model/dashboard/action_list_item.dart';
28 import 'package:cake_wallet/view_model/dashboard/anonpay_transaction_list_item.dart';
29 import 'package:cake_wallet/view_model/dashboard/balance_view_model.dart';
@@ -55,8 +56,6 @@ import 'package:mobx/mobx.dart';
56 import 'package:permission_handler/permission_handler.dart';
57 import 'package:shared_preferences/shared_preferences.dart';
58
58 -import '../../themes/theme_base.dart';
59 -
59 part 'dashboard_view_model.g.dart';
60
61 class DashboardViewModel = DashboardViewModelBase with _$DashboardViewModel;
@@ -282,7 +281,8 @@ abstract class DashboardViewModelBase with Store {
281 int confirmations = 1;
282 if (![WalletType.solana, WalletType.tron].contains(wallet.type)) {
283 try {
285 - confirmations = appStore.wallet!.transactionHistory.transactions.values.first.confirmations + 1;
284 + confirmations =
285 + appStore.wallet!.transactionHistory.transactions.values.first.confirmations + 1;
286 } catch (_) {}
287 }
288 return length * confirmations;
@@ -370,6 +370,8 @@ abstract class DashboardViewModelBase with Store {
370 @observable
371 bool isShowThirdYatIntroduction;
372
373 + @computed
374 + bool get isDarkTheme => appStore.themeStore.currentTheme.isDark;
375 @computed
376 String get address => wallet.walletAddresses.address;
377
@@ -411,16 +413,14 @@ abstract class DashboardViewModelBase with Store {
413 ordersStore.orders.where((item) => item.order.walletId == wallet.id).toList();
414
415 @computed
414 - List<AnonpayTransactionListItem> get anonpayTransactions =>
415 - anonpayTransactionsStore.transactions
416 - .where((item) => item.transaction.walletId == wallet.id)
417 - .toList();
416 + List<AnonpayTransactionListItem> get anonpayTransactions => anonpayTransactionsStore.transactions
417 + .where((item) => item.transaction.walletId == wallet.id)
418 + .toList();
419
420 @computed
420 - List<PayjoinTransactionListItem> get payjoinTransactions =>
421 - payjoinTransactionsStore.transactions
422 - .where((item) => item.session.walletId == wallet.id)
423 - .toList();
421 + List<PayjoinTransactionListItem> get payjoinTransactions => payjoinTransactionsStore.transactions
422 + .where((item) => item.session.walletId == wallet.id)
423 + .toList();
424
425 @computed
426 double get price => balanceViewModel.price;
@@ -433,8 +433,8 @@ abstract class DashboardViewModelBase with Store {
433 List<ActionListItem> get items {
434 final _items = <ActionListItem>[];
435
436 - _items.addAll(transactionFilterStore
437 - .filtered(transactions: [...transactions, ...anonpayTransactions]));
436 + _items.addAll(
437 + transactionFilterStore.filtered(transactions: [...transactions, ...anonpayTransactions]));
438 _items.addAll(tradeFilterStore.filtered(trades: trades, wallet: wallet));
439 _items.addAll(orders);
440
@@ -442,11 +442,9 @@ abstract class DashboardViewModelBase with Store {
442 final _payjoinTransactions = payjoinTransactions;
443 _items.forEach((e) {
444 if (e is TransactionListItem &&
445 - _payjoinTransactions
446 - .any((t) => t.session.txId == e.transaction.id)) {
447 - _payjoinTransactions
448 - .firstWhere((t) => t.session.txId == e.transaction.id)
449 - .transaction = e.transaction;
445 + _payjoinTransactions.any((t) => t.session.txId == e.transaction.id)) {
446 + _payjoinTransactions.firstWhere((t) => t.session.txId == e.transaction.id).transaction =
447 + e.transaction;
448 }
449 });
450 _items.addAll(_payjoinTransactions);
@@ -718,26 +716,18 @@ abstract class DashboardViewModelBase with Store {
716 @action
717 double getShadowSpread() {
718 double spread = 0;
721 - if (settingsStore.currentTheme.type == ThemeType.bright)
719 + if (!appStore.themeStore.currentTheme.isDark)
720 spread = 0;
723 - else if (settingsStore.currentTheme.type == ThemeType.light)
724 - spread = 0;
725 - else if (settingsStore.currentTheme.type == ThemeType.dark)
726 - spread = 0;
727 - else if (settingsStore.currentTheme.type == ThemeType.oled) spread = 0;
721 + else if (appStore.themeStore.currentTheme.isDark) spread = 0;
722 return spread;
723 }
724
725 @action
726 double getShadowBlur() {
727 double blur = 0;
734 - if (settingsStore.currentTheme.type == ThemeType.bright)
735 - blur = 0;
736 - else if (settingsStore.currentTheme.type == ThemeType.light)
737 - blur = 0;
738 - else if (settingsStore.currentTheme.type == ThemeType.dark)
728 + if (!appStore.themeStore.currentTheme.isDark)
729 blur = 0;
740 - else if (settingsStore.currentTheme.type == ThemeType.oled) blur = 0;
730 + else if (appStore.themeStore.currentTheme.isDark) blur = 0;
731 return blur;
732 }
733
@@ -954,7 +944,8 @@ abstract class DashboardViewModelBase with Store {
944 int confirmations = 1;
945 if (![WalletType.solana, WalletType.tron].contains(wallet.type)) {
946 try {
957 - confirmations = appStore.wallet!.transactionHistory.transactions.values.first.confirmations + 1;
947 + confirmations =
948 + appStore.wallet!.transactionHistory.transactions.values.first.confirmations + 1;
949 } catch (_) {}
950 }
951 return length * confirmations;
lib/view_model/dashboard/dropdown_filter_item_widget.dart
+2 -3
@@ -1,5 +1,4 @@
1 import 'package:auto_size_text/auto_size_text.dart';
2 -import 'package:cake_wallet/themes/extensions/picker_theme.dart';
2 import 'package:flutter/material.dart';
3
4 class DropdownFilterList extends StatefulWidget {
@@ -43,11 +42,11 @@ class _DropdownFilterListState extends State<DropdownFilterList> {
42 child: Column(
43 mainAxisAlignment: MainAxisAlignment.end,
44 children: [
46 - Icon(Icons.arrow_drop_down, color: Theme.of(context).extension<PickerTheme>()!.searchIconColor),
45 + Icon(Icons.arrow_drop_down, color: Theme.of(context).colorScheme.onSurfaceVariant),
46 ],
47 ),
48 ),
50 - dropdownColor: Theme.of(context).extension<PickerTheme>()!.searchBackgroundFillColor,
49 + dropdownColor: Theme.of(context).colorScheme.surfaceContainerHighest,
50 borderRadius: BorderRadius.circular(10),
51 items: widget.items
52 .map((item) => DropdownMenuItem<String>(
lib/view_model/payjoin_details_view_model.dart
+3 -4
@@ -5,11 +5,10 @@ import 'package:cake_wallet/generated/i18n.dart';
5 import 'package:cake_wallet/src/screens/trade_details/trade_details_list_card.dart';
6 import 'package:cake_wallet/src/screens/trade_details/trade_details_status_item.dart';
7 import 'package:cake_wallet/src/screens/transaction_details/standart_list_item.dart';
8 -import 'package:cake_wallet/store/settings_store.dart';
8 +import 'package:cake_wallet/themes/core/theme_store.dart';
9 import 'package:cake_wallet/utils/date_formatter.dart';
10 import 'package:cw_core/payjoin_session.dart';
11 import 'package:cw_core/transaction_info.dart';
12 -import 'package:cw_core/utils/print_verbose.dart';
12 import 'package:flutter/widgets.dart';
13 import 'package:hive_flutter/hive_flutter.dart';
14 import 'package:mobx/mobx.dart';
@@ -24,7 +23,7 @@ abstract class PayjoinDetailsViewModelBase with Store {
23 this.payjoinSessionId,
24 this.transactionInfo, {
25 required this.payjoinSessionSource,
27 - required this.settingsStore,
26 + required this.themeStore,
27 }) : items = ObservableList<StandartListItem>(),
28 payjoinSession = payjoinSessionSource.get(payjoinSessionId)! {
29 listener = payjoinSessionSource.watch().listen((e) {
@@ -34,7 +33,7 @@ abstract class PayjoinDetailsViewModelBase with Store {
33 }
34
35 final Box<PayjoinSession> payjoinSessionSource;
37 - final SettingsStore settingsStore;
36 + final ThemeStore themeStore;
37 final String payjoinSessionId;
38 final TransactionInfo? transactionInfo;
39
lib/view_model/restore_from_backup_view_model.dart
+1 -1
@@ -64,7 +64,7 @@ abstract class RestoreFromBackupViewModelBase with Store {
64 final store = getIt.get<AppStore>();
65 ReactionDisposer? reaction;
66 await store.settingsStore.reload(nodeSource: getIt.get<Box<Node>>());
67 -
67 + await store.themeStore.loadSavedTheme(isFromBackup: true);
68 reaction = autorun((_) {
69 final wallet = store.wallet;
70
lib/view_model/settings/display_settings_view_model.dart
+22 -8
@@ -1,20 +1,21 @@
1 import 'package:cake_wallet/entities/balance_display_mode.dart';
2 import 'package:cake_wallet/entities/fiat_currency.dart';
3 import 'package:cake_wallet/store/settings_store.dart';
4 -import 'package:cake_wallet/themes/theme_base.dart';
4 +import 'package:cake_wallet/themes/core/material_base_theme.dart';
5 import 'package:mobx/mobx.dart';
6 import 'package:cake_wallet/entities/fiat_api_mode.dart';
7 +import 'package:cake_wallet/themes/core/theme_store.dart';
8 +import 'package:flutter/material.dart';
9
10 part 'display_settings_view_model.g.dart';
11
12 class DisplaySettingsViewModel = DisplaySettingsViewModelBase with _$DisplaySettingsViewModel;
13
14 abstract class DisplaySettingsViewModelBase with Store {
13 - DisplaySettingsViewModelBase(
14 - this._settingsStore,
15 - );
15 + DisplaySettingsViewModelBase(this._settingsStore, this._themeStore);
16
17 final SettingsStore _settingsStore;
18 + final ThemeStore _themeStore;
19
20 @computed
21 FiatCurrency get fiatCurrency => _settingsStore.fiatCurrency;
@@ -32,7 +33,10 @@ abstract class DisplaySettingsViewModelBase with Store {
33 bool get shouldShowMarketPlaceInDashboard => _settingsStore.shouldShowMarketPlaceInDashboard;
34
35 @computed
35 - ThemeBase get theme => _settingsStore.currentTheme;
36 + ThemeData get theme => _themeStore.currentTheme.themeData;
37 +
38 + @computed
39 + ThemeMode get themeMode => _themeStore.themeMode;
40
41 @computed
42 bool get disabledFiatApiMode => _settingsStore.fiatApiMode == FiatApiMode.disabled;
@@ -58,8 +62,19 @@ abstract class DisplaySettingsViewModelBase with Store {
62 }
63
64 @action
61 - void setTheme(ThemeBase newTheme) {
62 - _settingsStore.currentTheme = newTheme;
65 + Future<void> onThemeSelected(MaterialThemeBase newTheme) async {
66 + await setTheme(newTheme);
67 + await setThemeMode(newTheme.themeMode);
68 + }
69 +
70 + @action
71 + Future<void> setTheme(MaterialThemeBase newTheme) async {
72 + await _themeStore.setTheme(newTheme);
73 + }
74 +
75 + @action
76 + Future<void> setThemeMode(ThemeMode value) async {
77 + await _themeStore.setThemeMode(value);
78 }
79
80 @action
@@ -72,5 +87,4 @@ abstract class DisplaySettingsViewModelBase with Store {
87
88 @action
89 void setShowAddressBookPopup(bool value) => _settingsStore.showAddressBookPopupEnabled = value;
75 -
90 }
lib/view_model/trade_details_view_model.dart
+4 -4
@@ -20,7 +20,7 @@ import 'package:cake_wallet/src/screens/trade_details/trade_details_list_card.da
20 import 'package:cake_wallet/src/screens/trade_details/trade_details_status_item.dart';
21 import 'package:cake_wallet/src/screens/trade_details/trade_provider_unsupported_item.dart';
22 import 'package:cake_wallet/src/screens/transaction_details/standart_list_item.dart';
23 -import 'package:cake_wallet/store/settings_store.dart';
23 +import 'package:cake_wallet/store/app_store.dart';
24 import 'package:cake_wallet/utils/date_formatter.dart';
25 import 'package:cake_wallet/utils/show_bar.dart';
26 import 'package:collection/collection.dart';
@@ -39,13 +39,13 @@ abstract class TradeDetailsViewModelBase with Store {
39 TradeDetailsViewModelBase({
40 required Trade tradeForDetails,
41 required this.trades,
42 - required this.settingsStore,
42 + required this.appStore,
43 }) : items = ObservableList<StandartListItem>(),
44 trade = trades.values.firstWhereOrNull((element) => element.id == tradeForDetails.id) ??
45 tradeForDetails {
46 switch (trade.provider) {
47 case ExchangeProviderDescription.changeNow:
48 - _provider = ChangeNowExchangeProvider(settingsStore: settingsStore);
48 + _provider = ChangeNowExchangeProvider(settingsStore: appStore.settingsStore);
49 break;
50 case ExchangeProviderDescription.sideShift:
51 _provider = SideShiftExchangeProvider();
@@ -126,7 +126,7 @@ abstract class TradeDetailsViewModelBase with Store {
126
127 Timer? timer;
128
129 - final SettingsStore settingsStore;
129 + final AppStore appStore;
130
131 @action
132 Future<void> _updateTrade() async {
res/values/strings_ar.arb
+8 -2
@@ -269,6 +269,7 @@
269 "domain_mismatch": "عدم تطابق المجال",
270 "domain_mismatch_description": "يحتوي هذا الموقع على مجال لا يتطابق مع مرسل هذا الطلب. قد تؤدي الموافقة على فقدان الأموال.",
271 "donation_link_details": "تفاصيل رابط التبرع",
272 + "done": "منتهي",
273 "e_sign_consent": "الموافقة على التوقيع الإلكتروني",
274 "edit": "تعديل",
275 "edit_backup_password": "تعديل كلمة مرور النسخ الاحتياطي",
@@ -449,6 +450,7 @@
450 "logout": "تسجيل خروج",
451 "low_fee": "رسوم منخفضة",
452 "low_fee_alert": "أنت تستخدم حاليًا أولوية منخفضة لرسوم الشبكة. قد يتسبب هذا في فترات انتظار طويلة ، أو أسعار مختلفة ، أو إلغاء صفقات. نوصي بتحديد رسوم أعلى لتجربة أفضل.",
453 + "made_easy": "جعل بسهولة",
454 "manage_nodes": "ﺪﻘﻌﻟﺍ ﺓﺭﺍﺩﺇ",
455 "manage_pow_nodes": "PoW ﻁﺎﻘﻧ ﺓﺭﺍﺩﺇ",
456 "manage_yats": "إدارة Yats",
@@ -559,7 +561,9 @@
561 "payjoin_unavailable_sheet_content": "يتطلب استلام معاملة Payjoin أن تكون Bitcoin جاهزًا للاستخدام.",
562 "payjoin_unavailable_sheet_title": "لماذا Payjoin غير متوفر؟",
563 "payment_id": "معرف الدفع:",
564 + "payment_made_easy": "المدفوعات جعلت سهلة",
565 "payment_was_received": "تم استلام الدفع الخاص بك.",
566 + "payments": "المدفوعات",
567 "pending": " (في الإنتظار)",
568 "percentageOf": "من ${amount}",
569 "pin_at_top": "تثبيت ${token} في الأعلى",
@@ -687,6 +691,7 @@
691 "search_language": "ابحث عن لغة",
692 "second_intro_content": "Yat الخاص بك هو عنوان تعبيري فريد يحل محل جميع العناوين السداسية العشرية الطويلة لجميع عملاتك.",
693 "second_intro_title": "عنوان تعبيري ايموجي واحد يحكمهم جميعا!",
694 + "security": "حماية",
695 "security_and_backup": "الأمان والنسخ الاحتياطي",
696 "security_risk": "خطر الأمن",
697 "security_risk_description": "تم وضع علامة على هذا المجال على أنه غير آمن من قبل مقدمي الأمان المتعددين. اترك على الفور لحماية أصولك.",
@@ -986,6 +991,7 @@
991 "use": "التبديل إلى",
992 "use_card_info_three": "استخدم البطاقة الرقمية عبر الإنترنت أو مع طرق الدفع غير التلامسية.",
993 "use_card_info_two": "يتم تحويل الأموال إلى الدولار الأمريكي عند الاحتفاظ بها في الحساب المدفوع مسبقًا ، وليس بالعملات الرقمية.",
994 + "use_device_theme": "استخدم موضوع الجهاز",
995 "use_payjoin": "يستخدم Payjoin",
996 "use_ssl": "استخدم SSL",
997 "use_suggested": "استخدام المقترح",
@@ -1042,7 +1048,7 @@
1048 "walletConnect": "WalletConnect",
1049 "wallets": "المحافظ",
1050 "warning": "تحذير",
1045 - "welcome": "مرحبا بك في",
1051 + "welcome": "مرحباً",
1052 "welcome_subtitle_new_wallet": "إذا كنت ترغب في البدء من جديد ، فانقر فوق إنشاء محفظة جديدة أدناه وستكون خارج السباقات.",
1053 "welcome_subtitle_restore_wallet": "إذا كان لديك محفظة موجودة تريد إحضارها إلى كعكة ، فما عليك سوى اختيار استعادة المحفظة الموجودة وسنمشيك خلال العملية.",
1054 "welcome_to_cakepay": "مرحبا بكم في Cake Pay!",
@@ -1077,4 +1083,4 @@
1083 "you_will_send": "تحويل من",
1084 "youCanGoBackToYourDapp": "يمكنك العودة إلى DAPP الخاص بك الآن",
1085 "yy": "YY"
1080 -}
1086 +}
\ No newline at end of file
res/values/strings_bg.arb
+8 -2
@@ -269,6 +269,7 @@
269 "domain_mismatch": "Несъответствие на домейна",
270 "domain_mismatch_description": "Този уебсайт има домейн, който не съответства на подателя на тази заявка. Одобряването може да доведе до загуба на средства.",
271 "donation_link_details": "Подробности за връзката за дарение",
272 + "done": "Готово",
273 "e_sign_consent": "E-Sign съгласие",
274 "edit": "Промени",
275 "edit_backup_password": "Промяна на паролата за възстановяване",
@@ -449,6 +450,7 @@
450 "logout": "Logout",
451 "low_fee": "Ниска такса",
452 "low_fee_alert": "Използвате ниска приоритетност в мрежата. Това може да доведе до дълго чакане, различни обменни курсове или отказани сделки. Препоръчваме използването на по-висока такса.",
453 + "made_easy": "улесняваше",
454 "manage_nodes": "Управление на възли",
455 "manage_pow_nodes": "Управление на PoW възли",
456 "manage_yats": "Управление на Yats",
@@ -559,7 +561,9 @@
561 "payjoin_unavailable_sheet_content": "Получаването на Payjoin транзакция изисква да имате готови за биткойн. \\ N \\ nas скоро, когато портфейлът ви има средства, Payjoin ще бъде активиран автоматично.",
562 "payjoin_unavailable_sheet_title": "Защо Payjoin не е наличен?",
563 "payment_id": "Payment ID: ",
564 + "payment_made_easy": "Плащанията, направени лесно",
565 "payment_was_received": "Плащането бе получено.",
566 + "payments": "Плащания",
567 "pending": " (чакащи)",
568 "percentageOf": "от ${amount}",
569 "pin_at_top": "закачете ${token} отгоре",
@@ -687,6 +691,7 @@
691 "search_language": "Търсене на език",
692 "second_intro_content": "Вашият Yat е уникален адрес във формата на емоджи, който играе ролята на всички Ваши дълги шестнайсетични портфейли за всяка валута.",
693 "second_intro_title": "Един емоджи адрес, обединяващ всички останали.",
694 + "security": "Сигурност",
695 "security_and_backup": "Сигурност и резервни копия",
696 "security_risk": "Риск за сигурността",
697 "security_risk_description": "Този домейн се маркира като опасен от множество доставчици на сигурност. Оставете незабавно, за да защитите активите си.",
@@ -986,6 +991,7 @@
991 "use": "Смяна на ",
992 "use_card_info_three": "Използвайте дигиталната карта онлайн или чрез безконтактен метод на плащане.",
993 "use_card_info_two": "Средствата се обръщат в USD, когато биват запазени в предплатената карта, а не в дигитална валута.",
994 + "use_device_theme": "Използвайте темата за устройството",
995 "use_payjoin": "Използвайте Payjoin",
996 "use_ssl": "Използване на SSL",
997 "use_suggested": "Използване на предложеното",
@@ -1042,7 +1048,7 @@
1048 "walletConnect": "WalletConnect",
1049 "wallets": "Портфейли",
1050 "warning": "Внимание",
1045 - "welcome": "Добре дошли в",
1051 + "welcome": "Добре дошли",
1052 "welcome_subtitle_new_wallet": "Ако искате да стартирате свеж, докоснете Създайте нов портфейл по -долу и ще се откажете от състезанията.",
1053 "welcome_subtitle_restore_wallet": "Ако имате съществуващ портфейл, който искате да внесете в тортата, просто изберете възстановяване на съществуващия портфейл и ще ви преведем през процеса.",
1054 "welcome_to_cakepay": "Добре дошли в Cake Pay!",
@@ -1077,4 +1083,4 @@
1083 "you_will_send": "Обръщане от",
1084 "youCanGoBackToYourDapp": "Можете да се върнете при вашия Dapp сега",
1085 "yy": "гг"
1080 -}
1086 +}
\ No newline at end of file
res/values/strings_cs.arb
+8 -2
@@ -269,6 +269,7 @@
269 "domain_mismatch": "Neshoda domény",
270 "domain_mismatch_description": "Tento web má doménu, která neodpovídá odesílateli této žádosti. Schválení může vést ke ztrátě finančních prostředků.",
271 "donation_link_details": "Podrobnosti odkazu na darování",
272 + "done": "Hotovo",
273 "e_sign_consent": "E-Sign souhlas",
274 "edit": "Upravit",
275 "edit_backup_password": "Upravit heslo pro zálohy",
@@ -449,6 +450,7 @@
450 "logout": "Odhlásit",
451 "low_fee": "Nízký poplatek",
452 "low_fee_alert": "Momentálně máte nastavené nízké poplatky pro transakce. To může způsobovat dlouhé čekání, změnu směnného kurzu, nebo zrušení směny. Doporučujeme nastavit vyšší poplatek.",
453 + "made_easy": "usnadněný",
454 "manage_nodes": "Spravovat uzly",
455 "manage_pow_nodes": "Správa uzlů PoW",
456 "manage_yats": "Spravovat Yaty",
@@ -559,7 +561,9 @@
561 "payjoin_unavailable_sheet_content": "Přijetí transakce Payjoin vyžaduje, abyste měli bitcoin připraveni k použití. \\ N \\ NAS, jakmile má vaše peněženka finanční prostředky, Payjoin bude automaticky povoleno.",
562 "payjoin_unavailable_sheet_title": "Proč je Payjoin nedostupný?",
563 "payment_id": "ID platby: ",
564 + "payment_made_easy": "Platby byly snadné",
565 "payment_was_received": "Vaše platba byla přijata.",
566 + "payments": "Platby",
567 "pending": " (čeká)",
568 "percentageOf": "z ${amount}",
569 "pin_at_top": "špendlík ${token} nahoře",
@@ -687,6 +691,7 @@
691 "search_language": "Hledat jazyk",
692 "second_intro_content": "Váš Yat je jediná unikátní emoji adresa, která nahrazuje všechny Vaše dlouhé hexadecimální adresy pro všechny Vaše měny.",
693 "second_intro_title": "Jedna emoji adresa vládne všem",
694 + "security": "Zabezpečení",
695 "security_and_backup": "Bezpečnost a zálohy",
696 "security_risk": "Bezpečnostní riziko",
697 "security_risk_description": "Tato doména je označena jako nebezpečná více poskytovateli zabezpečení. Okamžitě nechte chránit vaše aktiva.",
@@ -986,6 +991,7 @@
991 "use": "Přepnout na ",
992 "use_card_info_three": "Použijte tuto digitální kartu online nebo bezkontaktními platebními metodami.",
993 "use_card_info_two": "Prostředky jsou převedeny na USD, když jsou drženy na předplaceném účtu, nikoliv na digitální měnu.",
994 + "use_device_theme": "Použijte téma zařízení",
995 "use_payjoin": "Použijte %%TE",
996 "use_ssl": "Použít SSL",
997 "use_suggested": "Použít doporučený",
@@ -1042,7 +1048,7 @@
1048 "walletConnect": "WalletConnect",
1049 "wallets": "Peněženky",
1050 "warning": "Varování",
1045 - "welcome": "Vítejte v",
1051 + "welcome": "Vítejte",
1052 "welcome_subtitle_new_wallet": "Pokud chcete začít čerstvě, klepněte na Vytvořit novou peněženku níže a budete na závodech.",
1053 "welcome_subtitle_restore_wallet": "Pokud máte existující peněženku, kterou chcete přinést do dortu, jednoduše si vyberte obnovení stávající peněženky a my vás projdeme procesem.",
1054 "welcome_to_cakepay": "Vítejte v Cake Pay!",
@@ -1077,4 +1083,4 @@
1083 "you_will_send": "Směnit z",
1084 "youCanGoBackToYourDapp": "Nyní se můžete vrátit do svého dappu",
1085 "yy": "YY"
1080 -}
1086 +}
\ No newline at end of file
res/values/strings_de.arb
+9 -3
@@ -269,6 +269,7 @@
269 "domain_mismatch": "Domänenfehlanpassung",
270 "domain_mismatch_description": "Diese Website hat eine Domain, die nicht mit dem Absender dieser Anfrage übereinstimmt. Die Genehmigung kann zum Verlust von Geldern führen.",
271 "donation_link_details": "Details zum Spendenlink",
272 + "done": "Erledigt",
273 "e_sign_consent": "E-Sign-Zustimmung",
274 "edit": "Bearbeiten",
275 "edit_backup_password": "Sicherungskennwort bearbeiten",
@@ -449,6 +450,7 @@
450 "logout": "Abmelden",
451 "low_fee": "Niedrige Gebühr",
452 "low_fee_alert": "Sie verwenden derzeit eine niedrige Netzwerkgebührenpriorität. Dies kann zu langen Wartezeiten, unterschiedlichen Kursen oder stornierten Trades führen. Wir empfehlen, für ein besseres Erlebnis eine höhere Gebühr festzulegen.",
453 + "made_easy": "leicht gemacht",
454 "manage_nodes": "Knoten verwalten",
455 "manage_pow_nodes": "PoW-Knoten verwalten",
456 "manage_yats": "Yats verwalten",
@@ -559,7 +561,9 @@
561 "payjoin_unavailable_sheet_content": "Wenn Sie eine Payjoin-Transaktion erhalten, müssen Sie bereits Bitcoin im Wallet haben.",
562 "payjoin_unavailable_sheet_title": "Warum ist Payjoin nicht verfügbar?",
563 "payment_id": "Zahlungs-ID: ",
564 + "payment_made_easy": "Zahlungen einfach gemacht",
565 "payment_was_received": "Ihre Zahlung ist eingegangen.",
566 + "payments": "Zahlungen",
567 "pending": " (ausstehend)",
568 "percentageOf": "von ${amount}",
569 "pin_at_top": "Stecken Sie ${token} oben fest",
@@ -570,8 +574,8 @@
574 "please_choose_one": "Bitte wählen Sie einen",
575 "please_fill_totp": "Bitte geben Sie den 8-stelligen Code ein, der auf Ihrem anderen Gerät vorhanden ist",
576 "please_make_selection": "Bitte treffen Sie unten eine Auswahl zum Erstellen oder Wiederherstellen Ihrer Wallet.",
573 - "Please_reference_document": "Weitere Informationen finden Sie in den Dokumenten unten.",
577 "please_reference_document": "Bitte verweisen Sie auf die folgenden Dokumente, um weitere Informationen zu erhalten.",
578 + "Please_reference_document": "Weitere Informationen finden Sie in den Dokumenten unten.",
579 "please_select": "Bitte auswählen:",
580 "please_select_backup_file": "Bitte wählen Sie die Sicherungsdatei und geben Sie das Sicherungskennwort ein.",
581 "please_try_to_connect_to_another_node": "Bitte versuchen Sie, sich mit einem anderen Knoten zu verbinden",
@@ -688,6 +692,7 @@
692 "search_language": "Sprache suchen",
693 "second_intro_content": "Ihr Yat ist eine einzige eindeutige Emoji-Adresse, die alle Ihre langen hexadezimalen Adressen für alle Ihre Währungen ersetzt.",
694 "second_intro_title": "Eine Emoji-Adresse, um sie alle zu beherrschen",
695 + "security": "Sicherheit",
696 "security_and_backup": "Sicherheit und Datensicherung",
697 "security_risk": "Sicherheitsrisiko",
698 "security_risk_description": "Diese Domäne wird von mehreren Sicherheitsanbietern als unsicher gekennzeichnet. Gehen Sie sofort auf, um Ihr Vermögen zu schützen.",
@@ -988,6 +993,7 @@
993 "use": "Wechsel zu ",
994 "use_card_info_three": "Verwenden Sie die digitale Karte online oder mit kontaktlosen Zahlungsmethoden.",
995 "use_card_info_two": "Guthaben werden auf dem Prepaid-Konto in USD umgerechnet, nicht in digitale Währung.",
996 + "use_device_theme": "Verwenden Sie das Gerätethema",
997 "use_payjoin": "Benutze Payjoin",
998 "use_ssl": "SSL verwenden",
999 "use_suggested": "Vorgeschlagen verwenden",
@@ -1045,7 +1051,7 @@
1051 "walletConnect": "WalletConnect",
1052 "wallets": "Wallets",
1053 "warning": "Warnung",
1048 - "welcome": "Willkommen bei",
1054 + "welcome": "Willkommen",
1055 "welcome_subtitle_new_wallet": "Wenn Sie frisch anfangen möchten, tippen Sie unten neue Wallet und schon sind Sie bereit.",
1056 "welcome_subtitle_restore_wallet": "Wenn Sie über eine vorhandene Wallet verfügen, die Sie in Cake Wallet öffnen möchten, drücken Sie auf Vorhandene Wallet wiederherstellen und wir werden Sie durch den Prozess führen.",
1057 "welcome_to_cakepay": "Willkommen bei Cake Pay!",
@@ -1080,4 +1086,4 @@
1086 "you_will_send": "Konvertieren von",
1087 "youCanGoBackToYourDapp": "Sie können jetzt zu Ihrem Dapp zurückkehren",
1088 "yy": "YY"
1083 -}
1089 +}
\ No newline at end of file
res/values/strings_en.arb
+8 -2
@@ -269,6 +269,7 @@
269 "domain_mismatch": "Domain Mismatch",
270 "domain_mismatch_description": "This website has a domain that does not match the sender of this request. Approving may lead to loss of funds.",
271 "donation_link_details": "Donation link details",
272 + "done": "Done",
273 "e_sign_consent": "E-Sign Consent",
274 "edit": "Edit",
275 "edit_backup_password": "Edit Backup Password",
@@ -449,6 +450,7 @@
450 "logout": "Logout",
451 "low_fee": "Low fee",
452 "low_fee_alert": "You currently are using a low network fee priority. This could cause long waits, different rates, or canceled trades. We recommend setting a higher fee for a better experience.",
453 + "made_easy": "made easy",
454 "manage_nodes": "Manage nodes",
455 "manage_pow_nodes": "Manage PoW nodes",
456 "manage_yats": "Manage Yats",
@@ -560,7 +562,9 @@
562 "payjoin_unavailable_sheet_content": "Receiving a Payjoin transaction requires you to have Bitcoin ready to use.\n\nAs soon as your wallet has funds, Payjoin will be automatically enabled.",
563 "payjoin_unavailable_sheet_title": "Why is Payjoin unavailable?",
564 "payment_id": "Payment ID: ",
565 + "payment_made_easy": "Payments made easy",
566 "payment_was_received": "Your payment was received.",
567 + "payments": "Payments",
568 "pending": " (pending)",
569 "percentageOf": "of ${amount}",
570 "pin_at_top": "Pin ${token} at top",
@@ -688,6 +692,7 @@
692 "search_language": "Search language",
693 "second_intro_content": "Your Yat is a single unique emoji address that replaces all of your long hexadecimal addresses for all of your currencies.",
694 "second_intro_title": "One emoji address to rule them all",
695 + "security": "Security",
696 "security_and_backup": "Security and backup",
697 "security_risk": "Security Risk",
698 "security_risk_description": "This domain is flagged as unsafe by multiple security providers. Leave immediately to protect your assets.",
@@ -987,6 +992,7 @@
992 "use": "Switch to ",
993 "use_card_info_three": "Use the digital card online or with contactless payment methods.",
994 "use_card_info_two": "Funds are converted to USD when they're held in the prepaid account, not in digital currencies.",
995 + "use_device_theme": "Use Device Theme",
996 "use_payjoin": "Use Payjoin",
997 "use_ssl": "Use SSL",
998 "use_suggested": "Use Suggested",
@@ -1043,7 +1049,7 @@
1049 "walletConnect": "WalletConnect",
1050 "wallets": "Wallets",
1051 "warning": "Warning",
1046 - "welcome": "Welcome to",
1052 + "welcome": "Welcome",
1053 "welcome_subtitle_new_wallet": "If you want to start fresh, tap Create New Wallet below and you'll be off to the races.",
1054 "welcome_subtitle_restore_wallet": "If you have an existing wallet you want to bring into Cake, simply choose Restore Existing Wallet and we'll walk you through the process.",
1055 "welcome_to_cakepay": "Welcome to Cake Pay!",
@@ -1078,4 +1084,4 @@
1084 "you_will_send": "Convert from",
1085 "youCanGoBackToYourDapp": "You can go back to your dApp now",
1086 "yy": "YY"
1081 -}
1087 +}
\ No newline at end of file
res/values/strings_es.arb
+8 -1
@@ -269,6 +269,7 @@
269 "domain_mismatch": "Desajuste de dominio",
270 "domain_mismatch_description": "Este sitio web tiene un dominio que no coincide con el remitente de esta solicitud. La aprobación puede conducir a la pérdida de fondos.",
271 "donation_link_details": "Detalles del enlace de donación",
272 + "done": "Hecho",
273 "e_sign_consent": "Consentimiento de firma electrónica",
274 "edit": "Editar",
275 "edit_backup_password": "Editar contraseña de respaldo",
@@ -449,6 +450,7 @@
450 "logout": "Cerrar sesión",
451 "low_fee": "Tarifa baja",
452 "low_fee_alert": "Actualmente está utilizando una prioridad de tarifa de red baja. Esto podría causar largas esperas, tarifas diferentes o transacciones canceladas. Recomendamos establecer una tarifa más alta para una mejor experiencia.",
453 + "made_easy": "hecho fácil",
454 "manage_nodes": "Administrar nodos",
455 "manage_pow_nodes": "Administrar nodos PoW",
456 "manage_yats": "Administrar Yats",
@@ -559,7 +561,9 @@
561 "payjoin_unavailable_sheet_content": "Recibir una transacción Payjoin requiere que tenga Bitcoin listo para usar. \\ N \\ nas pronto como su billetera tenga fondos, Payjoin estará habilitado automáticamente.",
562 "payjoin_unavailable_sheet_title": "¿Por qué no está disponible Payjoin?",
563 "payment_id": "ID de pago: ",
564 + "payment_made_easy": "Pagos hechos fáciles",
565 "payment_was_received": "Su pago fue recibido.",
566 + "payments": "Pagos",
567 "pending": " (pendiente)",
568 "percentageOf": "de ${amount}",
569 "personalizado": "personalizado",
@@ -688,6 +692,7 @@
692 "search_language": "Idioma de búsqueda",
693 "second_intro_content": "Tu Yat es una única dirección emoji única que reemplaza todas tus direcciones hexadecimales largas para todas tus monedas.",
694 "second_intro_title": "Una dirección de emoji para gobernarlos a todos",
695 + "security": "Seguridad",
696 "security_and_backup": "Seguridad y respaldo",
697 "security_risk": "Riesgo de seguridad",
698 "security_risk_description": "Este dominio es marcado como inseguro por múltiples proveedores de seguridad. Deje inmediatamente para proteger sus activos.",
@@ -987,6 +992,7 @@
992 "use": "Utilizar a ",
993 "use_card_info_three": "Utiliza la tarjeta digital en línea o con métodos de pago sin contacto.",
994 "use_card_info_two": "Los fondos se convierten a USD cuando se mantienen en la cuenta prepaga, no en monedas digitales.",
995 + "use_device_theme": "Utilice el tema del dispositivo",
996 "use_payjoin": "Usar Payjoin",
997 "use_ssl": "Utiliza SSL",
998 "use_suggested": "Usar sugerido",
@@ -1044,6 +1050,7 @@
1050 "wallets": "Carteras",
1051 "warning": "Advertencia",
1052 "welcome": "Bienvenido",
1053 + "welcome_only": "Bienvenido",
1054 "welcome_subtitle_new_wallet": "Si desea comenzar de nuevo, toque Crear nueva billetera a continuación y se irá a las carreras.",
1055 "welcome_subtitle_restore_wallet": "Si tiene una billetera existente que desea llevar al pastel, simplemente elija Restaurar la billetera existente y lo guiaremos a través del proceso.",
1056 "welcome_to_cakepay": "¡Bienvenido a Cake Pay!",
@@ -1078,4 +1085,4 @@
1085 "you_will_send": "Convertir de",
1086 "youCanGoBackToYourDapp": "Puedes volver a tu dapp ahora",
1087 "yy": "YY"
1081 -}
1088 +}
\ No newline at end of file
res/values/strings_fr.arb
+8 -2
@@ -269,6 +269,7 @@
269 "domain_mismatch": "Décalage du domaine",
270 "domain_mismatch_description": "Ce site Web a un domaine qui ne correspond pas à l'expéditeur de cette demande. L'approbation peut entraîner une perte de fonds.",
271 "donation_link_details": "Détails du lien de don",
272 + "done": "Fait",
273 "e_sign_consent": "Consentement de signature électronique",
274 "edit": "Modifier",
275 "edit_backup_password": "Modifier le Mot de Passe de Sauvegarde",
@@ -449,6 +450,7 @@
450 "logout": "Déconnexion",
451 "low_fee": "Frais faibles",
452 "low_fee_alert": "Vous utilisez actuellement une priorité de frais de réseau peu élevés. Cela pourrait entraîner de longues attentes, des taux différents ou des transactions annulées. Nous vous recommandons de fixer des frais plus élevés pour une meilleure expérience.",
453 + "made_easy": "rendu facile",
454 "manage_nodes": "Gérer les nœuds",
455 "manage_pow_nodes": "Gérer les nœuds PoW",
456 "manage_yats": "Gérer les Yats",
@@ -559,7 +561,9 @@
561 "payjoin_unavailable_sheet_content": "La réception d'une transaction Payjoin vous oblige à avoir un bitcoin prêt à l'emploi. \\ N \\ nas dès que votre portefeuille a des fonds, Payjoin sera automatiquement activé.",
562 "payjoin_unavailable_sheet_title": "Pourquoi Payjoin n'est-il pas disponible?",
563 "payment_id": "ID de Paiement : ",
564 + "payment_made_easy": "Les paiements facilites",
565 "payment_was_received": "Votre paiement a été reçu.",
566 + "payments": "Paiements",
567 "pending": " (en attente)",
568 "percentageOf": "sur ${amount}",
569 "pin_at_top": "épingler ${token} en haut",
@@ -687,6 +691,7 @@
691 "search_language": "Rechercher une langue",
692 "second_intro_content": "Votre Yat est une seule et unique adresse emoji qui remplace toutes vos longues adresses hexadécimales pour toutes vos cryptomonnaies.",
693 "second_intro_title": "Une adresse emoji pour les gouverner toutes",
694 + "security": "Sécurité",
695 "security_and_backup": "Sécurité et sauvegarde",
696 "security_risk": "Risque de sécurité",
697 "security_risk_description": "Ce domaine est signalé comme dangereux par plusieurs fournisseurs de sécurité. Laissez immédiatement pour protéger vos actifs.",
@@ -986,6 +991,7 @@
991 "use": "Changer vers code PIN à ",
992 "use_card_info_three": "Utilisez la carte numérique en ligne ou avec des méthodes de paiement sans contact.",
993 "use_card_info_two": "Les fonds sont convertis en USD lorsqu'ils sont détenus sur le compte prépayé, et non en devises numériques.",
994 + "use_device_theme": "Utiliser le thème de l'appareil",
995 "use_payjoin": "Utiliser Payjoin",
996 "use_ssl": "Utiliser SSL",
997 "use_suggested": "Suivre la suggestion",
@@ -1042,7 +1048,7 @@
1048 "walletConnect": "WalletConnect",
1049 "wallets": "Portefeuilles",
1050 "warning": "Avertissement",
1045 - "welcome": "Bienvenue sur",
1051 + "welcome": "Accueillir",
1052 "welcome_subtitle_new_wallet": "Si vous souhaitez repartir de zéro, appuyez sur Créer un nouveau portefeuille ci-dessous et vous serez prêt à commencer.",
1053 "welcome_subtitle_restore_wallet": "Si vous avez un portefeuille existant que vous souhaitez importer dans Cake, choisissez simplement Restaurer un portefeuille existant et nous vous guiderons à travers le processus.",
1054 "welcome_to_cakepay": "Bienvenue sur Cake Pay !",
@@ -1077,4 +1083,4 @@
1083 "you_will_send": "Convertir depuis",
1084 "youCanGoBackToYourDapp": "Vous pouvez retourner à votre Dapp maintenant",
1085 "yy": "AA"
1080 -}
1086 +}
\ No newline at end of file
res/values/strings_ha.arb
+8 -1
@@ -269,6 +269,7 @@
269 "domain_mismatch": "Yankin zalunci",
270 "domain_mismatch_description": "Wannan rukunin yanar gizon yana da yanki wanda bai dace da aika wannan bukatar ba. Yarda na iya haifar da asarar kudade.",
271 "donation_link_details": "Bayanin hanyar sadaka",
272 + "done": "Yi",
273 "e_sign_consent": "Izinin Alamar E-Sign",
274 "edit": "Gyara",
275 "edit_backup_password": "Shirya Kalmar wucewa ta Ajiyayyen",
@@ -449,6 +450,7 @@
450 "logout": "Fita",
451 "low_fee": "maras tsada",
452 "low_fee_alert": "A halin yanzu kuna amfani da ƙarancin fifikon kuɗin hanyar sadarwa. Wannan na iya haifar da dogon jira, farashi daban-daban, ko soke kasuwancin. Muna ba da shawarar saita farashi mafi girma don ƙwarewa mafi kyau.",
453 + "made_easy": "Ya sanya sauki",
454 "manage_nodes": "Sarrafa nodes",
455 "manage_pow_nodes": "Sarrafa PoW Nodes",
456 "manage_yats": "Sarrafa Yats",
@@ -561,7 +563,9 @@
563 "payjoin_unavailable_sheet_content": "Karɓar A Payjoin Ma'amala yana buƙatar ku sami Bitcoin shirye don amfani. \\ N \\ n5 da zaran kamar walat ɗinku yana da kuɗi, Payjoin za'a kunna ta atomatik.",
564 "payjoin_unavailable_sheet_title": "Me yasa Payjoin rasaa?",
565 "payment_id": "ID na biyan kuɗi:",
566 + "payment_made_easy": "Biya mai sauki",
567 "payment_was_received": "An karɓi kuɗin ku.",
568 + "payments": "Biya",
569 "pending": "(pending)",
570 "percentageOf": "na ${amount}",
571 "pin_at_top": "pin ${token} a sama",
@@ -689,6 +693,7 @@
693 "search_language": "Bincika harshe",
694 "second_intro_content": "Your Yat adireshi ne na musamman na Emoji guda ɗaya wanda ke maye gurbin duk dogayen adiresoshin ku na hexadecimal na duk kudaden ku.",
695 "second_intro_title": "Adireshin emoji ɗaya don sarrafa su duka",
696 + "security": "Tsaro",
697 "security_and_backup": "Tsaro da madadin",
698 "security_risk": "Hadarin tsaro",
699 "security_risk_description": "An yiwa wannan yanki a matsayin marasa tsaro da masu ba da izini na tsaro. Bar nan da nan don kare kadarorin ku.",
@@ -988,6 +993,7 @@
993 "use": "Canja zuwa",
994 "use_card_info_three": "Yi amfani da katin dijital akan layi ko tare da hanyoyin biyan kuɗi mara lamba.",
995 "use_card_info_two": "Ana canza kuɗi zuwa dalar Amurka lokacin da ake riƙe su a cikin asusun da aka riga aka biya, ba cikin agogon dijital ba.",
996 + "use_device_theme": "Yi amfani da taken na'urar",
997 "use_payjoin": "Yi amfani da Payjoin",
998 "use_ssl": "Yi amfani da SSL",
999 "use_suggested": "Amfani da Shawarwari",
@@ -1045,6 +1051,7 @@
1051 "wallets": "Wallets",
1052 "warning": "Gargadi",
1053 "welcome": "Barka da zuwa",
1054 + "welcome_only": "Barka da zuwa",
1055 "welcome_subtitle_new_wallet": "Idan kana son farawa sabo ne, matsa Newirƙiri Sabuwar Wallow a ƙasa kuma za ka tafi da tsere.",
1056 "welcome_subtitle_restore_wallet": "Idan kuna da walat ɗin da kuke son shigo da cake, kawai zaɓi a cikin walat ɗin da yake ciki kuma za mu bi ku ta hanyar aiwatarwa.",
1057 "welcome_to_cakepay": "Barka da zuwa Cake Pay!",
@@ -1079,4 +1086,4 @@
1086 "you_will_send": "Maida daga",
1087 "youCanGoBackToYourDapp": "Kuna iya komawa zuwa DPP ɗinku yanzu",
1088 "yy": "YY"
1082 -}
1089 +}
\ No newline at end of file
res/values/strings_hi.arb
+9 -3
@@ -269,6 +269,7 @@
269 "domain_mismatch": "डोमेन बेमेल",
270 "domain_mismatch_description": "इस वेबसाइट में एक डोमेन है जो इस अनुरोध के प्रेषक से मेल नहीं खाता है। अनुमोदन से धन की हानि हो सकती है।",
271 "donation_link_details": "दान लिंक विवरण",
272 + "done": "हो गया",
273 "e_sign_consent": "ई-साइन सहमति",
274 "edit": "संपादित करें",
275 "edit_backup_password": "बैकअप पासवर्ड संपादित करें",
@@ -449,6 +450,7 @@
450 "logout": "लॉगआउट",
451 "low_fee": "कम शुल्क",
452 "low_fee_alert": "आप वर्तमान में कम नेटवर्क शुल्क प्राथमिकता का उपयोग कर रहे हैं। यह लंबे इंतजार, अलग-अलग दरों या रद्द किए गए ट्रेडों का कारण बन सकता है। हम बेहतर अनुभव के लिए अधिक शुल्क निर्धारित करने की सलाह देते हैं।",
453 + "made_easy": "आसान बनाया हुआ",
454 "manage_nodes": "नोड्स प्रबंधित करें",
455 "manage_pow_nodes": "PoW नोड्स प्रबंधित करें",
456 "manage_yats": "Yats प्रबंधित करें",
@@ -559,8 +561,10 @@
561 "payjoin_unavailable_sheet_content": "Payjoin लेन -देन प्राप्त करने के लिए आपको बिटकॉइन का उपयोग करने के लिए तैयार होना आवश्यक है। जैसे ही आपके वॉलेट में धन है, \\ n \\ nas, Payjoin स्वचालित रूप से सक्षम हो जाएगा।",
562 "payjoin_unavailable_sheet_title": "Payjoin अनुपलब्ध क्यों है?",
563 "payment_id": "भुगतान ID: ",
562 - "payment_was_received": "आपका भुगतान प्राप्त हुआ था।",
564 + "payment_made_easy": "भुगतान आसान किया गया",
565 "Payment_was_received": "आपका भुगतान प्राप्त हो गया था।",
566 + "payment_was_received": "आपका भुगतान प्राप्त हुआ था।",
567 + "payments": "भुगतान",
568 "pending": " (अपूर्ण)",
569 "percentageOf": "${amount} का",
570 "pin_at_top": "शीर्ष पर ${token} पिन करें",
@@ -689,6 +693,7 @@
693 "search_language": "भाषा खोजें",
694 "second_intro_content": "आपका Yat एक अद्वितीय इमोजी पता है जो आपकी सभी मुद्राओं के लिए आपके सभी लंबे हेक्साडेसिमल पतों को बदल देता है।",
695 "second_intro_title": "उन सभी पर राज करने के लिए एक इमोजी पता",
696 + "security": "सुरक्षा",
697 "security_and_backup": "सुरक्षा और बैकअप",
698 "security_risk": "सुरक्षा मे जोखिम",
699 "security_risk_description": "इस डोमेन को कई सुरक्षा प्रदाताओं द्वारा असुरक्षित के रूप में चिह्नित किया जाता है। अपनी संपत्ति की रक्षा के लिए तुरंत छोड़ दें।",
@@ -988,6 +993,7 @@
993 "use": "उपयोग ",
994 "use_card_info_three": "डिजिटल कार्ड का ऑनलाइन या संपर्क रहित भुगतान विधियों के साथ उपयोग करें।",
995 "use_card_info_two": "डिजिटल मुद्राओं में नहीं, प्रीपेड खाते में रखे जाने पर निधियों को यूएसडी में बदल दिया जाता है।",
996 + "use_device_theme": "डिवाइस थीम का उपयोग करें",
997 "use_payjoin": "उपयोग Payjoin",
998 "use_ssl": "उपयोग SSL",
999 "use_suggested": "सुझाए गए का प्रयोग करें",
@@ -1044,7 +1050,7 @@
1050 "walletConnect": "वॉलेटकनेक्ट",
1051 "wallets": "पर्स",
1052 "warning": "चेतावनी",
1047 - "welcome": "स्वागत हे सेवा मेरे",
1053 + "welcome": "स्वागत",
1054 "welcome_subtitle_new_wallet": "यदि आप ताजा शुरू करना चाहते हैं, तो नीचे नया बटुआ बनाएं और आप दौड़ से दूर हो जाएंगे।",
1055 "welcome_subtitle_restore_wallet": "यदि आपके पास एक मौजूदा बटुआ है जिसे आप केक में लाना चाहते हैं, तो बस मौजूदा बटुए को पुनर्स्थापित करें और हम आपको प्रक्रिया के माध्यम से चलेंगे।",
1056 "welcome_to_cakepay": "केकपे में आपका स्वागत है!",
@@ -1079,4 +1085,4 @@
1085 "you_will_send": "से रूपांतरित करें",
1086 "youCanGoBackToYourDapp": "अब आप अपने DAPP पर वापस जा सकते हैं",
1087 "yy": "वाईवाई"
1082 -}
1088 +}
\ No newline at end of file
res/values/strings_hr.arb
+8 -2
@@ -269,6 +269,7 @@
269 "domain_mismatch": "Neusklađenost domena",
270 "domain_mismatch_description": "Ova web stranica ima domenu koja ne odgovara pošiljatelju ovog zahtjeva. Odobrenje može dovesti do gubitka sredstava.",
271 "donation_link_details": "Detalji veza za donacije",
272 + "done": "Završen",
273 "e_sign_consent": "E-Sign pristanak",
274 "edit": "Uredi",
275 "edit_backup_password": "Uredi lozinku za sigurnosnu kopiju",
@@ -449,6 +450,7 @@
450 "logout": "Odjava",
451 "low_fee": "Niska naknada",
452 "low_fee_alert": "Trenutačno koristite niski prioritet mrežne naknade. To bi moglo uzrokovati duga čekanja, različite tečajeve ili otkazane trgovine. Preporučujemo postavljanje veće naknade za bolje iskustvo.",
453 + "made_easy": "olakšano",
454 "manage_nodes": "Upravljanje čvorovima",
455 "manage_pow_nodes": "Upravljanje PoW čvorovima",
456 "manage_yats": "Upravljanje Yat",
@@ -559,7 +561,9 @@
561 "payjoin_unavailable_sheet_content": "Primanje Payjoin Transakcije zahtijeva da Bitcoin bude spreman za upotrebu. \\ N \\ NAS čim vaš novčanik ima sredstva, Payjoin će biti automatski omogućen.",
562 "payjoin_unavailable_sheet_title": "Zašto je Payjoin nedostupno?",
563 "payment_id": "ID plaćanja: ",
564 + "payment_made_easy": "Plaćanja su olakšana",
565 "payment_was_received": "Vaša uplata je primljena.",
566 + "payments": "Isplata",
567 "pending": " (u tijeku)",
568 "percentageOf": "od ${amount}",
569 "pin_at_top": "prikvači ${token} na vrh",
@@ -687,6 +691,7 @@
691 "search_language": "Jezik pretraživanja",
692 "second_intro_content": "Vaš Yat jedinstvena je adresa emojija koja zamjenjuje sve vaše duge heksadecimalne adrese za sve vaše valute.",
693 "second_intro_title": "Jedna adresa emojija koja će svima njima vladati",
694 + "security": "Sigurnost",
695 "security_and_backup": "Sigurnost i sigurnosna kopija",
696 "security_risk": "Sigurnosni rizik",
697 "security_risk_description": "Ova je domena označena kao nesigurna od strane više pružatelja usluga sigurnosti. Ostavite odmah da zaštitite svoju imovinu.",
@@ -986,6 +991,7 @@
991 "use": "Prebaci na",
992 "use_card_info_three": "Koristite digitalnu karticu online ili s beskontaktnim metodama plaćanja.",
993 "use_card_info_two": "Sredstva se pretvaraju u USD kada se drže na prepaid računu, a ne u digitalnim valutama.",
994 + "use_device_theme": "Koristite temu uređaja",
995 "use_payjoin": "Koristite Payjoin",
996 "use_ssl": "Koristi SSL",
997 "use_suggested": "Koristite predloženo",
@@ -1042,7 +1048,7 @@
1048 "walletConnect": "WalletConnect",
1049 "wallets": "Novčanici",
1050 "warning": "Upozorenje",
1045 - "welcome": "Dobrodošli na",
1051 + "welcome": "Dobrodošli",
1052 "welcome_subtitle_new_wallet": "Ako želite započeti svježe, dodirnite Create New Wallet u nastavku i krenite na utrke.",
1053 "welcome_subtitle_restore_wallet": "Ako imate postojeći novčanik koji želite unijeti u tortu, jednostavno odaberite Vratite postojeći novčanik i prošetat ćemo vas kroz postupak.",
1054 "welcome_to_cakepay": "Dobro došli u Cake Pay!",
@@ -1077,4 +1083,4 @@
1083 "you_will_send": "Razmijeni iz",
1084 "youCanGoBackToYourDapp": "Sada se možete vratiti na svoj dapp",
1085 "yy": "GG"
1080 -}
1086 +}
\ No newline at end of file
res/values/strings_hy.arb
+8 -2
@@ -269,6 +269,7 @@
269 "domain_mismatch": "Դոմենի անհամապատասխանություն",
270 "domain_mismatch_description": "Այս կայքը ունի տիրույթ, որը չի համապատասխանում այս խնդրանքի ուղարկողին: Հաստատումը կարող է հանգեցնել միջոցների կորստի:",
271 "donation_link_details": "Նվիրատվության հղումի մանրամասներ",
272 + "done": "Արված",
273 "e_sign_consent": "Էլեկտրոնային ստորագրության համաձայնություն",
274 "edit": "Խմբագրել",
275 "edit_backup_password": "Փոփոխել Կրկնօրինակի Գաղտնաբառը",
@@ -449,6 +450,7 @@
450 "logout": "Ելք",
451 "low_fee": "Ցածր միջնորդավճար",
452 "low_fee_alert": "Դուք ներկայումս օգտագործում եք ցածր ցանցային միջնորդավճար: Սա կարող է հանգեցնել երկար սպասելու ժամանակի, տարբեր փոխարժեքների կամ չեղարկված առևտրի: Մենք առաջարկում ենք սահմանել ավելի բարձր միջնորդավճար ավելի լավ փորձ ունենալու համար",
453 + "made_easy": "հեշտացրեց",
454 "manage_nodes": "Կարգավորել հանգույցները",
455 "manage_pow_nodes": "Կարգավորել PoW հանգույցները",
456 "manage_yats": "Կառավարել Yats",
@@ -558,7 +560,9 @@
560 "payjoin_unavailable_sheet_content": "A Payjoin գործարք ստանալը պահանջում է, որ դուք պատրաստեք Bitcoin- ը պատրաստելու համար:",
561 "payjoin_unavailable_sheet_title": "Ինչու է Payjoin անհասանելի:",
562 "payment_id": "Վճարման հերթական համար",
563 + "payment_made_easy": "Վճարները հեշտացվել են",
564 "payment_was_received": "Վճարումը ստացված է",
565 + "payments": "Վճարումներ",
566 "pending": " (մշակվում է)",
567 "percentageOf": "${amount}-ի տոկոս",
568 "pin_at_top": "${token} պին վերևում",
@@ -686,6 +690,7 @@
690 "search_language": "Որոնել լեզու",
691 "second_intro_content": "Ձեր Yat-ը միակ եզակի էմոջի հասցե է, որը փոխարինում է ձեր բոլոր արժույթների համար ձեր բոլոր երկար հեքսադեցիմալ հասցեները",
692 "second_intro_title": "Մի էմոջի հասցե, որը կառավարում է դրանք բոլորը",
693 + "security": "Անվտանգություն",
694 "security_and_backup": "Անվտանգություն և կրկնօրինակ",
695 "security_risk": "Անվտանգության ռիսկ",
696 "security_risk_description": "Այս տիրույթը դրոշմված է որպես անվտանգության ոչ անվտանգ `բազմաթիվ անվտանգության մատակարարների կողմից: Անմիջապես թողեք ձեր ակտիվները պաշտպանելու համար:",
@@ -984,6 +989,7 @@
989 "use": "Փոխեք ",
990 "use_card_info_three": "Օգտագործեք թվային քարտը առցանց կամ անշփման վճարման մեթոդներով։",
991 "use_card_info_two": "Միջոցները փոխարկվում են ԱՄՆ դոլար երբ դրանք պահվում են կանխավճարային հաշվեկշռում, ոչ թե թվային արժույթներում։",
992 + "use_device_theme": "Օգտագործեք սարքի թեման",
993 "use_payjoin": "Օգտագործեք Payjoin",
994 "use_ssl": "Օգտագործել SSL",
995 "use_suggested": "Օգտագործել առաջարկվածը",
@@ -1040,7 +1046,7 @@
1046 "walletConnect": "WalletConnect",
1047 "wallets": "Դրամապանակներ",
1048 "warning": "Զգուշացում",
1043 - "welcome": "Բարի գալուստ",
1049 + "welcome": "Ողջույն",
1050 "welcome_subtitle_new_wallet": "Եթե ​​ցանկանում եք սկսել թարմ, հպեք Ստեղծեք նոր դրամապանակ ներքեւում եւ դուրս կգաք ցեղերի:",
1051 "welcome_subtitle_restore_wallet": "Եթե ​​ունեք գոյություն ունեցող դրամապանակ, որը ցանկանում եք տորթի մեջ մտցնել, պարզապես ընտրեք վերականգնել առկա դրամապանակը, եւ մենք ձեզ քայլելու ենք գործընթացի միջոցով:",
1052 "welcome_to_cakepay": "Բարի գալուստ Cake Pay!",
@@ -1075,4 +1081,4 @@
1081 "you_will_send": "Փոխանակեք",
1082 "youCanGoBackToYourDapp": "Այժմ կարող եք վերադառնալ ձեր DAPP- ին",
1083 "yy": "ՏՏ"
1078 -}
1084 +}
\ No newline at end of file
res/values/strings_id.arb
+8 -2
@@ -269,6 +269,7 @@
269 "domain_mismatch": "Ketidakcocokan Domain",
270 "domain_mismatch_description": "Situs web ini memiliki domain yang tidak cocok dengan pengirim permintaan ini. Menyetujui dapat menyebabkan hilangnya dana.",
271 "donation_link_details": "Detail tautan donasi",
272 + "done": "Selesai",
273 "e_sign_consent": "E-Sign Consent",
274 "edit": "Edit",
275 "edit_backup_password": "Edit Kata Sandi Cadangan",
@@ -449,6 +450,7 @@
450 "logout": "Keluar",
451 "low_fee": "Biaya rendah",
452 "low_fee_alert": "Anda saat ini menggunakan prioritas biaya jaringan rendah. Ini dapat menyebabkan tunggu yang lama, kurs yang berbeda, atau perdagangan yang dibatalkan. Kami merekomendasikan menetapkan biaya yang lebih tinggi untuk pengalaman yang lebih baik.",
453 + "made_easy": "menjadi mudah",
454 "manage_nodes": "Kelola node",
455 "manage_pow_nodes": "Kelola Node PoW",
456 "manage_yats": "Kelola Yats",
@@ -561,7 +563,9 @@
563 "payjoin_unavailable_sheet_content": "Menerima Payjoin transaksi mengharuskan Anda untuk menyiapkan bitcoin. \\ N \\ nas segera setelah dompet Anda memiliki dana, Payjoin akan diaktifkan secara otomatis.",
564 "payjoin_unavailable_sheet_title": "Mengapa Payjoin tidak tersedia?",
565 "payment_id": "ID Pembayaran: ",
566 + "payment_made_easy": "Pembayaran dilakukan dengan mudah",
567 "payment_was_received": "Pembayaran Anda telah diterima.",
568 + "payments": "Pembayaran",
569 "pending": " (pending)",
570 "percentageOf": "dari ${amount}",
571 "pin_at_top": "sematkan ${token} di atas",
@@ -690,6 +694,7 @@
694 "search_language": "Cari bahasa",
695 "second_intro_content": "Yat Anda adalah satu alamat emoji yang unik yang menggantikan semua alamat heksadesimal panjang Anda untuk semua mata uang Anda.",
696 "second_intro_title": "Satu alamat emoji untuk menguasainya semua",
697 + "security": "Keamanan",
698 "security_and_backup": "Keamanan dan cadangan",
699 "security_risk": "Risiko keamanan",
700 "security_risk_description": "Domain ini ditandai sebagai tidak aman oleh beberapa penyedia keamanan. Segera pergi untuk melindungi aset Anda.",
@@ -989,6 +994,7 @@
994 "use": "Beralih ke ",
995 "use_card_info_three": "Gunakan kartu digital secara online atau dengan metode pembayaran tanpa kontak.",
996 "use_card_info_two": "Dana dikonversi ke USD ketika disimpan dalam akun pra-bayar, bukan dalam mata uang digital.",
997 + "use_device_theme": "Gunakan tema perangkat",
998 "use_payjoin": "Menggunakan Payjoin",
999 "use_ssl": "Gunakan SSL",
1000 "use_suggested": "Gunakan yang Disarankan",
@@ -1045,7 +1051,7 @@
1051 "walletConnect": "DompetConnect",
1052 "wallets": "Dompet",
1053 "warning": "Peringatan",
1048 - "welcome": "Selamat datang di",
1054 + "welcome": "Selamat datang",
1055 "welcome_subtitle_new_wallet": "Jika Anda ingin memulai segar, ketuk membuat dompet baru di bawah ini dan Anda akan pergi ke balapan.",
1056 "welcome_subtitle_restore_wallet": "Jika Anda memiliki dompet yang ada yang ingin Anda bawa ke dalam kue, cukup pilih kembalikan dompet yang ada dan kami akan memandu Anda melalui prosesnya.",
1057 "welcome_to_cakepay": "Selamat Datang di Cake Pay!",
@@ -1080,4 +1086,4 @@
1086 "you_will_send": "Konversi dari",
1087 "youCanGoBackToYourDapp": "Anda dapat kembali ke dapp Anda sekarang",
1088 "yy": "YY"
1083 -}
1089 +}
\ No newline at end of file
res/values/strings_it.arb
+8 -1
@@ -269,6 +269,7 @@
269 "domain_mismatch": "Dominio Mismatch",
270 "domain_mismatch_description": "Questo sito Web ha un dominio che non corrisponde al mittente di questa richiesta. L'approvazione può comportare la perdita di fondi.",
271 "donation_link_details": "Dettagli del link di donazione",
272 + "done": "Fatto",
273 "e_sign_consent": "Consenso alla firma elettronica",
274 "edit": "Modifica",
275 "edit_backup_password": "Modifica Password Backup",
@@ -449,6 +450,7 @@
450 "logout": "Logout",
451 "low_fee": "Tariffa bassa",
452 "low_fee_alert": "Attualmente stai utilizzando una priorità a tariffa di rete bassa. Ciò potrebbe causare lunghe attese, tariffe diverse o operazioni annullate. Ti consigliamo di impostare una tariffa più alta per un'esperienza migliore.",
453 + "made_easy": "reso facile",
454 "manage_nodes": "Gestisci i nodi",
455 "manage_pow_nodes": "Gestisci i nodi PoW",
456 "manage_yats": "Gestisci gli Yat",
@@ -560,7 +562,9 @@
562 "payjoin_unavailable_sheet_content": "La ricezione di una transazione Payjoin richiede di avere Bitcoin pronto per l'uso. \\ Ns non appena il tuo portafoglio ha fondi, Payjoin verrà automaticamente abilitato.",
563 "payjoin_unavailable_sheet_title": "Perché Payjoin non è disponibile?",
564 "payment_id": "ID Pagamento: ",
565 + "payment_made_easy": "I pagamenti resi facilmente",
566 "payment_was_received": "Il tuo pagamento è stato ricevuto.",
567 + "payments": "Pagamenti",
568 "pending": " (non confermati)",
569 "percentageOf": "di ${amount}",
570 "pin_at_top": "fissa ${token} in alto",
@@ -688,6 +692,7 @@
692 "search_language": "Cerca lingua",
693 "second_intro_content": "Il tuo Yat è un unico indirizzo emoji univoco che sostituisce i lunghi indirizzi per tutte le tue valute.",
694 "second_intro_title": "Un indirizzo emoji per domarli tutti",
695 + "security": "Sicurezza",
696 "security_and_backup": "Sicurezza e backup",
697 "security_risk": "Rischio di sicurezza",
698 "security_risk_description": "Questo dominio è contrassegnato come non sicuro da più fornitori di sicurezza. Lascia immediatamente per proteggere le tue risorse.",
@@ -987,6 +992,7 @@
992 "use": "Passa a ",
993 "use_card_info_three": "Utilizza la carta digitale online o con metodi di pagamento contactless.",
994 "use_card_info_two": "I fondi vengono convertiti in USD quando sono detenuti nel conto prepagato, non in valute digitali.",
995 + "use_device_theme": "Usa il tema del dispositivo",
996 "use_payjoin": "Utilizzo Payjoin",
997 "use_ssl": "Usa SSL",
998 "use_suggested": "Usa suggerito",
@@ -1045,6 +1051,7 @@
1051 "wallets": "Portafogli",
1052 "warning": "Attenzione",
1053 "welcome": "Benvenuto",
1054 + "welcome_only": "Benvenuto",
1055 "welcome_subtitle_new_wallet": "Se vuoi ricominciare da capo, premi Crea un nuovo portafoglio qui sotto.",
1056 "welcome_subtitle_restore_wallet": "Se hai un portafoglio esistente che vuoi importare in Cake Wallet, scegli semplicemente il ripristino del portafoglio esistente e ti guideremo attraverso il processo.",
1057 "welcome_to_cakepay": "Benvenuto in Cake Pay!",
@@ -1079,4 +1086,4 @@
1086 "you_will_send": "Conveti da",
1087 "youCanGoBackToYourDapp": "Puoi tornare al tuo DApp ora",
1088 "yy": "YY"
1082 -}
1089 +}
\ No newline at end of file
res/values/strings_ja.arb
+8 -2
@@ -269,6 +269,7 @@
269 "domain_mismatch": "ドメインの不一致",
270 "domain_mismatch_description": "このWebサイトには、このリクエストの送信者と一致しないドメインがあります。承認すると、資金の損失につながる可能性があります。",
271 "donation_link_details": "寄付リンクの詳細",
272 + "done": "終わり",
273 "e_sign_consent": "電子署名の同意",
274 "edit": "編集",
275 "edit_backup_password": "バックアップパスワードの編集",
@@ -450,6 +451,7 @@
451 "logout": "ログアウト",
452 "low_fee": "低料金",
453 "low_fee_alert": "現在、低ネットワーク料金優先度を使用しています。これにより、長い待ち時間、異なるレート、またはキャンセルされた取引が発生する可能性があります。より良い体験のために、より高い料金を設定することをお勧めします。",
454 + "made_easy": "簡単になりました",
455 "manage_nodes": "ノードの管理",
456 "manage_pow_nodes": "PoWノードの管理",
457 "manage_yats": "Yatsを管理する",
@@ -560,7 +562,9 @@
562 "payjoin_unavailable_sheet_content": "Payjoinトランザクションを受信するには、ビットコインを使用できるようにする必要があります。\\ n \\ nasのウォレットに資金があるとすぐに、 Payjoinが自動的に有効になります。",
563 "payjoin_unavailable_sheet_title": "Payjoinが利用できないのはなぜですか?",
564 "payment_id": "支払いID: ",
565 + "payment_made_easy": "支払いは簡単になりました",
566 "payment_was_received": "お支払いを受け取りました。",
567 + "payments": "支払い",
568 "pending": " (保留中)",
569 "percentageOf": "of ${amount}",
570 "pin_at_top": "${token} を上部に固定します",
@@ -688,6 +692,7 @@
692 "search_language": "検索言語",
693 "second_intro_content": "Yatは、すべての通貨のすべての長い16進アドレスを置き換える単一の一意の絵文字アドレスです。",
694 "second_intro_title": "それらすべてを支配する1つの絵文字アドレス",
695 + "security": "安全",
696 "security_and_backup": "セキュリティとバックアップ",
697 "security_risk": "セキュリティリスク",
698 "security_risk_description": "このドメインは、複数のセキュリティプロバイダーによって安全でないとフラグが付けられています。あなたの資産を保護するためにすぐに出発します。",
@@ -987,6 +992,7 @@
992 "use": "使用する ",
993 "use_card_info_three": "デジタルカードをオンラインまたは非接触型決済方法で使用してください。",
994 "use_card_info_two": "デジタル通貨ではなく、プリペイドアカウントで保持されている場合、資金は米ドルに変換されます。",
995 + "use_device_theme": "デバイステーマを使用します",
996 "use_payjoin": "使用 Payjoin",
997 "use_ssl": "SSLを使用する",
998 "use_suggested": "推奨を使用",
@@ -1043,7 +1049,7 @@
1049 "walletConnect": "ウォレットコネクト",
1050 "wallets": "財布",
1051 "warning": "警告",
1046 - "welcome": "ようこそ に",
1052 + "welcome": "いらっしゃいませ",
1053 "welcome_subtitle_new_wallet": "新鮮な開始したい場合は、以下の新しい財布を作成すると、レースに出かけることができます。",
1054 "welcome_subtitle_restore_wallet": "ケーキに持ち込みたい既存のウォレットがある場合は、既存のウォレットを復元するだけで、プロセスを説明します。",
1055 "welcome_to_cakepay": "Cake Payへようこそ!",
@@ -1078,4 +1084,4 @@
1084 "you_will_send": "から変換",
1085 "youCanGoBackToYourDapp": "あなたは今あなたのダップに戻ることができます",
1086 "yy": "YY"
1081 -}
1087 +}
\ No newline at end of file
res/values/strings_ko.arb
+8 -2
@@ -269,6 +269,7 @@
269 "domain_mismatch": "도메인 불일치",
270 "domain_mismatch_description": "이 웹사이트의 도메인이 이 요청의 발신자와 일치하지 않습니다. 승인하면 자금 손실로 이어질 수 있습니다.",
271 "donation_link_details": "기부 링크 세부 정보",
272 + "done": "완료",
273 "e_sign_consent": "전자 서명 동의",
274 "edit": "편집",
275 "edit_backup_password": "백업 비밀번호 편집",
@@ -449,6 +450,7 @@
450 "logout": "로그아웃",
451 "low_fee": "낮은 수수료",
452 "low_fee_alert": "현재 낮은 네트워크 수수료 우선순위를 사용하고 있습니다. 이로 인해 대기 시간이 길어지거나, 환율이 달라지거나, 거래가 취소될 수 있습니다. 더 나은 경험을 위해 더 높은 수수료를 설정하는 것이 좋습니다.",
453 + "made_easy": "쉽게 만들었습니다",
454 "manage_nodes": "노드 관리",
455 "manage_pow_nodes": "PoW 노드 관리",
456 "manage_yats": "Yat 관리",
@@ -560,7 +562,9 @@
562 "payjoin_unavailable_sheet_content": "Payjoin 트랜잭션을 수신하려면 비트 코인을 사용할 준비가되어 있어야합니다. \\ n \\ nas 지갑이 자금이 자금이 있으면 Payjoin가 자동으로 활성화됩니다.",
563 "payjoin_unavailable_sheet_title": "Payjoin를 사용할 수없는 이유는 무엇입니까?",
564 "payment_id": "결제 ID: ",
565 + "payment_made_easy": "지불은 쉽게 만들었습니다",
566 "payment_was_received": "결제가 접수되었습니다.",
567 + "payments": "지불",
568 "pending": " (대기 중)",
569 "percentageOf": "${amount}의",
570 "pin_at_top": "${token} 상단에 고정",
@@ -688,6 +692,7 @@
692 "search_language": "언어 검색",
693 "second_intro_content": "Yat은 모든 통화에 대한 긴 16진수 주소를 대체하는 고유한 이모지 주소입니다.",
694 "second_intro_title": "하나의 이모지 주소로 모든 것을",
695 + "security": "보안",
696 "security_and_backup": "보안 및 백업",
697 "security_risk": "보안 위험",
698 "security_risk_description": "이 도메인은 여러 보안 제공 업체에서 안전하지 않다고 플래그 지정되었습니다. 자산을 보호하려면 즉시 나가십시오.",
@@ -987,6 +992,7 @@
992 "use": "다음으로 전환 ",
993 "use_card_info_three": "디지털 카드를 온라인 또는 비접촉 결제 방법으로 사용하세요.",
994 "use_card_info_two": "자금은 디지털 통화가 아닌 선불 계정에 보관될 때 USD로 변환됩니다.",
995 + "use_device_theme": "장치 테마를 사용하십시오",
996 "use_payjoin": "사용 Payjoin",
997 "use_ssl": "SSL 사용",
998 "use_suggested": "제안 사용",
@@ -1043,7 +1049,7 @@
1049 "walletConnect": "WalletConnect",
1050 "wallets": "지갑",
1051 "warning": "경고",
1046 - "welcome": "환영합니다",
1052 + "welcome": "환영",
1053 "welcome_subtitle_new_wallet": "새로 시작하려면 아래의 새 지갑 생성을 탭하면 바로 시작할 수 있습니다.",
1054 "welcome_subtitle_restore_wallet": "Cake로 가져오려는 기존 지갑이 있는 경우 기존 지갑 복구를 선택하면 과정을 안내해 드립니다.",
1055 "welcome_to_cakepay": "Cake Pay에 오신 것을 환영합니다!",
@@ -1078,4 +1084,4 @@
1084 "you_will_send": "전환 출처",
1085 "youCanGoBackToYourDapp": "이제 dApp으로 돌아갈 수 있습니다",
1086 "yy": "YY"
1081 -}
1087 +}
\ No newline at end of file
res/values/strings_my.arb
+8 -2
@@ -269,6 +269,7 @@
269 "domain_mismatch": "ဒိုမိန်းမတိုက်ဆိုင်",
270 "domain_mismatch_description": "ဤ 0 က်ဘ်ဆိုက်တွင်ဤတောင်းဆိုမှုကိုပေးပို့သူနှင့်မကိုက်ညီသောဒိုမိန်းရှိသည်။ အတည်ပြုခြင်းသည်ရန်ပုံငွေများဆုံးရှုံးမှုကိုဖြစ်ပေါ်စေနိုင်သည်။",
271 "donation_link_details": "လှူဒါန်းရန်လင့်ခ်အသေးစိတ်",
272 + "done": "ပြီးပြီ",
273 "e_sign_consent": "E-Sign သဘောတူညီချက်",
274 "edit": "တည်းဖြတ်ပါ။",
275 "edit_backup_password": "Backup Password ကို တည်းဖြတ်ပါ။",
@@ -449,6 +450,7 @@
450 "logout": "ထွက်လိုက်ပါ။",
451 "low_fee": "အနိမ့်ကြေး",
452 "low_fee_alert": "သင်သည် လက်ရှိတွင် သက်သာသော ကွန်ရက်အခကြေးငွေဦးစားပေးကို အသုံးပြုနေပါသည်။ ၎င်းသည် အကြာကြီးစောင့်ဆိုင်းခြင်း၊ မတူညီသောနှုန်းထားများ သို့မဟုတ် ပယ်ဖျက်ထားသော ကုန်သွယ်မှုများကို ဖြစ်စေနိုင်သည်။ ပိုမိုကောင်းမွန်သော အတွေ့အကြုံအတွက် ပိုမိုမြင့်မားသော အခကြေးငွေ သတ်မှတ်ပေးရန် အကြံပြုအပ်ပါသည်။",
453 + "made_easy": "လွယ်ကူပါတယ်",
454 "manage_nodes": "ဆုံမှတ်များကို စီမံပါ။",
455 "manage_pow_nodes": "PoW Nodes ကို စီမံပါ။",
456 "manage_yats": "Yats ကို စီမံပါ။",
@@ -559,7 +561,9 @@
561 "payjoin_unavailable_sheet_content": "Payjoin ငွေပေးချေမှုကိုလက်ခံရန်သင့်အား Bitcoin ကိုအသုံးပြုရန်အဆင်သင့်ဖြစ်ရန်လိုအပ်သည်။ \\ n \\ ns ပိုက်ဆံအိတ်သည်ရန်ပုံငွေများရှိပါက Payjoin သည်အလိုအလျောက်ဖွင့်ထားလိမ့်မည်။",
562 "payjoin_unavailable_sheet_title": "Payjoin Payjoin မရနိုင်ပါကဘာကြောင့်လဲ။",
563 "payment_id": "ငွေပေးချေမှု ID:",
564 + "payment_made_easy": "ငွေပေးချေမှုလွယ်ကူသောလုပ်",
565 "payment_was_received": "သင့်ငွေပေးချေမှုကို လက်ခံရရှိခဲ့သည်။",
566 + "payments": "ငွေပေးချေမှု",
567 "pending": " (ဆိုင်းငံ့)",
568 "percentageOf": "${amount} ၏",
569 "pin_at_top": "အပေါ်တွင် ${token} ပင်ထိုးပါ။",
@@ -687,6 +691,7 @@
691 "search_language": "ဘာသာစကားရှာပါ။",
692 "second_intro_content": "သင်၏ Yat သည် သင့်ငွေကြေးအားလုံးအတွက် သင်၏ ရှည်လျားသော ဆဋ္ဌမကိန်းဂဏန်းများအားလုံးကို အစားထိုးသည့် တစ်မူထူးခြားသော အီမိုဂျီလိပ်စာတစ်ခုဖြစ်သည်။",
693 "second_intro_title": "၎င်းတို့အားလုံးကို အုပ်ချုပ်ရန် အီမိုဂျီလိပ်စာတစ်ခု",
694 + "security": "လုံခွုံရေး",
695 "security_and_backup": "လုံခြုံရေးနှင့် မိတ္တူ",
696 "security_risk": "လုံခြုံရေးအန္တရာယ်",
697 "security_risk_description": "ဒီဒိုမိန်းကိုလုံခြုံရေးပံ့ပိုးပေးသူတွေရဲ့လုံခြုံမှုမရှိဘူး။ သင်၏ပိုင်ဆိုင်မှုများကိုကာကွယ်ရန်ချက်ချင်းချန်ထားပါ။",
@@ -986,6 +991,7 @@
991 "use": "သို့ပြောင်းပါ။",
992 "use_card_info_three": "ဒစ်ဂျစ်တယ်ကတ်ကို အွန်လိုင်း သို့မဟုတ် ထိတွေ့မှုမဲ့ ငွေပေးချေမှုနည်းလမ်းများဖြင့် အသုံးပြုပါ။",
993 "use_card_info_two": "ဒစ်ဂျစ်တယ်ငွေကြေးများဖြင့်မဟုတ်ဘဲ ကြိုတင်ငွေပေးချေသည့်အကောင့်တွင် သိမ်းထားသည့်အခါ ရန်ပုံငွေများကို USD သို့ ပြောင်းလဲပါသည်။",
994 + "use_device_theme": "Device Theme ကိုသုံးပါ",
995 "use_payjoin": "Payjoin Chair ကိုအသုံးပြုပါ",
996 "use_ssl": "SSL ကိုသုံးပါ။",
997 "use_suggested": "အကြံပြုထားသည်ကို အသုံးပြုပါ။",
@@ -1042,7 +1048,7 @@
1048 "walletConnect": "Wallet ချိတ်ဆက်မှု",
1049 "wallets": "ပိုက်ဆံအိတ်",
1050 "warning": "သတိပေးချက်",
1045 - "welcome": "မှကြိုဆိုပါတယ်။",
1051 + "welcome": "ဝမ်းသာစွာနှုတ်ဆက်ခြင်း",
1052 "welcome_subtitle_new_wallet": "လတ်ဆတ်စွာစတင်လိုပါကအောက်ကပိုက်ဆံအိတ်အသစ်ကိုဖန်တီးပါ။",
1053 "welcome_subtitle_restore_wallet": "အကယ်. သင့်တွင်သင်ကိတ်မုန့်ထဲသို့ယူဆောင်လိုသောလက်ရှိပိုက်ဆံအိတ်ရှိပါက Restore Lestore Wallet ကိုရွေးပါ။",
1054 "welcome_to_cakepay": "Cake Pay မှကြိုဆိုပါသည်။",
@@ -1077,4 +1083,4 @@
1083 "you_will_send": "မှပြောင်းပါ။",
1084 "youCanGoBackToYourDapp": "သငျသညျယခုသင်၏ dapp ကိုပြန်သွားနိုင်ပါတယ်",
1085 "yy": "YY"
1080 -}
1086 +}
\ No newline at end of file
res/values/strings_nl.arb
+8 -2
@@ -269,6 +269,7 @@
269 "domain_mismatch": "Domein mismatch",
270 "domain_mismatch_description": "Deze website heeft een domein dat niet overeenkomt met de afzender van dit verzoek. Goedkeuring kan leiden tot verlies van fondsen.",
271 "donation_link_details": "Details van de donatielink",
272 + "done": "Klaar",
273 "e_sign_consent": "Toestemming e-ondertekenen",
274 "edit": "Bewerk",
275 "edit_backup_password": "Bewerk back-upwachtwoord",
@@ -449,6 +450,7 @@
450 "logout": "Uitloggen",
451 "low_fee": "Lage vergoeding",
452 "low_fee_alert": "U gebruikt momenteel een lage prioriteit voor netwerkkosten. Dit kan lange wachttijden, andere tarieven of geannuleerde transacties veroorzaken. We raden aan een hogere vergoeding in te stellen voor een betere ervaring.",
453 + "made_easy": "gemakkelijk gemaakt",
454 "manage_nodes": "Beheer knooppunten",
455 "manage_pow_nodes": "PoW-knooppunten beheren",
456 "manage_yats": "Yats beheren",
@@ -559,7 +561,9 @@
561 "payjoin_unavailable_sheet_content": "Het ontvangen van een Payjoin -transactie vereist dat u Bitcoin klaar hebt om te gebruiken. \\ N \\ NAS Zodra uw portemonnee geld heeft, wordt Payjoin automatisch ingeschakeld.",
562 "payjoin_unavailable_sheet_title": "Waarom is Payjoin niet beschikbaar?",
563 "payment_id": "Betaling ID: ",
564 + "payment_made_easy": "Betalingen gemakkelijk gemaakt",
565 "payment_was_received": "Uw betaling is ontvangen.",
566 + "payments": "Betalingen",
567 "pending": " (in afwachting)",
568 "percentageOf": "van ${amount}",
569 "pin_at_top": "speld ${token} bovenaan",
@@ -687,6 +691,7 @@
691 "search_language": "Zoektaal",
692 "second_intro_content": "Je Yat is een enkel uniek emoji-adres dat al je lange hexadecimale adressen vervangt voor al je valuta's.",
693 "second_intro_title": "Eén emoji-adres om ze allemaal te regeren",
694 + "security": "Beveiliging",
695 "security_and_backup": "Beveiliging en back-up",
696 "security_risk": "Beveiligingsrisico",
697 "security_risk_description": "Dit domein wordt door meerdere beveiligingsproviders gemarkeerd als onveilig. Vertrek onmiddellijk om uw vermogen te beschermen.",
@@ -986,6 +991,7 @@
991 "use": "Gebruik ",
992 "use_card_info_three": "Gebruik de digitale kaart online of met contactloze betaalmethoden.",
993 "use_card_info_two": "Tegoeden worden omgezet naar USD wanneer ze op de prepaid-rekening staan, niet in digitale valuta.",
994 + "use_device_theme": "Gebruik apparaatthema",
995 "use_payjoin": "Gebruik Payjoin",
996 "use_ssl": "Gebruik SSL",
997 "use_suggested": "Gebruik aanbevolen",
@@ -1043,7 +1049,7 @@
1049 "walletConnect": "WalletConnect",
1050 "wallets": "Portefeuilles",
1051 "warning": "Waarschuwing",
1046 - "welcome": "Welkom bij",
1052 + "welcome": "Welkom",
1053 "welcome_subtitle_new_wallet": "Als u opnieuw wilt beginnen, tikt u op de nieuwe portemonnee hieronder en u bent op weg naar de races.",
1054 "welcome_subtitle_restore_wallet": "Als je een bestaande portemonnee hebt die je in cake wilt brengen, kies dan gewoon om de bestaande portemonnee te herstellen en we zullen je door het proces leiden.",
1055 "welcome_to_cakepay": "Welkom bij Cake Pay!",
@@ -1078,4 +1084,4 @@
1084 "you_will_send": "Converteren van",
1085 "youCanGoBackToYourDapp": "U kunt nu terug naar uw DApp gaan",
1086 "yy": "JJ"
1081 -}
1087 +}
\ No newline at end of file
res/values/strings_pl.arb
+8 -2
@@ -269,6 +269,7 @@
269 "domain_mismatch": "Niedopasowanie domeny",
270 "domain_mismatch_description": "Ta strona ma domenę, która nie pasuje do nadawcy tego żądania. Zatwierdzenie może prowadzić do utraty funduszy.",
271 "donation_link_details": "Szczegóły linku darowizny",
272 + "done": "Zrobione",
273 "e_sign_consent": "Zgoda na podpis elektroniczny",
274 "edit": "Edytuj",
275 "edit_backup_password": "Edytuj hasło kopii zapasowej",
@@ -449,6 +450,7 @@
450 "logout": "Wyloguj",
451 "low_fee": "Niska opłata",
452 "low_fee_alert": "Obecnie korzystasz z niskiego priorytetu opłaty sieciowej. Może to spowodować długie oczekiwanie, różne stawki lub anulowane transakcje. Zalecamy ustawienie wyższej opłaty, aby zapewnić lepsze wrażenia.",
453 + "made_easy": "łatwe",
454 "manage_nodes": "Zarządzaj węzłami",
455 "manage_pow_nodes": "Zarządzaj węzłami PoW",
456 "manage_yats": "Zarządzaj Yats",
@@ -559,7 +561,9 @@
561 "payjoin_unavailable_sheet_content": "Otrzymanie transakcji Payjoin wymaga przygotowania Bitcoin do użycia. \\ N \\ NAS, ponieważ portfel ma fundusze, Payjoin zostanie automatycznie włączony.",
562 "payjoin_unavailable_sheet_title": "Dlaczego Payjoin jest niedostępny?",
563 "payment_id": "ID Płatności: ",
564 + "payment_made_easy": "Płatności są łatwe",
565 "payment_was_received": "Twoja płatność została otrzymana.",
566 + "payments": "Płatności",
567 "pending": " (w oczekiwaniu)",
568 "percentageOf": "z ${amount}",
569 "pin_at_top": "przypnij ${token} na górze",
@@ -687,6 +691,7 @@
691 "search_language": "Wyszukaj język",
692 "second_intro_content": "Twój Yat to jeden unikalny adres emoji, który zastępuje wszystkie Twoje długie adresy szesnastkowe dla wszystkich Twoich walut.",
693 "second_intro_title": "Jeden adres emoji, aby zarzadzać wszystkimi walutami",
694 + "security": "Bezpieczeństwo",
695 "security_and_backup": "Bezpieczeństwo i kopia zapasowa",
696 "security_risk": "Ryzyko bezpieczeństwa",
697 "security_risk_description": "Ta domena jest oznaczona jako niebezpieczna przez wielu dostawców bezpieczeństwa. Odejdź natychmiast, aby chronić swoje aktywa.",
@@ -986,6 +991,7 @@
991 "use": "Użyj ",
992 "use_card_info_three": "Użyj cyfrowej karty online lub za pomocą zbliżeniowych metod płatności.",
993 "use_card_info_two": "Środki są przeliczane na USD, gdy są przechowywane na koncie przedpłaconym, a nie w walutach cyfrowych.",
994 + "use_device_theme": "Użyj motywu urządzenia",
995 "use_payjoin": "Używać Payjoin",
996 "use_ssl": "Użyj SSL",
997 "use_suggested": "Użyj sugerowane",
@@ -1042,7 +1048,7 @@
1048 "walletConnect": "WalletConnect",
1049 "wallets": "Portfele",
1050 "warning": "Ostrzeżenie",
1045 - "welcome": "Witamy w",
1051 + "welcome": "Powitanie",
1052 "welcome_subtitle_new_wallet": "Jeśli chcesz zacząć od nowa, dotknij Utwórz nowy portfel poniżej.",
1053 "welcome_subtitle_restore_wallet": "Jeśli masz istniejący portfel, który chcesz wnieść do ciasta, po prostu wybierz przywróć istniejący portfel, a my przeprowadzimy Cię przez proces.",
1054 "welcome_to_cakepay": "Witamy w Cake Pay!",
@@ -1077,4 +1083,4 @@
1083 "you_will_send": "Konwertuj z",
1084 "youCanGoBackToYourDapp": "Możesz teraz wrócić do swojego dapp",
1085 "yy": "RR"
1080 -}
1086 +}
\ No newline at end of file
res/values/strings_pt.arb
+8 -2
@@ -269,6 +269,7 @@
269 "domain_mismatch": "Incompatibilidade de domínio",
270 "domain_mismatch_description": "Este site possui um domínio que não corresponde ao remetente desta solicitação. A aprovação pode levar à perda de fundos.",
271 "donation_link_details": "Detalhes do link de doação",
272 + "done": "Feito",
273 "e_sign_consent": "Consentimento de assinatura eletrônica",
274 "edit": "Editar",
275 "edit_backup_password": "Editar senha de backup",
@@ -449,6 +450,7 @@
450 "logout": "Logout",
451 "low_fee": "Taxa baixa",
452 "low_fee_alert": "No momento, você está usando uma prioridade de taxa de rede baixa. Isso pode causar longas esperas, taxas diferentes ou negociações canceladas. Recomendamos definir uma taxa mais alta para uma melhor experiência.",
453 + "made_easy": "facilitado",
454 "manage_nodes": "Gerenciar nós",
455 "manage_pow_nodes": "Gerenciar nós PoW",
456 "manage_yats": "Gerenciar Yats",
@@ -561,7 +563,9 @@
563 "payjoin_unavailable_sheet_content": "O recebimento de uma transação Payjoin exige que você tenha o Bitcoin pronto para uso. \\ N \\ nas assim que sua carteira tiver fundos, Payjoin será ativado automaticamente.",
564 "payjoin_unavailable_sheet_title": "Por que Payjoin não está disponível?",
565 "payment_id": "ID de pagamento: ",
566 + "payment_made_easy": "Pagamentos facilitados",
567 "payment_was_received": "Seu pagamento foi recebido.",
568 + "payments": "Pagamentos",
569 "pending": " (pendente)",
570 "percentageOf": "de ${amount}",
571 "pin_at_top": "fixe ${token} no topo",
@@ -689,6 +693,7 @@
693 "search_language": "Idioma de pesquisa",
694 "second_intro_content": "Seu Yat é um endereço de emoji único e exclusivo que substitui todos os seus endereços hexadecimais longos para todas as suas moedas.",
695 "second_intro_title": "Um endereço de emoji para governar todos eles",
696 + "security": "Segurança",
697 "security_and_backup": "Segurança e backup",
698 "security_risk": "Risco de segurança",
699 "security_risk_description": "Esse domínio é sinalizado como inseguro por vários provedores de segurança. Saia imediatamente para proteger seus ativos.",
@@ -988,6 +993,7 @@
993 "use": "Use PIN de ",
994 "use_card_info_three": "Use o cartão digital online ou com métodos de pagamento sem contato.",
995 "use_card_info_two": "Os fundos são convertidos para USD quando mantidos na conta pré-paga, não em moedas digitais.",
996 + "use_device_theme": "Use o tema do dispositivo",
997 "use_payjoin": "Usar Payjoin",
998 "use_ssl": "Use SSL",
999 "use_suggested": "Uso sugerido",
@@ -1045,7 +1051,7 @@
1051 "walletConnect": "CarteiraConectada",
1052 "wallets": "Carteiras",
1053 "warning": "Aviso",
1048 - "welcome": "Bem-vindo ao",
1054 + "welcome": "Bem-vindo",
1055 "welcome_subtitle_new_wallet": "Se você quiser começar de novo, toque em criar uma nova carteira abaixo e você estará nas corridas.",
1056 "welcome_subtitle_restore_wallet": "Se você tem uma carteira existente que deseja trazer para o bolo, basta escolher a carteira existente e nós o guiaremos pelo processo.",
1057 "welcome_to_cakepay": "Bem-vindo ao Cake Pay!",
@@ -1080,4 +1086,4 @@
1086 "you_will_send": "Converter de",
1087 "youCanGoBackToYourDapp": "Você pode voltar para o seu dapp agora",
1088 "yy": "aa"
1083 -}
1089 +}
\ No newline at end of file
res/values/strings_ru.arb
+8 -2
@@ -269,6 +269,7 @@
269 "domain_mismatch": "Несоответствие домена",
270 "domain_mismatch_description": "Этот веб -сайт имеет домен, который не соответствует отправителю этого запроса. Утверждение может привести к потере средств.",
271 "donation_link_details": "Информация о ссылке для пожертвований",
272 + "done": "Сделанный",
273 "e_sign_consent": "Согласие электронной подписи",
274 "edit": "Редактировать",
275 "edit_backup_password": "Изменить пароль резервной копии",
@@ -449,6 +450,7 @@
450 "logout": "Выйти",
451 "low_fee": "Низкая комиссия",
452 "low_fee_alert": "В настоящее время вы используете низкий приоритет платы за сеть. Это может привести к длительному ожиданию, изменению ставок или отмене сделок. Мы рекомендуем установить более высокую плату для лучшего опыта.",
453 + "made_easy": "Сделано легко",
454 "manage_nodes": "Управление узлами",
455 "manage_pow_nodes": "Управление узлами PoW",
456 "manage_yats": "Управлять Yat",
@@ -560,7 +562,9 @@
562 "payjoin_unavailable_sheet_content": "Получение транзакции Payjoin требует, чтобы вы готовили биткойн для использования. \\ N \\ Nas, как только ваш кошелек получит средства, Payjoin будет автоматически включен.",
563 "payjoin_unavailable_sheet_title": "Почему Payjoin недоступен?",
564 "payment_id": "ID платежа: ",
565 + "payment_made_easy": "Платежи сделаны простыми",
566 "payment_was_received": "Ваш платеж получен.",
567 + "payments": "Платежи",
568 "pending": " (в ожидании)",
569 "percentageOf": "из ${amount}",
570 "pin_at_top": "закрепить ${token} вверху",
@@ -688,6 +692,7 @@
692 "search_language": "Язык поиска",
693 "second_intro_content": "Ваш Yat - это единственный уникальный адрес эмодзи, который заменяет длинные шестнадцатеричные адреса для всех ваших валют.",
694 "second_intro_title": "Один адрес эмодзи для управления остальными адресами",
695 + "security": "Безопасность",
696 "security_and_backup": "Безопасность и резервное копирование",
697 "security_risk": "Риск безопасности",
698 "security_risk_description": "Этот домен помечен как небезопасен несколькими поставщиками безопасности. Оставьте немедленно, чтобы защитить ваши активы.",
@@ -987,6 +992,7 @@
992 "use": "Использовать ",
993 "use_card_info_three": "Используйте цифровую карту онлайн или с помощью бесконтактных способов оплаты.",
994 "use_card_info_two": "Средства конвертируются в доллары США, когда они хранятся на предоплаченном счете, а не в цифровых валютах.",
995 + "use_device_theme": "Используйте тему устройства",
996 "use_payjoin": "Использовать Payjoin",
997 "use_ssl": "Использовать SSL",
998 "use_suggested": "Использовать предложенный",
@@ -1043,7 +1049,7 @@
1049 "walletConnect": "КошелекПодключиться",
1050 "wallets": "Кошельки",
1051 "warning": "Предупреждение",
1046 - "welcome": "Приветствуем в",
1052 + "welcome": "Добро пожаловать",
1053 "welcome_subtitle_new_wallet": "Если вы хотите начать Fresh, нажмите «Создать новый кошелек» ниже, и вы отправитесь на гонки.",
1054 "welcome_subtitle_restore_wallet": "Если у вас есть существующий кошелек, который вы хотите принести в торт, просто выберите «Восстановить существующий кошелек», и мы проведем вас через процесс.",
1055 "welcome_to_cakepay": "Добро пожаловать в Cake Pay!",
@@ -1078,4 +1084,4 @@
1084 "you_will_send": "Конвертировать из",
1085 "youCanGoBackToYourDapp": "Вы можете вернуться к своему даппу сейчас",
1086 "yy": "ГГ"
1081 -}
1087 +}
\ No newline at end of file
res/values/strings_th.arb
+8 -2
@@ -269,6 +269,7 @@
269 "domain_mismatch": "โดเมนไม่ตรงกัน",
270 "domain_mismatch_description": "เว็บไซต์นี้มีโดเมนที่ไม่ตรงกับผู้ส่งคำขอนี้ การอนุมัติอาจนำไปสู่การสูญเสียเงินทุน",
271 "donation_link_details": "รายละเอียดลิงค์บริจาค",
272 + "done": "เสร็จแล้ว",
273 "e_sign_consent": "การยอมรับ E-Sign",
274 "edit": "แก้ไข",
275 "edit_backup_password": "แก้ไขรหัสผ่านสำรอง",
@@ -449,6 +450,7 @@
450 "logout": "ออกจากระบบ",
451 "low_fee": "ค่าธรรมเนียมต่ำ",
452 "low_fee_alert": "ขณะนี้คุณกำลังใช้ค่าธรรมเนียมของเครือข่ายที่มีความสำคัญต่ำ ซึ่งอาจทำให้เกิดการรอนาน ราคาที่แตกต่างกัน หรือยกเลิกการซื้อขาย เราแนะนำให้กำหนดค่าธรรมเนียมที่สูงขึ้นเพื่อประสบการณ์ที่ดีขึ้น",
453 + "made_easy": "ทำง่าย",
454 "manage_nodes": "จัดการโหนด",
455 "manage_pow_nodes": "จัดการโหนด PoW",
456 "manage_yats": "จัดการ Yats",
@@ -559,7 +561,9 @@
561 "payjoin_unavailable_sheet_content": "การรับธุรกรรม Payjoin จะต้องให้คุณมี Bitcoin พร้อมใช้งาน \\ n \\ nas เร็ว ๆ นี้เนื่องจากกระเป๋าเงินของคุณมีเงินทุน Payjoin จะเปิดใช้งานโดยอัตโนมัติ",
562 "payjoin_unavailable_sheet_title": "ทำไม Payjoin ไม่พร้อมใช้งาน?",
563 "payment_id": "ID การชำระเงิน: ",
564 + "payment_made_easy": "การชำระเงินทำให้ง่าย",
565 "payment_was_received": "การชำระเงินของคุณได้รับการรับทราบแล้ว",
566 + "payments": "การชำระเงิน",
567 "pending": " (อยู่ระหว่างดำเนินการ)",
568 "percentageOf": "${amount} ของ",
569 "pin_at_top": "ปักหมุด ${token} ที่ด้านบน",
@@ -687,6 +691,7 @@
691 "search_language": "ค้นหาภาษา",
692 "second_intro_content": "Yat ของคุณเป็นอิโมจิที่อยู่เดียวที่จะแทนที่ทุกที่อยู่และเลขฐานสิบหกของคุณสำหรับเหรียญคริปโตทุกชนิด",
693 "second_intro_title": "อิโมจิที่อยู่เดียวที่จะควบคุมพวกเขาทั้งหมด",
694 + "security": "ความปลอดภัย",
695 "security_and_backup": "ความปลอดภัยและการสำรองข้อมูล",
696 "security_risk": "ความเสี่ยงด้านความปลอดภัย",
697 "security_risk_description": "โดเมนนี้ถูกตั้งค่าสถานะว่าไม่ปลอดภัยโดยผู้ให้บริการความปลอดภัยหลายราย ออกทันทีเพื่อปกป้องทรัพย์สินของคุณ",
@@ -986,6 +991,7 @@
991 "use": "สลับไปที่ ",
992 "use_card_info_three": "ใช้บัตรดิจิตอลออนไลน์หรือผ่านวิธีการชำระเงินแบบไม่ต้องใช้บัตรกระดาษ",
993 "use_card_info_two": "เงินจะถูกแปลงค่าเป็นดอลลาร์สหรัฐเมื่อถือไว้ในบัญชีสำรองเงิน ไม่ใช่สกุลเงินดิจิตอล",
994 + "use_device_theme": "ใช้ธีมอุปกรณ์",
995 "use_payjoin": "ใช้ Payjoin",
996 "use_ssl": "ใช้ SSL",
997 "use_suggested": "ใช้ที่แนะนำ",
@@ -1042,7 +1048,7 @@
1048 "walletConnect": "WalletConnect",
1049 "wallets": "กระเป๋า",
1050 "warning": "คำเตือน",
1045 - "welcome": "ยินดีต้อนรับสู่",
1051 + "welcome": "ยินดีต้อนรับ",
1052 "welcome_subtitle_new_wallet": "หากคุณต้องการเริ่มต้นใหม่ให้แตะสร้างกระเป๋าเงินใหม่ด้านล่างและคุณจะออกจากการแข่งขัน",
1053 "welcome_subtitle_restore_wallet": "หากคุณมีกระเป๋าเงินที่มีอยู่ที่คุณต้องการนำเข้าเค้กให้เลือกคืนกระเป๋าเงินที่มีอยู่แล้วเราจะพาคุณผ่านกระบวนการ",
1054 "welcome_to_cakepay": "ยินดีต้อนรับสู่ Cake Pay!",
@@ -1077,4 +1083,4 @@
1083 "you_will_send": "แปลงจาก",
1084 "youCanGoBackToYourDapp": "คุณสามารถกลับไปที่ dapp ของคุณได้ทันที",
1085 "yy": "ปี"
1080 -}
1086 +}
\ No newline at end of file
res/values/strings_tl.arb
+8 -2
@@ -269,6 +269,7 @@
269 "domain_mismatch": "Domain mismatch",
270 "domain_mismatch_description": "Ang website na ito ay may isang domain na hindi tumutugma sa nagpadala ng kahilingan na ito. Ang pag -apruba ay maaaring humantong sa pagkawala ng mga pondo.",
271 "donation_link_details": "Mga detalye ng link ng donasyon",
272 + "done": "Tapos na",
273 "e_sign_consent": "E-Sign Consent",
274 "edit": "I-edit",
275 "edit_backup_password": "I-edit ang backup na password",
@@ -449,6 +450,7 @@
450 "logout": "Mag-logout",
451 "low_fee": "Mababang fee",
452 "low_fee_alert": "Kasalukuyan kang gumagamit ng isang mababang priyoridad sa network fee. Maaari itong maging sanhi ng mahabang paghihintay, iba't ibang mga rate, o kanselahin ang mga trading. Inirerekumenda namin ang pagtatakda ng isang mas mataas na fee para sa isang mas mahusay na karanasan.",
453 + "made_easy": "Ginawa madali",
454 "manage_nodes": "Pamahalaan ang mga node",
455 "manage_pow_nodes": "Pamahalaan ang mga PoW node",
456 "manage_yats": "Pamahalaan ang mga Yat",
@@ -559,7 +561,9 @@
561 "payjoin_unavailable_sheet_content": "Ang pagtanggap ng isang Payjoin transaksyon ay nangangailangan sa iyo na handa nang gamitin ang bitcoin.",
562 "payjoin_unavailable_sheet_title": "Bakit hindi magagamit ang Payjoin?",
563 "payment_id": "Payment ID: ",
564 + "payment_made_easy": "Madali ang mga pagbabayad",
565 "payment_was_received": "Natanggap ang iyong bayad.",
566 + "payments": "Pagbabayad",
567 "pending": "(hindi pa tapos)",
568 "percentageOf": "ng ${amount}",
569 "pin_at_top": "I-pin ${token} sa tuktok",
@@ -687,6 +691,7 @@
691 "search_language": "Maghanap ng wika",
692 "second_intro_content": "Ang iyong Yat ay isang natatanging emoji address na pumapalit sa lahat ng iyong mahabang hexadecimal address para sa lahat ng iyong pera.",
693 "second_intro_title": "Isang emoji address para pamunuan silang lahat",
694 + "security": "Seguridad",
695 "security_and_backup": "Seguridad at backup",
696 "security_risk": "Panganib sa seguridad",
697 "security_risk_description": "Ang domain na ito ay na -flag bilang hindi ligtas ng maraming mga nagbibigay ng seguridad. Mag -iwan kaagad upang maprotektahan ang iyong mga pag -aari.",
@@ -986,6 +991,7 @@
991 "use": "Lumipat sa ",
992 "use_card_info_three": "Gamitin ang digital card online o sa mga paraan ng pagbabayad na walang contact.",
993 "use_card_info_two": "Ang mga pondo ay na-convert sa USD kapag hawak sa prepaid account, hindi sa mga digital na pera.",
994 + "use_device_theme": "Gumamit ng tema ng aparato",
995 "use_payjoin": "Gumamit ng Payjoin",
996 "use_ssl": "Gumamit ng SSL",
997 "use_suggested": "Gumamit ng iminungkahing",
@@ -1042,7 +1048,7 @@
1048 "walletConnect": "WalletConnect",
1049 "wallets": "Mga Wallet",
1050 "warning": "Babala",
1045 - "welcome": "Maligayang pagdating sa",
1051 + "welcome": "Maligayang pagdating",
1052 "welcome_subtitle_new_wallet": "Kung nais mong simulan ang sariwa, tapikin ang Lumikha ng Bagong Wallet sa ibaba at pupunta ka sa mga karera.",
1053 "welcome_subtitle_restore_wallet": "Kung mayroon kang isang umiiral na pitaka na nais mong dalhin sa cake, piliin lamang ang ibalik ang umiiral na pitaka at lalakad ka namin sa proseso.",
1054 "welcome_to_cakepay": "Maligayang pagdating sa Cake Pay!",
@@ -1077,4 +1083,4 @@
1083 "you_will_send": "I-convert mula sa",
1084 "youCanGoBackToYourDapp": "Maaari kang bumalik sa iyong dapp ngayon",
1085 "yy": "YY"
1080 -}
1086 +}
\ No newline at end of file
res/values/strings_tr.arb
+8 -2
@@ -269,6 +269,7 @@
269 "domain_mismatch": "Alan uyuşmazlığı",
270 "domain_mismatch_description": "Bu web sitesinde, bu isteğin göndereniyle eşleşmeyen bir etki alanı vardır. Onaylama fon kaybına yol açabilir.",
271 "donation_link_details": "Bağış bağlantısı ayrıntıları",
272 + "done": "Tamamlamak",
273 "e_sign_consent": "E-İmza Onayı",
274 "edit": "Düzenle",
275 "edit_backup_password": "Yedek parolasını değiştir",
@@ -449,6 +450,7 @@
450 "logout": "Çıkış yap",
451 "low_fee": "Düşük komisyon",
452 "low_fee_alert": "Şu anda düşük bir ağ ücreti önceliği kullanıyorsunuz. Bu durum uzun beklemeler, farklı oranlar veya iptal edilen işlemlere neden olabilir. Daha iyi bir deneyim için daha yüksek bir ücret belirlemenizi öneririz.",
453 + "made_easy": "kolaylaştırılmış",
454 "manage_nodes": "Düğümleri yönet",
455 "manage_pow_nodes": "PoW Düğümlerini Yönet",
456 "manage_yats": "Yats'ları yönet",
@@ -559,7 +561,9 @@
561 "payjoin_unavailable_sheet_content": "Bir Payjoin işlem almak, Bitcoin kullanıma hazır olmanızı gerektirir. \\ N \\ nas Cüzdanınızın fonları olduğu anda Payjoin otomatik olarak etkinleştirilir.",
562 "payjoin_unavailable_sheet_title": "Payjoin Neden mevcut değil?",
563 "payment_id": "Ödeme ID'si: ",
564 + "payment_made_easy": "Ödemeler kolaylaştırıldı",
565 "payment_was_received": "Ödemeniz alındı.",
566 + "payments": "Ödemeler",
567 "pending": " (bekleyen)",
568 "percentageOf": "of ${amount}",
569 "pin_at_top": "${token} üstte sabitle",
@@ -687,6 +691,7 @@
691 "search_language": "Dil arat",
692 "second_intro_content": "Yat'ınız, tüm para birimleriniz için uzun onaltılık adreslerinizin yerini alan benzersiz emoji adresidir.",
693 "second_intro_title": "Hepsini yönetebilen tek bir emoji adresi",
694 + "security": "Güvenlik",
695 "security_and_backup": "Güvenlik ve yedekleme",
696 "security_risk": "Güvenlik riski",
697 "security_risk_description": "Bu alan, birden fazla güvenlik sağlayıcısı tarafından güvensiz olarak işaretlenir. Varlıklarınızı korumak için hemen ayrılın.",
@@ -986,6 +991,7 @@
991 "use": "Şuna geç: ",
992 "use_card_info_three": "Dijital kartı çevrimiçi olarak veya temassız ödeme yöntemleriyle kullanın.",
993 "use_card_info_two": "Paralar, dijital para birimlerinde değil, ön ödemeli hesapta tutulduğunda USD'ye dönüştürülür.",
994 + "use_device_theme": "Cihaz temasını kullanın",
995 "use_payjoin": "Kullanmak Payjoin",
996 "use_ssl": "SSL kullan",
997 "use_suggested": "Önerileni Kullan",
@@ -1042,7 +1048,7 @@
1048 "walletConnect": "WalletConnect",
1049 "wallets": "Cüzdanlar",
1050 "warning": "Uyarı",
1045 - "welcome": "Hoş Geldiniz",
1051 + "welcome": "Hoş geldin",
1052 "welcome_subtitle_new_wallet": "Taze başlamak istiyorsanız, aşağıda yeni cüzdan oluşturun ve yarışlara gidersiniz.",
1053 "welcome_subtitle_restore_wallet": "Mevcut bir cüzdanınız varsa, kek içine getirmek istediğiniz, mevcut cüzdanı geri yüklemeyi seçin ve bu süreç boyunca size yol gösterelim.",
1054 "welcome_to_cakepay": "Cake Pay'e Hoş Geldiniz!",
@@ -1077,4 +1083,4 @@
1083 "you_will_send": "Biçiminden dönüştür:",
1084 "youCanGoBackToYourDapp": "Şimdi Dapp'ınıza geri dönebilirsin",
1085 "yy": "YY"
1080 -}
1086 +}
\ No newline at end of file
res/values/strings_uk.arb
+8 -2
@@ -269,6 +269,7 @@
269 "domain_mismatch": "Невідповідність домену",
270 "domain_mismatch_description": "Цей веб -сайт має домен, який не відповідає відправнику цього запиту. Затвердження може призвести до втрати коштів.",
271 "donation_link_details": "Деталі посилання для пожертв",
272 + "done": "Виконаний",
273 "e_sign_consent": "Згода електронного підпису",
274 "edit": "Редагувати",
275 "edit_backup_password": "Змінити пароль резервної копії",
@@ -449,6 +450,7 @@
450 "logout": "Вийти",
451 "low_fee": "Низька плата",
452 "low_fee_alert": "Зараз ви використовуєте низький пріоритет плати за мережу. Це може спричинити тривале очікування, інший курс або скасування угод. Ми рекомендуємо встановити вищу плату для кращого досвіду.",
453 + "made_easy": "полегшив",
454 "manage_nodes": "Керуйте вузлами",
455 "manage_pow_nodes": "Керуйте вузлами PoW",
456 "manage_yats": "Керувати Yat",
@@ -559,7 +561,9 @@
561 "payjoin_unavailable_sheet_content": "Отримання транзакції Payjoin вимагає, щоб ви біткойн готували до використання.",
562 "payjoin_unavailable_sheet_title": "Чому Payjoin недоступний?",
563 "payment_id": "ID платежу: ",
564 + "payment_made_easy": "Платежі полегшені",
565 "payment_was_received": "Ваш платіж отримано.",
566 + "payments": "Виплати",
567 "pending": " (в очікуванні)",
568 "percentageOf": "${amount}",
569 "pin_at_top": "закріпити ${token} зверху",
@@ -688,6 +692,7 @@
692 "search_language": "Мова пошуку",
693 "second_intro_content": "Ваш Yat - це єдина унікальна адреса емодзі, яка замінює довгі шістнадцятиричні адреси для всіх ваших валют.",
694 "second_intro_title": "Одна адреса емодзі для управління іншими адресами",
695 + "security": "Безпека",
696 "security_and_backup": "Безпека та резервне копіювання",
697 "security_risk": "Ризик безпеки",
698 "security_risk_description": "Цей домен позначений як небезпечно численними постачальниками безпеки. Залиште негайно, щоб захистити свої активи.",
@@ -987,6 +992,7 @@
992 "use": "Використати ",
993 "use_card_info_three": "Використовуйте цифрову картку онлайн або за допомогою безконтактних методів оплати.",
994 "use_card_info_two": "Кошти конвертуються в долари США, якщо вони зберігаються на передплаченому рахунку, а не в цифрових валютах.",
995 + "use_device_theme": "Використовуйте тему пристрою",
996 "use_payjoin": "Використовуйте Payjoin",
997 "use_ssl": "Використати SSL",
998 "use_suggested": "Використати запропоноване",
@@ -1043,7 +1049,7 @@
1049 "walletConnect": "WalletConnect",
1050 "wallets": "Гаманці",
1051 "warning": "УВАГА",
1046 - "welcome": "Вітаємо в",
1052 + "welcome": "Вітати",
1053 "welcome_subtitle_new_wallet": "Якщо ви хочете почати спочатку, торкніться Створити новий гаманець нижче, і ви будете поза конкуренціею.",
1054 "welcome_subtitle_restore_wallet": "Якщо у вас є існуючий гаманець, який ви хочете ввести в торт, просто виберіть Відновити існуючий гаманець, і ми проведемо вас через процес.",
1055 "welcome_to_cakepay": "Ласкаво просимо до Cake Pay!",
@@ -1078,4 +1084,4 @@
1084 "you_will_send": "Конвертувати з",
1085 "youCanGoBackToYourDapp": "Ви можете повернутися до свого DAPP зараз",
1086 "yy": "YY"
1081 -}
1087 +}
\ No newline at end of file
res/values/strings_ur.arb
+8 -2
@@ -269,6 +269,7 @@
269 "domain_mismatch": "ڈومین مماثل",
270 "domain_mismatch_description": "اس ویب سائٹ میں ایک ڈومین ہے جو اس درخواست کے مرسل سے مماثل نہیں ہے۔ منظوری سے فنڈز کا نقصان ہوسکتا ہے۔",
271 "donation_link_details": "عطیہ کے لنک کی تفصیلات",
272 + "done": "کیا",
273 "e_sign_consent": "ای سائن کنسنٹ",
274 "edit": "ترمیم",
275 "edit_backup_password": "بیک اپ پاس ورڈ میں ترمیم کریں۔",
@@ -449,6 +450,7 @@
450 "logout": "لاگ آوٹ",
451 "low_fee": "کم فیس",
452 "low_fee_alert": "آپ فی الحال کم نیٹ ورک فیس کی ترجیح استعمال کر رہے ہیں۔ یہ طویل انتظار، مختلف شرحوں، یا منسوخ شدہ تجارتوں کا سبب بن سکتا ہے۔ ہم بہتر تجربہ کے لیے زیادہ فیس مقرر کرنے کی تجویز کرتے ہیں۔",
453 + "made_easy": "آسان بنا دیا",
454 "manage_nodes": "۔ﮟﯾﺮﮐ ﻢﻈﻧ ﺎﮐ ﺱﮈﻮﻧ",
455 "manage_pow_nodes": "PoW ۔ﮟﯾﺮﮐ ﻢﻈﻧ ﺎﮐ ﺱﮈﻮﻧ",
456 "manage_yats": "یاٹس کا انتظام کریں۔",
@@ -561,7 +563,9 @@
563 "payjoin_unavailable_sheet_content": "Payjoin ٹرانزیکشن وصول کرنے کے ل you آپ کو بٹ کوائن کو استعمال کرنے کے لئے تیار کرنے کی ضرورت ہوتی ہے۔ \\ n \\ nas جیسے ہی آپ کے بٹوے میں فنڈز ہوں گے ، Payjoin خود بخود فعال ہوجائیں گے۔",
564 "payjoin_unavailable_sheet_title": "Payjoin دستیاب کیوں نہیں ہے؟",
565 "payment_id": "ادائیگی کی شناخت:",
566 + "payment_made_easy": "ادائیگی آسان کردی گئی",
567 "payment_was_received": "آپ کی ادائیگی موصول ہو گئی۔",
568 + "payments": "ادائیگی",
569 "pending": " (زیر التواء)",
570 "percentageOf": "${amount} کا",
571 "pin_at_top": "اوپر ${token} کو پن کریں۔",
@@ -689,6 +693,7 @@
693 "search_language": "زبان تلاش کریں۔",
694 "second_intro_content": "آپ کا Yat ایک منفرد ایموجی ایڈریس ہے جو آپ کی تمام کرنسیوں کے لیے آپ کے تمام لمبے ہیکسا ڈیسیمل پتوں کی جگہ لے لیتا ہے۔",
695 "second_intro_title": "ان سب پر حکمرانی کے لیے ایک ایموجی ایڈریس",
696 + "security": "سلامتی",
697 "security_and_backup": "سیکیورٹی اور بیک اپ",
698 "security_risk": "سیکیورٹی کا خطرہ",
699 "security_risk_description": "اس ڈومین کو متعدد سیکیورٹی فراہم کرنے والوں کے ذریعہ غیر محفوظ کے طور پر جھنڈا لگایا گیا ہے۔ اپنے اثاثوں کی حفاظت کے لئے فورا. چھوڑ دیں۔",
@@ -988,6 +993,7 @@
993 "use": "تبدیل کرنا",
994 "use_card_info_three": "ڈیجیٹل کارڈ آن لائن یا کنٹیکٹ لیس ادائیگی کے طریقوں کے ساتھ استعمال کریں۔",
995 "use_card_info_two": "رقوم کو امریکی ڈالر میں تبدیل کیا جاتا ہے جب پری پیڈ اکاؤنٹ میں رکھا جاتا ہے، ڈیجیٹل کرنسیوں میں نہیں۔",
996 + "use_device_theme": "ڈیوائس تھیم استعمال کریں",
997 "use_payjoin": "Payjoin کا استعمال کریں",
998 "use_ssl": "SSL استعمال کریں۔",
999 "use_suggested": "تجویز کردہ استعمال کریں۔",
@@ -1044,7 +1050,7 @@
1050 "walletConnect": "WalletConnect",
1051 "wallets": "بٹوے",
1052 "warning": "وارننگ",
1047 - "welcome": "میں خوش آمدید",
1053 + "welcome": "خوش آمدید",
1054 "welcome_subtitle_new_wallet": "اگر آپ تازہ شروع کرنا چاہتے ہیں تو ، نیچے نیا پرس بنائیں پر تھپتھپائیں اور آپ ریسوں پر جائیں گے۔",
1055 "welcome_subtitle_restore_wallet": "اگر آپ کے پاس موجودہ پرس ہے تو آپ کیک میں لانا چاہتے ہیں تو ، موجودہ بٹوے کو بحال کریں کا انتخاب کریں اور ہم آپ کو اس عمل میں چلیں گے۔",
1056 "welcome_to_cakepay": "Cake پے میں خوش آمدید!",
@@ -1079,4 +1085,4 @@
1085 "you_will_send": "سے تبدیل کریں۔",
1086 "youCanGoBackToYourDapp": "اب آپ اپنے ڈی اے پی پی پر واپس جاسکتے ہیں",
1087 "yy": "YY"
1082 -}
1088 +}
\ No newline at end of file
res/values/strings_vi.arb
+8 -2
@@ -268,6 +268,7 @@
268 "domain_mismatch": "Không phù hợp miền",
269 "domain_mismatch_description": "Trang web này có một tên miền không khớp với người gửi yêu cầu này. Phê duyệt có thể dẫn đến mất tiền.",
270 "donation_link_details": "Chi tiết liên kết quyên góp",
271 + "done": "Xong",
272 "e_sign_consent": "Đồng ý Ký Điện tử",
273 "edit": "Chỉnh sửa",
274 "edit_backup_password": "Chỉnh sửa mật khẩu sao lưu",
@@ -448,6 +449,7 @@
449 "logout": "Đăng xuất",
450 "low_fee": "Phí thấp",
451 "low_fee_alert": "Bạn hiện đang sử dụng mức ưu tiên phí mạng thấp. Điều này có thể dẫn đến thời gian chờ lâu, tỷ giá khác nhau, hoặc giao dịch bị hủy bỏ. Chúng tôi khuyến nghị bạn đặt mức phí cao hơn để có trải nghiệm tốt hơn.",
452 + "made_easy": "làm dễ dàng",
453 "manage_nodes": "Quản lý các nút",
454 "manage_pow_nodes": "Quản lý các nút PoW",
455 "manage_yats": "Quản lý Yats",
@@ -557,7 +559,9 @@
559 "payjoin_unavailable_sheet_content": "Nhận một giao dịch Payjoin yêu cầu bạn sẵn sàng sử dụng bitcoin. \\ N \\ nas sớm khi ví của bạn có tiền, Payjoin sẽ được bật tự động.",
560 "payjoin_unavailable_sheet_title": "Tại sao Payjoin không có sẵn?",
561 "payment_id": "ID thanh toán: ",
562 + "payment_made_easy": "Thanh toán được thực hiện dễ dàng",
563 "payment_was_received": "Thanh toán của bạn đã được nhận.",
564 + "payments": "Thanh toán",
565 "pending": " (đang chờ)",
566 "percentageOf": "của ${amount}",
567 "pin_at_top": "Ghim ${token} ở trên cùng",
@@ -685,6 +689,7 @@
689 "search_language": "Tìm kiếm ngôn ngữ",
690 "second_intro_content": "Yat của bạn là một địa chỉ emoji duy nhất thay thế tất cả các địa chỉ hex dài của bạn cho tất cả các loại tiền tệ của bạn.",
691 "second_intro_title": "Một địa chỉ emoji để cai trị tất cả",
692 + "security": "Bảo vệ",
693 "security_and_backup": "Bảo mật và sao lưu",
694 "security_risk": "Rủi ro bảo mật",
695 "security_risk_description": "Tên miền này được gắn cờ là không an toàn bởi nhiều nhà cung cấp bảo mật. Rời đi ngay lập tức để bảo vệ tài sản của bạn.",
@@ -983,6 +988,7 @@
988 "use": "Chuyển sang",
989 "use_card_info_three": "Sử dụng thẻ kỹ thuật số trực tuyến hoặc với các phương thức thanh toán không tiếp xúc.",
990 "use_card_info_two": "Các khoản tiền được chuyển đổi thành USD khi chúng được giữ trong tài khoản trả trước, không phải trong các loại tiền kỹ thuật số.",
991 + "use_device_theme": "Sử dụng chủ đề thiết bị",
992 "use_payjoin": "Sử dụng Payjoin",
993 "use_ssl": "Sử dụng SSL",
994 "use_suggested": "Sử dụng đề xuất",
@@ -1039,7 +1045,7 @@
1045 "walletConnect": "WalletConnect",
1046 "wallets": "Các ví",
1047 "warning": "Cảnh báo",
1042 - "welcome": "Chào mừng đến với",
1048 + "welcome": "Chào mừng",
1049 "welcome_subtitle_new_wallet": "Nếu bạn muốn bắt đầu mới, hãy nhấn Tạo ví mới bên dưới và bạn sẽ rời khỏi các cuộc đua.",
1050 "welcome_subtitle_restore_wallet": "Nếu bạn có một ví hiện có mà bạn muốn mang vào bánh, chỉ cần chọn khôi phục ví hiện có và chúng tôi sẽ hướng dẫn bạn qua quá trình này.",
1051 "welcome_to_cakepay": "Chào mừng đến với Cake Pay!",
@@ -1074,4 +1080,4 @@
1080 "you_will_send": "Chuyển đổi từ",
1081 "youCanGoBackToYourDapp": "Bạn có thể quay lại DAPP của mình ngay bây giờ",
1082 "yy": "YY"
1077 -}
1083 +}
\ No newline at end of file
res/values/strings_yo.arb
+8 -2
@@ -269,6 +269,7 @@
269 "domain_mismatch": "Ìkápá",
270 "domain_mismatch_description": "Oju opo wẹẹbu yii ni ašẹ ti ko baamu olufiranṣẹ ti ibeere yii. Itẹwọgba le ja si ipadanu awọn owo.",
271 "donation_link_details": "Iru awọn ẹya ọrọ ti o funni",
272 + "done": "Ṣe",
273 "dont_get_code": "Ṣé ẹ ti gba ọ̀rọ̀ ìdánimọ̀?",
274 "e_sign_consent": "Jẹ́rìí sí lórí ayélujára",
275 "edit": "Pààrọ̀",
@@ -450,6 +451,7 @@
451 "logout": "Jáde",
452 "low_fee": "Owó àfikún kékeré",
453 "low_fee_alert": "Ẹ ń fi owó àfikún kékeré fún àwọn àránṣẹ́ yín lágbára. Eleyìí lè pẹ́ gba àránṣẹ́ yín. Ó sì lè dá àwọn iye mìíràn t'á ṣẹ́ owó sí. Ó sì lè pa àwọn pàṣípààrọ̀. A dábàá pé k'ẹ́ lo owó àfikún títobi láti ṣe àṣejèrè.",
454 + "made_easy": "ṣe rọrun",
455 "manage_nodes": "Ṣakoso awọn apa",
456 "manage_pow_nodes": "Ṣakoso awọn Nodes PoW",
457 "manage_yats": "Bójú Yats",
@@ -560,7 +562,9 @@
562 "payjoin_unavailable_sheet_content": "Gbigba idunadura Payjoin iṣowo nbeere lati ni Bitcoin ṣetan lati lo. \\ N \\ NAS laipẹ bi apamọwọ rẹ ni owo, Payjoin yoo ṣiṣẹ laifọwọyi.",
563 "payjoin_unavailable_sheet_title": "Kini idi ti Payjoin ko si?",
564 "payment_id": "Àmì ìdánimọ̀ àránṣẹ́: ",
565 + "payment_made_easy": "Awọn sisanwo ti a ṣe rọrun",
566 "payment_was_received": "Àránṣẹ́ yín ti dé.",
567 + "payments": "Awọn sisanwo",
568 "pending": " pípẹ́",
569 "percentageOf": "láti ${amount}",
570 "pin_at_top": "pin ${tokini} ni oke",
@@ -688,6 +692,7 @@
692 "search_language": "Wá èdè",
693 "second_intro_content": "Àdírẹ́sì kan tó dá lórí emójì tó kì í jọra ni Yat yín. Ó rọ́pò gbogbo àwọn àdírẹ́sì gígùn yín tó dá lórí ìlà mẹ́rìndínlógún ti gbogbo àwọn iye owó yín.",
694 "second_intro_title": "Àdírẹ́sì kan t'á dá láti emójì tó pàṣẹ gbogbo ohun wà",
695 + "security": "Aabo",
696 "security_and_backup": "Ìṣọ́ àti ẹ̀dà nípamọ́",
697 "security_risk": "Ewu aabo",
698 "security_risk_description": "Aaye yii jẹ aami bi aiṣe nipasẹ awọn olupese aabo pupọ. Lọ kuro lẹsẹkẹsẹ lati daabo bo awọn ohun-ini rẹ.",
@@ -987,6 +992,7 @@
992 "use": "Lo",
993 "use_card_info_three": "Ẹ lo káàdí ayélujára lórí wẹ́ẹ̀bù tàbí ẹ lò ó lórí àwọn ẹ̀rọ̀ ìrajà tíwọn kò kò.",
994 "use_card_info_two": "A pààrọ̀ owó sí owó Amẹ́ríkà tó bá wà nínú àkanti t'á ti fikún tẹ́lẹ̀tẹ́lẹ̀. A kò kó owó náà nínú owó ayélujára.",
995 + "use_device_theme": "Lo akori ẹrọ",
996 "use_payjoin": "Lo Payjoin",
997 "use_ssl": "Lo SSL",
998 "use_suggested": "Lo àbá",
@@ -1043,7 +1049,7 @@
1049 "walletConnect": "Asopọmọra apamọwọ",
1050 "wallets": "Àwọn àpamọ́wọ́",
1051 "warning": "Ikilo",
1046 - "welcome": "Ẹ káàbọ sí",
1052 + "welcome": "Kaabọ",
1053 "welcome_subtitle_new_wallet": "Ti o ba fẹ bẹrẹ alabapade, tẹ Ṣẹda apamọwọ tuntun ni isalẹ iwọ yoo wa ni pipa si awọn ere-ije.",
1054 "welcome_subtitle_restore_wallet": "Ti o ba ni apamọwọ ti o wa tẹlẹ ti o fẹ lati mu wa sinu akara oyinbo, yan omi apamọwọ wa tẹlẹ ati pe a yoo rin ọ nipasẹ ilana naa.",
1055 "welcome_to_cakepay": "Ẹ káàbọ̀ sí Cake Pay!",
@@ -1078,4 +1084,4 @@
1084 "you_will_send": "Ṣe pàṣípààrọ̀ láti",
1085 "youCanGoBackToYourDapp": "O le pada si tapla rẹ bayi",
1086 "yy": "Ọd"
1081 -}
1087 +}
\ No newline at end of file
res/values/strings_zh.arb
+8 -2
@@ -269,6 +269,7 @@
269 "domain_mismatch": "域不匹配",
270 "domain_mismatch_description": "该网站的域与此请求的发件人的发件人不匹配。批准可能导致资金损失。",
271 "donation_link_details": "捐赠链接详情",
272 + "done": "完毕",
273 "e_sign_consent": "电子签名同意",
274 "edit": "编辑",
275 "edit_backup_password": "编辑备份密码",
@@ -449,6 +450,7 @@
450 "logout": "注销",
451 "low_fee": "费用低",
452 "low_fee_alert": "您当前正在使用低网络费用优先级。这可能会导致长时间等待、不同的费率或取消交易。我们建议设置更高的费用以获得更好的体验。",
453 + "made_easy": "变得容易",
454 "manage_nodes": "管理节点",
455 "manage_pow_nodes": "管理 PoW 节点",
456 "manage_yats": "管理 Yats",
@@ -559,7 +561,9 @@
561 "payjoin_unavailable_sheet_content": "接收 Payjoin Transaction需要您准备使用比特币。",
562 "payjoin_unavailable_sheet_title": "为什么 Payjoin不可用?",
563 "payment_id": "付款 ID: ",
564 + "payment_made_easy": "付款很容易",
565 "payment_was_received": "您的付款已收到。",
566 + "payments": "付款",
567 "pending": " (待定)",
568 "percentageOf": "${amount}",
569 "pin_at_top": "将 ${token} 固定在顶部",
@@ -687,6 +691,7 @@
691 "search_language": "搜索语言",
692 "second_intro_content": "您的 Yat 是一個唯一的表情符號地址,可替換您所有貨幣的所有長十六進制地址。",
693 "second_intro_title": "一個表情符號地址來統治他們",
694 + "security": "安全",
695 "security_and_backup": "安全和备份",
696 "security_risk": "安全风险",
697 "security_risk_description": "该域被多个安全提供者标记为不安全。立即离开以保护您的资产。",
@@ -986,6 +991,7 @@
991 "use": "切换使用",
992 "use_card_info_three": "在线使用电子卡或使用非接触式支付方式。",
993 "use_card_info_two": "预付账户中的资金转换为美元,不是数字货币。",
994 + "use_device_theme": "使用设备主题",
995 "use_payjoin": "使用 Payjoin",
996 "use_ssl": "使用SSL",
997 "use_suggested": "使用建议",
@@ -1042,7 +1048,7 @@
1048 "walletConnect": "钱包连接",
1049 "wallets": "钱包",
1050 "warning": "警告",
1045 - "welcome": "欢迎使用",
1051 + "welcome": "欢迎",
1052 "welcome_subtitle_new_wallet": "如果您想开始新鲜,请点击下面的创建新钱包,您将参加比赛。",
1053 "welcome_subtitle_restore_wallet": "如果您有一个现有的钱包要把蛋糕带入蛋糕,只需选择还原现有的钱包,我们将带您完成整个过程。",
1054 "welcome_to_cakepay": "欢迎来到 Cake Pay!",
@@ -1077,4 +1083,4 @@
1083 "you_will_send": "转换自",
1084 "youCanGoBackToYourDapp": "您现在可以回到DAPP",
1085 "yy": "YY"
1080 -}
1086 +}
\ No newline at end of file