createCupertinoWidget method

  1. @override
CupertinoNavigationBar createCupertinoWidget (
  1. BuildContext context
)
override

Implementation

@override
CupertinoNavigationBar createCupertinoWidget(BuildContext context) {
  final data = cupertino?.call(context, platform(context));

  var trailing = trailingActions == null || trailingActions.isEmpty
      ? null
      : Row(
          mainAxisSize: MainAxisSize.min,
          crossAxisAlignment: CrossAxisAlignment.stretch,
          children: trailingActions,
        );

  if (data?.heroTag != null) {
    return CupertinoNavigationBar(
      key: data?.widgetKey ?? widgetKey,
      middle: data?.title ?? title,
      backgroundColor: data?.backgroundColor ?? backgroundColor,
      actionsForegroundColor: data?.actionsForegroundColor,
      automaticallyImplyLeading: data?.automaticallyImplyLeading ??
          automaticallyImplyLeading ??
          true,
      automaticallyImplyMiddle: data?.automaticallyImplyMiddle ?? true,
      previousPageTitle: data?.previousPageTitle,
      padding: data?.padding,
      border: data?.border ?? _kDefaultNavBarBorder,
      leading: data?.leading ?? leading,
      trailing: data?.trailing ?? trailing,
      transitionBetweenRoutes: data?.transitionBetweenRoutes ?? true,
      brightness: data?.brightness,
      heroTag: data.heroTag,
    );
  }

  return CupertinoNavigationBar(
    key: data?.widgetKey ?? widgetKey,
    middle: data?.title ?? title,
    backgroundColor: data?.backgroundColor ?? backgroundColor,
    actionsForegroundColor: data?.actionsForegroundColor,
    automaticallyImplyLeading:
        data?.automaticallyImplyLeading ?? automaticallyImplyLeading ?? true,
    automaticallyImplyMiddle: data?.automaticallyImplyMiddle ?? true,
    previousPageTitle: data?.previousPageTitle,
    padding: data?.padding,
    border: data?.border ?? _kDefaultNavBarBorder,
    leading: data?.leading ?? leading,
    trailing: data?.trailing ?? trailing,
    transitionBetweenRoutes: data?.transitionBetweenRoutes ?? true,
    brightness: data?.brightness,
    //heroTag: , used above
  );
}