Skip to content

Commit 0378638

Browse files
committed
WIP: Removal of android.html iframe
Introduce Flutter based virtual display. Move touchscreen implementation to Flutter. Move browser gps implementation to flutter
1 parent 8f7d2d9 commit 0378638

31 files changed

+1205
-243
lines changed

lib/common/di/ta_locator.config.dart

Lines changed: 28 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/common/navigation/ta_page_factory.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import 'package:tesla_android/common/navigation/ta_page.dart';
66
import 'package:tesla_android/feature/about/about_page.dart';
77
import 'package:tesla_android/feature/display/cubit/display_cubit.dart';
88
import 'package:tesla_android/feature/donations/widget/donation_page.dart';
9+
import 'package:tesla_android/feature/gps/cubit/gps_cubit.dart';
910
import 'package:tesla_android/feature/home/cubit/ota_update_cubit.dart';
1011
import 'package:tesla_android/feature/home/home_page.dart';
1112
import 'package:tesla_android/feature/releaseNotes/cubit/release_notes_cubit.dart';
@@ -37,6 +38,7 @@ class TAPageFactory {
3738
BlocProvider(create: (_) => getIt<AudioConfigurationCubit>()),
3839
BlocProvider(create: (_) => getIt<GPSConfigurationCubit>()),
3940
BlocProvider(create: (_) => getIt<TouchscreenCubit>()),
41+
BlocProvider(create: (_) => getIt<GpsCubit>()),
4042
BlocProvider(create: (_) => getIt<DisplayCubit>()),
4143
BlocProvider(
4244
create: (_) => getIt<OTAUpdateCubit>()..checkForUpdates(),

lib/common/network/base_websocket_transport.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ abstract class BaseWebsocketTransport with Logger {
3838
_webSocketChannel = null;
3939
}
4040

41+
void reconnect() {
42+
disconnect();
43+
connect();
44+
}
45+
4146
Future<void> _connect() async {
4247
_webSocketChannel = WebSocket(
4348
Uri.parse(_flavor.getString(

lib/common/utils/logger.dart

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1+
import 'package:flutter/foundation.dart';
2+
13
mixin Logger {
24
void log(String message) {
3-
print("[$runtimeType $hashCode] $message" );
5+
if (kDebugMode) {
6+
print("[$runtimeType $hashCode] $message" );
7+
}
48
}
59

6-
void logException({exception, StackTrace? stackTrace}) {
7-
print("[$runtimeType] ${exception.toString()}");
8-
print("[$runtimeType] ${stackTrace.toString()}");
10+
void logException({dynamic exception, StackTrace? stackTrace}) {
11+
if (kDebugMode) {
12+
print("[$runtimeType] ${exception.toString()}");
13+
print("[$runtimeType] ${stackTrace.toString()}");
14+
}
915
}
1016
}

0 commit comments

Comments
 (0)