mirror of
https://github.com/qinglong-app/qinglong_app.git
synced 2025-10-09 16:48:19 +08:00
format code
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
|
||||
///tabbar样式下方横条固定宽度
|
||||
class AbsUnderlineTabIndicator extends Decoration {
|
||||
const AbsUnderlineTabIndicator({
|
||||
@@ -44,7 +43,8 @@ class AbsUnderlineTabIndicator extends Decoration {
|
||||
}
|
||||
|
||||
class _UnderlinePainter extends BoxPainter {
|
||||
_UnderlinePainter(this.decoration, VoidCallback? onChanged) : super(onChanged);
|
||||
_UnderlinePainter(this.decoration, VoidCallback? onChanged)
|
||||
: super(onChanged);
|
||||
|
||||
final AbsUnderlineTabIndicator decoration;
|
||||
|
||||
@@ -56,7 +56,11 @@ class _UnderlinePainter extends BoxPainter {
|
||||
final Rect indicator = insets!.resolve(textDirection).deflateRect(rect);
|
||||
//取中间坐标
|
||||
double cw = (indicator.left + indicator.right) / 2;
|
||||
return Rect.fromLTWH(cw - decoration.wantWidth! / 2, indicator.bottom - borderSide!.width, decoration.wantWidth!, borderSide!.width);
|
||||
return Rect.fromLTWH(
|
||||
cw - decoration.wantWidth! / 2,
|
||||
indicator.bottom - borderSide!.width,
|
||||
decoration.wantWidth!,
|
||||
borderSide!.width);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -64,8 +68,9 @@ class _UnderlinePainter extends BoxPainter {
|
||||
assert(configuration.size != null);
|
||||
final Rect rect = offset & configuration.size!;
|
||||
final TextDirection textDirection = configuration.textDirection!;
|
||||
final Rect indicator = _indicatorRectFor(rect, textDirection).deflate(borderSide!.width / 2.0);
|
||||
final Rect indicator =
|
||||
_indicatorRectFor(rect, textDirection).deflate(borderSide!.width / 2.0);
|
||||
final Paint paint = borderSide!.toPaint()..strokeCap = StrokeCap.round;
|
||||
canvas.drawLine(indicator.bottomLeft, indicator.bottomRight, paint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user