yihong1120 / traffic_report_front_flutter

A platform, 'Traffic-Violation-Report-System', enabling users in Taiwan to upload and share responses from law enforcement to traffic violations. This system aims for greater transparency in traffic law enforcement. It utilises Django for backend and Flutter for a separated frontend web development.
GNU Affero General Public License v3.0
0 stars 0 forks source link

[Sweep GHA Fix] Fix failing GitHub Actions #74

Closed sweep-ai[bot] closed 8 months ago

sweep-ai[bot] commented 9 months ago

PR Feedback (click)

Summary of Changes

sweep-ai[bot] commented 9 months ago

Rollback Files For Sweep

codeautopilot[bot] commented 9 months ago

PR summary

The Pull Request aims to address and fix failing GitHub Actions by correcting errors and warnings in the codebase. The changes include fixing an invalid assignment, removing an unused import, addressing issues with BuildContext usage, and updating constructor parameters for better code practices.

Suggestion

sweep-ai[bot] commented 9 months ago
Sweeping Fixing PR: track the progress here.

I'm currently fixing this PR to address the following:

[Sweep GHA Fix] The GitHub Actions run failed with the following error logs: ``` The command: Run dart analyze yielded the following error: ##[error]Process completed with exit code 3. Here are the logs: Analyzing traffic_report_front_flutter... error - lib/components/media_preview.dart:16:10 - The name 'key' is already defined. Try renaming one of the declarations. - duplicate_definition - The first definition of this name at lib/components/media_preview.dart:15:29. error - lib/screens/map/home_map.dart:19:17 - Non-nullable instance field '_selectedDateRange' must be initialized. Try adding an initializer expression, or a generative constructor that initializes it, or mark it 'late'. - not_initialized_non_nullable_instance_field error - lib/screens/map/home_map.dart:202:46 - A value of type 'String?' can't be assigned to a variable of type 'String'. Try changing the type of the variable, or casting the right-hand type to 'String'. - invalid_assignment error - lib/screens/map/home_map.dart:209:46 - A value of type 'Null' can't be assigned to a variable of type 'DateTimeRange'. Try changing the type of the variable, or casting the right-hand type to 'DateTimeRange'. - invalid_assignment warning - lib/screens/map/home_map.dart:81:28 - The operand can't be null, so the condition is always 'true'. Remove the condition. - unnecessary_null_comparison warning - lib/screens/map/home_map.dart:83:40 - The '!' will have no effect because the receiver can't be null. Try removing the '!' operator. - unnecessary_non_null_assertion warning - lib/screens/map/home_map.dart:83:71 - The '!' will have no effect because the receiver can't be null. Try removing the '!' operator. - unnecessary_non_null_assertion warning - lib/screens/reports/create_report_screen.dart:75:13 - The parameter 'key' is required. - missing_required_param warning - lib/screens/reports/edit_report_screen.dart:3:8 - Unused import: 'package:flutter/widgets.dart'. Try removing the import directive. - unused_import warning - lib/screens/reports/edit_report_screen.dart:56:13 - The value of the local variable 'messenger' isn't used. Try removing the variable or using it. - unused_local_variable warning - lib/screens/reports/edit_report_screen.dart:91:15 - The parameter 'key' is required. - missing_required_param info - lib/components/media_picker.dart:15:18 - Don't use 'BuildContext's across async gaps. Try rewriting the code to not reference the 'BuildContext'. - use_build_context_synchronously info - lib/components/media_preview.dart:15:9 - Constructors for public widgets should have a named 'key' parameter. Try adding a named parameter to the constructor. - use_key_in_widget_constructors info - lib/components/report_form.dart:17:9 - Convert 'key' to a super parameter. - use_super_parameters info - lib/screens/reports/edit_report_screen.dart:2:8 - The import of 'package:flutter/widgets.dart' is unnecessary because all of the used elements are also provided by the import of 'package:flutter/material.dart'. Try removing the import directive. - unnecessary_import info - lib/screens/reports/edit_report_screen.dart:48:30 - Don't use 'BuildContext's across async gaps. Try rewriting the code to not reference the 'BuildContext'. - use_build_context_synchronously info - lib/screens/reports/edit_report_screen.dart:56:25 - Don't use 'BuildContext's across async gaps. Try rewriting the code to not reference the 'BuildContext'. - use_build_context_synchronously 17 issues found. ```

Created Pull Request: https://github.com/yihong1120/traffic_report_front_flutter/pull/75