getNavBarDecoration static method

BoxDecoration getNavBarDecoration({
  1. required double opacity,
  2. bool showElevation = true,
  3. NavBarDecoration? decoration = const NavBarDecoration(),
  4. bool showBorder = true,
  5. bool showOpacity = true,
  6. Color? color = Colors.white,
})

Implementation

static BoxDecoration getNavBarDecoration({
  required final double opacity,
  final bool showElevation = true,
  final NavBarDecoration? decoration = const NavBarDecoration(),
  final bool showBorder = true,
  final bool showOpacity = true,
  final Color? color = Colors.white,
}) {
  if (opacity < 1.0) {
    return BoxDecoration(
      border: showBorder ? decoration!.border : null,
      borderRadius: decoration!.borderRadius,
      color: color!.withOpacity(opacity),
    );
  } else {
    return BoxDecoration(
      border: showBorder ? decoration!.border : null,
      borderRadius: decoration!.borderRadius,
      color: color,
      gradient: decoration.gradient,
      boxShadow: decoration.boxShadow,
    );
  }
}