Line data Source code
1 : import 'package:flutter/cupertino.dart'; 2 : 3 : class TabItem<T> { 4 : final String title; 5 : 6 : /// IconData or Image 7 : /// 8 : ///  9 : final T icon; 10 : 11 : /// Optional if not provided ,[icon] is used 12 : final T activeIcon; 13 : 14 : /// Whether icon should blend with color 15 : final bool blend; 16 : 17 1 : const TabItem({ 18 : this.title, 19 : @required this.icon, 20 : this.activeIcon, 21 : bool isIconBlend, 22 3 : }) : assert(icon is IconData || icon is Widget, 23 : "TabItem only support IconData and Widget"), 24 1 : blend = isIconBlend ?? (icon is IconData); 25 : }