[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"$f_AY77pueA27zOVnaxUuS-8B-QyKCalvAPi-TE3dNvas":3},{"code":4,"message":5,"data":6},200,"成功",{"id":7,"createdAt":8,"title":9,"content":10,"summary":11,"image":12,"uid":13,"user":14,"categoryId":21,"category":22,"subCategoryId":24,"subCategory":25,"comments":27,"status":17,"reason":33,"notice":33,"visitCount":38,"commentCount":17,"keywords":39},133,"2024-11-04T02:17:31.538Z","flutter_slidable的报错问题记录","## 问题\n工程引入了flutter_slidable库，但是随着工程升级，flutter_slider的新版本遇到编译问题，如下截图：\n![flutter报错截图](https://image.xinwei.ltd/image1730685616014.png)\n\n> Error (Xcode): Invaid depfile: /Users/edy/Desktop/xxxx/.dart_tool/flutter_build/1c028f2d1b282d28c0bd6c81c174182a/kernel_snapshot_program.d\n> \n> Could not build the application for the simulator.\n> Error launching application on iPhone XR.\n\n从截图中看不出具体，所以需要使用Xcode跑一下iOS工程，以便查处问题所在：\n![flutter ios工程编译](https://image.xinwei.ltd/image1730685745563.png)\n\n从xcode中可以看出是flutter_slider这个库出现了问题。\n\n## 解决方式\n首先通过代码的git变动记录，可以看出flutter_slidable这个库的版本在编译报错前后是出现了版本号变化的，如果你从`pubspec.yaml`中看不出来，可以查看`pubspec.lock`中的变化。\n\n通过在GitHub上：[https://github.com/letsar/flutter_slidable](https://github.com/letsar/flutter_slidable)，在issue中可以看到也有人反馈了相同问题：\n[https://github.com/letsar/flutter_slidable/issues/488](https://github.com/letsar/flutter_slidable/issues/488)\n\n问题出在，flutter_slidable的3.0.1到最新版本3.1.1，有变量未被定义，无法识别，引入tag的版本无法解决。但是master分支上已经有修复了，所以需要修改flutter_slidable的引入指向问题。\n所以做以下改动\n\n```pubspec.yaml\n  provider: ^6.1.2\n#  flutter_slidable: ^3.0.1\n  flutter_slidable:\n      git:\n        url: https://github.com/letsar/flutter_slidable.git\n        ref: master\n  pull_to_refresh: ^2.0.0\n```\n然后执行`flutter pub get`更新依赖。\n\n问题解决。\n\n## 其他\n如果存在缓存问题，可以clean一下工程\n```terminal\nflutter clean\n```\n","记录一个flutter工程中库报错的问题，原因是flutter_slider的master分支上有undefined的变量。","https://image.xinwei.ltd/image1730685616014.png",499668042977349,{"phone":15,"userId":13,"nickName":16,"vipType":17,"avatar":18,"sign":19,"createdAt":20},"13121171998","全栈老韩",1,"https://image.xinwei.ltd/images/IMG_5430.JPG","全栈工程师，擅长iOS App开发、前端（vue、react、nuxt、小程序&Taro）开发、Flutter、React Native、后端（midwayjs、golang、express、koa）开发、docker容器、seo优化等。","2024-01-01T16:14:30.305Z",2,{"id":21,"name":23},"IT技术",11,{"id":24,"name":26,"parentId":21},"Flutter",[28],{"id":29,"createAt":30,"content":31,"articleId":7,"userId":13,"user":32,"replyToUid":34,"replyToUser":35,"status":17,"statusDes":33,"replies":37},15,"2024-12-06T07:51:01.71Z","补充一下，报错是：Error (Xcode): ../../../../../../../.pub-cache/hosted/pub.flutter-io.cn/flutter_slidable-3.1.1/lib/src/notifications_old.dart:88:23: Error: The method 'hashValues' isn't defined for the class 'SlidableRatioNotification'.\n\nCould not build the application for the simulator.\nError launching application on iPhone Xʀ.",{"phone":15,"userId":13,"nickName":16,"vipType":17,"avatar":18,"sign":33,"createdAt":20},"",0,{"phone":33,"userId":34,"nickName":33,"vipType":34,"avatar":33,"sign":33,"createdAt":36},"0001-01-01T00:00:00Z",null,1170,"flutter_slidable,flutter,slider,flutter ios,xcode,ios"]