Skip to content

Commit cf3f1a4

Browse files
committed
UI logic improvements
1 parent 18b0526 commit cf3f1a4

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

lib/screens/port_screen.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ class _PortScreenState extends State<PortScreen>
193193
onTap: () async => await establishConnection(),
194194
builder: (BuildContext context, TapDebouncerFunc? onTap) {
195195
return ElevatedButton(
196-
onPressed: onTap,
196+
onPressed: dropdownValue != null ? onTap : null,
197197
style: ElevatedButton.styleFrom(
198198
minimumSize: const Size(150, 55),
199199
primary: Colors.grey.shade200,

lib/widgets/downshifter_widget.dart

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ class _DownshifterWidgetState extends State<DownshifterWidget> {
124124
],
125125
),
126126
Padding(
127-
padding: const EdgeInsets.fromLTRB(0, 30, 0, 35),
127+
padding: const EdgeInsets.fromLTRB(0, 35, 0, 30),
128128
child: Row(
129129
mainAxisAlignment: MainAxisAlignment.spaceAround,
130130
children: [
@@ -171,7 +171,12 @@ class _DownshifterWidgetState extends State<DownshifterWidget> {
171171
builder:
172172
(BuildContext context, TapDebouncerFunc? onTap) {
173173
return ElevatedButton(
174-
onPressed: onTap,
174+
onPressed: (double.tryParse(SettingsRepository()
175+
.sensorReading
176+
.value) !=
177+
2000)
178+
? onTap
179+
: null,
175180
style: ElevatedButton.styleFrom(
176181
minimumSize: const Size(150, 55),
177182
primary: Colors.white38,

lib/widgets/quickshifter_widget.dart

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ class _QuickshifterWidgetState extends State<QuickshifterWidget> {
124124
],
125125
),
126126
Padding(
127-
padding: const EdgeInsets.fromLTRB(0, 30, 0, 35),
127+
padding: const EdgeInsets.fromLTRB(0, 35, 0, 30),
128128
child: Row(
129129
mainAxisAlignment: MainAxisAlignment.spaceAround,
130130
children: [
@@ -171,7 +171,12 @@ class _QuickshifterWidgetState extends State<QuickshifterWidget> {
171171
builder:
172172
(BuildContext context, TapDebouncerFunc? onTap) {
173173
return ElevatedButton(
174-
onPressed: onTap,
174+
onPressed: (double.tryParse(SettingsRepository()
175+
.sensorReading
176+
.value) !=
177+
2000)
178+
? onTap
179+
: null,
175180
style: ElevatedButton.styleFrom(
176181
minimumSize: const Size(150, 55),
177182
primary: Colors.white38,

0 commit comments

Comments
 (0)