当我将标签设置为可滚动时,它会将我的所有标签设置为中心。但我想找到一种方法,我可以将所有选项卡对齐到左侧。有没有办法让我对齐左边的标签而不是中心?这是我的代码。谢谢。
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData(
primarySwatch: colorPrimary,
accentColor: colorAccent,
),
home: DefaultTabController(
length: 3,
child: Scaffold(
resizeToAvoidBottomPadding: false,
appBar: AppBar(
bottom: TabBar(
tabs: [
Tab(
child: Text(sign_in),
),
Tab(
child: Text(sign_up),
),
Tab(
child: Text(reset_password),
),
],
indicatorColor: colorWhite,
isScrollable: true,
),
),
body: TabBarView(
children: [
SignIn(),
SignUp(),
ResetPassword(),
],
),
),
),
);
}
}
对于那些感兴趣的人来说,这就是构成我的answer