Reputation: 117
I Have Problem about borderRadius of Container in flutter . I can't set it for container
I want to create something like this image :
and other problem about onTap() . ontap not work and i don't know why .
here this is part of my code:
InkWell(
borderRadius: BorderRadius.all(Radius.circular(5.0)),
child: Container(
padding: const EdgeInsets.all(10),
child: const Text("فلسفه",
style: TextStyle(
color: Color(0xFF201F1E),
),
textAlign: TextAlign.center),
color: greyColor,
),
onTap: () {
print("something");
},
),
can any one help me please?
Upvotes: 1
Views: 4153
Reputation: 12575
Please try with this
InkWell(
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5),
color: Colors.grey,
),
padding: const EdgeInsets.all(10),
child: const Text("فلسفه",
style: TextStyle(
color: Color(0xFF201F1E),
),
textAlign: TextAlign.center),
),
onTap: () {
print("something");
},
)
output:
Upvotes: 1
Reputation: 2419
delete this code in your inkWell
borderRadius: BorderRadius.all(Radius.circular(5.0)),
and put this in inside your Container
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10.0),
),
this will fix your BorderRadius problem
test it i think this will fix that onTap problem as well
Upvotes: 0