update legacy
This commit is contained in:
@@ -3,7 +3,9 @@ import 'dart:convert';
|
|||||||
// import 'dart:convert';
|
// import 'dart:convert';
|
||||||
|
|
||||||
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
|
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
|
||||||
|
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_icons.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart';
|
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart';
|
||||||
|
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_search_bar.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_objects/patients.dart';
|
import 'package:mzansi_innovation_hub/mih_objects/patients.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
@@ -15,7 +17,6 @@ import 'package:supertokens_flutter/http.dart' as http;
|
|||||||
import "package:universal_html/html.dart" as html;
|
import "package:universal_html/html.dart" as html;
|
||||||
|
|
||||||
import '../../mih_apis/mih_location_api.dart';
|
import '../../mih_apis/mih_location_api.dart';
|
||||||
import '../../mih_components/mih_inputs_and_buttons/mih_search_input.dart';
|
|
||||||
import '../../mih_components/mih_layout/mih_action.dart';
|
import '../../mih_components/mih_layout/mih_action.dart';
|
||||||
import 'components/mih_app_drawer.dart';
|
import 'components/mih_app_drawer.dart';
|
||||||
import '../../mih_components/mih_layout/mih_body.dart';
|
import '../../mih_components/mih_layout/mih_body.dart';
|
||||||
@@ -1082,16 +1083,22 @@ class _MIHHomeLegacyState extends State<MIHHomeLegacy> {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
child: MIHSearchField(
|
child: MihSearchBar(
|
||||||
controller: searchController,
|
controller: searchController,
|
||||||
hintText: "Search Mzansi Packages",
|
hintText: "Ask Mzansi",
|
||||||
required: false,
|
prefixIcon: Icons.search,
|
||||||
editable: true,
|
prefixAltIcon: MihIcons.mzansiAi,
|
||||||
onTap: () {
|
fillColor:
|
||||||
|
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
|
hintColor:
|
||||||
|
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||||
|
onPrefixIconTap: () {
|
||||||
|
print("Search Text: ${searchController.text}");
|
||||||
setState(() {
|
setState(() {
|
||||||
appSearch = searchController.text;
|
appSearch = searchController.text;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
searchFocusNode: FocusNode(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -3,10 +3,9 @@ import 'dart:convert';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_swipe_detector/flutter_swipe_detector.dart';
|
import 'package:flutter_swipe_detector/flutter_swipe_detector.dart';
|
||||||
|
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_search_bar.dart';
|
||||||
import '../../../main.dart';
|
import '../../../main.dart';
|
||||||
import 'package:supertokens_flutter/http.dart' as http;
|
import 'package:supertokens_flutter/http.dart' as http;
|
||||||
|
|
||||||
import '../../../mih_components/mih_inputs_and_buttons/mih_search_input.dart';
|
|
||||||
import '../../../mih_components/mih_layout/mih_action.dart';
|
import '../../../mih_components/mih_layout/mih_action.dart';
|
||||||
import '../../../mih_components/mih_layout/mih_body.dart';
|
import '../../../mih_components/mih_layout/mih_body.dart';
|
||||||
import '../../../mih_components/mih_layout/mih_header.dart';
|
import '../../../mih_components/mih_layout/mih_header.dart';
|
||||||
@@ -35,6 +34,7 @@ class ManageBusinessProfile extends StatefulWidget {
|
|||||||
|
|
||||||
class _ManageBusinessProfileState extends State<ManageBusinessProfile> {
|
class _ManageBusinessProfileState extends State<ManageBusinessProfile> {
|
||||||
final FocusNode _focusNode = FocusNode();
|
final FocusNode _focusNode = FocusNode();
|
||||||
|
final FocusNode _searchFocusNode = FocusNode();
|
||||||
final baseAPI = AppEnviroment.baseApiUrl;
|
final baseAPI = AppEnviroment.baseApiUrl;
|
||||||
final TextEditingController searchController = TextEditingController();
|
final TextEditingController searchController = TextEditingController();
|
||||||
|
|
||||||
@@ -179,7 +179,7 @@ class _ManageBusinessProfileState extends State<ManageBusinessProfile> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget userSearchView() {
|
Widget userSearchView(double width) {
|
||||||
return KeyboardListener(
|
return KeyboardListener(
|
||||||
focusNode: _focusNode,
|
focusNode: _focusNode,
|
||||||
autofocus: true,
|
autofocus: true,
|
||||||
@@ -198,15 +198,21 @@ class _ManageBusinessProfileState extends State<ManageBusinessProfile> {
|
|||||||
Divider(color: MzanziInnovationHub.of(context)!.theme.secondaryColor()),
|
Divider(color: MzanziInnovationHub.of(context)!.theme.secondaryColor()),
|
||||||
|
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
MIHSearchField(
|
Padding(
|
||||||
controller: searchController,
|
padding: EdgeInsets.symmetric(horizontal: width / 20),
|
||||||
hintText: "Username or Email Search",
|
child: MihSearchBar(
|
||||||
required: true,
|
controller: searchController,
|
||||||
editable: true,
|
hintText: "Ask Mzansi",
|
||||||
onTap: () {
|
prefixIcon: Icons.search,
|
||||||
submitUserForm();
|
fillColor: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
},
|
hintColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||||
|
onPrefixIconTap: () {
|
||||||
|
print("Search Text: ${searchController.text}");
|
||||||
|
},
|
||||||
|
searchFocusNode: _searchFocusNode,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
//spacer
|
//spacer
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
FutureBuilder(
|
FutureBuilder(
|
||||||
@@ -274,7 +280,7 @@ class _ManageBusinessProfileState extends State<ManageBusinessProfile> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget showSelection(int selectionIndex) {
|
Widget showSelection(int selectionIndex, double width, [double? height]) {
|
||||||
// if (selectionIndex == 0) {
|
// if (selectionIndex == 0) {
|
||||||
// return BusinessDetails(arguments: widget.arguments);
|
// return BusinessDetails(arguments: widget.arguments);
|
||||||
// } else
|
// } else
|
||||||
@@ -283,7 +289,7 @@ class _ManageBusinessProfileState extends State<ManageBusinessProfile> {
|
|||||||
} else if (selectionIndex == 1) {
|
} else if (selectionIndex == 1) {
|
||||||
return employeesview();
|
return employeesview();
|
||||||
} else {
|
} else {
|
||||||
return userSearchView();
|
return userSearchView(width);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -412,11 +418,11 @@ class _ManageBusinessProfileState extends State<ManageBusinessProfile> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
MIHBody getBody() {
|
MIHBody getBody(double width) {
|
||||||
return MIHBody(
|
return MIHBody(
|
||||||
borderOn: true,
|
borderOn: true,
|
||||||
bodyItems: [
|
bodyItems: [
|
||||||
showSelection(selectionIndex),
|
showSelection(selectionIndex, width),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -425,6 +431,7 @@ class _ManageBusinessProfileState extends State<ManageBusinessProfile> {
|
|||||||
void dispose() {
|
void dispose() {
|
||||||
searchController.dispose();
|
searchController.dispose();
|
||||||
_focusNode.dispose();
|
_focusNode.dispose();
|
||||||
|
_searchFocusNode.dispose();
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -437,6 +444,8 @@ class _ManageBusinessProfileState extends State<ManageBusinessProfile> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
final Size size = MediaQuery.sizeOf(context);
|
||||||
|
final double width = size.width;
|
||||||
return SwipeDetector(
|
return SwipeDetector(
|
||||||
onSwipeLeft: (offset) {
|
onSwipeLeft: (offset) {
|
||||||
if (selectionIndex < 2) {
|
if (selectionIndex < 2) {
|
||||||
@@ -458,7 +467,7 @@ class _ManageBusinessProfileState extends State<ManageBusinessProfile> {
|
|||||||
actionButton: getActionButton(),
|
actionButton: getActionButton(),
|
||||||
secondaryActionButton: null,
|
secondaryActionButton: null,
|
||||||
header: getHeader(),
|
header: getHeader(),
|
||||||
body: getBody(),
|
body: getBody(width),
|
||||||
actionDrawer: null,
|
actionDrawer: null,
|
||||||
secondaryActionDrawer: null,
|
secondaryActionDrawer: null,
|
||||||
bottomNavBar: null,
|
bottomNavBar: null,
|
||||||
|
|||||||
Reference in New Issue
Block a user