Line data Source code
1 : import 'package:flutter/widgets.dart'; 2 : 3 : /// Tab callback, [index] are tab index which is being clicked. 4 : typedef GestureTapIndexCallback = void Function(int index); 5 : 6 : /// Tab builder. 7 : /// * [context] BuildContent instance 8 : /// * [index] index of tab 9 : /// * [active] active state for tab index 10 : typedef CustomTabBuilder = Widget Function( 11 : BuildContext context, int index, bool active); 12 : 13 : /// Interface to apply any custom badge chip. 14 : abstract class ChipBuilder { 15 : /// Construct a new widget which represent the tab item with custom badge. 16 : /// 17 : /// * [context] BuildContext instance; 18 : /// * [child] the tab item Widget; 19 : /// * [index] index of the tab item; 20 : /// * [active] active state for the index; 21 : Widget build(BuildContext context, Widget child, int index, bool active); 22 : } 23 : 24 : /// Item builder. 25 : abstract class DelegateBuilder { 26 : /// Called when the tab item is build. 27 : /// * [context] BuildContext instance; 28 : /// * [index] tab index; 29 : /// * [active] tab state; 30 : Widget build(BuildContext context, int index, bool active); 31 : 32 : /// Whether the convex shape is fixed center or positioned according to selection. 33 1 : bool fixed() { 34 : return false; 35 : } 36 : }