Responsive Material Button widgets flutter - flutter

I have designed an interaface of login. Everything is working fine but these two buttons are not looking good.
Myscreen in landscape
I want to adjust them according to the screen size and orientation
want to achieve
Here is my code to define them
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Expanded(
child: Material(
elevation: 15.0,
borderRadius: BorderRadius.circular(5.0),
color: Color(0xFF0148A4),
child: MaterialButton(
textColor: Colors.white,
disabledColor: Colors.grey,
disabledTextColor: Colors.black,
padding:
EdgeInsets.fromLTRB(20.0, 10.0, 0.0, 10.0),
splashColor: Colors.blueAccent,
onPressed: () {
/*...*/
},
child: Row(
textBaseline: TextBaseline.alphabetic,
children: <Widget>[
Icon(
FontAwesomeIcons.facebookF,
color: Colors.white,
),
SizedBox(
width: 20.0,
),
Text(
'Facebook',
textAlign: TextAlign.start,
style: TextStyle(
fontSize: 15.0,
),
),
],
),
),
),
),
SizedBox(
width: 15.0,
),
Expanded(
child: Material(
elevation: 15.0,
borderRadius: BorderRadius.circular(5.0),
color: Color(0xFFF14436),
child: MaterialButton(
textColor: Colors.white,
disabledColor: Colors.grey,
disabledTextColor: Colors.black,
padding:
EdgeInsets.fromLTRB(20.0, 10.0, 0.0, 10.0),
splashColor: Colors.redAccent,
onPressed: () {
/*...*/
},
child: Row(
textBaseline: TextBaseline.ideographic,
children: <Widget>[
Icon(
FontAwesomeIcons.google,
color: Colors.white,
),
SizedBox(
width: 20.0,
),
Text(
'Google',
style: TextStyle(fontSize: 15.0),
),
],
),
),
),
),
],
),
Also the button below needs to be responsive as well. I am using expanded widget but its working as shown. Any other way to do that !

You may try FractionallySizedBox to set the width of the whole container with respect to the available screen width. Also FittedBox can help to restrict the widget to be drawn with in the bounds.
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
#override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData.light().copyWith(scaffoldBackgroundColor: Colors.white),
debugShowCheckedModeBanner: false,
home: Scaffold(
body: Center(
child: MyWidget(),
),
),
);
}
}
class MyWidget extends StatelessWidget {
#override
Widget build(BuildContext context) {
return FractionallySizedBox(
widthFactor: .8,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Expanded(
child: FittedBox(
fit: BoxFit.fitWidth,
child: Material(
elevation: 15.0,
borderRadius: BorderRadius.circular(5.0),
color: Color(0xFF0148A4),
child: MaterialButton(
textColor: Colors.white,
disabledColor: Colors.grey,
disabledTextColor: Colors.black,
padding: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0),
splashColor: Colors.blueAccent,
onPressed: () {
/*...*/
},
child: Row(
textBaseline: TextBaseline.alphabetic,
children: <Widget>[
Icon(
Icons.home,
color: Colors.white,
),
SizedBox(
width: 20.0,
),
Text(
'Facebook',
textAlign: TextAlign.start,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 15.0,
),
),
],
),
),
),
),
),
SizedBox(
width: 15.0,
),
Expanded(
child: FittedBox(
fit: BoxFit.fitWidth,
alignment: Alignment.center,
child: Material(
elevation: 15.0,
borderRadius: BorderRadius.circular(5.0),
color: Color(0xFFF14436),
child: MaterialButton(
textColor: Colors.white,
disabledColor: Colors.grey,
disabledTextColor: Colors.black,
padding: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0),
splashColor: Colors.redAccent,
onPressed: () {
/*...*/
},
child: Row(
textBaseline: TextBaseline.ideographic,
children: <Widget>[
Icon(
Icons.home,
color: Colors.white,
),
SizedBox(
width: 20.0,
),
Text(
'Google',
style: TextStyle(fontSize: 15.0),
),
],
),
),
),
),
),
],
),
);
}
}

Related

Flutter UI Place button on the edge of two containers

How to create an UI like above just the part where the Edit Profile button is on the edge of both the containers ? I used stack and positioned but didnt work out for me . Can somebody help me with this . How to approach this .
try this code no perfect but it will give you some idea
Container(
height: double.infinity,
width: double.infinity,
color: Colors.red,
child: Stack(children: <Widget>[
Padding(
padding: const EdgeInsets.all(16.0),
child: Stack(
alignment: Alignment.topCenter,
children: <Widget>[
Container(
height: 300.0,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15.0),
color: Colors.white,
boxShadow: const [
BoxShadow(
color: Colors.black26,
blurRadius: 8.0,
offset: Offset(0.0, 5.0),
),
],
),
width: double.infinity,
child: Padding(
padding: const EdgeInsets.only(top: 15.0, bottom: 15.0),
child: Column(
children: <Widget>[
const SizedBox(
height: 30.0,
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 32.0),
child: Column(
children: <Widget>[
Row(
mainAxisAlignment:
MainAxisAlignment.spaceEvenly,
children: const <Widget>[
Text(
'Year',
style: TextStyle(
fontSize: 20.0,
color: Colors.black54,
),
),
Text(
'Sophmor',
style: TextStyle(
fontSize: 34.0,
color: Colors.black87,
fontFamily: ''),
),
],
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceEvenly,
children: const <Widget>[
Text(
'Year',
style: TextStyle(
fontSize: 20.0,
color: Colors.black54,
),
),
Text(
'Sophmor',
style: TextStyle(
fontSize: 34.0,
color: Colors.black87,
fontFamily: ''),
),
],
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceEvenly,
children: const <Widget>[
Text(
'Year',
style: TextStyle(
fontSize: 20.0,
color: Colors.black54,
),
),
Text(
'Sophmor',
style: TextStyle(
fontSize: 34.0,
color: Colors.black87,
fontFamily: ''),
),
],
),
],
),
)
],
)),
),
Container(
width: 80,
height: 50,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.white,
borderRadius: BorderRadius.circular(15.0), ),
child: Padding(
padding: const EdgeInsets.all(4.0),
child: Center(
child: Container(
child: const Text('Edit Profile'),
),
),
),
),
],
),
),
]),
);
Instead of using Stack you can use Transform.translate to shift the TextButton up by the half of its height:
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
MyApp({super.key});
#override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Material App',
home: Scaffold(
appBar: AppBar(
title: const Text('Material App Bar'),
),
body: Column(
children: [
Expanded(
flex: 1,
child: Container(
alignment: Alignment.bottomCenter,
color: Color(0xFFF09384),
),
),
Expanded(
flex: 3,
child: Container(
alignment: Alignment.topCenter,
color: Color(0xFF3E8C92),
child: Column(
children: [
Transform.translate(
offset: Offset(0,-35/2), // Here you insert the half of the button height
child: TextButton(
onPressed: () => print("Hello"),
child: Text("Edit Profile"),
style: TextButton.styleFrom(
fixedSize: Size(120, 35), // Here you should fix the size of the button
backgroundColor: Colors.white,
primary: Color(0xFF3E8C92),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20)
)
),
),
),
...List<Text>.filled(5, Text("Data"))
]
),
),
),
],
)
),
);
}
}

How to make custom appbar like this in flutter?

I design my own and trying to use this design too
so it's can be like my design??
but i don't understand how to put this button to appbar[action] cuz when i fill that button take full height
my code here i write by use it as Widget ,then i call for use at appbar
AppBar _profileAppbar(
context,
) {
return AppBar(
automaticallyImplyLeading: false,
title: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Text(
"state.username",
style: TextStyle(
color: Colors.black, fontSize: 24, fontFamily: 'SukumvitSetBold'),
),
],
),
actions: <Widget>[
IconButton(
icon: Icon(
(IconData(
0xe908,
fontFamily: 'wishlistPost',
)),
color: HexColor("7225FF"),
size: 20,
),
iconSize: 30.0,
onPressed: () => print('Save post'),
),
InkWell(
onTap: () {},
child: Container(
padding: EdgeInsets.only(top: 20.0, bottom: 20.0),
decoration: BoxDecoration(
color: Colors.blue,
borderRadius: BorderRadius.circular(18.0),
),
child: Text(
"Edit",
style: TextStyle(color: Colors.white),
),
),
),
SizedBox(
height: 5,
width: 5,
),
],
iconTheme: IconThemeData(
color: Colors.black,
),
// leading: Icon(Icons.menu),
centerTitle: true,
backgroundColor: Colors.white,
elevation: 0.0,
);
}
One Idea is to make eveything custom without using AppBar().
class MyWidget extends StatelessWidget {
#override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: Container(
padding: const EdgeInsets.symmetric(horizontal: 10),
child: Row(
children: [
Expanded(child: Text("Username", style: TextStyle(color: Colors.black),)),
const SizedBox(width: 10),
Icon(Icons.message, color: Colors.black),
const SizedBox(width: 10),
TextButton(
style: TextButton.styleFrom(
backgroundColor: Colors.purple,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(999),
),
),
child: Text('Edit', style: TextStyle(color: Colors.white))
),
],
),
height: kToolbarHeight,
decoration: const BoxDecoration(color: Colors.white, boxShadow: [
BoxShadow(
offset: Offset(0.0, 2),
blurRadius: 14,
spreadRadius: 2,
)
]),
),
));
}
}

How to increment for a specific in Flutter?

enter image description here Like in my sample image, below, I want to increase or decrease the quantity by clicking the button for a single list item. If I increase the counter in setState (), its increment in each item in the list. I need help with this, especially managing a specific list item in Flutter Flutter.
Container(
height: 500.0,
width: double.infinity,
child: GridView.count(
crossAxisCount: 2,
children:
List.generate(userData == null ? 0 : userData.length, (index) {
return Container(
child: SizedBox(
width: 700,
child: Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(15.0),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Image.network(
"${userData[index]["image"]}",
width: 300,
height: 100,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
child: IconButton(
color: Colors.blue,
icon: const Icon(Icons.remove_circle,
size: 35.0),
onPressed: _decrementCount),
),
Container(
child: CircleAvatar(
radius: 20.0,
backgroundColor: Colors.white,
child: Text(
_counter.toString(),
style: TextStyle(
fontSize: 20.0,
fontWeight: FontWeight.bold,
color: Colors.black,
),
),
),
),
Container(
child: IconButton(
color: Colors.orange,
icon: const Icon(Icons.add_circle,
size: 35.0),
onPressed: () {
_incrementCount(userData[index]);
},
),
),
],
),
Container(
height: 20.0,
child: Text(
"${userData[index]["libelle"]}",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 20.0,
color: Colors.orange,
),
),
),
],
))),
);
})),
)
Make a separate Stateful class for your List item.
Like this
List.generate(2, (index) => MyCustomWidget(
user[index]
))
class MyCustomWidget extends StatefulWidget {
final user;
const MyCustomWidget({Key? key,required this.user}) : super(key:key);
#override
_MyCustomWidgetState createState() => _MyCustomWidgetState();
}
class _MyCustomWidgetState extends State<MyCustomWidget> {
#override
Widget build(BuildContext context) {
return Container(
child: SizedBox(
width: 700,
child: Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(15.0),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Image.network(
"${widget.user["image"]}",
width: 300,
height: 100,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
child: IconButton(
color: Colors.blue,
icon: const Icon(Icons.remove_circle,
size: 35.0),
onPressed: _decrementCount),
),
Container(
child: CircleAvatar(
radius: 20.0,
backgroundColor: Colors.white,
child: Text(
_counter.toString(),
style: TextStyle(
fontSize: 20.0,
fontWeight: FontWeight.bold,
color: Colors.black,
),
),
),
),
Container(
child: IconButton(
color: Colors.orange,
icon: const Icon(Icons.add_circle,
size: 35.0),
onPressed: () {
_incrementCount(userData[index]);
},
),
),
],
),
Container(
height: 20.0,
child: Text(
"${widget.user["libelle"]}",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 20.0,
color: Colors.orange,
),
),
),
],
))),
);
}
}
set some
conditions ? Image.network(
"${userData[index]["image"]}",
width: 300,
height: 100,
), : Image.network(
"${userData[index]["image"]}",
width: 400,
height: 250,
),
So if condition true then it's display like first one other wise take second one

Navigator.push() shows a Black Screen

I am trying to make a fruithero flutter app but while changing my main page to another page, It shows only a black screen on my android emulator in laptop and on my phone, but in https://flutlab.io/ it shows perfectly, What is the problem that the app is not working on local emulator or in my phone but working on online IDE
Showing an Eror like this: -
There are multiple heroes that share the same tag within a subtree.
main.dart
import 'package:flutter/material.dart';
import './detailsPage.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
#override
Widget build(BuildContext context) {
return MaterialApp(
home: MyHomePage(),
debugShowCheckedModeBanner: false,
);
}
}
class MyHomePage extends StatefulWidget {
#override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
#override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Color(0xFF21BFBD),
body: ListView(
children: <Widget>[
Padding(
padding: EdgeInsets.only(top: 15.0, left: 10.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
IconButton(
icon: Icon(Icons.arrow_back_ios),
color: Colors.white,
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => DetailsPage(),
),
);
},
),
Container(
width: 125.0,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
IconButton(
icon: Icon(Icons.filter_list),
color: Colors.white,
onPressed: () {},
),
IconButton(
icon: Icon(Icons.menu),
color: Colors.white,
onPressed: () {},
),
],
),
),
],
),
),
SizedBox(
height: 25.0,
),
Padding(
padding: EdgeInsets.only(left: 40.0),
child: Row(
children: <Widget>[
Text(
'Healthy',
style: TextStyle(
fontFamily: 'Mont',
color: Colors.white,
fontSize: 25.0,
fontWeight: FontWeight.bold),
),
SizedBox(width: 10.0),
Text(
'Food',
style: TextStyle(
fontFamily: 'Mont', color: Colors.white, fontSize: 25.0),
),
],
),
),
SizedBox(
height: 40.0,
),
Container(
height: MediaQuery.of(context).size.height - 185.0,
decoration: BoxDecoration(
color: Colors.white,
borderRadius:
BorderRadius.only(topLeft: Radius.circular(75.0))),
child: ListView(
primary: false,
padding: EdgeInsets.only(left: 25.0, right: 20.0),
children: <Widget>[
Padding(
padding: EdgeInsets.only(top: 45.0),
child: Container(
height: MediaQuery.of(context).size.height / 1.68,
child: ListView(
children: <Widget>[
_buildFoodItem('images/one.png', 'Salmon', '\$24.0'),
_buildFoodItem('images/two.png', 'Spring', '\$22.0'),
_buildFoodItem('images/three.png', 'Sprite', '\$34.0'),
_buildFoodItem('images/one.png', 'Mut', '\$12.0')
],
),
),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Container(
height: 65.0,
width: MediaQuery.of(context).size.width / 6,
decoration: BoxDecoration(
border: Border.all(
color: Colors.grey,
style: BorderStyle.solid,
width: 1.0,
),
borderRadius: BorderRadius.circular(20)),
child: Center(
child: Icon(
Icons.search,
color: Colors.black,
),
),
),
Container(
height: 65.0,
width: MediaQuery.of(context).size.width / 6,
decoration: BoxDecoration(
border: Border.all(
color: Colors.grey,
style: BorderStyle.solid,
width: 1.0,
),
borderRadius: BorderRadius.circular(20)),
child: Center(
child: Icon(
Icons.shopping_cart,
color: Colors.black,
),
),
),
Container(
height: 65.0,
width: MediaQuery.of(context).size.width / 2,
decoration: BoxDecoration(
color: Color(0xff170F1F),
border: Border.all(
color: Colors.grey,
style: BorderStyle.solid,
width: 1.0,
),
borderRadius: BorderRadius.circular(20)),
child: Center(
child: Text(
'Checkout',
style: TextStyle(
fontSize: 18.0,
color: Colors.white,
fontFamily: 'Mont',
),
)),
),
],
),
],
),
),
],
),
);
}
Widget _buildFoodItem(String imgPath, String foodName, String price) {
return Padding(
padding: EdgeInsets.only(left: 10.0, right: 10.0, top: 10.0),
child: InkWell(
onTap: () {
Navigator.push( //Here is the Navigator.push()
context,
MaterialPageRoute(builder: (BuildContext context) {
return DetailsPage();
}),
);
},
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Container(
child: Row(
children: [
Hero(
tag: imgPath,
child: Image(
image: AssetImage(imgPath),
fit: BoxFit.cover,
height: 75.0,
width: 75.0,
),
),
SizedBox(width: 10.0),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
foodName,
style: TextStyle(
fontFamily: 'Mont',
fontSize: 17.0,
fontWeight: FontWeight.bold),
),
Text(
price,
style: TextStyle(
fontFamily: 'Mont',
fontSize: 15.0,
color: Colors.grey),
)
],
),
],
),
),
IconButton(
icon: Icon(Icons.add),
color: Colors.black,
onPressed: () {},
),
],
),
),
);
}
}
Navigator.push code is like this:
Navigator.push(
context,
MaterialPageRoute(builder: (BuildContext context) {
return DetailsPage();
}),
);
detailsPage.dart
import 'package:flutter/material.dart';
class DetailsPage extends StatefulWidget {
#override
_DetailsPageState createState() => _DetailsPageState();
}
class _DetailsPageState extends State<DetailsPage> {
#override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Color(0xFF7A9BEE),
appBar: AppBar(
leading: IconButton(
onPressed: () {
Navigator.of(context).pop();
},
icon: Icon(Icons.arrow_back_ios),
color: Colors.white,
),
backgroundColor: Colors.transparent,
elevation: 0.0,
title: Text(
'Details',
style: TextStyle(
fontFamily: 'Mont',
fontSize: 18.0,
color: Colors.white,
),
),
centerTitle: true,
actions: <Widget>[
IconButton(
icon: Icon(Icons.more_horiz),
onPressed: () {},
color: Colors.white,
),
],
),
);
}
}
Here is git Repository link: 1
i dont see the hero widget in the detailsPage.dart, when you set up a Hero widget in main and Navigate to detailsPage, you have to set up a hero widget to receive a hero transition from the main page, and because you have a listView in main you have to give a dynamic tag to each list item because each hero must have a tag associated with it so when it transfer to different layout it knows which hero to transit to it,
you already set up a hero tag in main page and you already give it a tag as tag: imgPath
tag is like an id for that hero, now you need to set the same tag (id) in the detailsPage,
please watch this to understand the logic Hero Flutter Widget
You should use Hero Widgets on both screens.
I couldn't find the Hero widget, nor the tag and not the image that you used on your first screen too (AssetImage(imgPath))
Try and parameterize using the propoer Hero specs.
Here you can find an good example and instructions: Flutter example

How to layout a cell in flutter with flexible and expandable widgets

I'm trying to layout a cell in flutter and can't space them without a lot of hardcoded padding. The below image is how the layout is, and how I want it.
Using expandable or flexible layouts in cells, I keep getting blank screens with no cells. They seem to work well on non-scrollable layouts.
Current
Want
#override
Widget build(BuildContext context) {
Constants constants = Constants.of(context);
return Container(
constraints: BoxConstraints.tightFor(height: constants.d200),
margin: EdgeInsets.all(10.0),
child: Card(
color: constants.white,
child: Column(
children: <Widget>[
Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.end,
children: [
Container(
color: constants.white,
child: Text(product.name,
style: TextStyle(
fontWeight: FontWeight.normal,
color: constants.orange)),
),
SizedBox(
height: constants.d10,
),
Container(
color: constants.white,
child: Text(product.ean,
style: TextStyle(
fontWeight: FontWeight.bold, color: constants.black)),
),
Container(
color: constants.white,
child: Icon(
Icons.ac_unit,
size: 10,
color: constants.orange,
),
),
],
),
],
),
),
);
}
One way of doing it.
e.g Code:
#override
Widget build(BuildContext context) {
// Constants constants = Constants.of(context);
return Scaffold(
appBar: AppBar(),
body: Center(
child: SizedBox(
width: 250.0,
child: Card(
color: Colors.white,
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisSize: MainAxisSize.min,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
color: Colors.white,
child: RaisedButton(
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
shape: RoundedRectangleBorder(
side: BorderSide(color: Colors.black)),
onPressed: null,
disabledColor: Colors.white,
child: Text('20 EUR',
style: TextStyle(
fontWeight: FontWeight.normal,
color: Colors.black)),
),
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: RaisedButton(
onPressed: null,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
shape: RoundedRectangleBorder(
side: BorderSide(color: Colors.black)),
disabledColor: Colors.white,
child: Text('75546DRE4263',
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.orange,
)),
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
children: <Widget>[
Expanded(
child: RaisedButton(
onPressed: null,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
shape: RoundedRectangleBorder(
side: BorderSide(color: Colors.black)),
disabledColor: Colors.white,
child: Icon(
Icons.ac_unit,
size: 10,
color: Colors.orange,
),
),
),
SizedBox(
width: 5.0,
),
Expanded(
child: RaisedButton(
onPressed: null,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
disabledColor: Colors.white,
shape: RoundedRectangleBorder(
side: BorderSide(color: Colors.black)),
child: Text('Hint',
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
)),
),
),
],
),
),
],
),
),
),
),
);
}
Output: