Skip to content

Commit 9e11781

Browse files
committed
Added scrollbars in both directions when resized
1 parent 2c1c2f8 commit 9e11781

7 files changed

Lines changed: 473 additions & 566 deletions

File tree

lib/main.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ void main() {
77
WidgetsFlutterBinding.ensureInitialized();
88
if (Platform.isWindows || Platform.isLinux || Platform.isMacOS) {
99
setWindowTitle('Quick - Down - Shifter APP');
10-
setWindowMinSize(const Size(1110, 400));
10+
setWindowMinSize(const Size(100, 100));
1111
// setWindowMaxSize(const Size(1200, 730));
1212
}
1313

@@ -26,6 +26,7 @@ class _MyAppState extends State<MyApp> {
2626
Widget build(BuildContext context) {
2727
return MaterialApp(
2828
theme: ThemeData(
29+
scrollbarTheme: const ScrollbarThemeData(),
2930
appBarTheme: const AppBarTheme(
3031
backgroundColor: Colors.transparent,
3132
elevation: 1,

lib/screens/additional_widgets/numeric_setting_widget.dart

Lines changed: 46 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -27,57 +27,56 @@ class NumericSettingWidget extends StatefulWidget {
2727
class _NumericSettingWidgetState extends State<NumericSettingWidget> {
2828
@override
2929
Widget build(BuildContext context) {
30-
return Row(
31-
mainAxisAlignment: MainAxisAlignment.start,
32-
crossAxisAlignment: CrossAxisAlignment.center,
33-
children: [
34-
SizedBox(
35-
width: 280,
36-
child: Padding(
37-
padding: const EdgeInsets.fromLTRB(10, 5, 10, 10),
38-
child: Text(
39-
'${widget.setting.label} - ',
40-
textAlign: TextAlign.center,
41-
style: const TextStyle(fontSize: 25, color: Colors.white),
30+
return Padding(
31+
padding: const EdgeInsets.fromLTRB(0, 5, 0, 0),
32+
child: Row(
33+
mainAxisAlignment: MainAxisAlignment.start,
34+
crossAxisAlignment: CrossAxisAlignment.center,
35+
children: [
36+
SizedBox(
37+
width: 280,
38+
child: Padding(
39+
padding: const EdgeInsets.fromLTRB(0, 5, 0, 10),
40+
child: Text(
41+
'${widget.setting.label} - ',
42+
textAlign: TextAlign.center,
43+
style: const TextStyle(fontSize: 25, color: Colors.white),
44+
),
4245
),
4346
),
44-
),
45-
SizedBox(
46-
width: 200,
47-
// height: 60,
48-
child: CupertinoSpinBox(
49-
// showButtons: false,
50-
decoration: BoxDecoration(
51-
color: Colors.white12, borderRadius: BorderRadius.circular(5)),
52-
textStyle: const TextStyle(fontSize: 25, color: Colors.white),
53-
spacing: 3,
54-
min: widget.minAllowed,
55-
max: widget.maxAllowed,
56-
step: widget.step,
57-
decimals: determineDecimals(widget.step),
58-
59-
value: double.tryParse(widget.setting.value) ?? widget.minAllowed,
60-
61-
onChanged: (double value) {
62-
if (value < widget.minAllowed) {
63-
value = widget.minAllowed;
64-
}
65-
if (value > widget.maxAllowed) {
66-
value = widget.maxAllowed;
67-
}
68-
setState(() {
69-
if (widget.step % 1 == 0) {
70-
widget.setting.value = value.toStringAsFixed(0);
71-
} else {
72-
widget.setting.value = value.toStringAsFixed(2);
47+
SizedBox(
48+
width: 200,
49+
child: CupertinoSpinBox(
50+
decoration: BoxDecoration(
51+
color: Colors.white12,
52+
borderRadius: BorderRadius.circular(5)),
53+
textStyle: const TextStyle(fontSize: 25, color: Colors.white),
54+
spacing: 3,
55+
min: widget.minAllowed,
56+
max: widget.maxAllowed,
57+
step: widget.step,
58+
decimals: determineDecimals(widget.step),
59+
value: double.tryParse(widget.setting.value) ?? widget.minAllowed,
60+
onChanged: (double value) {
61+
if (value < widget.minAllowed) {
62+
value = widget.minAllowed;
7363
}
74-
75-
widget.notifyParent();
76-
});
77-
},
64+
if (value > widget.maxAllowed) {
65+
value = widget.maxAllowed;
66+
}
67+
setState(() {
68+
if (widget.step % 1 == 0) {
69+
widget.setting.value = value.toStringAsFixed(0);
70+
} else {
71+
widget.setting.value = value.toStringAsFixed(2);
72+
}
73+
widget.notifyParent();
74+
});
75+
},
76+
),
7877
),
79-
),
80-
],
78+
],
79+
),
8180
);
8281
}
8382
}

0 commit comments

Comments
 (0)