forked from yaso_meth/mih-project
Merge pull request #74 from yaso-meth/BUG-Loyalty-Card-Dropdown-click-fix
BUG-Loyalty-Card-Dropdown-click-fix
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/scheduler.dart';
|
||||
import '../mih_env/env.dart';
|
||||
import '../mih_router/routeGenerator.dart';
|
||||
import '../mih_theme/mih_theme.dart';
|
||||
@@ -53,8 +52,8 @@ class _MzanziInnovationHubState extends State<MzanziInnovationHub> {
|
||||
@override
|
||||
void initState() {
|
||||
theme = MihTheme();
|
||||
var systemTheme =
|
||||
SchedulerBinding.instance.platformDispatcher.platformBrightness;
|
||||
// var systemTheme =
|
||||
// SchedulerBinding.instance.platformDispatcher.platformBrightness;
|
||||
// bool isDarkMode = systemTheme == Brightness.dark;
|
||||
// if (isDarkMode) {
|
||||
// theme.mode = "Dark";
|
||||
|
||||
@@ -8,6 +8,7 @@ class MIHDropdownField extends StatefulWidget {
|
||||
final List<String> dropdownOptions;
|
||||
// final void Function(String?)? onSelect;
|
||||
final bool editable;
|
||||
final bool enableSearch;
|
||||
|
||||
const MIHDropdownField({
|
||||
super.key,
|
||||
@@ -16,6 +17,7 @@ class MIHDropdownField extends StatefulWidget {
|
||||
required this.dropdownOptions,
|
||||
required this.required,
|
||||
required this.editable,
|
||||
required this.enableSearch,
|
||||
// this.onSelect,
|
||||
});
|
||||
|
||||
@@ -99,6 +101,7 @@ class _MIHDropdownFieldState extends State<MIHDropdownField> {
|
||||
void initState() {
|
||||
menu = buidMenueOptions(widget.dropdownOptions);
|
||||
_focus.addListener(_onFocusChange);
|
||||
_focus.canRequestFocus = widget.enableSearch;
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@@ -106,6 +109,9 @@ class _MIHDropdownFieldState extends State<MIHDropdownField> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return DropdownMenu(
|
||||
enableSearch: widget.enableSearch,
|
||||
enableFilter: widget.enableSearch,
|
||||
// requestFocusOnTap: true,
|
||||
initialSelection: widget.controller.text,
|
||||
enabled: widget.editable,
|
||||
trailingIcon: Icon(
|
||||
|
||||
@@ -149,6 +149,7 @@ class _PatientAccessRequestState extends State<PatientAccessRequest> {
|
||||
],
|
||||
required: true,
|
||||
editable: true,
|
||||
enableSearch: false,
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
|
||||
@@ -138,6 +138,7 @@ class _PatientAccessRequestState extends State<Appointments> {
|
||||
dropdownOptions: const ["All", "Approved", "Pending", "Declined"],
|
||||
required: true,
|
||||
editable: true,
|
||||
enableSearch: false,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
|
||||
@@ -296,6 +296,7 @@ class _TipCalcState extends State<TipCalc> {
|
||||
dropdownOptions: const ["Yes", "No"],
|
||||
required: true,
|
||||
editable: true,
|
||||
enableSearch: false,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
ValueListenableBuilder(
|
||||
|
||||
@@ -189,6 +189,7 @@ class _BuildEmployeeListState extends State<BuildEmployeeList> {
|
||||
dropdownOptions: const ["Doctor", "Assistant"],
|
||||
required: true,
|
||||
editable: true,
|
||||
enableSearch: false,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHDropdownField(
|
||||
@@ -197,6 +198,7 @@ class _BuildEmployeeListState extends State<BuildEmployeeList> {
|
||||
dropdownOptions: const ["Full", "Partial"],
|
||||
required: true,
|
||||
editable: true,
|
||||
enableSearch: false,
|
||||
),
|
||||
const SizedBox(height: 15.0),
|
||||
SizedBox(
|
||||
|
||||
@@ -150,6 +150,7 @@ class _BuildUserListState extends State<BuildUserList> {
|
||||
dropdownOptions: const ["Doctor", "Assistant"],
|
||||
required: true,
|
||||
editable: true,
|
||||
enableSearch: false,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHDropdownField(
|
||||
@@ -158,6 +159,7 @@ class _BuildUserListState extends State<BuildUserList> {
|
||||
dropdownOptions: const ["Full", "Partial"],
|
||||
required: true,
|
||||
editable: true,
|
||||
enableSearch: false,
|
||||
),
|
||||
const SizedBox(height: 15.0),
|
||||
SizedBox(
|
||||
|
||||
@@ -369,6 +369,7 @@ class _BusinessAboutState extends State<BusinessAbout> {
|
||||
dropdownOptions: const ["Doctors Office", "Other"],
|
||||
required: true,
|
||||
editable: true,
|
||||
enableSearch: false,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHTextField(
|
||||
@@ -431,6 +432,7 @@ class _BusinessAboutState extends State<BusinessAbout> {
|
||||
dropdownOptions: const ["Doctor", "Assistant"],
|
||||
required: true,
|
||||
editable: true,
|
||||
enableSearch: false,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHTextField(
|
||||
@@ -475,6 +477,7 @@ class _BusinessAboutState extends State<BusinessAbout> {
|
||||
dropdownOptions: const ["Full", "Partial"],
|
||||
required: true,
|
||||
editable: false,
|
||||
enableSearch: false,
|
||||
),
|
||||
// const SizedBox(height: 15.0),
|
||||
// const Text(
|
||||
|
||||
@@ -364,6 +364,7 @@ class _BusinessDetailsState extends State<BusinessDetails> {
|
||||
dropdownOptions: const ["Doctors Office", "Other"],
|
||||
required: true,
|
||||
editable: true,
|
||||
enableSearch: false,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
ValueListenableBuilder(
|
||||
@@ -488,6 +489,7 @@ class _BusinessDetailsState extends State<BusinessDetails> {
|
||||
dropdownOptions: const ["Doctor", "Assistant"],
|
||||
required: true,
|
||||
editable: true,
|
||||
enableSearch: false,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHTextField(
|
||||
@@ -532,6 +534,7 @@ class _BusinessDetailsState extends State<BusinessDetails> {
|
||||
dropdownOptions: const ["Full", "Partial"],
|
||||
required: true,
|
||||
editable: false,
|
||||
enableSearch: false,
|
||||
),
|
||||
// const SizedBox(height: 15.0),
|
||||
// const Text(
|
||||
|
||||
@@ -293,6 +293,7 @@ class _ProfileBusinessAddState extends State<ProfileBusinessAdd> {
|
||||
dropdownOptions: const ["Doctors Office", "Other"],
|
||||
required: true,
|
||||
editable: true,
|
||||
enableSearch: false,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
ValueListenableBuilder(
|
||||
@@ -416,6 +417,7 @@ class _ProfileBusinessAddState extends State<ProfileBusinessAdd> {
|
||||
dropdownOptions: const ["Doctor", "Assistant"],
|
||||
required: true,
|
||||
editable: true,
|
||||
enableSearch: false,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHTextField(
|
||||
@@ -460,6 +462,7 @@ class _ProfileBusinessAddState extends State<ProfileBusinessAdd> {
|
||||
dropdownOptions: const ["Full", "Partial"],
|
||||
required: true,
|
||||
editable: false,
|
||||
enableSearch: false,
|
||||
),
|
||||
const SizedBox(height: 30.0),
|
||||
SizedBox(
|
||||
|
||||
@@ -336,6 +336,7 @@ class _AiChatState extends State<AiChat> {
|
||||
],
|
||||
required: true,
|
||||
editable: true,
|
||||
enableSearch: false,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -132,6 +132,7 @@ class _LoyaltyCardsState extends State<LoyaltyCards> {
|
||||
],
|
||||
required: true,
|
||||
editable: true,
|
||||
enableSearch: false,
|
||||
),
|
||||
ValueListenableBuilder(
|
||||
valueListenable: shopName,
|
||||
|
||||
@@ -83,6 +83,7 @@ class _ClaimStatementWindowState extends State<ClaimStatementWindow> {
|
||||
dropdownOptions: const ["Claim", "Statement"],
|
||||
required: true,
|
||||
editable: true,
|
||||
enableSearch: false,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
// Text(
|
||||
@@ -216,6 +217,7 @@ class _ClaimStatementWindowState extends State<ClaimStatementWindow> {
|
||||
],
|
||||
required: true,
|
||||
editable: true,
|
||||
enableSearch: false,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
ValueListenableBuilder(
|
||||
@@ -237,6 +239,7 @@ class _ClaimStatementWindowState extends State<ClaimStatementWindow> {
|
||||
],
|
||||
required: true,
|
||||
editable: true,
|
||||
enableSearch: false,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
],
|
||||
|
||||
@@ -229,6 +229,7 @@ class _AddPatientState extends State<AddPatient> {
|
||||
controller: medAidController,
|
||||
hintText: "Medical Aid",
|
||||
editable: true,
|
||||
enableSearch: false,
|
||||
// onSelect: (_) {
|
||||
// isRequired();
|
||||
// },
|
||||
@@ -248,6 +249,7 @@ class _AddPatientState extends State<AddPatient> {
|
||||
hintText: "Main Member",
|
||||
editable: value,
|
||||
required: value,
|
||||
enableSearch: false,
|
||||
dropdownOptions: const ["Yes", "No"],
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
|
||||
@@ -468,6 +468,7 @@ class _EditPatientState extends State<EditPatient> {
|
||||
// },
|
||||
editable: true,
|
||||
required: true,
|
||||
enableSearch: false,
|
||||
dropdownOptions: const ["Yes", "No"],
|
||||
),
|
||||
ValueListenableBuilder(
|
||||
@@ -483,6 +484,7 @@ class _EditPatientState extends State<EditPatient> {
|
||||
hintText: "Main Member.",
|
||||
editable: value,
|
||||
required: value,
|
||||
enableSearch: false,
|
||||
dropdownOptions: const ["Yes", "No"],
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
|
||||
@@ -384,6 +384,7 @@ class _PrescripInputState extends State<PrescripInput> {
|
||||
dropdownOptions: numberOptions,
|
||||
required: true,
|
||||
editable: true,
|
||||
enableSearch: false,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHDropdownField(
|
||||
@@ -392,6 +393,7 @@ class _PrescripInputState extends State<PrescripInput> {
|
||||
dropdownOptions: numberOptions,
|
||||
required: true,
|
||||
editable: true,
|
||||
enableSearch: false,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHDropdownField(
|
||||
@@ -400,6 +402,7 @@ class _PrescripInputState extends State<PrescripInput> {
|
||||
dropdownOptions: numberOptions,
|
||||
required: true,
|
||||
editable: true,
|
||||
enableSearch: false,
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHDropdownField(
|
||||
@@ -408,6 +411,7 @@ class _PrescripInputState extends State<PrescripInput> {
|
||||
dropdownOptions: numberOptions,
|
||||
required: true,
|
||||
editable: true,
|
||||
enableSearch: false,
|
||||
),
|
||||
const SizedBox(height: 15.0),
|
||||
SizedBox(
|
||||
|
||||
Reference in New Issue
Block a user