Remove ok sound on startup
This commit is contained in:
parent
32ae4952cc
commit
7b88d34fdb
|
@ -53,11 +53,11 @@ Future<void> main() async {
|
||||||
// Get a valid GVA endpoint
|
// Get a valid GVA endpoint
|
||||||
endPointGVA = await _homeProvider.getValidEndpoint();
|
endPointGVA = await _homeProvider.getValidEndpoint();
|
||||||
|
|
||||||
if (endPointGVA == 'HS') {
|
// if (endPointGVA == 'HS') {
|
||||||
_homeProvider.playSound('faché', 0.8);
|
// _homeProvider.playSound('faché', 0.8);
|
||||||
} else {
|
// } else {
|
||||||
_homeProvider.playSound('start', 0.2);
|
// _homeProvider.playSound('start', 0.2);
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (kReleaseMode && enableSentry) {
|
if (kReleaseMode && enableSentry) {
|
||||||
// CatcherOptions debugOptions = CatcherOptions(DialogReportMode(), [
|
// CatcherOptions debugOptions = CatcherOptions(DialogReportMode(), [
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
import 'package:audioplayers/audio_cache.dart';
|
// import 'package:audioplayers/audio_cache.dart';
|
||||||
import 'package:audioplayers/audioplayers.dart';
|
// import 'package:audioplayers/audioplayers.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
|
@ -23,7 +23,7 @@ class HomeProvider with ChangeNotifier {
|
||||||
Text('Explorateur', style: TextStyle(color: Colors.grey[850]));
|
Text('Explorateur', style: TextStyle(color: Colors.grey[850]));
|
||||||
|
|
||||||
List currentTab = [HistoryScreen(), WalletsHome()];
|
List currentTab = [HistoryScreen(), WalletsHome()];
|
||||||
AudioCache player = AudioCache(prefix: 'sounds/');
|
// AudioCache player = AudioCache(prefix: 'sounds/');
|
||||||
|
|
||||||
get currentIndex => _currentIndex;
|
get currentIndex => _currentIndex;
|
||||||
|
|
||||||
|
@ -132,10 +132,10 @@ class HomeProvider with ChangeNotifier {
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
void playSound(String customSound, double volume) async {
|
// void playSound(String customSound, double volume) async {
|
||||||
await player.play('$customSound.wav',
|
// await player.play('$customSound.wav',
|
||||||
volume: volume, mode: PlayerMode.LOW_LATENCY, stayAwake: false);
|
// volume: volume, mode: PlayerMode.LOW_LATENCY, stayAwake: false);
|
||||||
}
|
// }
|
||||||
|
|
||||||
void handleSearchEnd() {
|
void handleSearchEnd() {
|
||||||
searchIcon = Icon(
|
searchIcon = Icon(
|
||||||
|
|
|
@ -98,7 +98,7 @@ class WalletOptionsProvider with ChangeNotifier {
|
||||||
throw 'Bad pubkey';
|
throw 'Bad pubkey';
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
_homeProvider.playSound('non', 0.6);
|
// _homeProvider.playSound('non', 0.6);
|
||||||
log.e('ERROR READING FILE: $e');
|
log.e('ERROR READING FILE: $e');
|
||||||
this.pubkey.clear();
|
this.pubkey.clear();
|
||||||
return 'bad';
|
return 'bad';
|
||||||
|
|
13
pubspec.lock
13
pubspec.lock
|
@ -35,14 +35,7 @@ packages:
|
||||||
name: async
|
name: async
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.5.0"
|
version: "2.6.1"
|
||||||
audioplayers:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: audioplayers
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "0.18.3"
|
|
||||||
barcode:
|
barcode:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -140,7 +133,7 @@ packages:
|
||||||
name: crypto
|
name: crypto
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.0"
|
version: "3.0.1"
|
||||||
dubp:
|
dubp:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
@ -926,7 +919,7 @@ packages:
|
||||||
name: vm_service
|
name: vm_service
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "6.1.0+1"
|
version: "6.2.0"
|
||||||
watcher:
|
watcher:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
|
@ -46,7 +46,7 @@ dependencies:
|
||||||
responsive_framework: ^0.0.14
|
responsive_framework: ^0.0.14
|
||||||
responsive_builder: ^0.3.0
|
responsive_builder: ^0.3.0
|
||||||
jdenticon_dart: ^2.0.0
|
jdenticon_dart: ^2.0.0
|
||||||
audioplayers: ^0.18.1
|
# audioplayers: ^0.18.1
|
||||||
flutter_driver:
|
flutter_driver:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
test: ^1.16.8
|
test: ^1.16.8
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 917 B |
Binary file not shown.
After Width: | Height: | Size: 5.2 KiB |
Binary file not shown.
After Width: | Height: | Size: 8.1 KiB |
|
@ -0,0 +1,98 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<!--
|
||||||
|
If you are serving your web app in a path other than the root, change the
|
||||||
|
href value below to reflect the base path you are serving from.
|
||||||
|
|
||||||
|
The path provided below has to start and end with a slash "/" in order for
|
||||||
|
it to work correctly.
|
||||||
|
|
||||||
|
For more details:
|
||||||
|
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
|
||||||
|
-->
|
||||||
|
<base href="/">
|
||||||
|
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
|
||||||
|
<meta name="description" content="A new Flutter project.">
|
||||||
|
|
||||||
|
<!-- iOS meta tags & icons -->
|
||||||
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
|
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||||
|
<meta name="apple-mobile-web-app-title" content="gecko">
|
||||||
|
<link rel="apple-touch-icon" href="icons/Icon-192.png">
|
||||||
|
|
||||||
|
<title>gecko</title>
|
||||||
|
<link rel="manifest" href="manifest.json">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<!-- This script installs service_worker.js to provide PWA functionality to
|
||||||
|
application. For more information, see:
|
||||||
|
https://developers.google.com/web/fundamentals/primers/service-workers -->
|
||||||
|
<script>
|
||||||
|
var serviceWorkerVersion = null;
|
||||||
|
var scriptLoaded = false;
|
||||||
|
function loadMainDartJs() {
|
||||||
|
if (scriptLoaded) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
scriptLoaded = true;
|
||||||
|
var scriptTag = document.createElement('script');
|
||||||
|
scriptTag.src = 'main.dart.js';
|
||||||
|
scriptTag.type = 'application/javascript';
|
||||||
|
document.body.append(scriptTag);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ('serviceWorker' in navigator) {
|
||||||
|
// Service workers are supported. Use them.
|
||||||
|
window.addEventListener('load', function () {
|
||||||
|
// Wait for registration to finish before dropping the <script> tag.
|
||||||
|
// Otherwise, the browser will load the script multiple times,
|
||||||
|
// potentially different versions.
|
||||||
|
var serviceWorkerUrl = 'flutter_service_worker.js?v=' + serviceWorkerVersion;
|
||||||
|
navigator.serviceWorker.register(serviceWorkerUrl)
|
||||||
|
.then((reg) => {
|
||||||
|
function waitForActivation(serviceWorker) {
|
||||||
|
serviceWorker.addEventListener('statechange', () => {
|
||||||
|
if (serviceWorker.state == 'activated') {
|
||||||
|
console.log('Installed new service worker.');
|
||||||
|
loadMainDartJs();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (!reg.active && (reg.installing || reg.waiting)) {
|
||||||
|
// No active web worker and we have installed or are installing
|
||||||
|
// one for the first time. Simply wait for it to activate.
|
||||||
|
waitForActivation(reg.installing ?? reg.waiting);
|
||||||
|
} else if (!reg.active.scriptURL.endsWith(serviceWorkerVersion)) {
|
||||||
|
// When the app updates the serviceWorkerVersion changes, so we
|
||||||
|
// need to ask the service worker to update.
|
||||||
|
console.log('New service worker available.');
|
||||||
|
reg.update();
|
||||||
|
waitForActivation(reg.installing);
|
||||||
|
} else {
|
||||||
|
// Existing service worker is still good.
|
||||||
|
console.log('Loading app from service worker.');
|
||||||
|
loadMainDartJs();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// If service worker doesn't succeed in a reasonable amount of time,
|
||||||
|
// fallback to plaint <script> tag.
|
||||||
|
setTimeout(() => {
|
||||||
|
if (!scriptLoaded) {
|
||||||
|
console.warn(
|
||||||
|
'Failed to load app from service worker. Falling back to plain <script> tag.',
|
||||||
|
);
|
||||||
|
loadMainDartJs();
|
||||||
|
}
|
||||||
|
}, 4000);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// Service workers not supported. Just drop the <script> tag.
|
||||||
|
loadMainDartJs();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,23 @@
|
||||||
|
{
|
||||||
|
"name": "gecko",
|
||||||
|
"short_name": "gecko",
|
||||||
|
"start_url": ".",
|
||||||
|
"display": "standalone",
|
||||||
|
"background_color": "#0175C2",
|
||||||
|
"theme_color": "#0175C2",
|
||||||
|
"description": "A new Flutter project.",
|
||||||
|
"orientation": "portrait-primary",
|
||||||
|
"prefer_related_applications": false,
|
||||||
|
"icons": [
|
||||||
|
{
|
||||||
|
"src": "icons/Icon-192.png",
|
||||||
|
"sizes": "192x192",
|
||||||
|
"type": "image/png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "icons/Icon-512.png",
|
||||||
|
"sizes": "512x512",
|
||||||
|
"type": "image/png"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
Loading…
Reference in New Issue