From 0fe216a1cfeffce812950cbc2c7b4fce3bc1ea9e Mon Sep 17 00:00:00 2001 From: Brett Morgan Date: Thu, 7 Oct 2021 05:44:45 +1100 Subject: [PATCH] Make the URL for the data JSON file absolute. (#902) * Make the URL for the data JSON file absolute. * dart format --- form_app/test/form_app_test.dart | 4 ++-- web/filipino_cuisine/lib/main.dart | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/form_app/test/form_app_test.dart b/form_app/test/form_app_test.dart index 9d6045222..78ce24cca 100644 --- a/form_app/test/form_app_test.dart +++ b/form_app/test/form_app_test.dart @@ -12,13 +12,13 @@ final http.Client httpClient = MockClient(); void main() { testWidgets('sign in', (tester) async { - await _signIn(tester, 'root','password'); + await _signIn(tester, 'root', 'password'); expect(find.text('Unable to sign in.'), findsNothing); expect(find.text('Successfully signed in.'), findsOneWidget); }); testWidgets('sign in with bad password', (tester) async { - await _signIn(tester, 'admin','pw'); + await _signIn(tester, 'admin', 'pw'); expect(find.byType(AlertDialog), findsOneWidget); expect(find.text('Unable to sign in.'), findsOneWidget); expect(find.text('Successfully signed in.'), findsNothing); diff --git a/web/filipino_cuisine/lib/main.dart b/web/filipino_cuisine/lib/main.dart index 4aeb93f05..4cb26058d 100644 --- a/web/filipino_cuisine/lib/main.dart +++ b/web/filipino_cuisine/lib/main.dart @@ -42,7 +42,8 @@ class HState extends State { } Future getData() async { - http.Response r = await http.get('/data.json'); + http.Response r = await http.get( + 'https://flutter.github.io/samples/web/filipino_cuisine/data.json'); fd = json.decode(r.body) as Map; setState(() => fi = fd['0'] as Map); }