Skip to content

Commit

Permalink
fix 1.17 lint rules
Browse files Browse the repository at this point in the history
  • Loading branch information
avenwu committed May 13, 2020
1 parent 7513875 commit 4d573bf
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 22 deletions.
6 changes: 3 additions & 3 deletions lib/src/bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ class ConvexAppBarState extends State<ConvexAppBar>
super.dispose();
}

_updateTabController() {
void _updateTabController() {
final TabController newController =
widget.controller ?? DefaultTabController.of(context);
_tabController?.removeListener(_handleTabControllerAnimationTick);
Expand Down Expand Up @@ -409,7 +409,7 @@ class ConvexAppBarState extends State<ConvexAppBar>
@override
Widget build(BuildContext context) {
// take care of iPhoneX' safe area at bottom edge
final double additionalBottomPadding =
final additionalBottomPadding =
math.max(MediaQuery.of(context).padding.bottom, 0.0);
final convexIndex = isFixed() ? (widget.count ~/ 2) : _currentIndex;
final active = isFixed() ? convexIndex == _currentIndex : true;
Expand Down Expand Up @@ -463,7 +463,7 @@ class ConvexAppBarState extends State<ConvexAppBar>
bool isFixed() => widget.itemBuilder.fixed();

Widget _barContent(double height, double paddingBottom, int curveTabIndex) {
List<Widget> children = [];
var children = <Widget>[];
for (var i = 0; i < widget.count; i++) {
if (i == curveTabIndex) {
children.add(Expanded(child: Container()));
Expand Down
26 changes: 13 additions & 13 deletions lib/src/convex_shape.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,27 @@ class ConvexNotchedRectangle extends NotchedShape {

// The guest's shape is a circle bounded by the guest rectangle.
// So the guest's radius is half the guest width.
final double notchRadius = guest.width / 2.0;
final notchRadius = guest.width / 2.0;

const double s1 = 15.0;
const double s2 = 1.0;
const s1 = 15.0;
const s2 = 1.0;

final double r = notchRadius;
final double a = -1.0 * r - s2;
final double b = host.top - guest.center.dy;
final r = notchRadius;
final a = -1.0 * r - s2;
final b = host.top - guest.center.dy;

final double n2 = math.sqrt(b * b * r * r * (a * a + b * b - r * r));
final double p2xA = ((a * r * r) - n2) / (a * a + b * b);
final double p2xB = ((a * r * r) + n2) / (a * a + b * b);
final double p2yA = -math.sqrt(r * r - p2xA * p2xA);
final double p2yB = -math.sqrt(r * r - p2xB * p2xB);
final n2 = math.sqrt(b * b * r * r * (a * a + b * b - r * r));
final p2xA = ((a * r * r) - n2) / (a * a + b * b);
final p2xB = ((a * r * r) + n2) / (a * a + b * b);
final p2yA = -math.sqrt(r * r - p2xA * p2xA);
final p2yB = -math.sqrt(r * r - p2xB * p2xB);

final List<Offset> p = List<Offset>(6);
final p = List<Offset>(6);

// p0, p1, and p2 are the control points for segment A.
p[0] = Offset(a - s1, b);
p[1] = Offset(a, b);
final double cmp = b < 0 ? -1.0 : 1.0;
final cmp = b < 0 ? -1.0 : 1.0;
p[2] = cmp * p2yA > cmp * p2yB ? Offset(p2xA, p2yA) : Offset(p2xB, p2yB);

// p3, p4, and p5 are the control points for segment B, which is a mirror
Expand Down
2 changes: 1 addition & 1 deletion lib/src/item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ class TabItem<T> {
this.activeIcon,
bool isIconBlend,
}) : assert(icon is IconData || icon is Widget,
"TabItem only support IconData and Widget"),
'TabItem only support IconData and Widget'),
blend = isIconBlend ?? (icon is IconData);
}
6 changes: 3 additions & 3 deletions lib/src/painter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ class ConvexPainter extends CustomPainter {

@override
void paint(Canvas canvas, Size size) {
Rect host = Rect.fromLTWH(0, 0, size.width, size.height);
Rect guest = Rect.fromLTWH(
var host = Rect.fromLTWH(0, 0, size.width, size.height);
var guest = Rect.fromLTWH(
size.width * leftPercent.value - width / 2, top, width, height);
_gradient.updateWith(_paint, size: host);
Path path = _shape.getOuterPath(host, guest);
var path = _shape.getOuterPath(host, guest);
canvas.drawPath(path, _shadowPaint);
canvas.drawPath(path, _paint);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/src/reused_gradient.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class ReusedGradient {
}

/// Update the paint with provided size
updateWith(Paint paint, {Rect size}) {
void updateWith(Paint paint, {Rect size}) {
if (size == _size) {
return;
}
Expand Down
1 change: 1 addition & 0 deletions lib/src/style/inner_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ abstract class InnerBuilder extends DelegateBuilder {
/// Create style builder.
InnerBuilder({this.items, this.activeColor, this.color});

/// Get style config
StyleHook ofStyle(BuildContext context) {
return StyleProvider.of(context)?.style ?? (_style ??= provideStyle());
}
Expand Down
2 changes: 1 addition & 1 deletion lib/src/style/transition_container.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class TransitionContainer extends StatefulWidget {

/// Create transition with builder.
TransitionContainer(
{this.builder, this.duration, this.disableAnimateWhenUpdate})
{@required this.builder, this.duration, this.disableAnimateWhenUpdate})
: assert(builder != null);

/// Wrap a widget with scale transition.
Expand Down

0 comments on commit 4d573bf

Please sign in to comment.