发现了一个解决 Flutter 嵌套过深的包
資深大佬 : hxse 11
https://pub.dev/packages/styled_widget
native flutter
Align( alignment: Alignment.center, child: DecoratedBox( decoration: BoxDecoration( color: Colors.amber, ), child: Padding( padding: EdgeInsets.all(10), child: Text('some text'), ), ), );
styled_widget
Text('some text') .padding(all: 10) .backgroundColor(Colors.amber) .alignment(Alignment.center);
看起来清爽多了, 大家觉得怎么样?
大佬有話說 (1)