From 3b7e64475d76f548c776e09248dff83d22cb3c91 Mon Sep 17 00:00:00 2001 From: laiiihz Date: Thu, 24 Dec 2020 17:14:49 +0800 Subject: [PATCH] as navigation item add tag --- lib/bar/as_navigation_item.dart | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/lib/bar/as_navigation_item.dart b/lib/bar/as_navigation_item.dart index c6df77d..a6ba45b 100644 --- a/lib/bar/as_navigation_item.dart +++ b/lib/bar/as_navigation_item.dart @@ -1,19 +1,26 @@ +import 'package:ansu_ui/badge/as_badge.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; BottomNavigationBarItem asNavigationItem( - String path1, String path2, String title) { + String path1, + String path2, + String title, { + String tag, +}) { + Widget icon = Image.asset( + path1, + height: 24.w, + width: 24.w, + ); + Widget activeIcon = Image.asset( + path2, + height: 24.w, + width: 24.w, + ); return BottomNavigationBarItem( - icon: Image.asset( - path1, - height: 24.w, - width: 24.w, - ), - activeIcon: Image.asset( - path2, - height: 24.w, - width: 24.w, - ), + icon: ASBadge(child: icon, tag: tag), + activeIcon: ASBadge(child: activeIcon, tag: tag), label: title, ); }