Skip to content

Commit 161adf2

Browse files
committed
Minor ui issue fixes
Signed-off-by: Sarath <[email protected]>
1 parent a7c142b commit 161adf2

File tree

2 files changed

+53
-32
lines changed

2 files changed

+53
-32
lines changed

lib/screens/Receive/receive_screen.dart

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,13 @@ class _QRWidgetState extends State<QRWidget> {
137137

138138
@override
139139
Widget build(BuildContext context) {
140+
double qrSize = MediaQuery
141+
.of(context)
142+
.size
143+
.height / 4.5 < 120 ? 120 : MediaQuery
144+
.of(context)
145+
.size
146+
.height / 4.5;
140147
return Container(
141148
height: double.infinity,
142149
child: Column(
@@ -145,27 +152,24 @@ class _QRWidgetState extends State<QRWidget> {
145152
mainAxisSize: MainAxisSize.max,
146153
children: <Widget>[
147154
Container(
148-
margin: EdgeInsets.only(top: 16),
149-
height: 240,
150-
width: 240,
151-
child: RepaintBoundary(
152-
key: repaintKey,
153-
child: QrImage(
154-
data: _qrData,
155-
size: 240.0,
156-
version: QrVersions.auto,
157-
backgroundColor: Colors.white,
158-
),
155+
margin: EdgeInsets.only(top: 16),
156+
child: RepaintBoundary(
157+
key: repaintKey,
158+
child: QrImage(
159+
data: _qrData,
160+
size: qrSize,
161+
version: QrVersions.auto,
162+
backgroundColor: Colors.white,
159163
),
160164
),
165+
),
161166
Padding(
162167
padding: const EdgeInsets.symmetric(vertical: 4),
163168
child: Column(
164169
children: <Widget>[
165170
InkWell(
166171
onTap: () {
167-
Clipboard.setData(
168-
ClipboardData(text: _address));
172+
Clipboard.setData(ClipboardData(text: _address));
169173
Scaffold.of(context).showSnackBar(SnackBar(
170174
content: Text(
171175
"Address copied to clipboard",
@@ -230,8 +234,8 @@ class _QRWidgetState extends State<QRWidget> {
230234
child: Text("Request amount"),
231235
),
232236
Padding(
233-
padding:
234-
const EdgeInsets.symmetric(horizontal: 22.0),
237+
padding: const EdgeInsets.symmetric(
238+
horizontal: 22.0),
235239
child: AmountEntry(onAmountChange),
236240
)
237241
],

lib/screens/Track/tab_track_segwit.dart

Lines changed: 34 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ import 'package:sentinelx/widgets/sentinelx_icons.dart';
1414
class TabTrackSegwit extends StatefulWidget {
1515
final GlobalKey<PushUpCameraWrapperState> cameraKey;
1616

17-
TabTrackSegwit(Key key, this.cameraKey)
18-
: super(key: key);
17+
TabTrackSegwit(Key key, this.cameraKey) : super(key: key);
1918

2019
@override
2120
TabTrackSegwitState createState() => TabTrackSegwitState();
@@ -46,20 +45,30 @@ class TabTrackSegwitState extends State<TabTrackSegwit> {
4645
child: Column(
4746
children: <Widget>[
4847
Container(
49-
margin: EdgeInsets.symmetric(horizontal: 8, vertical: 12),
50-
child: Row(
48+
margin: EdgeInsets.symmetric(horizontal: 4, vertical: 4),
49+
child: Column(
5150
children: <Widget>[
52-
Icon(
53-
SentinelxIcons.segwit,
54-
size: 24,
55-
color: Colors.grey[400],
51+
Align(
52+
child: Icon(
53+
SentinelxIcons.segwit,
54+
size: 24,
55+
color: Colors.grey[400],
56+
),
57+
alignment: Alignment.topLeft,
5658
),
59+
Padding(padding: EdgeInsets.all(6),),
5760
Container(
58-
margin: EdgeInsets.only(left: 16),
61+
margin: EdgeInsets.only(left: 4),
5962
child: Text(
6063
"bitcoin wallet via segwit YPUB/ZPUB (BIP49/84)",
61-
style: TextStyle(color: Colors.grey[400]),
62-
))
64+
overflow: TextOverflow.ellipsis,
65+
maxLines: 2,
66+
style: Theme
67+
.of(context)
68+
.textTheme
69+
.subtitle
70+
.copyWith(color: Colors.grey[400]),
71+
)),
6372
],
6473
),
6574
),
@@ -83,15 +92,17 @@ class TabTrackSegwitState extends State<TabTrackSegwit> {
8392
),
8493
maxLines: 3,
8594
),
86-
8795
),
8896
Align(
8997
alignment: Alignment.topRight,
9098
child: IconButton(
91-
icon: Icon(SentinelxIcons.qr_scan, size: 22,),
99+
icon: Icon(
100+
SentinelxIcons.qr_scan,
101+
size: 22,
102+
),
92103
onPressed: () async {
93-
await SystemChannels.textInput.invokeMethod(
94-
'TextInput.hide');
104+
await SystemChannels.textInput
105+
.invokeMethod('TextInput.hide');
95106
widget.cameraKey.currentState.start();
96107
}),
97108
)
@@ -184,15 +195,21 @@ class TabTrackSegwitState extends State<TabTrackSegwit> {
184195

185196
void _showSuccessSnackBar(String msg) {
186197
final snackBar = SnackBar(
187-
content: Text(msg, style: TextStyle(color: Colors.white),),
198+
content: Text(
199+
msg,
200+
style: TextStyle(color: Colors.white),
201+
),
188202
backgroundColor: Color(0xff5BD38D),
189203
);
190204
Scaffold.of(context).showSnackBar(snackBar);
191205
}
192206

193207
void _showError(String msg) {
194208
final snackBar = SnackBar(
195-
content: Text(msg, style: TextStyle(color: Colors.white),),
209+
content: Text(
210+
msg,
211+
style: TextStyle(color: Colors.white),
212+
),
196213
backgroundColor: Color(0xffD55968),
197214
);
198215
Scaffold.of(context).showSnackBar(snackBar);

0 commit comments

Comments
 (0)