getNavBarDecoration function

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

Implementation

BoxDecoration getNavBarDecoration({
  bool showElevation = true,
  NavBarDecoration? decoration = const NavBarDecoration(),
  required double opacity,
  bool showBorder = true,
  bool showOpacity = true,
  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,
    );
  }
}