LCOV - code coverage report
Current view: top level - src/style - fixed_tab_style.dart (source / functions) Hit Total Coverage
Test: lcov.info Lines: 26 26 100.0 %
Date: 2020-02-17 18:53:51 Functions: 0 0 -

          Line data    Source code
       1             : import 'dart:ui';
       2             : 
       3             : import 'package:flutter/cupertino.dart';
       4             : import 'package:flutter/material.dart';
       5             : 
       6             : import '../../convex_bottom_bar.dart';
       7             : import 'blend_image_icon.dart';
       8             : 
       9             : /// Convex shape is fixed center
      10             : class FixedTabStyle extends DelegateBuilder {
      11             :   final List<TabItem> items;
      12             :   final Color activeColor;
      13             :   final Color color;
      14             :   final int convexIndex;
      15             :   DelegateBuilder tabBuilder;
      16             :   DelegateBuilder convexBuilder;
      17             : 
      18           1 :   FixedTabStyle({this.items, this.activeColor, this.color, this.convexIndex});
      19             : 
      20           1 :   @override
      21             :   Widget build(BuildContext context, int index, bool active) {
      22           2 :     if (index == convexIndex) {
      23           3 :       var item = items[convexIndex];
      24           1 :       return Container(
      25             :         height: ACTION_LAYOUT_SIZE,
      26           1 :         padding: EdgeInsets.only(bottom: 2),
      27           1 :         child: Column(
      28             :           mainAxisAlignment: MainAxisAlignment.end,
      29           1 :           children: <Widget>[
      30           1 :             BlendImageIcon(
      31           3 :               active ? item.activeIcon ?? item.icon : item.icon,
      32           3 :               color: item.blend ? (active ? activeColor : color) : null,
      33             :               size: ACTION_INNER_BUTTON_SIZE,
      34             :             ),
      35           1 :             Text(
      36           1 :               item.title,
      37           3 :               style: TextStyle(color: active ? activeColor : color),
      38             :             )
      39             :           ],
      40             :         ),
      41             :       );
      42             :     }
      43           2 :     var item = items[index];
      44           1 :     return Container(
      45           1 :       padding: EdgeInsets.only(bottom: 2),
      46           1 :       child: Column(
      47             :         mainAxisAlignment: MainAxisAlignment.end,
      48           1 :         children: <Widget>[
      49           1 :           BlendImageIcon(
      50           3 :             active ? item.activeIcon ?? item.icon : item.icon,
      51           3 :             color: item.blend ? (active ? activeColor : color) : null,
      52             :           ),
      53           1 :           Text(
      54           1 :             item.title,
      55           3 :             style: TextStyle(color: active ? activeColor : color),
      56             :           )
      57             :         ],
      58             :       ),
      59             :     );
      60             :   }
      61             : 
      62           1 :   @override
      63             :   bool fixed() {
      64             :     return true;
      65             :   }
      66             : }

Generated by: LCOV version 1.14