Raised buttons have a minimum size of 88.0 by 36.0

To increase/decrease the size of raised button , wrap the raised button in a container or in sized box and give them the desired height and width.

For Example->

SizedBox(
width: 100, // specific value
height: 40.0, // specific value
child: RaisedButton(
onPressed: () {},
child: Text("Hello Everyone"),
),
),

or

Container(
width: 100,
height: 40.0,
child: RaisedButton(
onPressed: () {},
child: Text("Hello Everyone"),
),
),

Now the Raised Button will have width as 100 and height as 40.

Another better Option is to use ButtonTheme

ButtonTheme(
minWidth: 100.0,
height: 100.0,
child: RaisedButton(
onPressed: () {},
child: Text("Hello Everyone"),
),
);

--

--

Replace

body: SingleChildScrollView(child: Container(),),

By

body: ScrollConfiguration(behavior: ScrollBehavior()..buildViewportChrome(context, null, AxisDirection.down),child: SingleChildScrollView(child: Container(
height: MediaQuery.of(context).size.height,
),),),

Make sure , you are using ScrollConfiguration in a stateful widget.

And you are Done!

--

--

Declare your getImage method->

PickedFile imageFile;

Future getImage(int type) async {
PickedFile pickedImage = await ImagePicker().getImage(
source: type == 1 ? ImageSource.camera : ImageSource.gallery,
imageQuality: 50);
return pickedImage;
}

Display your Picked image in the container ->

Expanded(
child: Container(
decoration: BoxDecoration(
image: DecorationImage(
image: imageFile == null
? AssetImage('assets/illustrations/name_contact.png')
: FileImage(File(imageFile.path)),
fit: BoxFit.cover)),
),
),

Calling the GetImage Method->

new ListTile(
leading: new Icon(
Icons.photo_library,
),
title: new Text(
'Galary',
onTap: () async {
final tmpFile = await getImage(2);

setState(() {
imageFile = tmpFile;
});
}),

Similarly we can call GetImage method for Camera input with input index 1 .

All done!

--

--

Expanded should only be descendant of a column, row or flex.

So, if anywhere expanded is Present in other than column , row or flex widget, try removing those widget.

For Example → Simply Using the Expanded wiget in the Conatiner can cause Error.


Container(
child: Text(
"Hello",
style: TextStyle(fontWeight: FontWeight.bold),
),
child: Expanded(
child: Text("HEY")
),
),

Try to wrap it in Column / Row or Flex Widget.

 Column(
children: [
Container(
child: Text(
"Hello",
style: TextStyle(fontWeight: FontWeight.bold),
),
),
Expanded(
child: Text("Hey"),
),
],
);

Simply wrap Expanded in the Row/Column or Flex widget and your Problem will be Solved.

Feel free to ask if you face any issue regarding this.

--

--