as navigation item add tag

null_safety
小赖 4 years ago
parent 3773e4cc60
commit 3b7e64475d

@ -1,19 +1,26 @@
import 'package:ansu_ui/badge/as_badge.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
BottomNavigationBarItem asNavigationItem( BottomNavigationBarItem asNavigationItem(
String path1, String path2, String title) { String path1,
return BottomNavigationBarItem( String path2,
icon: Image.asset( String title, {
String tag,
}) {
Widget icon = Image.asset(
path1, path1,
height: 24.w, height: 24.w,
width: 24.w, width: 24.w,
), );
activeIcon: Image.asset( Widget activeIcon = Image.asset(
path2, path2,
height: 24.w, height: 24.w,
width: 24.w, width: 24.w,
), );
return BottomNavigationBarItem(
icon: ASBadge(child: icon, tag: tag),
activeIcon: ASBadge(child: activeIcon, tag: tag),
label: title, label: title,
); );
} }

Loading…
Cancel
Save