我有 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) 有人可以解释如何使用onInitinGetX以及使用dispose/重要吗onClose?
我想要GETapi 数据并从应用程序启动时显示它
已经用谷歌搜索没有找到任何有用的:(
我正在使用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)