轮播图
https://github.com/best-flutter/flutter_swiper/blob/master/README-ZH.md
flutter_swiper : ^lastest_version
import ‘package:flutter_swiper/flutter_swiper.dart’;屏幕适配
https://github.com/OpenFlutter/flutter_screenutil/blob/master/README_CN.md
flutter_screenutil: ^5.6.0
import ‘package:flutter_screenutil/flutter_screenutil.dart’;dio是一个强大的Dart Http请求库,支持Restful API、FormData、拦截器、请求取消、Cookie管理、文件上传/下载、超时、自定义适配器
https://github.com/flutterchina/dio/blob/master/README-ZH.md
dio: ^4.0.6
import ‘package:dio/dio.dart’;本地存储插件shared_preferences
https://pub.flutter-io.cn/packages/shared_preferences
shared_preferences: ^2.0.15
import ‘package:shared_preferences/shared_preferences.dart’;
var prefs = await SharedPreferences.getInstance();//prefs.setInt('Key_Int', 12); //prefs.setDouble('Key_Double', 12.0); //prefs.setBool('Key_Bool', true); // prefs.setString('Key', 'laomeng'); // prefs.setStringList('Key_StringList', ['laomeng','Flutter']); var result = prefs.getInt('Key_Int'); //var result = prefs.getDouble('Key_Double'); //var result = prefs.getBool('Key_Bool'); // var result = prefs.getString('Key');
// var result = prefs.getStringList(‘Key_StringList’);
//prefs.remove('Key');删除 prefs.clear();//清空 //var keys = prefs.getKeys();//所有key [] // prefs.containsKey('Key') ?? false;//判断
加载远程web页面 官方(webview_flutter)
flutter_inappwebview: ^5.7.1
https://pub.flutter-io.cn/packages/flutter_inappwebview
import ‘package:flutter_inappwebview/flutter_inappwebview.dart’;状态管理provider
https://github.com/rrousselGit/provider/blob/master/resources/translations/zh-CN/README.md
provider: ^6.0.4
import ‘package:provider/provider.dart’;文件系统官方
path_provider: ^2.0.11
import ‘package:path_provider/path_provider.dart’;
Directory tempDir = await getTemporaryDirectory();
String tempPath = tempDir.path;//临时目录,下载的缓存文件,此目录随时可以清除
Directory appDocDir = await getApplicationDocumentsDirectory();
String appDocPath = appDocDir.path;//文档目录
Directory appDir = await getApplicationSupportDirectory();
String appDocPath = appDir.path;//应用目录,推荐长久存放
以上三个支持五平台
Directory? appDocDir = await getDownloadsDirectory();
String? appDocPath = appDocDir?.path;
下载路径支持win linux mac视频播放
https://pub.flutter-io.cn/packages/video_player
video_player: ^2.4.7
import ‘package:video_player/video_player.dart’;toast
https://pub.flutter-io.cn/packages/fluttertoast
fluttertoast: ^8.1.1
import ‘package:fluttertoast/fluttertoast.dart’;类似sqlite3
https://pub.flutter-io.cn/packages/sqflite
sqflite: ^2.2.0+3
import ‘package:sqflite/sqflite.dart’;svg
https://pub.flutter-io.cn/packages/flutter_svg
flutter_svg: ^1.1.6
import ‘package:flutter_svg/flutter_svg.dart’;qrcode和条码读取
https://pub.flutter-io.cn/packages/mobile_scanner生成二维码
https://pub.flutter-io.cn/packages/qr_flutter
qr_flutter: ^4.0.0
import ‘package:qr_flutter/qr_flutter.dart’;图表库
fl_chart: ^0.55.2
import ‘package:fl_chart/fl_chart.dart’;相机
https://pub.flutter-io.cn/packages/camera
camera: ^0.10.0+4
import ‘package:camera/camera.dart’;字体图标库
https://pub.flutter-io.cn/packages/font_awesome_flutter
font_awesome_flutter: ^10.2.1
import ‘package:font_awesome_flutter/font_awesome_flutter.dart’;markdown
https://pub.flutter-io.cn/packages/flutter_markdown
flutter_markdown: ^0.6.13
import ‘package:flutter_markdown/flutter_markdown.dart’;动画库,加载数据时的各种渐变进度动画(比如:菊花进度、圆环进度、旋转进度等
https://pub.flutter-io.cn/packages/flutter_spinkit
flutter_spinkit: ^5.1.0
import ‘package:flutter_spinkit/flutter_spinkit.dart’;日期时间
https://pub.flutter-io.cn/packages/flutter_picker
flutter_picker: ^2.0.5
import ‘package:flutter_picker/flutter_picker.dart’;图片选择
https://pub.flutter-io.cn/packages/image_picker
image_picker: ^0.8.6
import ‘package:image_picker/image_picker.dart’;动画库
https://pub.flutter-io.cn/packages/lottie
import ‘package:lottie/lottie.dart’;mockito 假数据
https://pub.flutter-io.cn/packages/mockito
mockito: ^5.3.2
import ‘package:mockito/mockito.dart’;权限处理
https://pub.flutter-io.cn/packages/permission_handler
permission_handler: ^10.2.0
import ‘package:permission_handler/permission_handler.dart’;键盘显示隐藏
https://pub.flutter-io.cn/packages/flutter_keyboard_visibility
flutter_keyboard_visibility: ^5.4.0
import ‘package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart’;路由跳转
https://pub.flutter-io.cn/packages/fluro
fluro: ^2.0.4
import ‘package:fluro/fluro.dart’;多语言
https://pub.flutter-io.cn/packages/intl
intl: ^0.17.0
import ‘package:intl/intl.dart’;UI组件库
https://pub.flutter-io.cn/packages/bruno
bruno:^3.1.0
import ‘package:bruno/bruno.dart’;UI组件库
https://github.com/flutterchina/flukit
flukit: ^3.0.1
import ‘package:flukit/flukit.dart’;汉字转换拼音
https://github.com/flutterchina/lpinyin
lpinyin: ^2.0.2
import ‘package:lpinyin/lpinyin.dart’;Flutter 城市列表、联系人列表,索引&悬停
https://github.com/flutterchina/azlistview/blob/master/README-ZH.md
更新时间:2024-12-05 13:26