Skip to content

Commit

Permalink
Add: Radius limiter on cupertino borders shape presentation
Browse files Browse the repository at this point in the history
  • Loading branch information
rydmike committed Aug 12, 2023
1 parent 2cc01ec commit 9492675
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/home/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ class _HomePageState extends State<HomePage> {
Widget build(BuildContext context) {
final ThemeData theme = Theme.of(context);
// TODO(rydmike): Consider adding color selection to UI of compared shapes.
// Prep for this feature made by adding FlexColorPicker.

// Colors for the compared shapes and lines.
final Color bottomShapeColor = theme.colorScheme.primaryContainer;
final Color bottomOnShapeColor = theme.colorScheme.onPrimaryContainer;
Expand Down
5 changes: 4 additions & 1 deletion lib/home/widgets/shapes_presentation.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'dart:math' as math;

import 'package:flutter/material.dart';

import '../../app/models/shape_borders.dart';
Expand Down Expand Up @@ -41,7 +43,8 @@ class ShapesPresentation extends StatelessWidget {
),
_DrawShapeBorder(
label: 'CupertinoSquircleBorder\ncupertino_rounded_corners',
shape: ShapeBorders.cupertinoCorners.shape(radius: radius),
shape: ShapeBorders.cupertinoCorners
.shape(radius: math.min(radius, 150)),
),
_DrawShapeBorder(
label: 'SuperEllipseShape\nsuperellipse_shape',
Expand Down

0 comments on commit 9492675

Please sign in to comment.