update home look and feel

This commit is contained in:
2024-08-29 14:43:18 +02:00
parent 3d263e3083
commit 570e5a6ee5

View File

@@ -402,94 +402,119 @@ class _HomeTileGridState extends State<HomeTileGrid> {
propicFile: widget.propicFile, propicFile: widget.propicFile,
), ),
body: SafeArea( body: SafeArea(
child: Column( child: Stack(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
children: [ children: [
const SizedBox(height: 15.0), Column(
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(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: [ children: [
Flexible( const SizedBox(height: 20.0),
flex: 1, Text(
child: Builder( "Mzanzi Innovation Hub",
builder: (context) => IconButton( textAlign: TextAlign.center,
padding: const EdgeInsets.all(0), style: TextStyle(
onPressed: () { fontWeight: FontWeight.bold,
setState(() { fontSize: 20.0,
appSearch = ""; color: MzanziInnovationHub.of(context)!
searchController.clear(); .theme
}); .secondaryColor(),
Scaffold.of(context).openDrawer();
},
icon: const Icon(
Icons.apps,
size: 50,
),
),
), ),
), ),
Flexible( const SizedBox(height: 20),
flex: 4, Row(
child: KeyboardListener( mainAxisAlignment: MainAxisAlignment.center,
focusNode: _focusNode, mainAxisSize: MainAxisSize.max,
autofocus: true, children: [
onKeyEvent: (event) async { Flexible(
if (event is KeyDownEvent && flex: 4,
event.logicalKey == LogicalKeyboardKey.enter) { child: KeyboardListener(
setState(() { focusNode: _focusNode,
appSearch = searchController.text; autofocus: true,
}); onKeyEvent: (event) async {
} if (event is KeyDownEvent &&
}, event.logicalKey == LogicalKeyboardKey.enter) {
child: SizedBox( setState(() {
child: MIHSearchField( appSearch = searchController.text;
controller: searchController, });
hintText: "Search Apps", }
required: false,
editable: true,
onTap: () {
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), Positioned(
Expanded( top: 10,
child: GridView.builder( left: 5,
padding: EdgeInsets.only( width: 50,
left: width / 10, height: 50,
right: width / 10, child: Builder(
//bottom: height / 5, builder: (context) => IconButton(
top: 20, 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];
},
), ),
), ),
], ],