Line data Source code
1 : import 'package:flutter/cupertino.dart'; 2 : import 'package:flutter/material.dart'; 3 : 4 : import '../../convex_bottom_bar.dart'; 5 : import 'blend_image_icon.dart'; 6 : import 'transition_container.dart'; 7 : 8 : /// tab icon, text animated with pop transition 9 : class TextInTabStyle extends DelegateBuilder { 10 : final List<TabItem> items; 11 : final Color activeColor; 12 : final Color color; 13 : final Curve curve; 14 : 15 1 : TextInTabStyle({this.items, this.activeColor, this.color, this.curve}); 16 : 17 1 : @override 18 : Widget build(BuildContext context, int index, bool active) { 19 2 : var item = items[index]; 20 : if (active) { 21 1 : return Container( 22 : height: ACTION_LAYOUT_SIZE, 23 : padding: const EdgeInsets.only(bottom: 2), 24 1 : child: Column( 25 : mainAxisAlignment: MainAxisAlignment.end, 26 1 : children: <Widget>[ 27 1 : TransitionContainer.scale( 28 1 : child: BlendImageIcon( 29 2 : item.activeIcon ?? item.icon, 30 2 : color: item.blend ? activeColor : null, 31 : size: ACTION_INNER_BUTTON_SIZE, 32 : ), 33 1 : curve: curve, 34 : ), 35 1 : TransitionContainer.slide( 36 4 : child: Text(item.title, style: TextStyle(color: activeColor)), 37 1 : curve: curve, 38 : ), 39 : ], 40 : ), 41 : ); 42 : } 43 : 44 1 : return Center( 45 4 : child: BlendImageIcon(item.icon, color: item.blend ? color : null), 46 : ); 47 : } 48 : }