Closed ghost closed 2 years ago
Row ( mainAxisAlignment: mainAxisAlignment, crossAxisAlignment: crossAxisAlignment, children: <Widget>[ leading ?? const BackButton( onPressed: null, ), titleWidget, actions ?? Container(), ], );
改成
Stack( alignment: Alignment.center, children: [ Row ( mainAxisAlignment: mainAxisAlignment, crossAxisAlignment: crossAxisAlignment, children: <Widget>[ leading ?? const BackButton( onPressed: null, ), const Spacer(), actions ?? Container(), ], ), titleWidget, ], );
才能让title居中,不然 两边不一样(指有leading没actions)就不是居中的了
1,leading,action可以放Containter 2. 组件只是个简单例子。要复制一份是很简单。
改成
才能让title居中,不然 两边不一样(指有leading没actions)就不是居中的了