diff --git a/Frontend/patient_manager/lib/components/myDropdownInput.dart b/Frontend/patient_manager/lib/components/myDropdownInput.dart index d4fcbf81..151c6e67 100644 --- a/Frontend/patient_manager/lib/components/myDropdownInput.dart +++ b/Frontend/patient_manager/lib/components/myDropdownInput.dart @@ -98,101 +98,98 @@ class _MyDropdownFieldState extends State { // bool makeEditable() { @override Widget build(BuildContext context) { - return Padding( - padding: const EdgeInsets.symmetric(horizontal: 25.0), - child: DropdownMenu( - enabled: widget.editable, - trailingIcon: Icon( - Icons.arrow_drop_down, - color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), - ), - selectedTrailingIcon: Icon( - Icons.arrow_drop_up, - color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), - ), - textStyle: TextStyle( - color: MzanziInnovationHub.of(context)!.theme.secondaryColor()), - menuHeight: 300, - controller: widget.controller, - expandedInsets: EdgeInsets.zero, - label: setRequiredText(), - errorText: _errorText, + return DropdownMenu( + enabled: widget.editable, + trailingIcon: Icon( + Icons.arrow_drop_down, + color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), + ), + selectedTrailingIcon: Icon( + Icons.arrow_drop_up, + color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), + ), + textStyle: TextStyle( + color: MzanziInnovationHub.of(context)!.theme.secondaryColor()), + menuHeight: 300, + controller: widget.controller, + expandedInsets: EdgeInsets.zero, + label: setRequiredText(), + errorText: _errorText, - focusNode: _focus, - onSelected: (_) { + focusNode: _focus, + onSelected: (_) { + setState(() { + startup = false; + }); + // if (widget.editable == false) { + // return false; + // } + }, + leadingIcon: IconButton( + onPressed: () { setState(() { startup = false; }); - // if (widget.editable == false) { - // return false; - // } + widget.controller.clear(); }, - leadingIcon: IconButton( - onPressed: () { - setState(() { - startup = false; - }); - widget.controller.clear(); - }, - icon: Icon( - Icons.delete_outline_rounded, + icon: Icon( + Icons.delete_outline_rounded, + color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), + ), + ), + menuStyle: MenuStyle( + backgroundColor: WidgetStatePropertyAll( + MzanziInnovationHub.of(context)!.theme.primaryColor()), + side: WidgetStatePropertyAll( + BorderSide( + color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), + width: 2.0), + ), + ), + + inputDecorationTheme: InputDecorationTheme( + filled: true, + errorStyle: TextStyle( + color: MzanziInnovationHub.of(context)!.theme.errorColor(), + fontWeight: FontWeight.bold), + fillColor: MzanziInnovationHub.of(context)!.theme.primaryColor(), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), ), ), - menuStyle: MenuStyle( - backgroundColor: WidgetStatePropertyAll( - MzanziInnovationHub.of(context)!.theme.primaryColor()), - side: WidgetStatePropertyAll( - BorderSide( - color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), - width: 2.0), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: MzanziInnovationHub.of(context)!.theme.errorColor(), + width: 2.0, ), ), - - inputDecorationTheme: InputDecorationTheme( - filled: true, - errorStyle: TextStyle( - color: MzanziInnovationHub.of(context)!.theme.errorColor(), - fontWeight: FontWeight.bold), - fillColor: MzanziInnovationHub.of(context)!.theme.primaryColor(), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), - ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: MzanziInnovationHub.of(context)!.theme.errorColor(), + width: 2.0, ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: MzanziInnovationHub.of(context)!.theme.errorColor(), - width: 2.0, - ), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: MzanziInnovationHub.of(context)!.theme.errorColor(), - width: 2.0, - ), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), - width: 2.0, - ), - ), - disabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), - width: 2.0, - ), - ), - outlineBorder: BorderSide( - color: MzanziInnovationHub.of(context)!.theme.secondaryColor()), ), - dropdownMenuEntries: menu, - // const >[ - // DropdownMenuEntry(value: "Dr.", label: "Dr."), - // DropdownMenuEntry(value: "Assistant", label: "Assistant"), - // ], + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), + width: 2.0, + ), + ), + disabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), + width: 2.0, + ), + ), + outlineBorder: BorderSide( + color: MzanziInnovationHub.of(context)!.theme.secondaryColor()), ), + dropdownMenuEntries: menu, + // const >[ + // DropdownMenuEntry(value: "Dr.", label: "Dr."), + // DropdownMenuEntry(value: "Assistant", label: "Assistant"), + // ], ); } }