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 : /// Convex shape is moved after selection 9 : class ReactTabStyle extends DelegateBuilder { 10 : final List<TabItem> items; 11 : final Color activeColor; 12 : final Color color; 13 : final Curve curve; 14 : 15 1 : ReactTabStyle({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 4 : Text(item.title, style: TextStyle(color: activeColor)) 36 : ], 37 : ), 38 : ); 39 : } 40 1 : return Container( 41 : height: BAR_HEIGHT, 42 : padding: const EdgeInsets.only(bottom: 2), 43 1 : child: Column( 44 : mainAxisAlignment: MainAxisAlignment.end, 45 1 : children: <Widget>[ 46 4 : BlendImageIcon(item.icon, color: item.blend ? color : null), 47 4 : Text(item.title, style: TextStyle(color: color)) 48 : ], 49 : ), 50 : ); 51 : } 52 : }