feat: Phase 2 — upgrade deps to null-safe, replace deprecated packages

- pubspec: bump all maintained deps to null-safe latest; flutter pub get resolves
- Remove 12 packages (0-ref or no null-safe): splashscreen, flappy_search_bar,
  searchable_dropdown, share, platform_detect, flutter_inappwebview, countdown,
  gender_selection, flutter_dash, smooth_star_rating, hovering, ffi
- Add flutter_rating_bar
- Keep discontinued-but-null-safe for now (Phase 5): pull_to_refresh, hive, catcher
- New null-safe custom components (API-compatible, callers change only imports):
  utils/countdown.dart, widgets/general/{hover_widget,gender_selection,
  smooth_star_rating,search_bar}.dart
- main.dart: drop dead SplashScreen _buildBody + _to field
- 23 consuming files: swap deprecated imports to local components

Null-safety migration + upgraded-API adaptation = Phase 3.
This commit is contained in:
2026-07-24 03:10:12 +08:00
parent 7ffcc848d0
commit 1a578c925d
37 changed files with 1252 additions and 574 deletions

View File

@@ -15,7 +15,7 @@
## 阶段
- [x] 阶段 0基线 & 锁版本
- [x] 阶段 1去掉 Stripe
- [ ] 阶段 2依赖替换与升级
- [x] 阶段 2依赖替换与升级
- [ ] 阶段 3空安全迁移
- [ ] 阶段 4Web 跑起来
@@ -38,3 +38,18 @@
- constants.dart: 新增 ETRANSFER_EMAIL(payment@wisetronic.com) 与 REMARK_PREFIX(R#)
- 新增 lib/widgets/general/e_transfer_pay.dart: 展示邮箱 + 提醒备注写 R#<orderId>
- 保留: PAYMENT_METHOD_CODE_STRIPE='stripe'(API 仍返回该 code路由到 e-Transfer)payment_platform.dart 的 'stripe' 显示名(后续美化时调整)
### 阶段 2 — 依赖替换与升级(已完成)
**flutter pub get 成功解析 178 个依赖。**
- 升级到 null-safe 最新版dio ^5.7、cached_network_image ^3.4、url_launcher ^6.3、path_provider ^2.1、image_picker ^1.1、google_maps_flutter ^2.9、geolocator ^12、youtube_player_iframe ^5.2、flutter_local_notifications ^17、uuid ^4、fluttertoast ^8.2、badges ^3、carousel_slider ^5、percent_indicator ^4.2.3、photo_view ^0.15、toggle_switch ^2.3、pinput ^5、email_validator ^3、responsive_builder ^0.7、flutter_redux ^0.10、fluro ^2.0.5、font_awesome_flutter ^10、flutter_spinkit ^5.2、flutter_markdown ^0.7、url_strategy ^0.3、universal_io/html
- 删除(0引用或无 null-safe 版)splashscreen(死代码)、flappy_search_bar、searchable_dropdown、share、platform_detect、flutter_inappwebview、countdown、gender_selection、flutter_dash(死 import)、smooth_star_rating、hovering、ffi
- 新增flutter_rating_bar ^4.0
- 停维但有 null-safe 版→暂留(Phase 5 再换)pull_to_refresh(→smart_refresher)、hive/hive_flutter(→hive_ce)、catcher ^0.8(→catcher2)
- 新建 null-safe 自定义组件替代废弃包(API 兼容, 调用方仅改 import)
- lib/utils/countdown.dart (CountDown.stream)
- lib/widgets/general/hover_widget.dart (HoverWidget)
- lib/widgets/general/gender_selection.dart (Gender 枚举 + GenderSelection)
- lib/widgets/general/smooth_star_rating.dart (SmoothStarRating)
- lib/widgets/general/search_bar.dart (轻量 Web 搜索 SearchBar + SearchBarController, 含 replayLastSearch 分页)
- main.dart删除未使用的 _buildBody(SplashScreen) 与 _to 字段
- ⚠️ 待 Phase 3API 升级破坏性变更(dio5/badges3/toggle_switch2/pinput5/geolocator12 等用法适配) + 整库空安全迁移,按 dart analyze 驱动修复