For Examples:
ElevatedButton(
style: ElevatedButton.styleFrom(
primary: Colors.deepOrange, //This is a button color
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8.0),
),
),
child: const Text(
'Upload Image',
style: TextStyle(
color: Colors.white,
fontSize: 22.0,
),
),
onPressed: () => selectImage(context),
),
With an Icon button:
ElevatedButton.icon(
onPressed: () {},
icon: const Icon(
Icons.my_location,
color: Colors.white,
),
label: const Text(
'Use current Location',
style: TextStyle(color: Colors.white),
),
style: ElevatedButton.styleFrom(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30.0),
),
/// color declare in the style: instead and using primary
primary: Colors.blue,
),
),
No comments:
Post a Comment