fix: auto repair bugs #11, #10, #9

This commit is contained in:
repair-agent 2026-02-24 16:08:31 +08:00
parent 5d8619450d
commit 679e33428c
6 changed files with 41 additions and 28 deletions

View File

@ -1,8 +1,4 @@
PODS: PODS:
- ali_auth (1.3.7):
- Flutter
- MJExtension
- SDWebImage
- audio_session (0.0.1): - audio_session (0.0.1):
- Flutter - Flutter
- Flutter (1.0.0) - Flutter (1.0.0)
@ -14,12 +10,8 @@ PODS:
- just_audio (0.0.1): - just_audio (0.0.1):
- Flutter - Flutter
- FlutterMacOS - FlutterMacOS
- MJExtension (3.4.2)
- permission_handler_apple (9.3.0): - permission_handler_apple (9.3.0):
- Flutter - Flutter
- SDWebImage (5.21.6):
- SDWebImage/Core (= 5.21.6)
- SDWebImage/Core (5.21.6)
- shared_preferences_foundation (0.0.1): - shared_preferences_foundation (0.0.1):
- Flutter - Flutter
- FlutterMacOS - FlutterMacOS
@ -28,7 +20,6 @@ PODS:
- FlutterMacOS - FlutterMacOS
DEPENDENCIES: DEPENDENCIES:
- ali_auth (from `.symlinks/plugins/ali_auth/ios`)
- audio_session (from `.symlinks/plugins/audio_session/ios`) - audio_session (from `.symlinks/plugins/audio_session/ios`)
- Flutter (from `Flutter`) - Flutter (from `Flutter`)
- flutter_blue_plus_darwin (from `.symlinks/plugins/flutter_blue_plus_darwin/darwin`) - flutter_blue_plus_darwin (from `.symlinks/plugins/flutter_blue_plus_darwin/darwin`)
@ -38,14 +29,7 @@ DEPENDENCIES:
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`) - shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
- webview_flutter_wkwebview (from `.symlinks/plugins/webview_flutter_wkwebview/darwin`) - webview_flutter_wkwebview (from `.symlinks/plugins/webview_flutter_wkwebview/darwin`)
SPEC REPOS:
trunk:
- MJExtension
- SDWebImage
EXTERNAL SOURCES: EXTERNAL SOURCES:
ali_auth:
:path: ".symlinks/plugins/ali_auth/ios"
audio_session: audio_session:
:path: ".symlinks/plugins/audio_session/ios" :path: ".symlinks/plugins/audio_session/ios"
Flutter: Flutter:
@ -64,15 +48,12 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/webview_flutter_wkwebview/darwin" :path: ".symlinks/plugins/webview_flutter_wkwebview/darwin"
SPEC CHECKSUMS: SPEC CHECKSUMS:
ali_auth: fe9a6188a90eb39227f3674c05a71383ac4ec6a2
audio_session: 9bb7f6c970f21241b19f5a3658097ae459681ba0 audio_session: 9bb7f6c970f21241b19f5a3658097ae459681ba0
Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467 Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467
flutter_blue_plus_darwin: 20a08bfeaa0f7804d524858d3d8744bcc1b6dbc3 flutter_blue_plus_darwin: 20a08bfeaa0f7804d524858d3d8744bcc1b6dbc3
image_picker_ios: e0ece4aa2a75771a7de3fa735d26d90817041326 image_picker_ios: e0ece4aa2a75771a7de3fa735d26d90817041326
just_audio: 4e391f57b79cad2b0674030a00453ca5ce817eed just_audio: 4e391f57b79cad2b0674030a00453ca5ce817eed
MJExtension: e97d164cb411aa9795cf576093a1fa208b4a8dd8
permission_handler_apple: 4ed2196e43d0651e8ff7ca3483a069d469701f2d permission_handler_apple: 4ed2196e43d0651e8ff7ca3483a069d469701f2d
SDWebImage: 1bb6a1b84b6fe87b972a102bdc77dd589df33477
shared_preferences_foundation: 7036424c3d8ec98dfe75ff1667cb0cd531ec82bb shared_preferences_foundation: 7036424c3d8ec98dfe75ff1667cb0cd531ec82bb
webview_flutter_wkwebview: 8ebf4fded22593026f7dbff1fbff31ea98573c8d webview_flutter_wkwebview: 8ebf4fded22593026f7dbff1fbff31ea98573c8d

View File

@ -1,6 +1,6 @@
class ApiConfig { class ApiConfig {
/// IP /// IP
static const String baseUrl = 'http://192.168.124.24:8000'; static const String baseUrl = 'http://192.168.124.8:8000';
/// App API /// App API
static const String apiPrefix = '/api/v1'; static const String apiPrefix = '/api/v1';

View File

@ -16,6 +16,7 @@ class LogCenterService {
defaultValue: 'https://qiyuan-log-center-api.airlabs.art', defaultValue: 'https://qiyuan-log-center-api.airlabs.art',
); );
static const String _url = '$_baseUrl/api/v1/logs/report'; static const String _url = '$_baseUrl/api/v1/logs/report';
static const String _registerUrl = '$_baseUrl/api/v1/projects/register';
static const String _projectId = 'airhub_app'; static const String _projectId = 'airhub_app';
static const String _repoUrl = 'https://gitea.airlabs.art/zyc/rtc_prd.git'; static const String _repoUrl = 'https://gitea.airlabs.art/zyc/rtc_prd.git';
@ -29,6 +30,24 @@ class LogCenterService {
)); ));
} }
/// Log Center
Future<void> initialize() async {
try {
await _dio.post(_registerUrl, data: {
'project_id': _projectId,
'repo_url': _repoUrl,
'description': 'Flutter mobile app (subdirectory of rtc_prd repo)',
'platform': defaultTargetPlatform.name,
'environment': const String.fromEnvironment(
'ENVIRONMENT',
defaultValue: kDebugMode ? 'development' : 'production',
),
});
} catch (_) {
// App
}
}
/// Flutter FlutterError /// Flutter FlutterError
void reportFlutterError(FlutterErrorDetails details) { void reportFlutterError(FlutterErrorDetails details) {
_report( _report(

View File

@ -33,9 +33,9 @@ _DeviceInfo _$DeviceInfoFromJson(Map<String, dynamic> json) => _DeviceInfo(
deviceType: (json['device_type'] is Map<String, dynamic>) deviceType: (json['device_type'] is Map<String, dynamic>)
? DeviceType.fromJson(json['device_type'] as Map<String, dynamic>) ? DeviceType.fromJson(json['device_type'] as Map<String, dynamic>)
: null, : null,
deviceTypeInfo: json['device_type_info'] == null deviceTypeInfo: (json['device_type_info'] is Map<String, dynamic>)
? null ? DeviceType.fromJson(json['device_type_info'] as Map<String, dynamic>)
: DeviceType.fromJson(json['device_type_info'] as Map<String, dynamic>), : null,
macAddress: json['mac_address'] as String?, macAddress: json['mac_address'] as String?,
name: json['name'] as String? ?? '', name: json['name'] as String? ?? '',
status: json['status'] as String? ?? 'in_stock', status: json['status'] as String? ?? 'in_stock',

View File

@ -14,6 +14,7 @@ void main() {
final container = ProviderContainer(); final container = ProviderContainer();
final logCenter = container.read(logCenterServiceProvider); final logCenter = container.read(logCenterServiceProvider);
logCenter.initialize();
// Flutter Widget build // Flutter Widget build
FlutterError.onError = (details) { FlutterError.onError = (details) {

View File

@ -75,7 +75,7 @@ class _BluetoothPageState extends ConsumerState<BluetoothPage>
static const _airhubPrefix = 'Airhub_'; static const _airhubPrefix = 'Airhub_';
// //
bool _isSearching = true; bool _isSearching = !kIsWeb; // Web
bool _isBluetoothOn = false; bool _isBluetoothOn = false;
List<MockDevice> _devices = []; List<MockDevice> _devices = [];
int _currentIndex = 0; int _currentIndex = 0;
@ -132,7 +132,8 @@ class _BluetoothPageState extends ConsumerState<BluetoothPage>
setState(() => _isBluetoothOn = isOn); setState(() => _isBluetoothOn = isOn);
if (isOn) { if (isOn) {
_startSearch(); // Web : BLE scan
if (!kIsWeb) _startSearch();
} else if (state == BluetoothAdapterState.off) { } else if (state == BluetoothAdapterState.off) {
FlutterBluePlus.stopScan(); FlutterBluePlus.stopScan();
setState(() { setState(() {
@ -307,6 +308,7 @@ class _BluetoothPageState extends ConsumerState<BluetoothPage>
/// ///
Future<void> _requestPermissions() async { Future<void> _requestPermissions() async {
if (kIsWeb) return; // Web
try { try {
if (Platform.isAndroid) { if (Platform.isAndroid) {
// Android BLE // Android BLE
@ -324,7 +326,7 @@ class _BluetoothPageState extends ConsumerState<BluetoothPage>
/// ///
void _showBluetoothOffDialog() { void _showBluetoothOffDialog() {
if (!mounted) return; if (!mounted || kIsWeb) return; // Web
showGlassDialog( showGlassDialog(
context: context, context: context,
title: '蓝牙未开启', title: '蓝牙未开启',
@ -781,9 +783,9 @@ class _BluetoothPageState extends ConsumerState<BluetoothPage>
return Container( return Container(
padding: EdgeInsets.fromLTRB( padding: EdgeInsets.fromLTRB(
20, // HTML: 20px sides 20, // HTML: 20px sides
20, // HTML: 20px top 16, // HTML: 20px top (reduced to prevent overflow)
20, 20,
MediaQuery.of(context).padding.bottom + 60, // HTML: safe-area + 60px MediaQuery.of(context).padding.bottom + 40, // HTML: safe-area + bottom padding
), ),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
@ -812,6 +814,16 @@ class _BluetoothPageState extends ConsumerState<BluetoothPage>
), ),
), ),
), ),
// (Web )
if (!_isSearching && _devices.isEmpty) ...[
const SizedBox(width: 16),
GradientButton(
text: '搜索设备',
width: 180,
height: 52,
onPressed: _startSearch,
),
],
// () // ()
if (!_isSearching && _devices.isNotEmpty) ...[ if (!_isSearching && _devices.isNotEmpty) ...[
const SizedBox(width: 16), // HTML: gap 16px const SizedBox(width: 16), // HTML: gap 16px