Padding组件处理容器与子元素之间的间距。
class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { return Container( padding: const EdgeInsets.all(20), child: const Icon(Icons.abc_outlined), ); } } class MyApp1 extends StatelessWidget { const MyApp1({super.key}); @override Widget build(BuildContext context) { return const Padding( padding: EdgeInsets.all(20), child: Icon(Icons.abc_outlined), ); } }
标签:const,Icons,Paddiing,MyApp1,MyApp,child,组件,Flutter From: https://www.cnblogs.com/xbinbin/p/17835669.html