build method

  1. @override
Widget build(
  1. BuildContext _,
  2. Widget child,
  3. int i,
  4. bool active,
)
override

Construct a new widget which represent the tab item with custom badge.

  • context BuildContext instance;
  • child the tab item Widget;
  • index index of the tab item;
  • active active state for the index;

Implementation

@override
Widget build(_, child, i, active) {
  var chip = chips[i];
  if (chip == null || chip == '') {
    return child;
  }
  return Stack(
    alignment: Alignment.center,
    children: <Widget>[child, asBadge(chip)],
  );
}