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 : class FlipTabStyle extends DelegateBuilder { 9 : final List<TabItem> items; 10 : final Color activeColor; 11 : final Color color; 12 : final Curve curve; 13 : 14 1 : FlipTabStyle({this.items, this.activeColor, this.color, this.curve}); 15 : 16 1 : @override 17 : Widget build(BuildContext context, int index, bool active) { 18 2 : var item = items[index]; 19 : if (active) { 20 1 : return TransitionContainer.flip( 21 1 : duration: Duration(milliseconds: 500), 22 : height: ACTION_LAYOUT_SIZE, 23 1 : bottomChild: Container( 24 1 : padding: EdgeInsets.only(bottom: 2), 25 1 : child: Column( 26 : mainAxisAlignment: MainAxisAlignment.end, 27 1 : children: <Widget>[ 28 1 : BlendImageIcon( 29 2 : item.activeIcon ?? item.icon, 30 2 : color: item.blend ? activeColor : null, 31 : size: ACTION_INNER_BUTTON_SIZE, 32 : ), 33 4 : Text(item.title, style: TextStyle(color: activeColor)) 34 : ], 35 : ), 36 : ), 37 1 : topChild: Container( 38 : height: BAR_HEIGHT, 39 1 : child: Center( 40 4 : child: BlendImageIcon(item.icon, color: item.blend ? color : null), 41 : ), 42 : ), 43 1 : curve: curve, 44 : ); 45 : } 46 1 : return Center( 47 4 : child: BlendImageIcon(item.icon, color: item.blend ? color : null), 48 : ); 49 : } 50 : }