Fixate QR background and foreground colors in all themes

OmarHatem committed Jan 31, 2023 at 17:31 UTC 0e9d30c915b5295c600b5b5d468dd41a1fd179f6
4 files changed +6 -25
lib/src/screens/exchange_trade/exchange_trade_page.dart
+1 -8
@@ -165,14 +165,7 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
165 .color!
166 )
167 ),
168 - child: QrImage(
169 - data: trade.inputAddress ?? fetchingLabel,
170 - backgroundColor: Colors.transparent,
171 - foregroundColor: Theme.of(context)
172 - .accentTextTheme!
173 - .subtitle2!
174 - .color!,
175 - ),
168 + child: QrImage(data: trade.inputAddress ?? fetchingLabel),
169 )))),
170 Spacer(flex: 3)
171 ]),
lib/src/screens/receive/fullscreen_qr_page.dart
+2 -7
@@ -1,7 +1,6 @@
1 import 'package:cake_wallet/src/screens/receive/widgets/qr_image.dart';
2 import 'package:cake_wallet/themes/theme_base.dart';
3 import 'package:flutter/material.dart';
4 -import 'package:flutter/cupertino.dart';
4 import 'package:cake_wallet/src/screens/base_page.dart';
5
6 class FullscreenQRPage extends BasePage {
@@ -69,14 +68,10 @@ class FullscreenQRPage extends BasePage {
68 child: AspectRatio(
69 aspectRatio: 1.0,
70 child: Container(
72 - padding: EdgeInsets.all(5),
71 + padding: EdgeInsets.all(10),
72 decoration: BoxDecoration(
73 border: Border.all(width: 3, color: Theme.of(context).accentTextTheme!.headline2!.backgroundColor!)),
75 - child: QrImage(
76 - data: qrData,
77 - backgroundColor: isLight ? Colors.transparent : Colors.black,
78 - foregroundColor: Theme.of(context).accentTextTheme!.headline2!.backgroundColor!,
79 - ),
74 + child: QrImage(data: qrData),
75 ),
76 ),
77 ),
lib/src/screens/receive/widgets/qr_image.dart
+2 -5
@@ -5,18 +5,14 @@ class QrImage extends StatelessWidget {
5 QrImage({
6 required this.data,
7 this.size = 100.0,
8 - this.backgroundColor,
9 - this.foregroundColor = Colors.black,
8 this.version = 9, // Previous value: 7 something happened after flutter upgrade monero wallets addresses are longer than ver. 7 ???
9 this.errorCorrectionLevel = qr.QrErrorCorrectLevel.L,
10 });
11
14 - final Color? backgroundColor;
12 final double size;
13 final String data;
14 final int version;
15 final int errorCorrectionLevel;
19 - final Color foregroundColor;
16
17 @override
18 Widget build(BuildContext context) {
@@ -25,7 +21,8 @@ class QrImage extends StatelessWidget {
21 errorCorrectionLevel: errorCorrectionLevel,
22 version: version,
23 size: size,
28 - foregroundColor: foregroundColor,
24 + foregroundColor: Colors.black,
25 + backgroundColor: Colors.white,
26 padding: EdgeInsets.zero,
27 );
28 }
lib/src/screens/receive/widgets/qr_widget.dart
+1 -5
@@ -89,11 +89,7 @@ class QRWidget extends StatelessWidget {
89 color: Theme.of(context).accentTextTheme!.headline2!.backgroundColor!,
90 ),
91 ),
92 - child: QrImage(
93 - data: addressListViewModel.uri.toString(),
94 - backgroundColor: isLight ? Colors.transparent : Colors.black,
95 - foregroundColor: Theme.of(context).accentTextTheme!.headline2!.backgroundColor!,
96 - ),
92 + child: QrImage(data: addressListViewModel.uri.toString()),
93 ),
94 ),
95 ),