基础组件库
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 
 

40 rindas
1.4 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. 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. }