Linting Improvements: Use `withAlpha` Instead of `withOpacity`, Add `mounted` Checks for Context Safety
Is your feature request related to a problem? Please describe.
There are some minor linting and best practice issues in the code that can be cleaned up for better consistency and long-term maintainability.
Describe the solution you'd like
- Replace
withOpacity(0.95)withwithAlpha(242)for clarity and to align with linting recommendations (withOpacityis now deprecated). - Add a
mountedcheck before usingcontextin async callbacks (particularly inEditableTextWidget). - Ensure the code is compliant with Flutter's latest lint rules and avoids common pitfalls.
Approach to be followed (optional)
- Follow existing structure — no need to refactor logic.
- Use
withAlphawhen setting semi-transparent colors. - Wrap
contextusage afterawaitwith amountedcheck.
Additional context
These are not functional bugs but polish-level improvements that enhance code quality, readability, and safety. Comment on the issue to get assigned.
Thank you for opening this issue! 🚀 Our team will review it soon. Please make sure you've included all relevant details and followed our Contributing Guidelines. For questions about our project, check out our README and Code of Conduct.
please assign me this issue @may-tas
@PearlGrell I was gonna open this issue soon, thanks for opening it. Go ahead. Just for your reference if there is any color : Colors.primary.withOpacity(0.5); then you need to convert it to : Colors.primary.withAlpha((0.5*255).toInt());