overlayInputDecoration static method

InputDecoration overlayInputDecoration({
  1. required BuildContext context,
  2. Widget? prefixIcon,
  3. Widget? suffixIcon,
  4. String? hintText,
})

Input decoration for the overlay text field that is displayed on top of the fleet map and list.

Implementation

static InputDecoration overlayInputDecoration({
  required BuildContext context,
  Widget? prefixIcon,
  Widget? suffixIcon,
  String? hintText,
}) {
  final brightness = context.theme.brightness;

  final border = OutlineInputBorder(
    borderRadius: const BorderRadius.all(Radius.circular(30.0)),
    borderSide: BorderSide(
      width: 1.0,
      color: brightness.isDark
          ? Colors.black
          : context.colorScheme.outline.withOpacity(0.38),
    ),
  );

  return InputDecoration(
    contentPadding: const EdgeInsets.symmetric(vertical: 10),
    hintText: hintText,
    prefixIcon: prefixIcon != null
        ? IconTheme.merge(
            data: IconThemeData(
              color: context.colorScheme.inverseSurface,
              size: 18.0,
            ),
            child: prefixIcon,
          )
        : null,
    hintStyle: TextStyle(
      color: context.colorScheme.inverseSurface.withOpacity(0.54),
    ),
    filled: true,
    fillColor: context.colorScheme.onInverseSurface
        .withOpacity(brightness.isDark ? 0.54 : 0.70),
    border: border,
    enabledBorder: border,
    suffixIcon: suffixIcon,
  );
}