|
12345678910111213141516171819202122232425262728293031323334353637383940 |
- library zhiying_base_widget;
-
- import 'package:flutter/services.dart';
-
- export 'dialog/loading/loading.dart';
- export 'package:flutter_swiper/flutter_swiper.dart';
- export 'package:zhiying_base_widget/pages/main_page/model/background_model.dart';
- export 'package:zhiying_base_widget/pages/custom_page/bloc/background_bloc.dart';
- export 'package:pull_to_refresh/pull_to_refresh.dart';
- export 'package:flutter_user_agent/flutter_user_agent.dart';
- export 'package:zhiying_base_widget/widgets/restart_widget/restart_widget.dart';
- export 'package:amap_flutter_location/amap_flutter_location.dart';
- export 'package:amap_flutter_location/amap_location_option.dart';
- export 'package:tab_indicator_styler/tab_indicator_styler.dart';
- export 'package:zhiying_base_widget/dialog/global_dialog/notification_setting_dialog/notification_setting_dialog.dart';
- export 'pages/order_found_page/order_found_search_page/order_found_search_page.dart';
-
- class ZhiyingBaseWidget {
- static const MethodChannel _channel = const MethodChannel('zhiying_base_widget');
-
- ///监听重定向的方法
- static addListener(Function(String) reload) {
- _channel.setMethodCallHandler((call) {
- if (call.method == "reload") {
- reload(call.arguments['url']);
- }
- return null;
- });
- }
-
- ///打开原生webView
- static loadUrl(String url) async {
- await _channel.invokeMethod("loadUrl", {"url": url});
- }
-
- static Future<String> get platformVersion async {
- final String version = await _channel.invokeMethod('getPlatformVersion');
- return version;
- }
- }
|