基础组件库
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.

zhiying_base_widget.dart 1.4 KiB

4 vuotta sitten
4 vuotta sitten
123456789101112131415161718192021222324252627282930313233343536373839
  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. class ZhiyingBaseWidget {
  15. static const MethodChannel _channel = const MethodChannel('zhiying_base_widget');
  16. ///监听重定向的方法
  17. static addListener(Function(String) reload) {
  18. _channel.setMethodCallHandler((call) {
  19. if (call.method == "reload") {
  20. reload(call.arguments['url']);
  21. }
  22. return null;
  23. });
  24. }
  25. ///打开原生webView
  26. static loadUrl(String url) async {
  27. await _channel.invokeMethod("loadUrl", {"url": url});
  28. }
  29. static Future<String> get platformVersion async {
  30. final String version = await _channel.invokeMethod('getPlatformVersion');
  31. return version;
  32. }
  33. }