首页
壁纸
关于
Search
1
IObit Uninstaller 注册码
2,119 阅读
2
与元素类型 "application" 相关联的属性 "tools:replace" 的前缀 "tools" 未绑定。
336 阅读
3
常用的开源API记录
181 阅读
4
flutter 隐藏中间省略号
177 阅读
5
诗集收藏•明:陈曦/高启
148 阅读
默认
开发
随记
工具
游戏
番剧
关于猫的随笔
登录
Search
路过的假面骑士
累计撰写
87
篇文章
累计收到
2
条评论
首页
栏目
默认
开发
随记
工具
游戏
番剧
关于猫的随笔
页面
壁纸
关于
搜索到
58
篇与
的结果
2023-02-28
Flutter的自定义dialog
showGeneralDialog( barrierDismissible: true, barrierLabel: 'open', barrierColor: Colors.transparent, context: context, transitionDuration: Duration(milliseconds: 200), transitionBuilder: (BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation, Widget child) { return FadeTransition( opacity: animation, child: child); }, pageBuilder: (BuildContext buildContext, Animation<double> animation, Animation<double> secondaryAnimation) => Align( alignment: Alignment.centerRight, child: Material( color: appColor.main.withOpacity(0.5), child: Container( width: 200, child: SingleChildScrollView( child: Padding( padding: const EdgeInsets.all(8), child: Wrap( spacing: 12, runSpacing: 6, alignment: WrapAlignment.start, runAlignment: WrapAlignment.start, crossAxisAlignment: WrapCrossAlignment.start, children: buttomListPlay(), ), ), ), ))));
2023年02月28日
59 阅读
0 评论
0 点赞
2023-02-28
Flutter的几种动画类型
SlideTransition:滑动过渡动画,可以控制转换的方向;SizeTransition:大小过渡动画,可以控制大小的转换;FadeTransition:淡入淡出过渡动画;RotationTransition:旋转过渡动画;PositionedTransition:定位过渡动画;FadeThroughTransition:淡入淡出过渡动画;AnimatedContainer:容器过渡动画;AnimatedCrossFade:交叉淡入淡出过渡动画;Hero:英雄过渡动画;DecoratedBoxTransition:装饰盒过渡动画;DefaultTextStyleTransition:默认文本样式过渡动画;AlignTransition:对齐过渡动画;RelativePositionedTransition:相对定位过渡动画;AnimatedBuilder:动画构建者过渡动画;AnimatedOpacity:不透明度动画;AnimatedWidget:动画控件过渡动画;AnimatedIcon:动画图标过渡动画;AnimatedPhysicalModel:动画物理模型过渡动画;AnimatedPositioned:动画定位过渡动画;AnimatedPadding:动画填充过渡动画;AnimatedTheme:动画主题过渡动画;AnimatedDefaultTextStyle:动画默认文本样式过渡动画;AnimatedSize:动画大小过渡动画。
2023年02月28日
47 阅读
0 评论
0 点赞
2023-02-28
Flutter 图片保存页面
class ImagesView extends StatefulWidget { final String pic; const ImagesView({Key? key, required this.pic}) : super(key: key); @override State<ImagesView> createState() => _ImagesViewState(); } class _ImagesViewState extends State<ImagesView> { int downproess = 0; @override Widget build(BuildContext context) { return GestureDetector( onTap: () { Get.back(); }, child: comBottonBar( child: Scaffold( appBar: AppBar( leading: comLeading(), actions: [ IconButton( onPressed: () { Get.bottomSheet(Container( height: 120, decoration: BoxDecoration( borderRadius: BorderRadius.only( topLeft: Radius.circular(12), topRight: Radius.circular(12)), color: appColor.main), child: SingleChildScrollView( padding: EdgeInsets.all(12), child: Column( children: [ Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ toolsWidget( iconData: CocoIconBold.Arrow_Bottom_3, msg: '保存图片', ontap: () async { Get.back(); try { var response = await dio.get( widget.pic, options: Options( responseType: ResponseType.bytes), onReceiveProgress: (count, total) { setState(() { downproess = ((count / total) * 100) .toInt(); }); }, ); final result = await ImageGallerySaver.saveImage( Uint8List.fromList( response.data), quality: 80, name: widget.pic.replaceAll( 'https://', '')); comToast(msg: '保存成功'); } on DioError catch (e) { comToast(msg: '保存失败'); Exception(e); } vibrate(); }), ], ), const SizedBox(height: 12), TextButton( onPressed: () { Get.back(); }, child: Text( '关闭', style: TextStyle(color: appColor.sub), )) ], ), ), )); }, icon: Icon( CocoIconBold.Menu_1, size: 20, )) ], ), body: Stack(alignment: Alignment.center, children: [ Padding( padding: const EdgeInsets.all(12.0), child: Center( child: PhotoView( loadingBuilder: (context, event) => Center( child: comLoading(), ), imageProvider: CachedNetworkImageProvider(widget.pic), backgroundDecoration: BoxDecoration(), )), ), Visibility( visible: downproess == 0 || downproess == 100 ? false : true, child: CircularProgressIndicator( value: downproess / 100, backgroundColor: appColor.black.withOpacity(0.02), valueColor: AlwaysStoppedAnimation<Color>( (appColor.sub), ), ), ) ]), ), ), ); } }
2023年02月28日
31 阅读
0 评论
0 点赞
2023-02-27
GetX框架的snackbar
if (dateTime == null || DateTime.now().difference(dateTime!) > Duration(seconds: 2)) { dateTime = DateTime.now(); Get.snackbar( '', '', titleText: Text( '再按一次退出', style: TextStyle( color: appColor.white, fontSize: 15, fontWeight: FontWeight.bold), ), messageText: Text( '消息', style: TextStyle( color: appColor.white, fontSize: 12, fontWeight: FontWeight.bold, ), ), snackPosition: SnackPosition.TOP, barBlur: 5, icon: Align( alignment: Alignment.center, child: SvgPicture.asset( myImages.LogoWhite, width: 20, height: 20, ), ), ); return false; } return true; },
2023年02月27日
9 阅读
0 评论
0 点赞
2023-02-20
正则匹配文中是否有加密货币
getTextTokenName({required String text}) { List cryptoNames = []; String str = "$text"; RegExp r = RegExp(r"$[a-zA-Z]*");Iterable matches = r.allMatches(text); for (Match m in matches) {cryptoNames.add(m.group(0)!.substring(1)); print(cryptoNames);} return cryptoNames;}
2023年02月20日
19 阅读
0 评论
0 点赞
1
...
4
5
6
...
12