feat(client): 网络恢复自动刷新 + 离线嗅探 + 连通性感知登录
网络嗅探与自动恢复: - ConnectivityNotifier:在线时 30s 检测,离线时切换为 1min 嗅探 - 新增 networkRecoveryCountProvider:网络恢复时自增,各数据 provider 通过 ref.watch 实现自动重新加载 - inventory/product/stock_in/stock_out/partner provider 均已接入 FutureBuilder 类屏幕: - finance_screen + batch_tracking_screen 通过 ref.listen 监听恢复事件 修复问题 1:API 超时 10s/30s → 5s/15s,减少无网络时等待 修复问题 2:offline banner 文字由"写操作已禁用"改为实际行为描述 连通性感知: - app 启动时(_AppBootstrap)立即 forceCheck,路由跳转前状态已就绪 - 登录页:watch connectivityProvider,离线时显示警告 banner - 登录按钮:离线状态下直接提示,不等待超时 测试: - login_screen_test + login_flow_test 通过 ConnectivityNotifier(skipInit: true) 覆盖 provider,避免测试环境中 pending HTTP timer Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -49,14 +49,16 @@ void main() {
|
||||
'data': [
|
||||
{
|
||||
'warehouse_id': 1,
|
||||
'warehouse_name': '主仓库',
|
||||
'product_id': 1,
|
||||
'product_name': '五粮液',
|
||||
'product_code': 'P001',
|
||||
'product_spec': '500ml',
|
||||
'product_unit': '瓶',
|
||||
'product_brand': '五粮液集团',
|
||||
'min_stock': 10,
|
||||
'warehouse': {'name': '主仓库'},
|
||||
'product': {
|
||||
'name': '五粮液',
|
||||
'code': 'P001',
|
||||
'spec': '500ml',
|
||||
'unit': '瓶',
|
||||
'brand': '五粮液集团',
|
||||
'min_stock': 10,
|
||||
},
|
||||
'quantity': 50.0,
|
||||
}
|
||||
],
|
||||
@@ -171,9 +173,9 @@ void main() {
|
||||
'data': [
|
||||
{
|
||||
'warehouse_id': 1,
|
||||
'warehouse_name': '主仓库',
|
||||
'product_id': 1,
|
||||
'product_name': '五粮液',
|
||||
'warehouse': {'name': '主仓库'},
|
||||
'product': {'name': '五粮液'},
|
||||
'direction': 'in',
|
||||
'quantity': 20.0,
|
||||
'qty_before': 30.0,
|
||||
|
||||
Reference in New Issue
Block a user