Added date pretty print

This commit is contained in:
2024-11-14 09:37:23 +05:30
parent c0ca9542c3
commit e52db038f4
2 changed files with 26 additions and 13 deletions

View File

@@ -157,6 +157,10 @@ class GlobalModel extends ChangeNotifier {
return DateFormat("dd-MM-yyyy").format(this.currentDate); return DateFormat("dd-MM-yyyy").format(this.currentDate);
} }
String get prettyDate {
return DateFormat("EEE, MMM d").format(this.currentDate);
}
void incrDate() { void incrDate() {
this.currentDate = this.currentDate.add(const Duration(days: 1)); this.currentDate = this.currentDate.add(const Duration(days: 1));
this.isMenuAvailable(); this.isMenuAvailable();

View File

@@ -30,8 +30,8 @@ class HomePage extends StatelessWidget {
child: ListView( child: ListView(
children: [ children: [
ListTile( ListTile(
leading: Icon(Icons.arrow_back), leading: const Icon(Icons.arrow_back),
title: Text("Menu"), title: const Text("Menu"),
onTap: () { onTap: () {
Navigator.pop(context); Navigator.pop(context);
}), }),
@@ -69,7 +69,7 @@ class HomePage extends StatelessWidget {
title: Text(data.menuTime), title: Text(data.menuTime),
bottom: TabBar( bottom: TabBar(
controller: cont, controller: cont,
// splashFactory: InkSplash.splashFactory, splashFactory: NoSplash.splashFactory,
// indicator: const UnderlineTabIndicator( // indicator: const UnderlineTabIndicator(
// insets: EdgeInsets.fromLTRB(10, 3, 10, 3)), // insets: EdgeInsets.fromLTRB(10, 3, 10, 3)),
onTap: (int index) { onTap: (int index) {
@@ -87,9 +87,14 @@ class HomePage extends StatelessWidget {
onTap: () { onTap: () {
data.updateCall(); data.updateCall();
}, },
child: Icon(data.menuAvailable == DataStatus.Loading child: Padding(
? Icons.downloading_rounded padding: const EdgeInsets.symmetric(horizontal: 10.0),
: Icons.update_rounded), child: Center(
child: Icon(data.menuAvailable == DataStatus.Loading
? Icons.downloading_rounded
: Icons.update_rounded),
),
),
), ),
InkWell( InkWell(
splashFactory: NoSplash.splashFactory, splashFactory: NoSplash.splashFactory,
@@ -98,9 +103,11 @@ class HomePage extends StatelessWidget {
}, },
child: const Padding( child: const Padding(
padding: EdgeInsets.symmetric(horizontal: 10), padding: EdgeInsets.symmetric(horizontal: 10),
child: Icon( child: Center(
Icons.keyboard_arrow_left_rounded, child: Icon(
size: 30, Icons.keyboard_arrow_left_rounded,
size: 30,
),
), ),
)), )),
InkWell( InkWell(
@@ -121,7 +128,7 @@ class HomePage extends StatelessWidget {
data.setDateToADay(); data.setDateToADay();
}, },
child: Center( child: Center(
child: Text(data.date), child: Text(data.prettyDate),
), ),
), ),
InkWell( InkWell(
@@ -131,9 +138,11 @@ class HomePage extends StatelessWidget {
}, },
child: const Padding( child: const Padding(
padding: EdgeInsets.symmetric(horizontal: 10), padding: EdgeInsets.symmetric(horizontal: 10),
child: Icon( child: Center(
Icons.keyboard_arrow_right_rounded, child: Icon(
size: 30, Icons.keyboard_arrow_right_rounded,
size: 30,
),
), ),
)), )),
], ],