widgets used as fab in a scaffold
seem to have padding by default
see dartpad example
import 'package:flutter/material.dart';
void main() => runApp(
MaterialApp(
home: Scaffold(
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
floatingActionButton: Padding(
padding: EdgeInsets.zero,
child: Container(height: 56, color: Colors.red),
),
),
),
);
how do I remove the padding at the bottom of the red container?
the current (lame) workaround being
import 'package:flutter/material.dart';
void main() => runApp(
MaterialApp(
home: Scaffold(
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
+ bottomSheet: Container(height: 16, color: Colors.red),
floatingActionButton: Padding(
padding: EdgeInsets.zero,
child: Container(height: 56, color: Colors.red),
),
),
),
);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.