utils/src/global_util library

Constants

appChannel → const String
flutter run --dart-define=app-channel=official 多渠道打包 Android Studio可以配置运行Flutter参数 --dart-define=app-channel=official
isProduction → const bool
kPathIcons → const String
kPathOthers → const String

Properties

isAndroid bool
getter/setter pair
isAppDebugFlag bool
打开app调试模式
getter/setter pair
isDebug bool
final
isDesktop bool
getter/setter pair
isIOS bool
getter/setter pair
isLinux bool
getter/setter pair
isMacOS bool
getter/setter pair
isPhone bool
getter/setter pair
isWeb bool
getter/setter pair
isWebInAndroid bool
no setter
isWebInIos bool
no setter
isWebInIPad bool
no setter
isWebInIPhone bool
no setter
isWebInWeChat bool
no setter
isWindows bool
getter/setter pair
operatingSystem String
no setter
operatingSystemVersion String
no setter
userAgent String
no setter
webOrigin String
no setter
webUserAgent String
https://www.jianshu.com/p/40430596e3ab
no setter

Functions

appStoreUrl(String appId) String
appStoreUserReviewsUrl(String appId) String
appStoreWriteReview(String appId) String
assetsImagesPath(String name, {String format = "png"}) String
获取图片路径
assetsImagesPathSvg(String name) String
获取图片路径后缀svg
assetsImagesPathWebP(String name) String
获取图片路径后缀wep
canLaunch(String urlString) Future<bool>
getAppDocumentsDirectory() Future<Directory>
放置数据的目录的路径
getAppExternalStorageDirectory() Future<Directory?>
应用程序可以访问顶级存储的目录的路径 Android
getAppLibraryDirectory() Future<Directory>
应用程序可以存储持久文件的目录的路径 iOS and macOS
getAppSupportDirectory() Future<Directory>
应用程序可以放置应用程序支持的目录的路径
getAppTemporaryDirectory() Future<Directory>
设备上临时目录的路径,该临时目录未备份且。适用于存储下载文件的缓存
getBasename(String path) String
Gets the part of path after the last separator.
getBasenameWithoutExtension(String path) String
Gets the part of path after the last separator, and without any trailing file extension.
getClipboard() Future<String?>
获取剪贴板内容
getDirname(String path) String
Gets the part of path before the last separator.
getExtension(String path, [int level = 1]) String
Gets the file extension of path: the portion of basename from the last . to the end (including the . itself).
getJoin(String part1, [String? part2, String? part3, String? part4, String? part5, String? part6, String? part7, String? part8, String? part9, String? part10, String? part11, String? part12, String? part13, String? part14, String? part15, String? part16]) String
Joins the given path parts into a single path using the current platform's separator. Example:
hapticFeedbackHeavyImpact() → void
较重碰撞振动
hapticFeedbackLightImpact() → void
较轻碰撞振动
hapticFeedbackMediumImpact() → void
中等碰撞振动
hapticFeedbackVibrate() → void
长振动
hideKeyboard(BuildContext context) → void
全局隐藏键盘
onLaunch(String urlString, {BaseLaunchMode mode = BaseLaunchMode.platformDefault, WebViewConfiguration webViewConfiguration = const urlLauncher.WebViewConfiguration(), String? webOnlyWindowName}) Future<bool>
randomInt(int max) int
随机数(0-max)小于max
setClipboard(String text) Future<void>
将文本内容复制到剪贴板

Typedefs

BaseLaunchMode = LaunchMode