forked from yaso_meth/mih-project
update home look and feel
This commit is contained in:
@@ -402,94 +402,119 @@ class _HomeTileGridState extends State<HomeTileGrid> {
|
||||
propicFile: widget.propicFile,
|
||||
),
|
||||
body: SafeArea(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
child: Stack(
|
||||
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),
|
||||
Row(
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: Builder(
|
||||
builder: (context) => IconButton(
|
||||
padding: const EdgeInsets.all(0),
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
appSearch = "";
|
||||
searchController.clear();
|
||||
});
|
||||
Scaffold.of(context).openDrawer();
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.apps,
|
||||
size: 50,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20.0),
|
||||
Text(
|
||||
"Mzanzi Innovation Hub",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 20.0,
|
||||
color: MzanziInnovationHub.of(context)!
|
||||
.theme
|
||||
.secondaryColor(),
|
||||
),
|
||||
),
|
||||
Flexible(
|
||||
flex: 4,
|
||||
child: KeyboardListener(
|
||||
focusNode: _focusNode,
|
||||
autofocus: true,
|
||||
onKeyEvent: (event) async {
|
||||
if (event is KeyDownEvent &&
|
||||
event.logicalKey == LogicalKeyboardKey.enter) {
|
||||
setState(() {
|
||||
appSearch = searchController.text;
|
||||
});
|
||||
}
|
||||
},
|
||||
child: SizedBox(
|
||||
child: MIHSearchField(
|
||||
controller: searchController,
|
||||
hintText: "Search Apps",
|
||||
required: false,
|
||||
editable: true,
|
||||
onTap: () {
|
||||
setState(() {
|
||||
appSearch = searchController.text;
|
||||
});
|
||||
const SizedBox(height: 20),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Flexible(
|
||||
flex: 4,
|
||||
child: KeyboardListener(
|
||||
focusNode: _focusNode,
|
||||
autofocus: true,
|
||||
onKeyEvent: (event) async {
|
||||
if (event is KeyDownEvent &&
|
||||
event.logicalKey == LogicalKeyboardKey.enter) {
|
||||
setState(() {
|
||||
appSearch = searchController.text;
|
||||
});
|
||||
}
|
||||
},
|
||||
child: SizedBox(
|
||||
child: MIHSearchField(
|
||||
controller: searchController,
|
||||
hintText: "Search Apps",
|
||||
required: false,
|
||||
editable: true,
|
||||
onTap: () {
|
||||
setState(() {
|
||||
appSearch = searchController.text;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: IconButton(
|
||||
//padding: const EdgeInsets.all(0),
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
appSearch = "";
|
||||
searchController.clear();
|
||||
});
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.filter_alt_off,
|
||||
size: 30,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Expanded(
|
||||
child: GridView.builder(
|
||||
padding: EdgeInsets.only(
|
||||
left: width / 10,
|
||||
right: width / 10,
|
||||
//bottom: height / 5,
|
||||
top: 20,
|
||||
),
|
||||
// physics: ,
|
||||
// shrinkWrap: true,
|
||||
itemCount:
|
||||
searchApp(pbswitch[_selectedIndex], appSearch).length,
|
||||
gridDelegate:
|
||||
const SliverGridDelegateWithMaxCrossAxisExtent(
|
||||
mainAxisSpacing: 15, maxCrossAxisExtent: 200),
|
||||
itemBuilder: (context, index) {
|
||||
return searchApp(
|
||||
pbswitch[_selectedIndex], appSearch)[index];
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Expanded(
|
||||
child: GridView.builder(
|
||||
padding: EdgeInsets.only(
|
||||
left: width / 10,
|
||||
right: width / 10,
|
||||
//bottom: height / 5,
|
||||
top: 20,
|
||||
Positioned(
|
||||
top: 10,
|
||||
left: 5,
|
||||
width: 50,
|
||||
height: 50,
|
||||
child: Builder(
|
||||
builder: (context) => IconButton(
|
||||
padding: const EdgeInsets.all(0),
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
appSearch = "";
|
||||
searchController.clear();
|
||||
});
|
||||
Scaffold.of(context).openDrawer();
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.apps,
|
||||
size: 50,
|
||||
),
|
||||
),
|
||||
// physics: ,
|
||||
// shrinkWrap: true,
|
||||
itemCount:
|
||||
searchApp(pbswitch[_selectedIndex], appSearch).length,
|
||||
gridDelegate: const SliverGridDelegateWithMaxCrossAxisExtent(
|
||||
mainAxisSpacing: 15, maxCrossAxisExtent: 200),
|
||||
itemBuilder: (context, index) {
|
||||
return searchApp(
|
||||
pbswitch[_selectedIndex], appSearch)[index];
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user