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