Remove conditional import (#59)

* Remove conditional import

* fix pickWeb

Co-authored-by: rish07 <rishirajsinghchhabra@gmail.com>
pull/60/head^2
Xin Yao 4 years ago committed by GitHub
parent d66c058997
commit 9810fae5d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 22
      app/pubspec.lock
  2. 2
      lib/widgets/editor.dart
  3. 4
      lib/widgets/fake_ui.dart
  4. 9
      lib/widgets/real_ui.dart
  5. 3
      lib/widgets/toolbar.dart

@ -84,7 +84,7 @@ packages:
name: ffi name: ffi
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.1.3" version: "1.0.0"
file: file:
dependency: transitive dependency: transitive
description: description:
@ -98,7 +98,7 @@ packages:
name: file_picker name: file_picker
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.0.0-nullsafety.2" version: "3.0.0"
flutter: flutter:
dependency: "direct main" dependency: "direct main"
description: flutter description: flutter
@ -124,7 +124,7 @@ packages:
name: flutter_keyboard_visibility_platform_interface name: flutter_keyboard_visibility_platform_interface
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.0-nullsafety.0" version: "2.0.0"
flutter_keyboard_visibility_web: flutter_keyboard_visibility_web:
dependency: transitive dependency: transitive
description: description:
@ -232,28 +232,28 @@ packages:
name: path_provider_linux name: path_provider_linux
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.0.1+2" version: "2.0.0"
path_provider_macos: path_provider_macos:
dependency: transitive dependency: transitive
description: description:
name: path_provider_macos name: path_provider_macos
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.0.4+8" version: "2.0.0"
path_provider_platform_interface: path_provider_platform_interface:
dependency: transitive dependency: transitive
description: description:
name: path_provider_platform_interface name: path_provider_platform_interface
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.4" version: "2.0.1"
path_provider_windows: path_provider_windows:
dependency: transitive dependency: transitive
description: description:
name: path_provider_windows name: path_provider_windows
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.0.4+3" version: "2.0.0"
pedantic: pedantic:
dependency: transitive dependency: transitive
description: description:
@ -281,7 +281,7 @@ packages:
name: plugin_platform_interface name: plugin_platform_interface
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0-nullsafety.2" version: "2.0.0"
process: process:
dependency: transitive dependency: transitive
description: description:
@ -440,14 +440,14 @@ packages:
name: win32 name: win32
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.7.4+1" version: "2.0.0"
xdg_directories: xdg_directories:
dependency: transitive dependency: transitive
description: description:
name: xdg_directories name: xdg_directories
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.1.2" version: "0.2.0"
zone_local: zone_local:
dependency: transitive dependency: transitive
description: description:
@ -456,5 +456,5 @@ packages:
source: hosted source: hosted
version: "0.1.2" version: "0.1.2"
sdks: sdks:
dart: ">=2.12.0-259.9.beta <3.0.0" dart: ">=2.12.0 <3.0.0"
flutter: ">=1.24.0-10.2.pre" flutter: ">=1.24.0-10.2.pre"

@ -1,6 +1,7 @@
import 'dart:convert'; import 'dart:convert';
import 'dart:io' as io; import 'dart:io' as io;
import 'dart:math' as math; import 'dart:math' as math;
import 'dart:ui' as ui;
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
@ -24,7 +25,6 @@ import 'package:string_validator/string_validator.dart';
import 'package:universal_html/prefer_universal/html.dart' as html; import 'package:universal_html/prefer_universal/html.dart' as html;
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
import 'fake_ui.dart' if (dart.library.html) 'real_ui.dart' as ui;
import 'box.dart'; import 'box.dart';
import 'controller.dart'; import 'controller.dart';
import 'cursor.dart'; import 'cursor.dart';

@ -1,4 +0,0 @@
// ignore: camel_case_types
class platformViewRegistry {
static registerViewFactory(String viewId, dynamic cb) {}
}

@ -1,9 +0,0 @@
import 'dart:ui' as ui;
// ignore: camel_case_types
class platformViewRegistry {
static registerViewFactory(String viewId, dynamic cb) {
// ignore:undefined_prefixed_name
ui.platformViewRegistry.registerViewFactory(viewId, cb);
}
}

@ -519,7 +519,7 @@ class _ImageButtonState extends State<ImageButton> {
Future<String> _pickImage(ImageSource source) async { Future<String> _pickImage(ImageSource source) async {
final PickedFile pickedFile = await _picker.getImage(source: source); final PickedFile pickedFile = await _picker.getImage(source: source);
if (pickedFile == null) return null; if (pickedFile == null) return null;
final File file = File(pickedFile.path); final File file = File(pickedFile.path);
if (file == null || widget.onImagePickCallback == null) return null; if (file == null || widget.onImagePickCallback == null) return null;
@ -567,6 +567,7 @@ class _ImageButtonState extends State<ImageButton> {
} else { } else {
// User canceled the picker // User canceled the picker
} }
return null;
} }
@override @override

Loading…
Cancel
Save