Increase Flutter Radio Widget size - flutter

I am using default Flutter Radio Widget. I want to increase its size but there is no property available for it.
Tried using SizedBox with width: 50, height: 50. Didn't help.
Not want to implement a whole custom radio button. Just want to increase the default's size.
Thanks

Well you can wrap it in Transform.Scale then use the scale property to increase it.
Transform.scale(
scale: 2.0,
child: Radio(
value: 'wire',
groupValue: selectedRadio,
onChanged: (value)=>radioSelected(value),
activeColor: Color(0xffFFBD11),
),
),

I don't think this is possible without creating your own Widget.
You should have a look at this package.

Related

How can I adjust flutter icon button (or image button) to get larger?

leading: Padding(
padding: EdgeInsets.only(left: 20),
child: IconButton(
onPressed: () => print('Menu Tapped'),
icon: Image.asset(
'assets/images/vecteezy_triangle_1200693.png',
fit: BoxFit.fitWidth,
),
),
),
I try adding height: and width: to the Image.asset and iconsize: to IconButton but it does't work
Does it have something to do with edgeInsets?
PS* I'm quite new here, I'm follow YouTube to write a financial management app
if your code is about Appbar you need to increase the icon's space in the Appbar by using toolbarHeight: and leadingWidth: in the Appbar widget.
I hope this work for you.
Since you are providing this widget to "leading", I'm guessing this is for an AppBar. The size of the icon cannot exceed the size of your appbar. You need to increase the size of your appbar to be able to increase the size of your icon. If this doesn't work, provide your code containing the AppBar widget so I can test it out for you.

Flutter: RadioListTile color is not changing

I have a RadioListTile in my widget tree which has the property tileColor, whenever I change its value it doesn't actually change.
Anyone can help on this?
Thanks in Advance
The easiest solution for this problem is to just wrap the RadioListTile with a Material widget and you will find that the problem is gone.
Example:
Material(
child: RadioListTile(
tileColor: Colors.red,
),
)

Automatically resize third-party flutter widget with default sizes

I am using flutter numberpicker to build a mobile app. The default size of the widget is 50px by 100px. The size is too large for small screens. How should I make it automatically resize by specifying the right height and width?
Thanks. Any ideas and thoughts are appreciated.
You can use a combination of SizedBox and FittedBox to achieve any kind of scale manipulation of Widgets.
For your case, you can use it like this,
SizedBox(
width: 75,
child: FittedBox(
fit: BoxFit.contain,
child: NumberPicker(
value: _currentValue,
minValue: 0,
maxValue: 100,
onChanged: (value) => setState(() => _currentValue = value),
),
),
),
If you use it normally or don't give the width param in above code, tt looks like this.
But if you give a width of 75 like in the code above, it looks like this.

Reduce space between checkbox and title in flutter

I need to remove the space between checkbox and title but i cant able to reduce the space
here is my code
Expanded(
//width: 30,
child: CheckboxListTile(
checkColor: Colors.white,
activeColor: PRIMARY_COLOR,
title: Text('Select All',
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.bold,
color: Colors.black)),
value: _selectAll,
dense: true,
contentPadding: EdgeInsets.fromLTRB(0, 0, 0, 0),
controlAffinity: ListTileControlAffinity.leading,
onChanged: (bool value) {
}
}
setState(() {});
}),
),
here is the image how it is coming
How to reduce the space
You need to create a custom widget in order to resolve your problem, because if you're using the CheckboxListTile the way it is, you're gonna have to add more contentPadding to your widget in order to make the gap smaller and by default, I see that it has a default padding between the actual checkbox and the text widget ... I personally, don't know why you're trying to squeeze more space from this thing, because in documentation it says clearly that CheckboxListTile acts just like a ListTile, which in my knowledge it takes all the space available in a row and the padding between items in your widget will be a little bit bigger. Also your widget is wrapped in an Expanded widget which also take the whole space available. So in conclusion you either use it as the way it is intended, or you can create a custom widget that will bennefit your problems.

Flutter RenderStack object was given an infinite size during layout. How to position container inside stack?

I am trying to position a container inside a stack but keeps getting this exception.How can i position the container of given size inside the stack using lets say right:0,top:0?The code i am using is shown below:
What changes should i make in my code to make it work?
**return SizedBox.fromSize(
size:Size.fromHeight(300.0),
child:Container(
decoration:BoxDecoration(**
color:Color(0xFFF3F3F5),
),
child:ListView.builder(
scrollDirection:Axis.horizontal,
itemCount:3,
physics:BouncingScrollPhysics(),
itemBuilder:(BuildContext context,index){
print(10);
return Stack(
children:<Widget>[
Positioned(
right:0,
top:0,
child:Container(
margin:EdgeInsets.symmetric(horizontal:15.0),
height:80,
width:140,
decoration:BoxDecoration(
borderRadius:BorderRadius.circular(16.0),
color:Color(0xFFDDE3F0),
),
),),
],
);
}
),
),
);
**
You can solve this in two way.
1) use shrinkwrap property of listView and set it to true.
shrinkWrap: false,
2) using column and Expanded. Wrap your ListView with Expanded and Wrap Expanded with Column.
Column->Expanded->ListView.
You should give the Container that wraps your ListView a height.