diff --git a/Frontend/patient_manager/lib/components/myDateInput.dart b/Frontend/patient_manager/lib/components/myDateInput.dart index 26c3be7d..de339592 100644 --- a/Frontend/patient_manager/lib/components/myDateInput.dart +++ b/Frontend/patient_manager/lib/components/myDateInput.dart @@ -90,61 +90,58 @@ class _MyDateFieldState extends State { @override Widget build(BuildContext context) { - return Padding( - padding: const EdgeInsets.symmetric(horizontal: 25.0), - child: TextField( - style: TextStyle( - color: MzanziInnovationHub.of(context)!.theme.secondaryColor()), - controller: widget.controller, - readOnly: true, - obscureText: false, - focusNode: _focus, - onChanged: (_) => setState(() { - startup = false; - }), - decoration: InputDecoration( - errorText: _errorText, - errorStyle: TextStyle( - color: MzanziInnovationHub.of(context)!.theme.errorColor(), - fontWeight: FontWeight.bold), - label: setRequiredText(), - //labelText: widget.LableText, - //labelStyle: const TextStyle(color: Colors.blueAccent), - prefixIcon: Icon( - Icons.calendar_today, + return TextField( + style: TextStyle( + color: MzanziInnovationHub.of(context)!.theme.secondaryColor()), + controller: widget.controller, + readOnly: true, + obscureText: false, + focusNode: _focus, + onChanged: (_) => setState(() { + startup = false; + }), + decoration: InputDecoration( + errorText: _errorText, + errorStyle: TextStyle( + color: MzanziInnovationHub.of(context)!.theme.errorColor(), + fontWeight: FontWeight.bold), + label: setRequiredText(), + //labelText: widget.LableText, + //labelStyle: const TextStyle(color: Colors.blueAccent), + prefixIcon: Icon( + Icons.calendar_today, + color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), + ), + fillColor: MzanziInnovationHub.of(context)!.theme.primaryColor(), + filled: true, + //hintText: hintText, + //hintStyle: TextStyle(color: Colors.blueGrey[400]), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), - ), - fillColor: MzanziInnovationHub.of(context)!.theme.primaryColor(), - filled: true, - //hintText: hintText, - //hintStyle: TextStyle(color: Colors.blueGrey[400]), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), - 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, - ), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: MzanziInnovationHub.of(context)!.theme.secondaryColor()), + width: 2.0, ), ), - onTap: () { - _selectDate(context); - }, + 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, + ), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: MzanziInnovationHub.of(context)!.theme.secondaryColor()), + ), ), + onTap: () { + _selectDate(context); + }, ); } } diff --git a/Frontend/patient_manager/lib/components/myMLTextInput.dart b/Frontend/patient_manager/lib/components/myMLTextInput.dart index ce981bca..f2dc22ab 100644 --- a/Frontend/patient_manager/lib/components/myMLTextInput.dart +++ b/Frontend/patient_manager/lib/components/myMLTextInput.dart @@ -85,57 +85,54 @@ class _MyMLTextFieldState extends State { @override Widget build(BuildContext context) { - return Padding( - padding: const EdgeInsets.symmetric(horizontal: 25.0), - child: TextField( - style: TextStyle( + return TextField( + style: TextStyle( + color: MzanziInnovationHub.of(context)!.theme.secondaryColor()), + textAlign: TextAlign.start, + textAlignVertical: TextAlignVertical.top, + expands: true, + maxLines: null, + controller: widget.controller, + readOnly: makeEditable(), + obscureText: false, + focusNode: _focus, + onChanged: (_) => setState(() { + startup = false; + }), + decoration: InputDecoration( + label: setRequiredText(), + errorText: _errorText, + errorStyle: TextStyle( + color: MzanziInnovationHub.of(context)!.theme.errorColor(), + fontWeight: FontWeight.bold), + labelStyle: TextStyle( color: MzanziInnovationHub.of(context)!.theme.secondaryColor()), - textAlign: TextAlign.start, - textAlignVertical: TextAlignVertical.top, - expands: true, - maxLines: null, - controller: widget.controller, - readOnly: makeEditable(), - obscureText: false, - focusNode: _focus, - onChanged: (_) => setState(() { - startup = false; - }), - decoration: InputDecoration( - label: setRequiredText(), - errorText: _errorText, - errorStyle: TextStyle( - color: MzanziInnovationHub.of(context)!.theme.errorColor(), - fontWeight: FontWeight.bold), - labelStyle: TextStyle( + alignLabelWithHint: true, + fillColor: MzanziInnovationHub.of(context)!.theme.primaryColor(), + filled: true, + //hintText: hintText, + //hintStyle: TextStyle(color: Colors.blueGrey[400]), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), + 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, + ), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( color: MzanziInnovationHub.of(context)!.theme.secondaryColor()), - alignLabelWithHint: true, - fillColor: MzanziInnovationHub.of(context)!.theme.primaryColor(), - filled: true, - //hintText: hintText, - //hintStyle: TextStyle(color: Colors.blueGrey[400]), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), - 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, - ), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: MzanziInnovationHub.of(context)!.theme.secondaryColor()), - ), ), ), ); diff --git a/Frontend/patient_manager/lib/components/myPassInput.dart b/Frontend/patient_manager/lib/components/myPassInput.dart index 3ec2a70e..33c201af 100644 --- a/Frontend/patient_manager/lib/components/myPassInput.dart +++ b/Frontend/patient_manager/lib/components/myPassInput.dart @@ -87,61 +87,58 @@ class _MyPassFieldState extends State { @override Widget build(BuildContext context) { - return Padding( - padding: const EdgeInsets.symmetric(horizontal: 25.0), - child: TextField( - controller: widget.controller, - style: TextStyle( - color: MzanziInnovationHub.of(context)!.theme.secondaryColor()), - obscureText: _obscured, - focusNode: textFieldFocusNode, - onChanged: (_) => setState(() { - startup = false; - }), - decoration: InputDecoration( - fillColor: MzanziInnovationHub.of(context)!.theme.primaryColor(), - filled: true, - label: setRequiredText(), - //labelStyle: const TextStyle(color: Colors.blueAccent), - errorText: _errorText, - errorStyle: TextStyle( - color: MzanziInnovationHub.of(context)!.theme.errorColor(), - fontWeight: FontWeight.bold), - //hintText: widget.hintText, - //hintStyle: TextStyle(color: Colors.blueGrey[400]), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( + return TextField( + controller: widget.controller, + style: TextStyle( + color: MzanziInnovationHub.of(context)!.theme.secondaryColor()), + obscureText: _obscured, + focusNode: textFieldFocusNode, + onChanged: (_) => setState(() { + startup = false; + }), + decoration: InputDecoration( + fillColor: MzanziInnovationHub.of(context)!.theme.primaryColor(), + filled: true, + label: setRequiredText(), + //labelStyle: const TextStyle(color: Colors.blueAccent), + errorText: _errorText, + errorStyle: TextStyle( + color: MzanziInnovationHub.of(context)!.theme.errorColor(), + fontWeight: FontWeight.bold), + //hintText: widget.hintText, + //hintStyle: TextStyle(color: Colors.blueGrey[400]), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), + 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, + ), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: MzanziInnovationHub.of(context)!.theme.secondaryColor()), + ), + suffixIcon: Padding( + padding: const EdgeInsets.fromLTRB(0, 0, 4, 0), + child: GestureDetector( + onTap: _toggleObscured, + child: Icon( + _obscured + ? Icons.visibility_rounded + : Icons.visibility_off_rounded, + size: 24, color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), - 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, - ), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: MzanziInnovationHub.of(context)!.theme.secondaryColor()), - ), - suffixIcon: Padding( - padding: const EdgeInsets.fromLTRB(0, 0, 4, 0), - child: GestureDetector( - onTap: _toggleObscured, - child: Icon( - _obscured - ? Icons.visibility_rounded - : Icons.visibility_off_rounded, - size: 24, - color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), - ), ), ), ), diff --git a/Frontend/patient_manager/lib/components/mySearchInput.dart b/Frontend/patient_manager/lib/components/mySearchInput.dart index f2b784d3..f66b0a17 100644 --- a/Frontend/patient_manager/lib/components/mySearchInput.dart +++ b/Frontend/patient_manager/lib/components/mySearchInput.dart @@ -91,62 +91,59 @@ class _MySearchFieldState extends State { @override Widget build(BuildContext context) { - return Padding( - padding: const EdgeInsets.symmetric(horizontal: 25.0), - child: TextField( - style: TextStyle( - color: MzanziInnovationHub.of(context)!.theme.secondaryColor()), - onChanged: widget.onChanged, - controller: widget.controller, - //style: TextStyle(color: MzanziInnovationHub.of(context)!.theme.secondaryColor()), - readOnly: makeEditable(), - focusNode: _focus, - obscureText: false, - decoration: InputDecoration( - fillColor: MzanziInnovationHub.of(context)!.theme.primaryColor(), - prefixIcon: IconButton( - icon: Icon( - Icons.search, - color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), - ), - onPressed: () { - setState(() { - startup = false; - }); - if (widget.controller.text != "") { - widget.onTap(); - } - }, + return TextField( + style: TextStyle( + color: MzanziInnovationHub.of(context)!.theme.secondaryColor()), + onChanged: widget.onChanged, + controller: widget.controller, + //style: TextStyle(color: MzanziInnovationHub.of(context)!.theme.secondaryColor()), + readOnly: makeEditable(), + focusNode: _focus, + obscureText: false, + decoration: InputDecoration( + fillColor: MzanziInnovationHub.of(context)!.theme.primaryColor(), + prefixIcon: IconButton( + icon: Icon( + Icons.search, + color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), ), - filled: true, - label: setRequiredText(), - errorText: _errorText, - errorStyle: TextStyle( - color: MzanziInnovationHub.of(context)!.theme.errorColor(), - fontWeight: FontWeight.bold), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), - width: 2.0, - ), + onPressed: () { + setState(() { + startup = false; + }); + if (widget.controller.text != "") { + widget.onTap(); + } + }, + ), + filled: true, + label: setRequiredText(), + errorText: _errorText, + errorStyle: TextStyle( + color: MzanziInnovationHub.of(context)!.theme.errorColor(), + fontWeight: FontWeight.bold), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), + width: 2.0, ), - focusedErrorBorder: 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, - ), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: MzanziInnovationHub.of(context)!.theme.secondaryColor()), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: MzanziInnovationHub.of(context)!.theme.errorColor(), + width: 2.0, ), ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: MzanziInnovationHub.of(context)!.theme.secondaryColor()), + ), ), ); } diff --git a/Frontend/patient_manager/lib/components/myTextInput.dart b/Frontend/patient_manager/lib/components/myTextInput.dart index 3eb847e0..23bb0a36 100644 --- a/Frontend/patient_manager/lib/components/myTextInput.dart +++ b/Frontend/patient_manager/lib/components/myTextInput.dart @@ -85,60 +85,57 @@ class _MyTextFieldState extends State { @override Widget build(BuildContext context) { - return Padding( - padding: const EdgeInsets.symmetric(horizontal: 25.0), - child: TextField( - style: TextStyle( - color: MzanziInnovationHub.of(context)!.theme.secondaryColor()), - controller: widget.controller, - focusNode: _focus, - readOnly: makeEditable(), - enabled: !makeEditable(), - obscureText: false, - onChanged: (_) => setState(() { - startup = false; - }), - decoration: InputDecoration( - label: setRequiredText(), - //labelStyle: TextStyle(color: MzanziInnovationHub.of(context)!.theme.primaryColor()), - fillColor: MzanziInnovationHub.of(context)!.theme.primaryColor(), - filled: true, - errorText: _errorText, - errorStyle: TextStyle( - color: MzanziInnovationHub.of(context)!.theme.errorColor(), - fontWeight: FontWeight.bold), - //errorBorder: const InputBorder(), - //hintText: hintText, - //hintStyle: TextStyle(color: Colors.blueGrey[400]), - disabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), - width: 2.0, - ), + return TextField( + style: TextStyle( + color: MzanziInnovationHub.of(context)!.theme.secondaryColor()), + controller: widget.controller, + focusNode: _focus, + readOnly: makeEditable(), + enabled: !makeEditable(), + obscureText: false, + onChanged: (_) => setState(() { + startup = false; + }), + decoration: InputDecoration( + label: setRequiredText(), + //labelStyle: TextStyle(color: MzanziInnovationHub.of(context)!.theme.primaryColor()), + fillColor: MzanziInnovationHub.of(context)!.theme.primaryColor(), + filled: true, + errorText: _errorText, + errorStyle: TextStyle( + color: MzanziInnovationHub.of(context)!.theme.errorColor(), + fontWeight: FontWeight.bold), + //errorBorder: const InputBorder(), + //hintText: hintText, + //hintStyle: TextStyle(color: Colors.blueGrey[400]), + disabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), + width: 2.0, ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), - width: 2.0, - ), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), + width: 2.0, ), - focusedErrorBorder: 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, - ), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: MzanziInnovationHub.of(context)!.theme.secondaryColor()), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: MzanziInnovationHub.of(context)!.theme.errorColor(), + width: 2.0, ), ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: MzanziInnovationHub.of(context)!.theme.secondaryColor()), + ), ), ); }