Skip to content

Solving Dart Warnings#57

Merged
gabrielbmoro merged 27 commits intomainfrom
feature/dart-warnings
Jul 28, 2025
Merged

Solving Dart Warnings#57
gabrielbmoro merged 27 commits intomainfrom
feature/dart-warnings

Conversation

@gabrielbmoro
Copy link
Copy Markdown
Collaborator

@gabrielbmoro gabrielbmoro commented Jul 27, 2025

  • Update some Flutter dependencies;
  • Convert flutter gradle files to be gradle .kts;
  • Try to use Dart analyze with Megalinter but it looks like it is only supported by dart, we do not have flutter linter support. I will check how we can add it in their repository. For now, I created a specific linter job for flutter.

Tests

  • Run the flutter app sample on Android and iOS

Screenshots

image

Check list

  • The tests were executed and passed successfully.
  • Code changes follow the project style guidelines.
  • Tests have been added if applicable.
  • Did you subscribe to the channel?😛

- Replaced Groovy Gradle files with Kotlin DSL (.kts) equivalents.
- Updated Gradle wrapper to version 8.12.
- Updated Android Gradle Plugin and Kotlin versions.
- Modified `AndroidManifest.xml` files:
    - Removed `package` attribute from root manifest.
    - Added `taskAffinity=""` to `MainActivity`.
    - Added `<queries>` for `ACTION_PROCESS_TEXT`.
- Updated `.gitignore` to include `.cxx/`.
- Increased Gradle JVM arguments in `gradle.properties`.
- Updated various dependency versions in `pubspec.lock`.
- Added empty test files for iOS and macOS.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jul 27, 2025

🦙 MegaLinter status: ⚠️ WARNING

Descriptor Linter Files Fixed Errors Warnings Elapsed time
⚠️ KOTLIN detekt yes 93 no 3.84s
⚠️ MARKDOWN markdown-table-formatter 19 1 0 0.25s
✅ YAML prettier 14 0 0 0.77s

See detailed report in MegaLinter reports

You could have the same capabilities but better runtime performances if you use a MegaLinter flavor:

MegaLinter is graciously provided by OX Security

@gabrielbmoro gabrielbmoro changed the title Update Android Gradle configuration and dependencies Solving Dart Warnings Jul 27, 2025
- Enable stricter type checks (`strict-casts`, `strict-raw-types`) in `analysis_options.yaml`.
- Exclude `build/**` directory from linting.
- Point MegaLinter to the correct Dart analyzer configuration file.
- Removed commented-out informational section in `analysis_options.yaml`.
This commit introduces a new `analysis_options.yaml` file for Flutter projects. This file defines a set of linter rules to enforce coding standards and best practices.

The specific rules added are based on the recommended set from `package:flutter_lints`, aiming to improve code quality, readability, and maintainability.

The Mega-Linter configuration has also been updated to remove the explicit reference to a Dart analyzer config file, as the standard `analysis_options.yaml` will now be used by default.
Replaced double quotes with single quotes for string literals across the codebase for consistency. This change primarily affects property lookups in `fromJson` methods and static key definitions in builder classes.
The Dartanalyzer will now run `flutter pub get` in the `flutter/craftd_widget` and `flutter/sample` directories before analysis. This ensures that dependencies are fetched, which is necessary for the analyzer to function correctly.
This commit updates the MegaLinter configuration by:

- Removing pre-commands for Dart analyzer, as they are no longer needed.
- Ensuring JavaScript Standard errors are disabled.
Comment thread .mega-linter.yml Outdated
@gabrielbmoro gabrielbmoro marked this pull request as ready for review July 28, 2025 02:17
Comment thread .github/actions/setup-flutter/action.yml
Comment thread .github/workflows/pr.yml
Comment thread .github/workflows/publish.yml
Comment thread flutter/sample/android/app/build.gradle.kts
Comment thread flutter/sample/android/app/src/main/AndroidManifest.xml
@gabrielbmoro gabrielbmoro merged commit be49d3f into main Jul 28, 2025
4 checks passed
@rviannaoliveira rviannaoliveira deleted the feature/dart-warnings branch July 29, 2025 00:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants