I am new in flutter, how to set width and height OutlineButton in Flutter,
i have to try input width and height inside OutlineButton but got some errors.
this is my code :
OutlinedButton(
//width: AppSize.DIMEN_230,
style: OutlinedButton.styleFrom(
side: BorderSide(
width: 2.0, color: Colors.black12,
),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),),
onPressed: () {
showDatePicker(
context: context,
initialDate: DateTime.now(),
firstDate: DateTime(1880),
lastDate: DateTime(2050),
);
}, child: Text("YYYY/MM/DD HH:MM:SS",
style: textStyleW400S16.copyWith(
fontStyle: FontStyle.italic,
color: Colors.black54,
),
),
),
Is it correct? Is there another way to do it?
2
Answers
Wrap your button in
SizedBox
, and give itwidth
andheight
.Try below code, and refer
styleFrom
for button style andSize-class
for set the width and height of the button and as per your comment I have set your text left-sideResult->