'icon get out of its container if the device is tablet
I am using GetX.
I have used device_preview package to see if the application is responsive or not, i found that add "+" icon is go out of the container if the device is tablet!. why that happened?
The Code Is:
class ProductsWidget extends GetResponsiveView<HomeTabController> {
@override
Widget? builder() {
return ListView.builder(
itemCount: 3,
itemBuilder: (context, index) => Container(
margin: EdgeInsets.only(bottom: screen.isPhone ? 5 : 20),
child: Column(children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Container(
decoration: BoxDecoration(
border: Border.all(
width: screen.isPhone ? 0.5 : 1, color: darkGreyColor),
borderRadius: BorderRadius.all(Radius.circular(5.0)),
),
child: Center(
child: Wrap(
crossAxisAlignment: WrapCrossAlignment.center,
runAlignment: WrapAlignment.center,
spacing: screen.isPhone ? 10 : 50,
children: [
// Minus
IconButton(
onPressed: () {},
icon: Center(
child: Icon(
Icons.remove,
size: screen.isPhone ? 25 : 60,
),
),
),
// Count Number Text
Text(
"0",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: screen.isPhone ? 15 : 40,
),
),
IconButton(
onPressed: () {},
icon: Center(
child: Icon(
Icons.add,
size: screen.isPhone ? 25 : 60,
),
}
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
