How to fit Container in Row - flutter

I'm going to ask a question about flutter.
Looking at the capture, I want the height of the left and right containers to match the height of the longer one.
Since we have to fit a longer height, we want to implement it in a way that does not declare a height.
I hope someone can help me solve this.
Thank you.
this is a capture
this is a my code
import 'package:flutter/material.dart';
class RowTest extends StatefulWidget {
#override
_RowTestState createState() => _RowTestState();
}
class _RowTestState extends State<RowTest> {
#override
Widget build(BuildContext context) {
final Size size = MediaQuery.of(context).size;
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('simple Page'),
),
body: ListView(
shrinkWrap: true,
children: <Widget>[
Container(
color: Colors.blue,
child: Column(
children: <Widget>[
Container(
child: Column(
children: <Widget>[
for (int i = 0; i < 5; i++)
Row(
children: <Widget>[
Container(
width: 141,
margin: EdgeInsets.fromLTRB(size.width * 0.1,
8, size.width * 0.05, 8),
padding: EdgeInsets.fromLTRB(10, 10, 10, 10),
decoration: BoxDecoration(
border: Border.all(
color: Color(0xff939393),
),
color: Colors.red,
borderRadius:
BorderRadius.all(Radius.circular(5)),
),
child: Center(
child: Text(
'testededed',
textAlign: TextAlign.center,
textScaleFactor: 1.0,
style: TextStyle(
fontSize: 16,
height: 1.5,
color: Colors.white),
),
),
),
Container(
width: 141,
margin: EdgeInsets.fromLTRB(size.width * 0.05,
8, size.width * 0.1, 8),
padding: EdgeInsets.fromLTRB(10, 10, 10, 10),
decoration: BoxDecoration(
border: Border.all(
color: Color(0xff939393),
),
color: Colors.red,
borderRadius:
BorderRadius.all(Radius.circular(5)),
),
child: Center(
child: Text(
'testesttaaaaaaaaaaaaest',
textAlign: TextAlign.center,
textScaleFactor: 1.0,
style: TextStyle(
fontSize: 16,
height: 1.5,
color: Colors.white),
),
),
),
],
)
],
)),
],
),
)
],
)));
}
}

If you use:
Row (with mainAxisSize max) > Expanded > Container, the container will fit the entire row
If you use:
Column > Expanded > Container, the container will fit the entire column
If you use:
Column > Row (with mainAxisSize max) > Expanded > Container, Container, Container, the 3 containers will fit the entire row with the same width
If you use:
Scaffold > Stack (with fit> StackFit.expand) > Expanded > Container, the stack will try to fit the entire scaffold and the container will fit the stack

Use crossAxisAlignment: CrossAxisAlignment.start to your Root Column of Tree
Column(
crossAxisAlignment: CrossAxisAlignment.start,

I'm sorry for the delay in the response because I had several things overlapped.
I solved it using IntrinsicHeight.
Thanks to everyone who helped with the comments.
class RowTest extends StatefulWidget {
#override
_RowTestState createState() => _RowTestState();
}
class _RowTestState extends State<RowTest> {
#override
Widget build(BuildContext context) {
final Size size = MediaQuery.of(context).size;
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('simple Page'),
),
body: ListView(
shrinkWrap: true,
children: <Widget>[
Container(
color: Colors.blue,
child: Column(
children: <Widget>[
Container(
child: Column(
children: <Widget>[
for (int i = 0; i < 5; i++)
IntrinsicHeight(
child: Row(
children: <Widget>[
Container(
width: 141,
margin: EdgeInsets.fromLTRB(
size.width * 0.1,
8,
size.width * 0.05,
8),
padding:
EdgeInsets.fromLTRB(10, 10, 10, 10),
decoration: BoxDecoration(
border: Border.all(
color: Color(0xff939393),
),
color: Colors.red,
borderRadius:
BorderRadius.all(Radius.circular(5)),
),
child: Center(
child: Text(
'testededed',
textAlign: TextAlign.center,
textScaleFactor: 1.0,
style: TextStyle(
fontSize: 16,
height: 1.5,
color: Colors.white),
),
),
),
Container(
width: 141,
margin: EdgeInsets.fromLTRB(
size.width * 0.05,
8,
size.width * 0.1,
8),
padding:
EdgeInsets.fromLTRB(10, 10, 10, 10),
decoration: BoxDecoration(
border: Border.all(
color: Color(0xff939393),
),
color: Colors.red,
borderRadius:
BorderRadius.all(Radius.circular(5)),
),
child: Center(
child: Text(
'testesttaaaaaaaaaaaaest',
textAlign: TextAlign.center,
textScaleFactor: 1.0,
style: TextStyle(
fontSize: 16,
height: 1.5,
color: Colors.white),
),
),
),
],
),
)
],
)),
],
),
)
],
)));
}
}

Related

How To Make Responsive positioned inside a Stack in flutter and how to control the space between elements inside the row and the row inside coulmn

This is The Result in tablet and phone the different is show
this is main design i build it
**How To Solve It **
this is my code in this design
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import '../../../../core/app_color.dart';
import '../../../../core/app_style.dart';
import '../../../../models/product_model.dart';
class ProductView extends StatelessWidget {
ProductView({Key? key, required this.productModel}) : super(key: key);
final ProductModel productModel;
final ScrollController scrollController = ScrollController();
final double _height = 100;
#override
Widget build(BuildContext context) {
double height = MediaQuery.of(context).size.height;
double width = MediaQuery.of(context).size.width;
final double percent = (productModel.disPrice - productModel.price) /
productModel.disPrice *
100;
return Container(
decoration: BoxDecoration(
color: AppColor.white,
borderRadius: BorderRadius.circular(20),
),
margin: const EdgeInsets.only(left: 15, right: 15, bottom: 20),
padding: const EdgeInsets.symmetric(
horizontal: 8,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Stack(children: [
Container(
width: width * 0.42,
height: height * 0.21,
decoration: BoxDecoration(
color: Colors.transparent,
image: DecorationImage(
image: AssetImage(productModel.imageUrl),
),
),
),
Positioned(
bottom: height * 0.01,
right: 0.0,
child: Container(
width: 48.31,
height: 19,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
color: AppColor.lightBlue,
// border: Border.all(color: AppColor.white)),
),
child: Text(
productModel.productNameType,
style: bodyStyle1.copyWith(
fontSize: 7.sp, color: AppColor.white),
textAlign: TextAlign.center,
),
),
),
//height * 0.026
//width * 0.04
Align(
widthFactor: width * 0.42 / width * 12,
child: Container(
decoration: BoxDecoration(
color: AppColor.lightBlue,
borderRadius: BorderRadius.circular(30)),
child: const FaIcon(
Icons.favorite_outline_rounded,
color: AppColor.white,
),
),
),
]),
Text(
productModel.productName,
style: bodyStyle1.copyWith(color: AppColor.lightBlue),
),
Text(
productModel.productType,
style: bodyStyle2.copyWith(fontSize: 11.sp, color: AppColor.grey),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'${productModel.price}',
style: bodyStyle1.copyWith(
fontSize: 12.sp,
color: AppColor.lightGreyHeader,
decoration: TextDecoration.lineThrough),
),
Text(
'${productModel.disPrice}',
style: bodyStyle1.copyWith(
fontSize: 12.sp,
color: AppColor.black,
),
),
percent != 0
? Container(
width: 48.31,
height: 19,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
color: Colors.transparent,
border: Border.all(color: AppColor.lightBlue)),
child: Text(
'${percent.toStringAsFixed(0)}%',
style: bodyStyle2.copyWith(
fontSize: 9.sp, color: AppColor.lightBlue),
textAlign: TextAlign.center,
),
)
: Container(),
],
)
],
),
);
}
}
how to solve the responsive positioned
and how to control the space between elements inside the row
i tired of try and try and can not any soloution of that issue

ListView.builder is not scrolling in flutter

i'm trying to integrate a listView.builder in my UI! First of all, the whole content of the screen is inside a CustomScrollView that has silver widgets inside of it. Everything works pretty fine unless that my listview is not scrolling.
Here is the code:
class _DashboardScreenState extends State<DashboardScreen> {
#override
Widget build(BuildContext context) {
final screenHeight = MediaQuery.of(context).size.height;
return Scaffold(
appBar: CustomAppBar(),
body: CustomScrollView(
physics: ClampingScrollPhysics(),
slivers: <Widget>[
_buildHeader(screenHeight),
_buildBody(screenHeight),
],
),
);
}
}
The _buildBody code:
SliverToBoxAdapter _buildBody(double screenHeight) {
return SliverToBoxAdapter(
child: Column(
children: [
Container(
width: 100,
height: 65,
child: Padding(
padding: const EdgeInsets.only(top: 20),
child: ElevatedButton(
onPressed: () {},
child: Text(
'Add',
style: TextStyle(fontSize: 18),
),
style: ElevatedButton.styleFrom(
shape: StadiumBorder(),
backgroundColor: Palette.primaryColor),
),
),
),
SizedBox(
height: 10,
),
ListView.builder(
scrollDirection: Axis.vertical,
physics: const AlwaysScrollableScrollPhysics(),
shrinkWrap: true,
itemCount: 6,
itemBuilder: ((BuildContext context, int index) {
return Container(
margin: const EdgeInsets.symmetric(
vertical: 10.0,
horizontal: 20.0,
),
padding: const EdgeInsets.all(10.0),
height: screenHeight * 0.15,
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [Color(0xFFAD9FE4), Palette.primaryColor],
),
borderRadius: BorderRadius.circular(20.0),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
Image.asset(
"assets/worker.png",
height: 80,
width: 80,
),
Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
'Somme: 50 €',
style: const TextStyle(
color: Colors.white,
fontSize: 18.0,
fontWeight: FontWeight.bold,
),
),
SizedBox(height: screenHeight * 0.01),
Text(
'Date: 19 novembre 2022',
style: TextStyle(fontSize: 10, color: Colors.white),
),
SizedBox(height: screenHeight * 0.01),
Text(
'Follow the instructions\nto do your own test.',
style: const TextStyle(
color: Colors.white,
fontSize: 16.0,
),
maxLines: 2,
),
],
)
],
),
);
}))
],
),
);
}
I tried adding shrinkWrap: true as well as the scroll direction. Also tried wrapping it inside a SingleScrollChildView, none of the solutions worked for me. I appreciate any kind of help!
You can use physics: const NeverScrollableScrollPhysics(), on listView, the parent widget is already handling the scroll event. But you can replace listView with Column widget.(we already have on parent, therefor using loop)
SliverToBoxAdapter _buildBody(double screenHeight) {
return SliverToBoxAdapter(
child: Column(
children: [
Container(
width: 100,
height: 65,
child: Padding(
padding: const EdgeInsets.only(top: 20),
child: ElevatedButton(
onPressed: () {},
child: Text(
'Add',
style: TextStyle(fontSize: 18),
),
style: ElevatedButton.styleFrom(
shape: StadiumBorder(),
backgroundColor: Palette.primaryColor),
),
),
),
SizedBox(
height: 10,
),
for (int i = 0; i < 6; i++)
Container(
margin: const EdgeInsets.symmetric(
vertical: 10.0,
horizontal: 20.0,
),
padding: const EdgeInsets.all(10.0),
height: screenHeight * 0.15,
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [Color(0xFFAD9FE4), Palette.primaryColor],
),
borderRadius: BorderRadius.circular(20.0),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
Image.asset(
"assets/worker.png",
height: 80,
width: 80,
),
Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
'Somme: 50 €',
style: const TextStyle(
color: Colors.white,
fontSize: 18.0,
fontWeight: FontWeight.bold,
),
),
SizedBox(height: screenHeight * 0.01),
Text(
'Date: 19 novembre 2022',
style: TextStyle(fontSize: 10, color: Colors.white),
),
SizedBox(height: screenHeight * 0.01),
Text(
'Follow the instructions\nto do your own test.',
style: const TextStyle(
color: Colors.white,
fontSize: 16.0,
),
maxLines: 2,
),
],
)
],
),
)
],
),
);
}
Instead of using ListView.Builderinside CustomScrollView. It is always better to use Slivers. Therefore, instead of wrapping ListView.builder with SliverToBoxAdapter, use SliverList. Here is the detail code I have refactored below for you. Or you can directly visit this link where you can play with the refactored code.
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
#override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData.light(),
home: const DashboardScreen(),
debugShowCheckedModeBanner: false,
);
}
}
class DashboardScreen extends StatefulWidget {
const DashboardScreen({super.key});
#override
State<DashboardScreen> createState() => _DashboardScreenState();
}
class _DashboardScreenState extends State<DashboardScreen> {
#override
Widget build(BuildContext context) {
final screenHeight = MediaQuery.of(context).size.height;
return Scaffold(
appBar: AppBar(),
body: CustomScrollView(
physics: ClampingScrollPhysics(),
slivers: <Widget>[
// your build header widget
SliverToBoxAdapter(
child: Container(
width: 100,
height: 65,
child: Padding(
padding: const EdgeInsets.only(top: 20),
child: ElevatedButton(
onPressed: () {},
child: Text(
'Add',
style: TextStyle(fontSize: 18),
),
style: ElevatedButton.styleFrom(
shape: StadiumBorder(),
backgroundColor: Colors.red,
),
),
),
),
),
SliverToBoxAdapter(
child: SizedBox(height: 10),
),
SliverList(
delegate: SliverChildBuilderDelegate((context, index) {
return Container(
margin: const EdgeInsets.symmetric(
vertical: 10.0,
horizontal: 20.0,
),
padding: const EdgeInsets.all(10.0),
height: screenHeight * 0.15,
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [Color(0xFFAD9FE4), Colors.red],
),
borderRadius: BorderRadius.circular(20.0),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
// Image.asset(
// "assets/worker.png",
// height: 80,
// width: 80,
// ),
//
Container(
height: 80,
width: 80,
child: Text("A"),
),
Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
'Somme: 50 €',
style: const TextStyle(
color: Colors.white,
fontSize: 18.0,
fontWeight: FontWeight.bold,
),
),
SizedBox(height: screenHeight * 0.01),
Text(
'Date: 19 novembre 2022',
style: TextStyle(fontSize: 10, color: Colors.white),
),
SizedBox(height: screenHeight * 0.01),
Text(
'Follow the instructions\nto do your own test.',
style: const TextStyle(
color: Colors.white,
fontSize: 16.0,
),
maxLines: 2,
),
],
)
],
),
);
}),
)
],
),
);
}
}

I want to design grid like this in flutter:

I want to design a Grid like the below output in flutter.
Please help with this.
The Code I have tried is this:
Container(
height: 100,
width: 170,
margin: const EdgeInsets.symmetric(horizontal: 30),
child: DecoratedBox(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
color: Colors.white,
),
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
color: Colors.black
),
margin: const EdgeInsets.all(1.5),
child: const Center(
child: Text(
"data",
style: TextStyle(color: Colors.white),
),
),
),
),
),
And the output I get is this:
Thanks in advance for your help.
What you can do to maintain a grid is use Wrap.
Not very efficient for long list of items but for short it will suffice.
Take a look at the code below :
( You can run this code using Dartpad )
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
#override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData.dark(),
debugShowCheckedModeBanner: false,
home: Scaffold(
appBar: AppBar(),
body: Padding(
padding: const EdgeInsets.all(16),
child: LayoutBuilder(builder: (c, box) {
var crossCount = 2;
var spacing = 15.0;
var maxWidth = (box.maxWidth - ((crossCount - 1) * spacing)) / 2;
return Wrap(
spacing: spacing,
runSpacing: spacing,
children: List.generate(
10,
(i) => Stack(
children: [
Container(
width: maxWidth,
height: maxWidth * 0.55 * 0.5,
decoration: BoxDecoration(
borderRadius: BorderRadius.only(topLeft: Radius.circular(16)),
gradient : LinearGradient(
end: Alignment.topLeft,
begin: Alignment.bottomRight,
colors: [
Colors.black,
Colors.black,
Colors.amber,
],
),
// color: Colors.white,
// boxShadow: [BoxShadow(color: Colors.black, blurRadius: 4)],
),
),
Container(
width: maxWidth,
height: maxWidth * 0.55,
margin: const EdgeInsets.all(2),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16),
color: Colors.black,
),
)
],
),
),
);
}),
),
),
);
}
}
Note : Replace the Container's child with your own UI logic for implementing the design you like.
I tried it by myself and manage to built the same.
This is the Code:
Padding(
padding: const EdgeInsets.all(10),
child: GridTile(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text(
"Gate 2",
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
color: Colors.white),
),
const Text(
"Unlocked",
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w500,
color: Colors.grey),
),
const SizedBox(
height: 10,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
const Icon(
Icons.lock,
color: Colors.white,
size: 30,
),
const SizedBox(width: 5),
Image.asset("assets/swipe.png",height: 30,width: 30,),
const SizedBox(width: 5),
// const Icon(Icons.lock, color: Colors.white,size: 30,),
Draggable(
axis: Axis.horizontal,
maxSimultaneousDrags: 3,
rootOverlay: false,
child: Container(
padding: const EdgeInsets.all(5),
decoration: const BoxDecoration(
color: Colors.white12,
borderRadius: BorderRadius.all(Radius.circular(100),),
),
child: const Icon(
Icons.lock_open,
color: Colors.orangeAccent,
size: 30,
),
),
feedback: Container(
decoration: const BoxDecoration(
color: Colors.white12,
borderRadius: BorderRadius.all(Radius.circular(100),),
),
child: const Icon(
Icons.lock_open,
color: Colors.transparent,
size: 40,
),
),
),
],
),
],
),
),
),
Here is the Output.

Outline border to widget in flutter

I want to make outline border and label to container like this
You can do this for simulate this design. It looks little bit of complicate but I can't find other way to do this. Hope that it will work for you.
Just make sure the bottom and the top container colors are same as the code.
Just call this MyMenuContent class to see this output.
class MyMenuContent extends StatelessWidget {
#override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Container(
height: MediaQuery.of(context).size.height / 2,
padding: EdgeInsets.all(10),
child: Stack(
children: [
Positioned(
top: 50,
child: Container(
height: MediaQuery.of(context).size.height / 12,
width: MediaQuery.of(context).size.width / 2,
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(12),
color: Colors.white,
border: Border.all(
color: Colors.black,
width: 1,
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Icon(Icons.calendar_today),
SizedBox(width: 10),
//Text
Text(
'16-12-2020',
style: TextStyle(
fontSize: 17, fontWeight: FontWeight.w500),
)
],
),
),
),
Positioned(
// top: 40,left: 80,
top: MediaQuery.of(context).size.width / 9.5,
left: MediaQuery.of(context).size.height / 7,
child: Container(
decoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(12),
),
child: Center(
child: Text(
"outline",
style: TextStyle(fontSize: 15),
)),
),
)
],
),
),
),
);
}
}

how to match height of a row widget which is tallest among other widgets

I've defined a Row of column widgets but unable to match height of other widgets defined in a Row
I have tried with Expand , Intrinsic Height, width, Contrained box, and defining containers inside each column.
Expected Results are to match height with parent/other row widgets[enter image description here][1]
Widget columnOne(String t1, String t2) {
return ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(8)),
child: Container(
color: Colors.white,
child: Column(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Container(
color: Colors.white,
child: Padding(
padding:
EdgeInsets.fromLTRB(10, 10, 10, 10),
child: Align(
alignment: Alignment.center,
child: Text(t1,
style: TextStyle(
fontSize: 30,
color: Colors.black,
backgroundColor: Colors.white,
fontFamily: 'FJ',fontWeight: FontWeight.bold
)),
)
),
),
IntrinsicHeight(
child: ConstrainedBox(
constraints: const BoxConstraints(minWidth: double.infinity),
child: Container(
color: Colors.red,
child: Padding(
padding: EdgeInsets.all(10),
child: Align(
alignment: Alignment.center,
child: Text(t2 ,
textAlign: TextAlign.center,
textWidthBasis: TextWidthBasis.parent,
style: TextStyle(
fontSize: 16,
color: Colors.black,
backgroundColor: Colors.red,
)),
))),
)
)
],
),
),
);
}
https://i.stack.imgur.com/HfYOl.png
Current result If I change text/overflow the text
https://i.stack.imgur.com/t9MTK.png
Expected
Judging by the design, the bottom of the card can only be one or 2 lines high.
In this case, it’s easier not to rely on the automatic height, but to use fixed values.
import 'package:flutter/material.dart';
import 'package:vector_math/vector_math.dart' as v_math;
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
#override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: Scaffold(
backgroundColor: Colors.black,
body: SafeArea(
child: RowExample(),
),
),
);
}
}
class RowExample extends StatelessWidget {
final List<List<String>> entities = [
['22', 'fdslfdssdf'],
['22', 'sdfdssf fd fasdf '],
['3242', 'sdsf'],
];
#override
Widget build(BuildContext context) {
return Row(
children: entities.map((item) => columnOne(item[0], item[1])).toList(),
);
}
Widget columnOne(String t1, String t2) {
return ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(8)),
child: Container(
height: 130,
width: 100,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(8)),
color: Colors.white,
),
child: Column(
children: <Widget>[
Container(
height: 70,
color: Colors.white,
child: Padding(
padding: EdgeInsets.fromLTRB(10, 10, 10, 10),
child: Align(
alignment: Alignment.center,
child: Text(t1,
style: TextStyle(
fontSize: 30,
color: Colors.black,
backgroundColor: Colors.white,
fontFamily: 'FJ',
fontWeight: FontWeight.bold)),
)),
),
Expanded(
child: Container(
color: Colors.red,
child: Padding(
padding: EdgeInsets.all(10),
child: Align(
alignment: Alignment.center,
child: Text(t2,
textAlign: TextAlign.center,
textWidthBasis: TextWidthBasis.parent,
style: TextStyle(
fontSize: 16,
color: Colors.black,
backgroundColor: Colors.red,
)),
))),
)
],
),
),
);
}
}