Browse Source

1.优化多眼导航在有边距时的居中对齐

tags/0.0.4+7
“yanghuaxuan” 3 years ago
parent
commit
12d64b9fea
2 changed files with 6 additions and 5 deletions
  1. +2
    -2
      example/android/app/build.gradle
  2. +4
    -3
      lib/widgets/custom/multi_nav/custom_quick_entry.dart

+ 2
- 2
example/android/app/build.gradle View File

@@ -112,9 +112,9 @@ android {
// 智夜生活 // 智夜生活
zhiying { zhiying {
applicationId "cn.zhios.zhiying" applicationId "cn.zhios.zhiying"
versionCode 33
versionCode 34
dimension "app" dimension "app"
versionName '1.2.33'
versionName '1.2.34'
// 签名信息 // 签名信息
signingConfig signingConfigs.zhiying signingConfig signingConfigs.zhiying
} }


+ 4
- 3
lib/widgets/custom/multi_nav/custom_quick_entry.dart View File

@@ -820,7 +820,7 @@ class _CustomQuickCateEntryState extends State<CustomQuickCateEntry> with Ticker
labelColor: HexColor.fromHex("#FFFFFF"), labelColor: HexColor.fromHex("#FFFFFF"),
unselectedLabelColor: HexColor.fromHex("#FF333333"), unselectedLabelColor: HexColor.fromHex("#FF333333"),
labelStyle: TextStyle(fontSize: 14), labelStyle: TextStyle(fontSize: 14),
tabs: _buildTab(model,columSize),
tabs: _buildTab(model,columSize,marginLeftRight),
labelPadding: EdgeInsets.only(left: 16,right: 16), labelPadding: EdgeInsets.only(left: 16,right: 16),
controller: tabController, controller: tabController,
indicatorSize: TabBarIndicatorSize.label, indicatorSize: TabBarIndicatorSize.label,
@@ -868,9 +868,9 @@ class _CustomQuickCateEntryState extends State<CustomQuickCateEntry> with Ticker
); );
} }


_buildTab(CustomQuickEntryModel model,int columSize) {
_buildTab(CustomQuickEntryModel model,int columSize,double marginLeft) {
List<Widget> listWidget = List(); List<Widget> listWidget = List();
var maxWidth = (MediaQuery.of(context).size.width-(32*columSize)) / columSize;
var maxWidth = ((MediaQuery.of(context).size.width-marginLeft*2)-(32*columSize)) / columSize;
print("测试"+columSize.toString()); print("测试"+columSize.toString());
for (var item in model?.typeList) { for (var item in model?.typeList) {
listWidget.add(Tab( listWidget.add(Tab(
@@ -992,6 +992,7 @@ class _CustomQuickCateEntryState extends State<CustomQuickCateEntry> with Ticker
onTap: () => _itemIconClick(item), onTap: () => _itemIconClick(item),
child: Container( child: Container(
height: itemHeight, height: itemHeight,
width:60,
// color: Colors.red, // color: Colors.red,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,


Loading…
Cancel
Save