-
Notifications
You must be signed in to change notification settings - Fork 114
Switch from network images to asset images. #63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
f38b6f0
-
polina-c 3bcf4cb
Update images.dart
polina-c 9c3c4b9
-
polina-c e82aa34
Update images.dart
polina-c ad72815
-
polina-c 9626ddc
Update main.dart
polina-c ebfec99
Update images_test.dart
polina-c ae3f1c0
Update images_test.dart
polina-c 62ff740
Create catalog_test.dart
polina-c 8dc106e
-
polina-c af328ff
-
polina-c 6182caf
-
polina-c cd9ca10
Update main.dart
polina-c 9981351
-
polina-c b3f29b0
Merge branch 'main' into images
polina-c 41c0bab
Update main.dart
polina-c 22a34d0
Update catalog.dart
polina-c 88104bd
Merge branch 'main' of github.com:flutter/genui into images
polina-c 752e866
-
polina-c 39cbdeb
Merge branch 'main' of github.com:flutter/genui into images
polina-c ea6dc59
-
polina-c fcf6163
Update main.dart
polina-c 8dae5b7
Merge branch 'main' of github.com:flutter/genui into images
polina-c d84e9ae
Merge branch 'main' of github.com:flutter/genui into images
polina-c 04514d6
-
polina-c File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
4 changes: 0 additions & 4 deletions
4
examples/generic_chat/linux/flutter/generated_plugin_registrant.cc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 0 additions & 4 deletions
4
examples/generic_chat/linux/flutter/generated_plugin_registrant.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 0 additions & 4 deletions
4
examples/generic_chat/macos/Flutter/GeneratedPluginRegistrant.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 0 additions & 4 deletions
4
examples/generic_chat/windows/flutter/generated_plugin_registrant.cc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 0 additions & 4 deletions
4
examples/generic_chat/windows/flutter/generated_plugin_registrant.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| import 'package:flutter/services.dart'; | ||
| import 'package:flutter/widgets.dart'; | ||
|
|
||
| @visibleForTesting | ||
| const assetImageCatalogPath = 'assets/travel_images'; | ||
| @visibleForTesting | ||
| const assetImageCatalogJsonFile = '$assetImageCatalogPath/.images.json'; | ||
|
|
||
| Future<String> assetImageCatalogJson() async { | ||
| var result = await rootBundle.loadString(assetImageCatalogJsonFile); | ||
| result = result.replaceAll( | ||
| '"image_file_name": "', | ||
| '"image_file_name": "$assetImageCatalogPath/', | ||
| ); | ||
| return result; | ||
| } |
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
examples/travel_app/linux/flutter/generated_plugin_registrant.cc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 0 additions & 4 deletions
4
examples/travel_app/linux/flutter/generated_plugin_registrant.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 0 additions & 4 deletions
4
examples/travel_app/macos/Flutter/GeneratedPluginRegistrant.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| // ignore_for_file: avoid_dynamic_calls | ||
|
|
||
| import 'dart:convert'; | ||
| import 'dart:io'; | ||
|
|
||
| import 'package:flutter_test/flutter_test.dart'; | ||
| import 'package:travel_app/src/asset_images.dart'; | ||
|
|
||
| void main() { | ||
| test( | ||
| 'images.json should contain all images from assets/travel_images', | ||
| () async { | ||
| TestWidgetsFlutterBinding.ensureInitialized(); | ||
|
|
||
| final imageAssets = await assetImageCatalogJson(); | ||
| final imageList = (jsonDecode(imageAssets) as List) | ||
| .map((e) => e['image_file_name'] as String) | ||
| .toList(); | ||
|
|
||
| final imageDir = Directory(assetImageCatalogPath); | ||
| final imageFiles = imageDir | ||
| .listSync() | ||
| .where((file) => file.path != assetImageCatalogJsonFile) | ||
| .map((file) => file.path) | ||
| .toList(); | ||
|
|
||
| expect(imageList, unorderedEquals(imageFiles)); | ||
| }, | ||
| ); | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.