1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-08 22:09:06 +00:00

Fix sample index deployment action (#862)

* Update sample index dependencies

* Update to tuneup 0.3.8, update dependencies

* Upgrade to null safety, lock sass version

* fix analyzer warnings

* Fix unit tests

* Fix issues from upgrading to null safety
This commit is contained in:
John Ryan
2021-08-02 15:41:18 -07:00
committed by GitHub
parent 699cc3a8c5
commit 7de8fafcee
17 changed files with 153 additions and 102 deletions

View File

@@ -15,8 +15,10 @@ Future<List<Sample>> getSamples() async {
var cookbookFile = File('lib/src/cookbook.json');
var contents = await yamlFile.readAsString();
var cookbookContents = await cookbookFile.readAsString();
var index = checkedYamlDecode(contents, (m) => Index.fromJson(m),
var index = checkedYamlDecode(
contents, (m) => m != null ? Index.fromJson(m) : null,
sourceUrl: yamlFile.uri);
if (index == null) throw('unable to get load from ${yamlFile.uri}');
var cookbookIndex =
Index.fromJson(json.decode(cookbookContents) as Map<dynamic, dynamic>);
return index.samples..addAll(cookbookIndex.samples);