Merge pull request #2 from kphanipavan/master

Update test to master
This commit is contained in:
Phani Pavan Kambhampati
2024-11-14 09:19:37 +05:30
committed by GitHub
4 changed files with 25 additions and 6 deletions

View File

@@ -94,7 +94,7 @@ jobs:
# files: build/app/outputs/flutter-apk/app-arm64-v8a-release.apk # files: build/app/outputs/flutter-apk/app-arm64-v8a-release.apk
- name: Upload production-ready build files - name: Upload production-ready build files
uses: actions/upload-artifact@v3.1.2 uses: actions/upload-artifact@v4.4.3
with: with:
name: production-files name: production-files
path: ./build/web path: ./build/web
@@ -107,7 +107,7 @@ jobs:
steps: steps:
- name: Download artifact - name: Download artifact
uses: actions/download-artifact@v2.1.1 uses: actions/download-artifact@v4.1.8
with: with:
name: production-files name: production-files
path: ./build path: ./build

View File

@@ -22,3 +22,20 @@ const String dataLink =
"https://raw.githubusercontent.com/kphanipavan/IIITB_Menu/menu_scraper/out.json"; "https://raw.githubusercontent.com/kphanipavan/IIITB_Menu/menu_scraper/out.json";
enum DataStatus { Loaded, Loading, NotFound } enum DataStatus { Loaded, Loading, NotFound }
Widget newNoMenuWidget = Center(
child: Column(children: [
const Text("Menu not available for this session",
style: TextStyle(fontSize: 20, fontStyle: FontStyle.italic)),
RichText(
text: const TextSpan(
children: [
TextSpan(text: "Click "),
WidgetSpan(child: Icon(Icons.update_rounded)),
TextSpan(text: " to check for updates.")
],
style: TextStyle(fontSize: 20, fontStyle: FontStyle.italic),
),
)
], mainAxisAlignment: MainAxisAlignment.center),
);

View File

@@ -29,6 +29,8 @@ class GlobalModel extends ChangeNotifier {
} }
updateCall() async { updateCall() async {
this.menuAvailable = DataStatus.Loading;
notifyListeners();
this.mainData = await GlobalModel.updateLocal(); this.mainData = await GlobalModel.updateLocal();
if (this.mainData["dates"].keys.contains(this.date)) { if (this.mainData["dates"].keys.contains(this.date)) {
this.menuAvailable = DataStatus.Loaded; this.menuAvailable = DataStatus.Loaded;

View File

@@ -148,10 +148,10 @@ class HomePage extends StatelessWidget {
MenuListView(menuType: "dn"), MenuListView(menuType: "dn"),
] ]
: [ : [
noMenuWidget, newNoMenuWidget,
noMenuWidget, newNoMenuWidget,
noMenuWidget, newNoMenuWidget,
noMenuWidget, newNoMenuWidget,
]), ]),
); );
}); });