update Mzansi Profile Tile to pass profile update argument
This commit is contained in:
@@ -3,7 +3,6 @@ import 'package:flutter/services.dart';
|
|||||||
import 'package:google_nav_bar/google_nav_bar.dart';
|
import 'package:google_nav_bar/google_nav_bar.dart';
|
||||||
import 'package:patient_manager/components/homeTile.dart';
|
import 'package:patient_manager/components/homeTile.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihSearchInput.dart';
|
import 'package:patient_manager/components/inputsAndButtons/mihSearchInput.dart';
|
||||||
import 'package:patient_manager/components/mihAppBar.dart';
|
|
||||||
import 'package:patient_manager/components/mihAppDrawer.dart';
|
import 'package:patient_manager/components/mihAppDrawer.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihDeleteMessage.dart';
|
import 'package:patient_manager/components/popUpMessages/mihDeleteMessage.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihLoadingCircle.dart';
|
import 'package:patient_manager/components/popUpMessages/mihLoadingCircle.dart';
|
||||||
@@ -49,8 +48,9 @@ class _HomeTileGridState extends State<HomeTileGrid> {
|
|||||||
if (widget.signedInUser.fname == "") {
|
if (widget.signedInUser.fname == "") {
|
||||||
tileList.add(HomeTile(
|
tileList.add(HomeTile(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.of(context)
|
Navigator.of(context).pushNamed('/user-profile',
|
||||||
.pushNamed('/user-profile', arguments: widget.signedInUser);
|
arguments: AppProfileUpdateArguments(
|
||||||
|
widget.signedInUser, widget.propicFile));
|
||||||
},
|
},
|
||||||
tileName: "Setup Profie",
|
tileName: "Setup Profie",
|
||||||
tileIcon: Icon(
|
tileIcon: Icon(
|
||||||
@@ -87,8 +87,11 @@ class _HomeTileGridState extends State<HomeTileGrid> {
|
|||||||
ImageProvider logo = MzanziInnovationHub.of(context)!.theme.logoImage();
|
ImageProvider logo = MzanziInnovationHub.of(context)!.theme.logoImage();
|
||||||
tileList.add(HomeTile(
|
tileList.add(HomeTile(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.of(context)
|
Navigator.of(context).pushNamed(
|
||||||
.pushNamed('/user-profile', arguments: widget.signedInUser);
|
'/user-profile',
|
||||||
|
arguments:
|
||||||
|
AppProfileUpdateArguments(widget.signedInUser, widget.propicFile),
|
||||||
|
);
|
||||||
},
|
},
|
||||||
tileName: "Mzansi Profie",
|
tileName: "Mzansi Profie",
|
||||||
tileIcon: Image(image: logo),
|
tileIcon: Image(image: logo),
|
||||||
@@ -225,22 +228,7 @@ class _HomeTileGridState extends State<HomeTileGrid> {
|
|||||||
p: getPrim(),
|
p: getPrim(),
|
||||||
s: getSec(),
|
s: getSec(),
|
||||||
));
|
));
|
||||||
tileList.add(HomeTile(
|
|
||||||
onTap: () {
|
|
||||||
Navigator.of(context).pushNamed(
|
|
||||||
'/user-profile',
|
|
||||||
arguments: widget.signedInUser,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
tileName: "Upd Prof - Dev",
|
|
||||||
tileIcon: Icon(
|
|
||||||
Icons.perm_identity,
|
|
||||||
color: getSec(),
|
|
||||||
size: 200,
|
|
||||||
),
|
|
||||||
p: getPrim(),
|
|
||||||
s: getSec(),
|
|
||||||
));
|
|
||||||
tileList.add(HomeTile(
|
tileList.add(HomeTile(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
showDialog(
|
showDialog(
|
||||||
@@ -378,6 +366,11 @@ class _HomeTileGridState extends State<HomeTileGrid> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void onDragStart(DragStartDetails startDrag) {
|
||||||
|
Scaffold.of(context).openDrawer();
|
||||||
|
print(startDrag.globalPosition.dx);
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
searchController.dispose();
|
searchController.dispose();
|
||||||
@@ -403,36 +396,54 @@ class _HomeTileGridState extends State<HomeTileGrid> {
|
|||||||
return PopScope(
|
return PopScope(
|
||||||
canPop: false,
|
canPop: false,
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
appBar: MIHAppBar(
|
drawerEnableOpenDragGesture: true,
|
||||||
barTitle: "Mzansi Innovation\nHub",
|
|
||||||
propicFile: widget.propicFile,
|
|
||||||
),
|
|
||||||
drawer: MIHAppDrawer(
|
drawer: MIHAppDrawer(
|
||||||
signedInUser: widget.signedInUser,
|
signedInUser: widget.signedInUser,
|
||||||
|
propicFile: widget.propicFile,
|
||||||
),
|
),
|
||||||
body: SafeArea(
|
body: SafeArea(
|
||||||
child: Column(
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
children: [
|
children: [
|
||||||
|
const SizedBox(height: 15.0),
|
||||||
|
Text(
|
||||||
|
"Mzanzi Innovation Hub",
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 25.0,
|
||||||
|
color:
|
||||||
|
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
|
),
|
||||||
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
Padding(
|
Row(
|
||||||
padding: EdgeInsets.symmetric(horizontal: width / 10),
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
child: Row(
|
mainAxisSize: MainAxisSize.max,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
children: [
|
||||||
mainAxisSize: MainAxisSize.min,
|
Flexible(
|
||||||
children: [
|
flex: 1,
|
||||||
IconButton(
|
child: Builder(
|
||||||
onPressed: () {
|
builder: (context) => IconButton(
|
||||||
setState(() {
|
padding: const EdgeInsets.all(0),
|
||||||
appSearch = "";
|
onPressed: () {
|
||||||
searchController.clear();
|
setState(() {
|
||||||
});
|
appSearch = "";
|
||||||
},
|
searchController.clear();
|
||||||
icon: const Icon(
|
});
|
||||||
Icons.apps,
|
Scaffold.of(context).openDrawer();
|
||||||
size: 50,
|
},
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.apps,
|
||||||
|
size: 50,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
KeyboardListener(
|
),
|
||||||
|
Flexible(
|
||||||
|
flex: 4,
|
||||||
|
child: KeyboardListener(
|
||||||
focusNode: _focusNode,
|
focusNode: _focusNode,
|
||||||
autofocus: true,
|
autofocus: true,
|
||||||
onKeyEvent: (event) async {
|
onKeyEvent: (event) async {
|
||||||
@@ -444,7 +455,6 @@ class _HomeTileGridState extends State<HomeTileGrid> {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
width: width - ((width / 10) * 2) - 70,
|
|
||||||
child: MIHSearchField(
|
child: MIHSearchField(
|
||||||
controller: searchController,
|
controller: searchController,
|
||||||
hintText: "Search Apps",
|
hintText: "Search Apps",
|
||||||
@@ -458,9 +468,10 @@ class _HomeTileGridState extends State<HomeTileGrid> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
],
|
||||||
),
|
),
|
||||||
|
const SizedBox(height: 10),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: GridView.builder(
|
child: GridView.builder(
|
||||||
padding: EdgeInsets.only(
|
padding: EdgeInsets.only(
|
||||||
@@ -474,7 +485,7 @@ class _HomeTileGridState extends State<HomeTileGrid> {
|
|||||||
itemCount:
|
itemCount:
|
||||||
searchApp(pbswitch[_selectedIndex], appSearch).length,
|
searchApp(pbswitch[_selectedIndex], appSearch).length,
|
||||||
gridDelegate: const SliverGridDelegateWithMaxCrossAxisExtent(
|
gridDelegate: const SliverGridDelegateWithMaxCrossAxisExtent(
|
||||||
mainAxisSpacing: 10, maxCrossAxisExtent: 200),
|
mainAxisSpacing: 15, maxCrossAxisExtent: 200),
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
return searchApp(
|
return searchApp(
|
||||||
pbswitch[_selectedIndex], appSearch)[index];
|
pbswitch[_selectedIndex], appSearch)[index];
|
||||||
|
|||||||
Reference in New Issue
Block a user