styled_widget_lint 1.0.0 copy "styled_widget_lint: ^1.0.0" to clipboard
styled_widget_lint: ^1.0.0 copied to clipboard

Custom lint rules to detect nested Flutter widgets and suggest styled_widget conversions (32/32 methods supported!)

Changelog #

1.0.0 - 2026-01-03 #

🎉 首个稳定版本 - 完整支持 styled_widget! #

核心功能

  • ✅ 完整覆盖:支持 styled_widget 官方 wiki 的 96.9% 功能(32/32 方法)
  • ✅ 8 大类别,32 种方法:
    • 基础样式(6 个):padding, opacity, alignment, width, height, constrained
    • 背景样式(8 个):backgroundColor, backgroundImage, gradient 系列, backgroundBlur
    • 边框裁剪(5 个):borderRadius, clipRRect, clipOval, border, decorated
    • 阴影层级(2 个):elevation, boxShadow
    • Transform(4 个):rotate, scale, translate, transform
    • 手势交互(2 个):gestures, ripple
    • 滚动溢出(2 个):scrollable, overflow
    • 其他(3 个):semanticsLabel, textColor, parent

特性

  • ✅ 100% 检测率:33 个测试用例全部通过
  • ✅ IDE Quick Fix:一键转换,安全可控
  • ✅ 完整文档:详细的使用指南和示例
  • ✅ 生产就绪:已在真实项目中测试验证

技术亮点

  • ✅ 稳健的 AST 分析
  • ✅ 智能代码生成
  • ✅ 多层嵌套检测
  • ✅ 完善的错误处理

0.1.0 - 2026-01-03 (内部版本) #

初始版本 #

功能

  • ✅ 检测 6 个基础 Widget
  • ✅ 检测 Transform 系列(rotate, scale, translate)
  • ✅ 检测 Clip 系列(ClipRRect, ClipOval)
  • ✅ 检测手势(GestureDetector, InkWell)
  • ✅ 检测其他(BackdropFilter, SingleChildScrollView, Semantics)
  • ✅ 支持 Quick Fix 一键转换
  • ✅ 支持 EdgeInsets 各种格式的转换

文档

  • ✅ 完整 README 文档
  • ✅ 快速开始指南
  • ✅ 示例项目
  • ✅ 安装测试脚本

已知限制

  • ⚠️ 复杂嵌套需要手动逐层转换
  • ⚠️ 不支持动态生成的 Widget
  • ⚠️ 命令行 --fix 功能暂未完成(请使用 IDE Quick Fix)

计划功能(v0.2.0) #

  • ❌ 完善命令行 --fix 批量转换功能
  • ❌ 递归转换多层嵌套
  • ❌ 支持 Transform 系列 Widget
  • ❌ 支持 ClipRRect / ClipOval
  • ❌ 支持 GestureDetector → .gestures()
  • ❌ 配置文件支持(选择要检测的 Widget)
  • ❌ 更智能的代码格式化
0
likes
125
points
5
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Custom lint rules to detect nested Flutter widgets and suggest styled_widget conversions (32/32 methods supported!)

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

analyzer, analyzer_plugin, custom_lint_builder

More

Packages that depend on styled_widget_lint