mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-09 07:28:14 -07:00
Init repo
This commit is contained in:
commit
764b6034e3
566 changed files with 212335 additions and 0 deletions
65
lib/widgets/shared/shapes.dart
Normal file
65
lib/widgets/shared/shapes.dart
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
class AppBarShape extends OutlinedBorder {
|
||||
@override
|
||||
OutlinedBorder copyWith({BorderSide? side}) => this; //todo
|
||||
|
||||
@override
|
||||
Path getInnerPath(Rect rect, {TextDirection? textDirection}) {
|
||||
Path path = Path()
|
||||
..fillType = PathFillType.evenOdd
|
||||
..addRect(rect)
|
||||
..addRRect(RRect.fromRectAndCorners(
|
||||
Rect.fromLTWH(rect.left, rect.bottom - 14, rect.width, 14),
|
||||
topLeft: Radius.circular(14),
|
||||
topRight: Radius.circular(14),
|
||||
));
|
||||
return path;
|
||||
}
|
||||
|
||||
@override
|
||||
Path getOuterPath(Rect rect, {TextDirection? textDirection}) {
|
||||
return getInnerPath(rect, textDirection: textDirection);
|
||||
}
|
||||
|
||||
@override
|
||||
void paint(Canvas canvas, Rect rect, {TextDirection? textDirection}) {
|
||||
/// create shader linear gradient
|
||||
canvas.drawPath(getInnerPath(rect), Paint()..color = Colors.transparent);
|
||||
}
|
||||
|
||||
@override
|
||||
ShapeBorder scale(double t) => this;
|
||||
}
|
||||
|
||||
class BottomBarShape extends OutlinedBorder {
|
||||
@override
|
||||
OutlinedBorder copyWith({BorderSide? side}) => this; //todo
|
||||
|
||||
@override
|
||||
Path getInnerPath(Rect rect, {TextDirection? textDirection}) {
|
||||
Path path = Path()
|
||||
..fillType = PathFillType.evenOdd
|
||||
..addRect(rect)
|
||||
..addRRect(RRect.fromRectAndCorners(
|
||||
Rect.fromLTWH(rect.left, rect.top, rect.width, 14),
|
||||
bottomLeft: Radius.circular(14),
|
||||
bottomRight: Radius.circular(14),
|
||||
));
|
||||
return path;
|
||||
}
|
||||
|
||||
@override
|
||||
Path getOuterPath(Rect rect, {TextDirection? textDirection}) {
|
||||
return getInnerPath(rect, textDirection: textDirection);
|
||||
}
|
||||
|
||||
@override
|
||||
void paint(Canvas canvas, Rect rect, {TextDirection? textDirection}) {
|
||||
/// create shader linear gradient
|
||||
canvas.drawPath(getInnerPath(rect), Paint()..color = Colors.transparent);
|
||||
}
|
||||
|
||||
@override
|
||||
ShapeBorder scale(double t) => this;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue