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