mirror of https://github.com/flutter/samples.git
deploy: 3f5ab56485
parent
4e726a75ad
commit
39609b88ed
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 46 KiB |
Before Width: | Height: | Size: 54 KiB |
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,61 @@
|
|||||||
|
# Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
|
||||||
|
# for details. All rights reserved. Use of this source code is governed by a
|
||||||
|
# BSD-style license that can be found in the LICENSE file.
|
||||||
|
#
|
||||||
|
# Google internally enforced rules. See README.md for more information,
|
||||||
|
# including a list of lints that are intentionally _not_ enforced.
|
||||||
|
|
||||||
|
linter:
|
||||||
|
rules:
|
||||||
|
- always_declare_return_types
|
||||||
|
- always_require_non_null_named_parameters
|
||||||
|
- annotate_overrides
|
||||||
|
- avoid_init_to_null
|
||||||
|
- avoid_null_checks_in_equality_operators
|
||||||
|
- avoid_relative_lib_imports
|
||||||
|
- avoid_return_types_on_setters
|
||||||
|
- avoid_shadowing_type_parameters
|
||||||
|
- avoid_single_cascade_in_expression_statements
|
||||||
|
- avoid_types_as_parameter_names
|
||||||
|
- await_only_futures
|
||||||
|
- camel_case_extensions
|
||||||
|
- curly_braces_in_flow_control_structures
|
||||||
|
- empty_catches
|
||||||
|
- empty_constructor_bodies
|
||||||
|
- library_names
|
||||||
|
- library_prefixes
|
||||||
|
- no_duplicate_case_values
|
||||||
|
- null_closures
|
||||||
|
- omit_local_variable_types
|
||||||
|
- prefer_adjacent_string_concatenation
|
||||||
|
- prefer_collection_literals
|
||||||
|
- prefer_conditional_assignment
|
||||||
|
- prefer_contains
|
||||||
|
- prefer_equal_for_default_values
|
||||||
|
- prefer_final_fields
|
||||||
|
- prefer_for_elements_to_map_fromIterable
|
||||||
|
- prefer_generic_function_type_aliases
|
||||||
|
- prefer_if_null_operators
|
||||||
|
- prefer_inlined_adds
|
||||||
|
- prefer_is_empty
|
||||||
|
- prefer_is_not_empty
|
||||||
|
- prefer_iterable_whereType
|
||||||
|
- prefer_single_quotes
|
||||||
|
- prefer_spread_collections
|
||||||
|
- recursive_getters
|
||||||
|
- slash_for_doc_comments
|
||||||
|
- sort_child_properties_last
|
||||||
|
- type_init_formals
|
||||||
|
- unawaited_futures
|
||||||
|
- unnecessary_brace_in_string_interps
|
||||||
|
- unnecessary_const
|
||||||
|
- unnecessary_getters_setters
|
||||||
|
- unnecessary_new
|
||||||
|
- unnecessary_null_in_if_null_operators
|
||||||
|
- unnecessary_this
|
||||||
|
- unrelated_type_equality_checks
|
||||||
|
- unsafe_html
|
||||||
|
- use_full_hex_values_for_flutter_colors
|
||||||
|
- use_function_type_syntax_for_parameters
|
||||||
|
- use_rethrow_when_possible
|
||||||
|
- valid_regexps
|
File diff suppressed because one or more lines are too long
@ -1,69 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<title>Flutter samples</title>
|
|
||||||
<link href="styles.css" rel="stylesheet" media="screen">
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Google+Sans|Google+Sans+Display|Roboto:300,400,500&display=swap" rel="stylesheet">
|
|
||||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
<script src="packages/mdc_web/material-components-web.min.js"></script>
|
|
||||||
<script src="https://kit.fontawesome.com/16cc04762e.js"></script>
|
|
||||||
<script defer src="description.dart.js"></script>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<div class="content">
|
|
||||||
<div class="navbar">
|
|
||||||
<a class="leading" href="./">
|
|
||||||
<img src="images/logos/logo_lockup_flutter_horizontal_wht_96.png" />
|
|
||||||
<span class="title">Samples</span>
|
|
||||||
</a>
|
|
||||||
<div class="nav-items">
|
|
||||||
<a href="https://flutter.dev/">Flutter Home</a>
|
|
||||||
<a href="https://api.flutter.dev/">API Docs</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="container">
|
|
||||||
<div class="description-title-row">
|
|
||||||
<h1>Timeflow</h1>
|
|
||||||
<div class="type-label type-label-bordered">demo</div>
|
|
||||||
</div>
|
|
||||||
<p>By Fabian Stein</p>
|
|
||||||
<div class="toolbar">
|
|
||||||
<div class="buttons">
|
|
||||||
<button class="mdc-button mdc-button--outlined" onclick="window.location.href = 'web/timeflow';"><span class="mdc-button__ripple"></span> Launch App</button><button class="mdc-button mdc-button--outlined" onclick="window.location.href = 'https://github.com/Fabian-Stein/timeflow';">
|
|
||||||
<div class="mdc-button__ripple"></div>
|
|
||||||
<i class="material-icons mdc-button__icon" aria-hidden="true">code</i>
|
|
||||||
<span class="mdc-button__label">Source Code</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div class="tags-container">
|
|
||||||
<div class="tags-label">
|
|
||||||
<i class="material-icons">local_offer</i>
|
|
||||||
<span>Tags</span>
|
|
||||||
</div>
|
|
||||||
<div class="tags">
|
|
||||||
<a href="./#?search=tag%3Ademo">demo</a>
|
|
||||||
<a href="./#?search=tag%3Aanimation">animation</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="slider-container">
|
|
||||||
<div class="slider-content">
|
|
||||||
<div class="slider-single"><img class="slider-single-image" src="images/timeflow1.png" alt="Timeflow screenshot" /></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="description">
|
|
||||||
<p>A gentle animation that provides a calming experience to stressed developers.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
|
|
||||||
<div class="footer">
|
|
||||||
<span>© Flutter 2020</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</html>
|
|
@ -1 +1 @@
|
|||||||
396760aeed7c6587350ab73d3313dee4
|
f2cb1c5fdc6794ee6b45912a918f74b5
|
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
|||||||
396760aeed7c6587350ab73d3313dee4
|
f2cb1c5fdc6794ee6b45912a918f74b5
|
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
|||||||
396760aeed7c6587350ab73d3313dee4
|
f2cb1c5fdc6794ee6b45912a918f74b5
|
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
|||||||
396760aeed7c6587350ab73d3313dee4
|
f2cb1c5fdc6794ee6b45912a918f74b5
|
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
|||||||
396760aeed7c6587350ab73d3313dee4
|
f2cb1c5fdc6794ee6b45912a918f74b5
|
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
|||||||
396760aeed7c6587350ab73d3313dee4
|
f2cb1c5fdc6794ee6b45912a918f74b5
|
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
|||||||
7e07f0fa30361861bec9302a1dcfa5a4
|
7d429bd842f05f1027b0163bb7928836
|
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
|||||||
396760aeed7c6587350ab73d3313dee4
|
f2cb1c5fdc6794ee6b45912a918f74b5
|
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
|||||||
396760aeed7c6587350ab73d3313dee4
|
f2cb1c5fdc6794ee6b45912a918f74b5
|
File diff suppressed because one or more lines are too long
@ -1 +0,0 @@
|
|||||||
396760aeed7c6587350ab73d3313dee4
|
|
@ -1 +0,0 @@
|
|||||||
{"preview.png":["assets/preview.png"]}
|
|
@ -1 +0,0 @@
|
|||||||
[{"family":"MaterialIcons","fonts":[{"asset":"fonts/MaterialIcons-Regular.otf"}]}]
|
|
File diff suppressed because it is too large
Load Diff
Before Width: | Height: | Size: 40 KiB |
Binary file not shown.
@ -1,186 +0,0 @@
|
|||||||
'use strict';
|
|
||||||
const MANIFEST = 'flutter-app-manifest';
|
|
||||||
const TEMP = 'flutter-temp-cache';
|
|
||||||
const CACHE_NAME = 'flutter-app-cache';
|
|
||||||
const RESOURCES = {
|
|
||||||
"version.json": "6ce6e541ea6755920e21548a6cb27fba",
|
|
||||||
"index.html": "51839f812a32cce7ac40ca488295da30",
|
|
||||||
"/": "51839f812a32cce7ac40ca488295da30",
|
|
||||||
"main.dart.js": "a8dca390931d90530e0b2a50c1c150d6",
|
|
||||||
"assets/AssetManifest.json": "e9760aff26d7236650b16d3f72345665",
|
|
||||||
"assets/NOTICES": "16c10a071ed1e902cf4d91b9175f37db",
|
|
||||||
"assets/FontManifest.json": "7b2a36307916a9721811788013e65289",
|
|
||||||
"assets/fonts/MaterialIcons-Regular.otf": "1288c9e28052e028aba623321f7826ac",
|
|
||||||
"assets/assets/preview.png": "84a7314976da474e68875dcf8e35cd1b"
|
|
||||||
};
|
|
||||||
|
|
||||||
// The application shell files that are downloaded before a service worker can
|
|
||||||
// start.
|
|
||||||
const CORE = [
|
|
||||||
"/",
|
|
||||||
"main.dart.js",
|
|
||||||
"index.html",
|
|
||||||
"assets/NOTICES",
|
|
||||||
"assets/AssetManifest.json",
|
|
||||||
"assets/FontManifest.json"];
|
|
||||||
// During install, the TEMP cache is populated with the application shell files.
|
|
||||||
self.addEventListener("install", (event) => {
|
|
||||||
self.skipWaiting();
|
|
||||||
return event.waitUntil(
|
|
||||||
caches.open(TEMP).then((cache) => {
|
|
||||||
return cache.addAll(
|
|
||||||
CORE.map((value) => new Request(value + '?revision=' + RESOURCES[value], {'cache': 'reload'})));
|
|
||||||
})
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
// During activate, the cache is populated with the temp files downloaded in
|
|
||||||
// install. If this service worker is upgrading from one with a saved
|
|
||||||
// MANIFEST, then use this to retain unchanged resource files.
|
|
||||||
self.addEventListener("activate", function(event) {
|
|
||||||
return event.waitUntil(async function() {
|
|
||||||
try {
|
|
||||||
var contentCache = await caches.open(CACHE_NAME);
|
|
||||||
var tempCache = await caches.open(TEMP);
|
|
||||||
var manifestCache = await caches.open(MANIFEST);
|
|
||||||
var manifest = await manifestCache.match('manifest');
|
|
||||||
// When there is no prior manifest, clear the entire cache.
|
|
||||||
if (!manifest) {
|
|
||||||
await caches.delete(CACHE_NAME);
|
|
||||||
contentCache = await caches.open(CACHE_NAME);
|
|
||||||
for (var request of await tempCache.keys()) {
|
|
||||||
var response = await tempCache.match(request);
|
|
||||||
await contentCache.put(request, response);
|
|
||||||
}
|
|
||||||
await caches.delete(TEMP);
|
|
||||||
// Save the manifest to make future upgrades efficient.
|
|
||||||
await manifestCache.put('manifest', new Response(JSON.stringify(RESOURCES)));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var oldManifest = await manifest.json();
|
|
||||||
var origin = self.location.origin;
|
|
||||||
for (var request of await contentCache.keys()) {
|
|
||||||
var key = request.url.substring(origin.length + 1);
|
|
||||||
if (key == "") {
|
|
||||||
key = "/";
|
|
||||||
}
|
|
||||||
// If a resource from the old manifest is not in the new cache, or if
|
|
||||||
// the MD5 sum has changed, delete it. Otherwise the resource is left
|
|
||||||
// in the cache and can be reused by the new service worker.
|
|
||||||
if (!RESOURCES[key] || RESOURCES[key] != oldManifest[key]) {
|
|
||||||
await contentCache.delete(request);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Populate the cache with the app shell TEMP files, potentially overwriting
|
|
||||||
// cache files preserved above.
|
|
||||||
for (var request of await tempCache.keys()) {
|
|
||||||
var response = await tempCache.match(request);
|
|
||||||
await contentCache.put(request, response);
|
|
||||||
}
|
|
||||||
await caches.delete(TEMP);
|
|
||||||
// Save the manifest to make future upgrades efficient.
|
|
||||||
await manifestCache.put('manifest', new Response(JSON.stringify(RESOURCES)));
|
|
||||||
return;
|
|
||||||
} catch (err) {
|
|
||||||
// On an unhandled exception the state of the cache cannot be guaranteed.
|
|
||||||
console.error('Failed to upgrade service worker: ' + err);
|
|
||||||
await caches.delete(CACHE_NAME);
|
|
||||||
await caches.delete(TEMP);
|
|
||||||
await caches.delete(MANIFEST);
|
|
||||||
}
|
|
||||||
}());
|
|
||||||
});
|
|
||||||
|
|
||||||
// The fetch handler redirects requests for RESOURCE files to the service
|
|
||||||
// worker cache.
|
|
||||||
self.addEventListener("fetch", (event) => {
|
|
||||||
if (event.request.method !== 'GET') {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var origin = self.location.origin;
|
|
||||||
var key = event.request.url.substring(origin.length + 1);
|
|
||||||
// Redirect URLs to the index.html
|
|
||||||
if (key.indexOf('?v=') != -1) {
|
|
||||||
key = key.split('?v=')[0];
|
|
||||||
}
|
|
||||||
if (event.request.url == origin || event.request.url.startsWith(origin + '/#') || key == '') {
|
|
||||||
key = '/';
|
|
||||||
}
|
|
||||||
// If the URL is not the RESOURCE list then return to signal that the
|
|
||||||
// browser should take over.
|
|
||||||
if (!RESOURCES[key]) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// If the URL is the index.html, perform an online-first request.
|
|
||||||
if (key == '/') {
|
|
||||||
return onlineFirst(event);
|
|
||||||
}
|
|
||||||
event.respondWith(caches.open(CACHE_NAME)
|
|
||||||
.then((cache) => {
|
|
||||||
return cache.match(event.request).then((response) => {
|
|
||||||
// Either respond with the cached resource, or perform a fetch and
|
|
||||||
// lazily populate the cache.
|
|
||||||
return response || fetch(event.request).then((response) => {
|
|
||||||
cache.put(event.request, response.clone());
|
|
||||||
return response;
|
|
||||||
});
|
|
||||||
})
|
|
||||||
})
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
self.addEventListener('message', (event) => {
|
|
||||||
// SkipWaiting can be used to immediately activate a waiting service worker.
|
|
||||||
// This will also require a page refresh triggered by the main worker.
|
|
||||||
if (event.data === 'skipWaiting') {
|
|
||||||
self.skipWaiting();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (event.data === 'downloadOffline') {
|
|
||||||
downloadOffline();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Download offline will check the RESOURCES for all files not in the cache
|
|
||||||
// and populate them.
|
|
||||||
async function downloadOffline() {
|
|
||||||
var resources = [];
|
|
||||||
var contentCache = await caches.open(CACHE_NAME);
|
|
||||||
var currentContent = {};
|
|
||||||
for (var request of await contentCache.keys()) {
|
|
||||||
var key = request.url.substring(origin.length + 1);
|
|
||||||
if (key == "") {
|
|
||||||
key = "/";
|
|
||||||
}
|
|
||||||
currentContent[key] = true;
|
|
||||||
}
|
|
||||||
for (var resourceKey of Object.keys(RESOURCES)) {
|
|
||||||
if (!currentContent[resourceKey]) {
|
|
||||||
resources.push(resourceKey);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return contentCache.addAll(resources);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Attempt to download the resource online before falling back to
|
|
||||||
// the offline cache.
|
|
||||||
function onlineFirst(event) {
|
|
||||||
return event.respondWith(
|
|
||||||
fetch(event.request).then((response) => {
|
|
||||||
return caches.open(CACHE_NAME).then((cache) => {
|
|
||||||
cache.put(event.request, response.clone());
|
|
||||||
return response;
|
|
||||||
});
|
|
||||||
}).catch((error) => {
|
|
||||||
return caches.open(CACHE_NAME).then((cache) => {
|
|
||||||
return cache.match(event.request).then((response) => {
|
|
||||||
if (response != null) {
|
|
||||||
return response;
|
|
||||||
}
|
|
||||||
throw error;
|
|
||||||
});
|
|
||||||
});
|
|
||||||
})
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,18 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-67589403-8"></script>
|
|
||||||
<script>
|
|
||||||
window.dataLayer = window.dataLayer || [];
|
|
||||||
function gtag(){dataLayer.push(arguments);}
|
|
||||||
gtag('js', new Date());
|
|
||||||
gtag('config', 'UA-67589403-8');
|
|
||||||
</script>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
<title>Timeflow - Flutter web sample</title>
|
|
||||||
<script defer src="main.dart.js" type="application/javascript"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
File diff suppressed because one or more lines are too long
@ -1 +0,0 @@
|
|||||||
{"app_name":"timeflow","version":null,"build_number":null}
|
|
@ -1 +1 @@
|
|||||||
7e07f0fa30361861bec9302a1dcfa5a4
|
7d429bd842f05f1027b0163bb7928836
|
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue