1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-08 13:58:47 +00:00

Upgrade deps, format, fix web/filipino_cuisine (#898)

fixes: https://github.com/flutter/samples/issues/897
This commit is contained in:
Brett Morgan
2021-09-22 04:38:59 +10:00
committed by GitHub
parent 7665752896
commit 297f6b0b96
75 changed files with 555 additions and 325 deletions

View File

@@ -18,7 +18,7 @@ Future<List<Sample>> getSamples() async {
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}');
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);

View File

@@ -4,10 +4,10 @@
import 'dart:io';
import 'package:samples_index/samples_index.dart';
import 'package:samples_index/browser.dart';
import 'package:test/test.dart';
import 'package:checked_yaml/checked_yaml.dart';
import 'package:samples_index/browser.dart';
import 'package:samples_index/samples_index.dart';
import 'package:test/test.dart';
void main() {
group('YAML', () {
@@ -16,10 +16,11 @@ void main() {
var contents = await file.readAsString();
expect(contents, isNotEmpty);
var index = checkedYamlDecode(contents, (m) => m != null ? Index.fromJson(m) : null,
var index = checkedYamlDecode(
contents, (m) => m != null ? Index.fromJson(m) : null,
sourceUrl: file.uri);
if (index == null) {
throw('unable to load YAML from $file');
throw ('unable to load YAML from $file');
}
expect(index.samples, isNotEmpty);
@@ -52,10 +53,11 @@ void main() {
var contents = await file.readAsString();
expect(contents, isNotEmpty);
var index = checkedYamlDecode(contents, (m) => m != null ? Index.fromJson(m) : null,
var index = checkedYamlDecode(
contents, (m) => m != null ? Index.fromJson(m) : null,
sourceUrl: file.uri);
if (index == null) {
throw('unable to load YAML from $file');
throw ('unable to load YAML from $file');
}
var sample = index.samples.first;
expect(