Fat*_*sel 2 flutter flutter-bottomnavigation convex-bottom-bar
当我尝试更改 TextStyle 时,它显示“参数类型“文本”无法分配给参数类型“字符串”。” 我怎样才能改变它?
\n bottomNavigationBar: ConvexAppBar(\n items: [\n TabItem(icon: Icons.touch_app_rounded, title: Text("Tab1",style: TextStyle(fontFamily: "iransans"),)),\n TabItem(icon: Icons.store_rounded, title: 'Ma\xc4\x9faza'),\n TabItem(icon: Icons.developer_board_rounded, title: 'Sim\xc3\xbclasyon'),\n TabItem(icon: Icons.timeline_rounded, title: '\xc4\xb0statistik'),\n TabItem(icon: Icons.view_week_rounded, title: 'Di\xc4\x9fer'),\n ],\n gradient: LinearGradient(\n colors: [Color(0xFFEC407A),\n Color(0XFF1A237E)],\n begin: Alignment.bottomCenter,\n stops: [\n 0.0,0.4\n ],\n end: Alignment.topCenter,\n ),\n height: 70,\n backgroundColor: Color(0xFFEC407A),\n //backgroundColor: Colors.white,\n activeColor: Colors.white,\n initialActiveIndex: 0,//optional, default as 0\n onTap: (int i) => print('click index=$i'),\n ),\nRun Code Online (Sandbox Code Playgroud)\n
小智 8
//Don't use Text () and use the StyleProvider Widget in your bottomNavigationBar. In
//TextStyle add fontFamily.
bottomNavigationBar: StyleProvider(
style: Style(),
child: ConvexAppBar(
initialActiveIndex: 1,
height: 50,
top: -30,
curveSize: 100,
style: TabStyle.fixedCircle,
items: [
TabItem(icon: Icons.link),
TabItem(icon: Icons.import_contacts),
TabItem(title: "2020", icon: Icons.work),
],
backgroundColor: _tabBackgroundColor,
),
)
class Style extends StyleHook {
@override
double get activeIconSize => 40;
@override
double get activeIconMargin => 10;
@override
double get iconSize => 20;
@override
TextStyle textStyle(Color color) {
return TextStyle(fontSize: 20, color: color);
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1461 次 |
| 最近记录: |