mirror of
https://github.com/flutter/samples.git
synced 2025-11-08 13:58:47 +00:00
re-enable web samples, fix various issues (#156)
* update peanut.yaml, slide_puzzle pubspec * add data to web/ directory * define github_data as an asset * add preview image
This commit is contained in:
BIN
web/gallery/assets/preview.png
Normal file
BIN
web/gallery/assets/preview.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
@@ -182,7 +182,7 @@ class _MainLayoutState extends State<MainLayout> with TickerProviderStateMixin {
|
||||
|
||||
Future loadGitHubData() async {
|
||||
String contributorsJsonStr =
|
||||
(await http.get("github_data/contributors.json")).body;
|
||||
(await http.get("assets/github_data/contributors.json")).body;
|
||||
List jsonObjs = jsonDecode(contributorsJsonStr) as List;
|
||||
List<UserContribution> contributionList =
|
||||
jsonObjs.map((e) => UserContribution.fromJson(e)).toList();
|
||||
@@ -191,25 +191,25 @@ class _MainLayoutState extends State<MainLayout> with TickerProviderStateMixin {
|
||||
|
||||
int numWeeksTotal = contributionList[0].contributions.length;
|
||||
|
||||
String starsByWeekStr = (await http.get("github_data/stars.tsv")).body;
|
||||
String starsByWeekStr = (await http.get("assets/github_data/stars.tsv")).body;
|
||||
List<StatForWeek> starsByWeekLoaded =
|
||||
summarizeWeeksFromTSV(starsByWeekStr, numWeeksTotal);
|
||||
|
||||
String forksByWeekStr = (await http.get("github_data/forks.tsv")).body;
|
||||
String forksByWeekStr = (await http.get("assets/github_data/forks.tsv")).body;
|
||||
List<StatForWeek> forksByWeekLoaded =
|
||||
summarizeWeeksFromTSV(forksByWeekStr, numWeeksTotal);
|
||||
|
||||
String commitsByWeekStr = (await http.get("github_data/commits.tsv")).body;
|
||||
String commitsByWeekStr = (await http.get("assets/github_data/commits.tsv")).body;
|
||||
List<StatForWeek> commitsByWeekLoaded =
|
||||
summarizeWeeksFromTSV(commitsByWeekStr, numWeeksTotal);
|
||||
|
||||
String commentsByWeekStr =
|
||||
(await http.get("github_data/comments.tsv")).body;
|
||||
(await http.get("assets/github_data/comments.tsv")).body;
|
||||
List<StatForWeek> commentsByWeekLoaded =
|
||||
summarizeWeeksFromTSV(commentsByWeekStr, numWeeksTotal);
|
||||
|
||||
String pullRequestActivityByWeekStr =
|
||||
(await http.get("github_data/pull_requests.tsv")).body;
|
||||
(await http.get("assets/github_data/pull_requests.tsv")).body;
|
||||
List<StatForWeek> pullRequestActivityByWeekLoaded =
|
||||
summarizeWeeksFromTSV(pullRequestActivityByWeekStr, numWeeksTotal);
|
||||
|
||||
|
||||
@@ -11,3 +11,4 @@ dependencies:
|
||||
flutter:
|
||||
assets:
|
||||
- preview.png
|
||||
- github_data/
|
||||
|
||||
@@ -2,11 +2,10 @@
|
||||
|
||||
directories:
|
||||
- charts/web
|
||||
# package:http doesn't work yet: https://github.com/flutter/flutter/issues/34858
|
||||
#- dad_jokes/web
|
||||
#- filipino_cuisine/web
|
||||
- dad_jokes/web
|
||||
- filipino_cuisine/web
|
||||
- gallery/web
|
||||
#- github_dataviz/web
|
||||
- github_dataviz/web
|
||||
- particle_background/web
|
||||
- slide_puzzle/web
|
||||
- spinning_square/web
|
||||
|
||||
@@ -63,7 +63,7 @@ packages:
|
||||
name: crypto
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.2"
|
||||
version: "2.1.3"
|
||||
csslib:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
||||
Reference in New Issue
Block a user