Im using lint in my flutter project and i applied some rules in my analysis_options.yaml that works on local as i expected, but when my workflow on github actions is excecuted (with the same exact code) flutter analyze fails and show me 2 new problems like this one:
"info • Prefer const over final for declarations • lib/data/remote/user_api_provider.dart:146:7 • prefer_const_declarations
"
on local "flutter analyze" it cant detect it.
im very confused, i cant find information on google i dont know how to solve this.
Im using Flutter 2.2.2 stable and dart 2.13.3 stable.
Edit: This is my workflow
name: Lint-Analyze
on:
pull_request:
branches:
- develop
jobs:
flutter_analyze:
name: Run flutter analyze
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: "12.x"
- uses: subosito/flutter-action@v1
with:
flutter-version: '2.2.2'
channel: 'stable'
- run: flutter pub get
- run: flutter analyze
I think your Flutter version in the GitHub action is not on the same version you use locally.
Please check your workflow file for something like this:
with: flutter-version: '2.0.5'
And run flutter doctor on your local machine to check if the versions are really the same. If not, just change the version of your GitHub action.
Hope that's fixes your issue :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With