fixing a ton of sloppy mess...
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
// integration_test/app_flow_test.dart
|
||||
//
|
||||
// integration_test/app_flow_test.dart
|
||||
// ignore_for_file: prefer_const_constructors, no_leading_underscores_for_local_identifiers
|
||||
//
|
||||
// Integration Tests (E2E) untuk WalkGuide App — 3 alur utama:
|
||||
// Flow 1: Login → Dashboard → Logout
|
||||
// Flow 2: Login → WalkGuide → Start → Stop → SOS
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// test/unit/obstacle_analyzer_test.dart
|
||||
//
|
||||
// test/unit/obstacle_analyzer_test.dart
|
||||
// ignore_for_file: prefer_const_declarations
|
||||
//
|
||||
// Unit test untuk ObstacleAnalyzer — logika AI direction & distance.
|
||||
// Jalankan: flutter test test/unit/obstacle_analyzer_test.dart
|
||||
//
|
||||
|
||||
@@ -51,14 +51,14 @@ class _FakeStt {
|
||||
// VoiceCommandHandler (mirror dari project)
|
||||
typedef CommandCallback = void Function(VoiceCommandKey key);
|
||||
|
||||
class VoiceCommandHandler {
|
||||
class _VoiceCommandHandler {
|
||||
final _FakeStt _stt;
|
||||
final _FakeTts _tts;
|
||||
|
||||
List<VoiceCommand> _commands = [];
|
||||
CommandCallback? onCommand;
|
||||
|
||||
VoiceCommandHandler(this._stt, this._tts);
|
||||
_VoiceCommandHandler(this._stt, this._tts);
|
||||
|
||||
void loadCommands(List<VoiceCommand> commands) {
|
||||
_commands = commands;
|
||||
@@ -137,7 +137,7 @@ class VoiceCommandHandler {
|
||||
// ---------- Tests ----------
|
||||
|
||||
void main() {
|
||||
late VoiceCommandHandler handler;
|
||||
late _VoiceCommandHandler handler;
|
||||
late _FakeStt fakeStt;
|
||||
late _FakeTts fakeTts;
|
||||
|
||||
@@ -146,7 +146,7 @@ void main() {
|
||||
setUp(() {
|
||||
fakeStt = _FakeStt();
|
||||
fakeTts = _FakeTts();
|
||||
handler = VoiceCommandHandler(fakeStt, fakeTts);
|
||||
handler = _VoiceCommandHandler(fakeStt, fakeTts);
|
||||
dispatchedCommands.clear();
|
||||
handler.loadDefaultCommands();
|
||||
handler.onCommand = dispatchedCommands.add;
|
||||
|
||||
@@ -151,8 +151,6 @@ class _StubLoginScreenState extends State<_StubLoginScreen> {
|
||||
}
|
||||
|
||||
// Workaround untuk SizedBox(height(12)) yang error — gunakan helper
|
||||
SizedBox _gap(double h) => SizedBox(height: h);
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Tests
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -397,4 +395,4 @@ void main() {
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// test/widget/manual_screen_test.dart
|
||||
//
|
||||
// test/widget/manual_screen_test.dart
|
||||
// ignore_for_file: prefer_const_constructors
|
||||
//
|
||||
// Widget tests untuk ManualScreen — halaman panduan perintah suara.
|
||||
// Jalankan: flutter test test/widget/manual_screen_test.dart
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// test/widget/notification_screen_test.dart
|
||||
//
|
||||
// test/widget/notification_screen_test.dart
|
||||
// ignore_for_file: prefer_const_constructors
|
||||
//
|
||||
// Widget tests untuk NotificationScreen — menampilkan notifikasi dari Guardian.
|
||||
// Jalankan: flutter test test/widget/notification_screen_test.dart
|
||||
|
||||
|
||||
@@ -167,7 +167,7 @@ class _StubSosScreenState extends State<_StubSosScreen> {
|
||||
shape: BoxShape.circle,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.red.withOpacity(0.4),
|
||||
color: Colors.red.withValues(alpha: 0.4),
|
||||
blurRadius: 20,
|
||||
spreadRadius: 4,
|
||||
),
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// test/widget/walk_guide_screen_test.dart
|
||||
//
|
||||
// test/widget/walk_guide_screen_test.dart
|
||||
// ignore_for_file: prefer_const_constructors, prefer_const_literals_to_create_immutables
|
||||
//
|
||||
// Widget tests untuk WalkGuideScreen — layar utama navigasi tunanetra.
|
||||
// Jalankan: flutter test test/widget/walk_guide_screen_test.dart
|
||||
//
|
||||
@@ -264,7 +265,7 @@ class _DetectionOverlay extends StatelessWidget {
|
||||
margin: const EdgeInsets.symmetric(horizontal: 16),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
||||
decoration: BoxDecoration(
|
||||
color: detection.isAlert ? Colors.red.withOpacity(0.85) : Colors.black87,
|
||||
color: detection.isAlert ? Colors.red.withValues(alpha: 0.85) : Colors.black87,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Text(
|
||||
@@ -578,4 +579,4 @@ void main() {
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user