基础组件库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

41 lines
1.5 KiB

  1. library zhiying_base_widget;
  2. import 'package:flutter/services.dart';
  3. export 'dialog/loading/loading.dart';
  4. export 'package:flutter_swiper/flutter_swiper.dart';
  5. export 'package:zhiying_base_widget/pages/main_page/model/background_model.dart';
  6. export 'package:zhiying_base_widget/pages/custom_page/bloc/background_bloc.dart';
  7. export 'package:pull_to_refresh/pull_to_refresh.dart';
  8. export 'package:flutter_user_agent/flutter_user_agent.dart';
  9. export 'package:zhiying_base_widget/widgets/restart_widget/restart_widget.dart';
  10. export 'package:amap_flutter_location/amap_flutter_location.dart';
  11. export 'package:amap_flutter_location/amap_location_option.dart';
  12. export 'package:tab_indicator_styler/tab_indicator_styler.dart';
  13. export 'package:zhiying_base_widget/dialog/global_dialog/notification_setting_dialog/notification_setting_dialog.dart';
  14. export 'pages/order_found_page/order_found_search_page/order_found_search_page.dart';
  15. class ZhiyingBaseWidget {
  16. static const MethodChannel _channel = const MethodChannel('zhiying_base_widget');
  17. ///监听重定向的方法
  18. static addListener(Function(String) reload) {
  19. _channel.setMethodCallHandler((call) {
  20. if (call.method == "reload") {
  21. reload(call.arguments['url']);
  22. }
  23. return null;
  24. });
  25. }
  26. ///打开原生webView
  27. static loadUrl(String url) async {
  28. await _channel.invokeMethod("loadUrl", {"url": url});
  29. }
  30. static Future<String> get platformVersion async {
  31. final String version = await _channel.invokeMethod('getPlatformVersion');
  32. return version;
  33. }
  34. }