Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 246 Vote(s) - 3.52 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Flutter - how to remove default padding (48 px as per doc) from widgets (IconButton, CheckBox, FlatButton)

#11
There are three options:

1.
```dart
// or Checkbox()
Radio(
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
)

```

2.

```dart
// or Checkbox()
Radio(
visualDensity: VisualDensity(horizontal: -4, vertical: -4),
)

```

3.
```dart
SizedBox(
height: 20,
width: 20,
// or Checkbox()
child: Radio()
)

```
Reply

#12
If you want the padding removed because it is causing the control to be too far to the right or too far down (I wanted the control to be perfectly left aligned), you could wrap it in a [TransForm.translate][1].

Transform.translate(
offset: const Offset(-24, 0),
child: Checkbox(...),
)


[1]:

[To see links please register here]

Reply

#13
**this is for particular for Checkbox**


assign following property for remove padding

**materialTapTargetSize:MaterialTapTargetSize.shrinkWrap**,

show code
```
Checkbox(
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
value: agreeForTC, // bool value
onChanged: (bool? update) {
setState(() => agreeForTC = update!); // update bool
debugPrint('agreeForTC : $agreeForTC');
},
)
```
but this will still have some required padding and remove this just wrap Checkbox in SizeBox and give width and height

```
SizedBox(
width: 30,
height: 30,
child: Checkbox(
materialTapTargetSize:
MaterialTapTargetSize.shrinkWrap,

value: agreeForTC,
onChanged: (bool? update) {
setState(() => agreeForTC = update!);
debugPrint('agreeForTC : $agreeForTC');
},
),
),
```
Reply

#14
Use Checkbox instead of CheckboxListTile and wrap CheckBox with Transform.scale,

Transform.scale(
scale: 1.2,
child: Checkbox(),
)
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through