mirror of
https://github.com/flutter/samples.git
synced 2025-11-11 15:28:44 +00:00
Simplify samples index and remove cookbook recipes (#2102)
Remove the cookbook recipes from the samples index in a step to eventually remove it as a whole. The cookbook recipe listings in the index haven't been updated in a long time, the support for updating them doesn't work, and this isn't generally how people are finding cookbook recipes. This has the added benefit of reducing repo size quite a bit due to the large images.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -36,11 +36,10 @@ class Sample {
|
||||
/// The author of the sample. Typically "Flutter"
|
||||
final String? author;
|
||||
|
||||
/// Screenshots of the sample or cookbook article. At least 1 screenshot is
|
||||
/// required.
|
||||
/// Screenshots of the sample. At least 1 screenshot is required.
|
||||
final List<Screenshot> screenshots;
|
||||
|
||||
/// A link to the source code or cookbook article if type is 'cookbook'.
|
||||
/// A link to the source code.
|
||||
final String source;
|
||||
|
||||
/// A link to this sample running in the browser.
|
||||
@@ -69,7 +68,7 @@ class Sample {
|
||||
final List<String> platforms;
|
||||
|
||||
/// The type of the sample. Supported values are either 'sample' or
|
||||
/// 'cookbook'.
|
||||
/// 'demo'.
|
||||
final String type;
|
||||
|
||||
/// The date this sample was created.
|
||||
|
||||
@@ -110,12 +110,6 @@ String _indexBody(List<Sample> samples) => '''
|
||||
<span role="button" tabindex="-1" class="mdc-chip__text">Sample</span>
|
||||
</span>
|
||||
</div>
|
||||
<div class="mdc-chip" role="row">
|
||||
<div class="mdc-chip__ripple"></div>
|
||||
<span role="gridcell">
|
||||
<span role="button" tabindex="-1" class="mdc-chip__text">Cookbook</span>
|
||||
</span>
|
||||
</div>
|
||||
<div class="mdc-chip" role="row">
|
||||
<div class="mdc-chip__ripple"></div>
|
||||
<span role="gridcell">
|
||||
@@ -205,11 +199,6 @@ String _descriptionButtons(Sample sample) {
|
||||
<span class="mdc-button__label">Source Code</span>
|
||||
</button>''');
|
||||
}
|
||||
|
||||
if (sample.type == 'cookbook') {
|
||||
buf.write(
|
||||
'''<button class="mdc-button mdc-button--outlined" onclick="window.location.href = '${sample.source}';"> <span class="mdc-button__ripple"></span>View Recipe</button>''');
|
||||
}
|
||||
return buf.toString();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user