common/common
library
Functions
-
callPhone(String phoneNumber)
→ void
-
拨打电话
-
changeLanguage(Locale locale)
→ void
-
更改语言
-
changeThemeMode(ThemeMode themeMode)
→ void
-
切换主题模式
-
delayed(int milliseconds, dynamic callback())
→ void
-
延时执行
-
dismissLoading()
→ void
-
隐藏loading
-
enterFullScreen()
→ void
-
-
eventListen<T>(void onData(T)?, {Function? onError, void onDone()?, bool? cancelOnError})
→ StreamSubscription<T>
-
监听事件总线
-
exitFullScreen()
→ void
-
-
generateNonce()
→ String
-
生成32位唯一字符串
-
generateRandomNumber(int length)
→ int
-
生成随机数
-
getAndroidSdkVersion()
→ Future<int?>
-
-
getAppName()
→ Future<String>
-
获取AppName
-
getBuildNumber()
→ Future<String>
-
获取BuildNumber
-
getDeviceInfo()
→ Future<BaseDeviceInfo>
-
获取设备信息
-
getDeviceModel()
→ Future<String?>
-
-
getIosSystemVersion()
→ Future<String?>
-
-
getNowDateString()
→ String
-
获取当前日期字符串
-
getNowDateTimeString()
→ String
-
获取当前日期时间字符串
-
getNowTimeString()
→ String
-
获取当前时间字符串
-
getPackageInfo()
→ Future<PackageInfo>
-
获取包信息
-
getPackageName()
→ Future<String>
-
获取PackageName
-
getTimeStamp({bool isSecond = false})
→ int
-
获取当前时间戳(Millisecond)
-
getTimeStampSecond()
→ int
-
获取当前时间戳(Second)
-
getVersion()
→ Future<String>
-
获取Version
-
hideKeyboard()
→ void
-
隐藏输入法
-
hideStatusBar()
→ Future<void>
-
This function will hide status bar
-
init({bool isDebug = false, String? logTag, String? networkLog, int dioTimeOut = 10, List<Locale>? supportedLocales})
→ Future<WidgetsBinding>
-
初始化脚手架
-
isConnectedToMobile()
→ Future<bool>
-
判断设备是否连接移动网络
-
isConnectedToWiFi()
→ Future<bool>
-
判断设备是否连接WiFi
-
isNetworkAvailable()
→ Future<bool>
-
判断设备是否连接网络
-
log(String log, [String? tag])
→ void
-
统一Log输出
-
openWebPage(String url, {LaunchMode mode = LaunchMode.platformDefault})
→ void
-
打开网页
-
refreshAppui()
→ void
-
刷新App所有页面
-
requestBluetoothPermission()
→ Future<bool>
-
申请蓝牙权限 仅Android需要申请 IOS默认开启
-
requestCameraPermission()
→ Future<bool>
-
申请相机权限
-
requestPermission({required Permission permission, String? title, String? confirmText, required String message, required String error})
→ Future<bool>
-
申请权限
-
requestPhotosPermission()
→ Future<bool>
-
申请相册权限
-
sendEvent<T>(T event)
→ dynamic
-
发送事件总线
-
setDarkStatusBar()
→ void
-
Dark Status Bar
-
setLightStatusBar()
→ void
-
Light Status Bar
-
setOrientationLandscape()
→ void
-
Set orientation to landscape
-
setOrientationPortrait()
→ void
-
Set orientation to portrait
-
setStatusBarColor(Color statusBarColor, {Color? systemNavigationBarColor, Brightness? statusBarBrightness, Brightness? statusBarIconBrightness, int delayInMilliSeconds = 200})
→ Future<void>
-
Change status bar Color and Brightness
-
showError([String? msg])
→ void
-
显示错误
-
showErrorToast(String msg)
→ void
-
显示错误Toast
-
showInfo(String msg)
→ void
-
显示提示
-
showInfoToast(String msg)
→ void
-
显示提示Toast
-
showLoading([String? msg])
→ void
-
显示loading
-
showStatusBar()
→ Future<void>
-
This function will show status bar
-
showSuccess([String? msg])
→ void
-
显示成功
-
showSuccessToast(String msg)
→ void
-
显示成功Toast
-
showToast(String msg)
→ void
-
显示Toast
-
showWarningToast(String msg)
→ void
-
显示警告Toast
-
unfocus()
→ void
-
清除焦点