align hint to start
This commit is contained in:
@@ -44,7 +44,22 @@ class _MihNumericStepperState extends State<MihNumericStepper> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Row(
|
||||
return Column(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
widget.hintText,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: widget.fillColor,
|
||||
fontSize: 15,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
@@ -53,12 +68,12 @@ class _MihNumericStepperState extends State<MihNumericStepper> {
|
||||
Container(
|
||||
// color: Colors.white,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius:
|
||||
BorderRadius.circular(25), // Optional: rounds the corners
|
||||
borderRadius: BorderRadius.circular(
|
||||
25), // Optional: rounds the corners
|
||||
boxShadow: const [
|
||||
BoxShadow(
|
||||
color: Color.fromARGB(
|
||||
60, 0, 0, 0), // 0.2 opacity = 51 in alpha (255 * 0.2)
|
||||
color: Color.fromARGB(60, 0, 0,
|
||||
0), // 0.2 opacity = 51 in alpha (255 * 0.2)
|
||||
spreadRadius: -2,
|
||||
blurRadius: 10,
|
||||
offset: Offset(0, 5),
|
||||
@@ -85,7 +100,8 @@ class _MihNumericStepperState extends State<MihNumericStepper> {
|
||||
setState(() {
|
||||
widget.controller.text =
|
||||
(_currentValue - 1).toString();
|
||||
_currentValue = int.tryParse(widget.controller.text)!;
|
||||
_currentValue =
|
||||
int.tryParse(widget.controller.text)!;
|
||||
});
|
||||
}
|
||||
print("New Current Value: $_currentValue");
|
||||
@@ -112,14 +128,14 @@ class _MihNumericStepperState extends State<MihNumericStepper> {
|
||||
fillColor: widget.fillColor,
|
||||
inputColor: widget.inputColor,
|
||||
controller: widget.controller,
|
||||
hintText: widget.hintText,
|
||||
hintText: null,
|
||||
requiredText: widget.requiredText,
|
||||
readOnly: true,
|
||||
numberMode: true,
|
||||
validator: (value) {
|
||||
if (widget.validationOn) {
|
||||
return MihValidationServices()
|
||||
.validateNumber(value, widget.minValue, widget.maxValue);
|
||||
return MihValidationServices().validateNumber(
|
||||
value, widget.minValue, widget.maxValue);
|
||||
}
|
||||
return null;
|
||||
},
|
||||
@@ -130,12 +146,12 @@ class _MihNumericStepperState extends State<MihNumericStepper> {
|
||||
Container(
|
||||
// color: Colors.white,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius:
|
||||
BorderRadius.circular(25), // Optional: rounds the corners
|
||||
borderRadius: BorderRadius.circular(
|
||||
25), // Optional: rounds the corners
|
||||
boxShadow: const [
|
||||
BoxShadow(
|
||||
color: Color.fromARGB(
|
||||
60, 0, 0, 0), // 0.2 opacity = 51 in alpha (255 * 0.2)
|
||||
color: Color.fromARGB(60, 0, 0,
|
||||
0), // 0.2 opacity = 51 in alpha (255 * 0.2)
|
||||
spreadRadius: -2,
|
||||
blurRadius: 10,
|
||||
offset: Offset(0, 5),
|
||||
@@ -163,7 +179,8 @@ class _MihNumericStepperState extends State<MihNumericStepper> {
|
||||
setState(() {
|
||||
widget.controller.text =
|
||||
(_currentValue + 1).toString();
|
||||
_currentValue = int.tryParse(widget.controller.text)!;
|
||||
_currentValue =
|
||||
int.tryParse(widget.controller.text)!;
|
||||
});
|
||||
}
|
||||
print("New Current Value: $_currentValue");
|
||||
@@ -184,6 +201,8 @@ class _MihNumericStepperState extends State<MihNumericStepper> {
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user