YFree library

Classes

YConfig
YFree主配置
YDeferredBuilder
YDrawer
侧滑菜单
YFreeWebPlugin
YKeepAlivePage
页面基类(保存状态)
YLocaleUtils
YPage
页面基类
YSliverDelegate
YStatefulWidget
YWidget

Enums

YIntentType

Properties

lastClickTime int
getter/setter pair
yFreeWebPlugin → _YFreeWebPlugin?
final
yIsApp bool
final
yIsPC bool
final
yIsShowingProgress bool
getter/setter pair
yIsWeb bool
final
yPages List<YPage>
final

Functions

yAesDecode(String content, String password) String
aes解密
yAesEncode(String content, String password) String
aes加密
YAnimatedSwitcher({required Widget child, int duration = 300}) Widget
YAppBar({String? title, Color? navBarTitleColor, bool canBack = true, bool divider = false, Widget? left, Widget? right, Widget? widget, String? statubar, String? navBar}) Widget
YAppBarWidget({String? title, Widget? leftWidget, dynamic onLeftClick()?, Widget? rightWidget, dynamic onRightClick()?, Widget? leftContainer, Widget? rightContainer, Widget? centerContainer}) Stack
导航条组件
yBase64Decode(String content) String
base64解码
yBase64Encode(String content) String
base64转码
YButton({required Widget child, double? width, double? height, Color? color, Decoration? decoration, EdgeInsetsGeometry? padding, EdgeInsetsGeometry? margin, required dynamic onTap(), bool enable = true, bool isInk = false, int? tapTime, BorderRadius borderRadius = BorderRadius.zero}) Widget
按钮
yCheckUpdate({required int newVersion, required String updateContent, required String? apkDownloadPath, required String? androidAppId, required String? iOSAppId, bool enableIgnore = false, dynamic onNewest()?}) → void
检测更新
YCIMGestureDetector(BuildContext context, Widget child) GestureDetector
YCircularProgress({double size = 50, double strokeWidth = 4}) Widget
yCloseInputMethod({BuildContext? context}) → void
yConfigIP(String ip) → void
配置原生框架post地址
yConfigUpdateIP(String updateIp) → void
配置原生框架检测升级地址
yCopyClipBoard(String content) → void
复制到剪贴板
yDelete(String key, {bool secure = false}) Future<void>
本地删值
yDismissDialog(BuildContext? dialogContext) → void
yDismissDialog_unDismissible() → void
yDismissProgress() → void
关闭进度条,传入page可拦截安卓返回键
yDoCrash(dynamic message, {Object? obj}) → void
YEmpty() Widget
空组件
YEmptyContainer() Widget
YExpanded({int flex = 1}) Widget
占位组件
yFinishApplication() → void
退出App
yGetAppName() String
获取App名称
yGetDeviceID() Future<String>
设备唯一码
YImage(double? width, double? height, String url, {BoxFit fit = BoxFit.contain, String? imagePlaceHolder}) Widget
加载图像
YImage2(double? width, double? height, String url, {BoxFit fit = BoxFit.contain, String? imagePlaceHolder}) Widget
YImageCircle(double? width, double? height, String url, {BoxFit fit = BoxFit.cover, String? imagePlaceHolder}) Widget
加载图像(圆形)
YImageCircle2(double? width, double? height, String url, {BoxFit fit = BoxFit.cover, String? imagePlaceHolder}) Widget
YImageCorner(double? width, double? height, String url, double corner, {BoxFit fit = BoxFit.cover, String? imagePlaceHolder}) Widget
加载图像(圆角)
YImageCorner2(double? width, double? height, String url, double corner, {BoxFit fit = BoxFit.cover, String? imagePlaceHolder}) Widget
YInkButton(Widget? widget, {dynamic color = Colors.transparent, bool enable = true, int? tapTime, required GestureTapCallback onTap}) Material
YInkRoundButton(Widget? widget, {dynamic color = Colors.transparent, bool enable = true, int? tapTime, required GestureTapCallback onTap, double size = 70.0}) Widget
yIsNetAble() Future<bool>
检查网络是否可用
yIsNotEmpty(String? content) bool
检查非空
yIsNullOrEmpty(String? content) bool
检查为空
YListTile(String title, String? image, dynamic onClick(), {Color bgColor = Colors.transparent, double imageSize = 20, Widget? right, EdgeInsets? padding, TextStyle? titleStyle, bool enable = true}) Widget
列表条目
yLog(String message) → void
打印log
yMD5(String content) String
MD5加密
yNavBarHeight() double
获取导航条高度
yRead(String key, {bool secure = false}) Future<String?>
本地取值
YRefreshContainer({required Widget child, dynamic onRefresh()?, ScrollController? scrollController, Header? header, Footer? footer, dynamic onLoadMore()?, dynamic bottomBouncing = true, dynamic scrollbar = true}) Widget
下拉刷新组件
YRefreshGridView<T>({required List<T> models, required SliverGridDelegate gridDelegate, dynamic onRefresh()?, required dynamic itemBuilder(BuildContext context, int index, T model), ScrollController? scrollController, Header? header, Footer? footer, dynamic onLoadMore()?, dynamic bottomBouncing = true, dynamic scrollbar = true, EdgeInsets padding = EdgeInsets.zero}) Widget
YRefreshListView<T>({required List<T> models, dynamic onRefresh()?, required dynamic itemBuilder(BuildContext context, int index, T model), ScrollController? scrollController, Header? header, Footer? footer, dynamic onLoadMore()?, dynamic bottomBouncing = true, dynamic scrollbar = true, EdgeInsets padding = EdgeInsets.zero, bool reverse = false}) Widget
YRefreshStaticListView({required List<Widget> children, dynamic onRefresh()?, ScrollController? scrollController, Header? header, Footer? footer, dynamic onLoadMore()?, dynamic bottomBouncing = true, dynamic scrollbar = true, EdgeInsets padding = EdgeInsets.zero}) Widget
yRequestStorage({bool showFail = true}) Future<bool>
请求存储权限
YRight({required Widget child}) Widget
居右组件
yRun(dynamic action(), {dynamic delay = 0}) → void
主线程运行
yRunApp({required YPage launchPage, MaterialColor? primarySwatch, required dynamic onYConfig(), dynamic builder(BuildContext context, Widget? child)?, ThemeData? theme}) → void
YFree启动函数
yRunCompleter<T>(dynamic action(Completer<T> completer)) Future<T>
异步转同步
yRunLoop(dynamic action(Timer? timer), int loop, {dynamic runNow = false}) Timer
主线程运行(循环)
yRunOnce<T>(String key, T fn()) → T
yRunOnceContainsKey(String key) bool
yRunOnceDelete(String key) → void
ySafeAreaBottomHeight({BuildContext? context}) double
获取底部安全区高度
ySave(String key, String value, {bool secure = false}) Future<void>
本地存值
yScreenSize({BuildContext? context}) Size
获取屏幕尺寸
yShowActionSheet(String message, List<String> actions, dynamic onCallBack(int index, String action), {dynamic onCancel()?, BuildContext? context}) → void
弹出actionsheet
yShowBuilder(String message, dynamic confirmCallBack(), dynamic cancelCallBack()?, bool cancelAble, {String posTitle = "确定", String negTitle = "取消", BuildContext? context}) → void
弹出对话框
yShowDialog({required dynamic alertBuilder(BuildContext pageContext, BuildContext? dialogContext), bool dismissible = true, BuildContext? context}) → void
yShowProgress() → void
打开进度条,传入page可拦截安卓返回键
yShowSelectBuilder(String message, bool cancelAble, List<String> actions, dynamic onCallBack(int index, String action), {dynamic onCancelBack()?, BuildContext? context}) → void
弹出单选框
yShowStatefulDialog({required dynamic alertBuilder(BuildContext pageContext, BuildContext? dialogContext, BuildContext statefulContext, StateSetter setDialogState), bool dismissible = true, BuildContext? context}) → void
YSpacer({double width = 0, double height = 0}) Widget
间距组件
yStatubarHeight({BuildContext? context}) double
获取状态栏高度
YTitleWidget(String? title, {Color? navBarTitleColor}) Expanded
标题组件
yToast(String message) → void
底部文字提示
YToggleWidget({required bool isShowChildA, required Widget childA(), required Widget childB(), int duration = 300, AnimatedSwitcherTransitionBuilder? transitionBuilder}) Widget
yToJson(Object obj) String
字典转json