小编CCP*_*CCP的帖子

Flutter TabBar 标签之间的边距/填充

我有 3 TabBars,我想将标签放置在类别的左侧。

TabBar想要的:

在此输入图像描述

我的TabBar

在此输入图像描述

我的代码:

       // BOTTOM
      bottom: PreferredSize(
        preferredSize: const Size.fromHeight(kToolbarHeight),
        child: Align(
          alignment: Alignment.centerLeft,
          child: Container(
            width: MediaQuery.of(context).size.width / 1.1,
            child: TabBar(
              labelPadding: EdgeInsets.all(0),
              labelColor: Colors.white,
              labelStyle: poppins.copyWith(
                fontSize: 15,
                fontWeight: bold,
              ),
              unselectedLabelColor: Color(0xff585861),
              indicatorColor: Colors.white,
              indicatorSize: TabBarIndicatorSize.label,

              // TABS
              tabs: [
                Tab(
                  text: 'Following',
                ),
                Tab(
                  text: 'Trending',
                ),
                Tab(
                  text: 'Search',
                ),
              ],
            ),
          ),
        ),
      ),
Run Code Online (Sandbox Code Playgroud)

dart flutter

6
推荐指数
1
解决办法
8375
查看次数

颤振,GetX 初始化状态

有人可以解释如何使用onInitinGetX以及使用dispose/重要吗onClose

我想要GETapi 数据并从应用程序启动时显示它

已经用谷歌搜索没有找到任何有用的:(

dart flutter flutter-getx

4
推荐指数
1
解决办法
1万
查看次数

Flutter包滑动宽度

我正在使用flutter_slidable: ^1.2.0包,如何调整宽度SlidableAction?它可以编辑半径吗?也许与 BorderRadius.circular

再一个如果我按下删除按钮我想运行关闭动画功能如何?

在此输入图像描述

这是完整的代码

 for (var i = 0; i < c.noteList.length; i++)
                  Slidable(
                    key: ValueKey(
                      c.noteList[i]['id'],
                    ),
                    startActionPane: ActionPane(
                      motion: StretchMotion(),
                      dismissible: DismissiblePane(
                        onDismissed: () {
                          handleDeleteSet(
                            c.noteList[i]['id'],
                          );
                        },
                      ),
                      children: [
                        SlidableAction(
                          onPressed: (context) {},
                          backgroundColor: Colors.red,
                          foregroundColor: Colors.white,
                          icon: Icons.delete,
                          label: 'Delete',
                        ),
                      ],
                    ),
                    child: NoteTile(
                      index: i + 1,
                      item: c.noteList[i],
                      deleteItem: (id) {
                        handleDeleteSet(id);
                      },
                      onSaveData: () {
                        saveData();
                      },
                    ),
                  ),
Run Code Online (Sandbox Code Playgroud)

dart flutter

2
推荐指数
1
解决办法
3812
查看次数

标签 统计

dart ×3

flutter ×3

flutter-getx ×1