WritingGuidelinesStyle constructor

const WritingGuidelinesStyle({
  1. required double fontSize,
  2. Color lineColor = const Color(0xFFE0E0E0),
  3. double lineWidth = 1.0,
  4. double baselineRatio = 2 / 3,
  5. double heightRatio = 1.5,
  6. Color? backgroundColor,
  7. EdgeInsetsGeometry padding = const EdgeInsets.symmetric(horizontal: 4.0),
  8. VoidCallback? onTap,
})

创建写字格的样式配置。

Implementation

const WritingGuidelinesStyle({
  required this.fontSize,
  this.lineColor = const Color(0xFFE0E0E0),
  this.lineWidth = 1.0,
  this.baselineRatio = 2 / 3,
  this.heightRatio = 1.5,
  this.backgroundColor,
  this.padding = const EdgeInsets.symmetric(horizontal: 4.0),
  this.onTap,
}) : assert(
       baselineRatio >= 0.0 && baselineRatio <= 1.0,
       'baselineRatio 必须在 0.0 到 1.0 之间',
     ),
     assert(heightRatio > 0, 'heightRatio 必须大于 0');