| .. | .. |
|---|
| 160 | 160 | _ws!.onStatusChanged = (status) { |
|---|
| 161 | 161 | if (mounted) { |
|---|
| 162 | 162 | ref.read(wsStatusProvider.notifier).state = status; |
|---|
| 163 | + if (status == ConnectionStatus.connected) { |
|---|
| 164 | + ref.read(connectionDetailProvider.notifier).state = ''; |
|---|
| 165 | + } |
|---|
| 166 | + } |
|---|
| 167 | + }; |
|---|
| 168 | + _ws!.onStatusDetail = (detail) { |
|---|
| 169 | + if (mounted) { |
|---|
| 170 | + ref.read(connectionDetailProvider.notifier).state = detail; |
|---|
| 163 | 171 | } |
|---|
| 164 | 172 | }; |
|---|
| 165 | 173 | _ws!.onMessage = _handleMessage; |
|---|
| .. | .. |
|---|
| 1301 | 1309 | final messages = ref.watch(messagesProvider); |
|---|
| 1302 | 1310 | final wsStatus = ref.watch(wsStatusProvider); |
|---|
| 1303 | 1311 | final isTyping = ref.watch(isTypingProvider); |
|---|
| 1312 | + final connectionDetail = ref.watch(connectionDetailProvider); |
|---|
| 1304 | 1313 | final sessions = ref.watch(sessionsProvider); |
|---|
| 1305 | 1314 | final activeSession = ref.watch(activeSessionProvider); |
|---|
| 1306 | 1315 | final unreadCounts = ref.watch(unreadCountsProvider); |
|---|
| .. | .. |
|---|
| 1319 | 1328 | _scaffoldKey.currentState?.openDrawer(); |
|---|
| 1320 | 1329 | }, |
|---|
| 1321 | 1330 | ), |
|---|
| 1322 | | - title: Text( |
|---|
| 1323 | | - activeSession?.name ?? 'PAILot', |
|---|
| 1324 | | - style: const TextStyle(fontSize: 16, fontWeight: FontWeight.w600), |
|---|
| 1331 | + title: Column( |
|---|
| 1332 | + crossAxisAlignment: CrossAxisAlignment.center, |
|---|
| 1333 | + mainAxisSize: MainAxisSize.min, |
|---|
| 1334 | + children: [ |
|---|
| 1335 | + Text( |
|---|
| 1336 | + activeSession?.name ?? 'PAILot', |
|---|
| 1337 | + style: const TextStyle(fontSize: 16, fontWeight: FontWeight.w600), |
|---|
| 1338 | + ), |
|---|
| 1339 | + if (connectionDetail.isNotEmpty && wsStatus != ConnectionStatus.connected) |
|---|
| 1340 | + Text( |
|---|
| 1341 | + connectionDetail, |
|---|
| 1342 | + style: TextStyle(fontSize: 11, color: Colors.grey.shade400), |
|---|
| 1343 | + ), |
|---|
| 1344 | + ], |
|---|
| 1325 | 1345 | ), |
|---|
| 1326 | 1346 | actions: [ |
|---|
| 1327 | 1347 | StatusDot(status: wsStatus), |
|---|