Align Scrollable Tabs On Left

我只是一个虾纸丫 提交于 2021-01-29 14:09:12

问题


When i set my tabs to scrollable, it will set all my tabs to the center. But i want to find a way that i can align all the tabs to the left. Is there a way for me align the tabs on the left instead of center? Here is my code. Thank you.

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(),
            ],
          ),
        ),
      ),
    );
  }
}

回答1:


For those who are interested, this is the answer that works form me



来源:https://stackoverflow.com/questions/55774056/align-scrollable-tabs-on-left

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!