Skip to content

[web] Check web before Platform.isX #391

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/parse_server_sdk.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import 'dart:math';
import 'dart:typed_data';

import 'package:devicelocale/devicelocale.dart';
import 'package:flutter/foundation.dart' show kIsWeb;
import 'package:http/http.dart';
import 'package:http/io_client.dart';
import 'package:meta/meta.dart';
Expand Down
4 changes: 3 additions & 1 deletion lib/src/objects/parse_installation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ class ParseInstallation extends ParseObject {
/// Updates the installation with current device data
Future<void> _updateInstallation() async {
//Device type
if (Platform.isAndroid) {
if (kIsWeb) {
set<String>(keyDeviceType, 'web');
} else if (Platform.isAndroid) {
set<String>(keyDeviceType, 'android');
} else if (Platform.isIOS) {
set<String>(keyDeviceType, 'ios');
Expand Down
2 changes: 1 addition & 1 deletion lib/src/storage/core_store_sem_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class CoreStoreSembastImp implements CoreStore {
factory ??= databaseFactoryIo;
final SembastCodec codec = getXXTeaSembastCodec(password: password);
String dbDirectory = '';
if (Platform.isIOS || Platform.isAndroid)
if (!kIsWeb && (Platform.isIOS || Platform.isAndroid))
dbDirectory = (await getApplicationDocumentsDirectory()).path;
final String dbPath = path.join('$dbDirectory/parse', 'parse.db');
final Database db = await factory.openDatabase(dbPath, codec: codec);
Expand Down