Skip to content

Commit

Permalink
feat: add workflows flutter + --fatal-infos
Browse files Browse the repository at this point in the history
  • Loading branch information
amaralkaff committed Oct 31, 2024
1 parent 6e5eee7 commit 1f03ee6
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 21 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/dart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ jobs:

# Consider passing '--fatal-infos' for slightly stricter analysis.
- name: Analyze project source
run: flutter analyze
run: flutter analyze --fatal-infos
continue-on-error: true # Allow the workflow to continue even if analysis fails

# Run Flutter tests
- name: Run tests
Expand Down
6 changes: 6 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@

# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
analyzer:
errors:
depend_on_referenced_packages: ignore
avoid_print: ignore
curly_braces_in_flow_control_structures: ignore
use_build_context_synchronously: ignore
include: package:flutter_lints/flutter.yaml

linter:
Expand Down
1 change: 0 additions & 1 deletion lib/services/pushup_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import 'package:workout_ai/services/auth_service.dart';

class PushupService {
static const String baseUrl = 'https://backend-workout-ai.vercel.app/api';
final AuthService _authService = AuthService();

Future<Map<String, dynamic>> submitPushups({
required int pushUps,
Expand Down
21 changes: 2 additions & 19 deletions lib/views/camera_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import 'package:workout_ai/painters/pose_painter.dart';
import 'package:workout_ai/services/pushup_service.dart';
import 'package:workout_ai/utils/utils.dart' as utils;
import 'package:workout_ai/widgets/workout_completion_dialog.dart';
import 'dart:developer' as developer;

class ExerciseStatsWidget extends StatelessWidget {
final String exerciseType;
Expand Down Expand Up @@ -151,7 +152,6 @@ class _CameraViewState extends State<CameraView> {
static List<CameraDescription> _cameras = [];
CameraController? _controller;
int _cameraIndex = -1;
double _currentZoomLevel = 1.0;

bool _changingCameraLens = false;

Expand Down Expand Up @@ -195,21 +195,6 @@ class _CameraViewState extends State<CameraView> {
});
}

void _pauseTimer() {
_timer?.cancel();
setState(() {
_isTimerRunning = false;
});
}

void _resetTimer() {
_timer?.cancel();
setState(() {
_seconds = 0;
_isTimerRunning = false;
});
}

String _formatTime(int seconds) {
int minutes = seconds ~/ 60;
int remainingSeconds = seconds % 60;
Expand Down Expand Up @@ -238,7 +223,7 @@ class _CameraViewState extends State<CameraView> {
if (p1 != null && p2 != null && p3 != null) {
final rtaAngle = utils.angle(p1!, p2!, p3!);
final rta = utils.isPushUp(rtaAngle, bloc.state);
print("Angle: ${rtaAngle.toStringAsFixed(2)}");
developer.log("Angle: ${rtaAngle.toStringAsFixed(2)}");
if (rta != null) {
if (rta == PushUpState.init) {
bloc.setPushUpState(rta);
Expand Down Expand Up @@ -470,8 +455,6 @@ Widget _liveFeedBody() {
await _controller!.initialize();
if (!mounted) return;

_currentZoomLevel = await _controller!.getMinZoomLevel();

await _controller!.startImageStream(_processCameraImage);

if (widget.onCameraFeedReady != null) {
Expand Down

0 comments on commit 1f03ee6

Please sign in to comment.