fix for web
This commit is contained in:
parent
d8c89ad621
commit
49c2bf9616
@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:firebase_analytics/firebase_analytics.dart';
|
import 'package:firebase_analytics/firebase_analytics.dart';
|
||||||
import 'package:firebase_analytics/observer.dart';
|
|
||||||
import 'package:firebase_core/firebase_core.dart';
|
import 'package:firebase_core/firebase_core.dart';
|
||||||
import 'common.dart';
|
import 'common.dart';
|
||||||
import 'models/model.dart';
|
import 'models/model.dart';
|
||||||
@ -21,7 +20,7 @@ Future<Null> main() async {
|
|||||||
class App extends StatelessWidget {
|
class App extends StatelessWidget {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final analytics = FirebaseAnalytics();
|
final analytics = FirebaseAnalytics.instance;
|
||||||
refreshCurrentUser();
|
refreshCurrentUser();
|
||||||
return MultiProvider(
|
return MultiProvider(
|
||||||
providers: [
|
providers: [
|
||||||
@ -38,7 +37,7 @@ class App extends StatelessWidget {
|
|||||||
primarySwatch: Colors.blue,
|
primarySwatch: Colors.blue,
|
||||||
visualDensity: VisualDensity.adaptivePlatformDensity,
|
visualDensity: VisualDensity.adaptivePlatformDensity,
|
||||||
),
|
),
|
||||||
home: isWeb ? WebHomePage() : HomePage(),
|
home: !isAndroid ? WebHomePage() : HomePage(),
|
||||||
navigatorObservers: [
|
navigatorObservers: [
|
||||||
FirebaseAnalyticsObserver(analytics: analytics),
|
FirebaseAnalyticsObserver(analytics: analytics),
|
||||||
],
|
],
|
||||||
|
@ -715,7 +715,9 @@ class FFI {
|
|||||||
|
|
||||||
static List<Peer> peers() {
|
static List<Peer> peers() {
|
||||||
try {
|
try {
|
||||||
List<dynamic> peers = json.decode(getByName('peers'));
|
var str = getByName('peers');
|
||||||
|
if (str == "") return [];
|
||||||
|
List<dynamic> peers = json.decode(str);
|
||||||
return peers
|
return peers
|
||||||
.map((s) => s as List<dynamic>)
|
.map((s) => s as List<dynamic>)
|
||||||
.map((s) =>
|
.map((s) =>
|
||||||
|
@ -19,7 +19,7 @@ class ConnectionPage extends StatefulWidget implements PageShape {
|
|||||||
final title = translate("Connection");
|
final title = translate("Connection");
|
||||||
|
|
||||||
@override
|
@override
|
||||||
final appBarActions = isWeb ? <Widget>[WebMenu()] : <Widget>[];
|
final appBarActions = !isAndroid ? <Widget>[WebMenu()] : <Widget>[];
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_ConnectionPageState createState() => _ConnectionPageState();
|
_ConnectionPageState createState() => _ConnectionPageState();
|
||||||
@ -257,7 +257,7 @@ class _ConnectionPageState extends State<ConnectionPage> {
|
|||||||
PopupMenuItem<String>(
|
PopupMenuItem<String>(
|
||||||
child: Text(translate('Remove')), value: 'remove')
|
child: Text(translate('Remove')), value: 'remove')
|
||||||
] +
|
] +
|
||||||
(isWeb
|
(!isAndroid
|
||||||
? []
|
? []
|
||||||
: [
|
: [
|
||||||
PopupMenuItem<String>(
|
PopupMenuItem<String>(
|
||||||
|
14
pubspec.lock
14
pubspec.lock
@ -226,6 +226,20 @@ packages:
|
|||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
version: "0.0.0"
|
||||||
|
http:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: http
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "0.13.4"
|
||||||
|
http_parser:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: http_parser
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "4.0.0"
|
||||||
image:
|
image:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -45,6 +45,7 @@ dependencies:
|
|||||||
draggable_float_widget: ^0.0.2
|
draggable_float_widget: ^0.0.2
|
||||||
settings_ui: ^2.0.2
|
settings_ui: ^2.0.2
|
||||||
flutter_breadcrumb: ^1.0.1
|
flutter_breadcrumb: ^1.0.1
|
||||||
|
http: ^0.13.4
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_launcher_icons: ^0.9.1
|
flutter_launcher_icons: ^0.9.1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user