parent
be56739a53
commit
321cb76c71
7 changed files with 38 additions and 9 deletions
@ -0,0 +1,3 @@ |
||||
analyzer: |
||||
errors: |
||||
undefined_prefixed_name: ignore |
@ -0,0 +1,3 @@ |
||||
class platformViewRegistry { |
||||
static registerViewFactory(String viewId, dynamic cb) {} |
||||
} |
@ -0,0 +1,9 @@ |
||||
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); |
||||
} |
||||
} |
@ -0,0 +1,22 @@ |
||||
library universal_ui; |
||||
|
||||
import 'package:flutter/foundation.dart'; |
||||
import 'fake_ui.dart' if (dart.library.html) 'real_ui.dart' as ui_instance; |
||||
|
||||
class PlatformViewRegistryFix { |
||||
registerViewFactory(dynamic x, dynamic y) { |
||||
if (kIsWeb) { |
||||
// ignore: undefined_prefixed_name |
||||
ui_instance.platformViewRegistry.registerViewFactory( |
||||
x, |
||||
y, |
||||
); |
||||
} else {} |
||||
} |
||||
} |
||||
|
||||
class UniversalUI { |
||||
PlatformViewRegistryFix platformViewRegistry = PlatformViewRegistryFix(); |
||||
} |
||||
|
||||
var ui = UniversalUI(); |
Loading…
Reference in new issue