LCOV - code coverage report
Current view: top level - src/style - react_tab_style.dart (source / functions) Hit Total Coverage
Test: lcov.info Lines: 18 18 100.0 %
Date: 2020-03-09 19:58:44 Functions: 0 0 -

          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 'inner_builder.dart';
       7             : import 'transition_container.dart';
       8             : 
       9             : /// Convex shape is moved after selection.
      10             : class ReactTabStyle extends InnerBuilder {
      11             :   /// Curve for tab transition.
      12             :   final Curve curve;
      13             : 
      14             :   /// Create style builder.
      15           1 :   ReactTabStyle({
      16             :     List<TabItem> items,
      17             :     Color activeColor,
      18             :     Color color,
      19             :     this.curve,
      20           1 :   }) : super(items: items, activeColor: activeColor, color: color);
      21             : 
      22           1 :   @override
      23             :   Widget build(BuildContext context, int index, bool active) {
      24           2 :     var item = items[index];
      25             :     if (active) {
      26           1 :       return Container(
      27             :         height: ACTION_LAYOUT_SIZE,
      28             :         padding: const EdgeInsets.only(bottom: 2),
      29           1 :         child: Column(
      30             :           mainAxisAlignment: MainAxisAlignment.end,
      31           1 :           children: <Widget>[
      32           1 :             TransitionContainer.scale(
      33           1 :               child: BlendImageIcon(
      34           2 :                 item.activeIcon ?? item.icon,
      35           2 :                 color: item.blend ? activeColor : null,
      36             :                 size: ACTION_INNER_BUTTON_SIZE,
      37             :               ),
      38           1 :               curve: curve,
      39             :             ),
      40           4 :             Text(item.title, style: TextStyle(color: activeColor))
      41             :           ],
      42             :         ),
      43             :       );
      44             :     }
      45           1 :     return Container(
      46             :       height: BAR_HEIGHT,
      47             :       padding: const EdgeInsets.only(bottom: 2),
      48           1 :       child: Column(
      49             :         mainAxisAlignment: MainAxisAlignment.end,
      50           1 :         children: <Widget>[
      51           4 :           BlendImageIcon(item.icon, color: item.blend ? color : null),
      52           4 :           Text(item.title, style: TextStyle(color: color))
      53             :         ],
      54             :       ),
      55             :     );
      56             :   }
      57             : }

Generated by: LCOV version 1.14