Skip to content

Commit

Permalink
Merge pull request #120 from kevlatus/feat/customizable-triangle-indi…
Browse files Browse the repository at this point in the history
…cator

Feat/customizable triangle indicator
  • Loading branch information
kevlatus authored Feb 5, 2024
2 parents dedba9e + 754758d commit 4ee5f23
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ FortuneWheel(
alignment: Alignment.bottomCenter, // <-- changing the position of the indicator
child: TriangleIndicator(
color: Colors.green, // <-- changing the color of the indicator
width: 20.0, // <-- changing the width of the indicator
height: 20.0, // <-- changing the height of the indicator
elevation: 0, // <-- changing the elevation of the indicator
),
),
],
Expand Down
12 changes: 9 additions & 3 deletions lib/src/indicators/triangle_indicator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@ part of 'indicators.dart';

class TriangleIndicator extends StatelessWidget {
final Color? color;
final double width;
final double height;
final double elevation;

const TriangleIndicator({
Key? key,
this.color,
this.width = 36.0,
this.height = 36.0,
this.elevation = 2,
}) : super(key: key);

@override
Expand All @@ -14,11 +20,11 @@ class TriangleIndicator extends StatelessWidget {
return Transform.rotate(
angle: _math.pi,
child: SizedBox(
width: 36,
height: 36,
width: width,
height: height,
child: _Triangle(
color: color ?? theme.colorScheme.secondary,
elevation: 2,
elevation: elevation,
),
),
);
Expand Down

0 comments on commit 4ee5f23

Please sign in to comment.