auto_smooth_corners 1.0.1
auto_smooth_corners: ^1.0.1 copied to clipboard
A Flutter package for creating smooth, customizable corners in your UI with support for various corner styles and animations.
auto_smooth_corners #
[Demo: Normal vs. Smooth Corners]
A Flutter package for highly customizable, dynamic smooth corners (iOS-style squircle) with per-corner control.
Features #
- Dynamic smoothing:
smoothingFactorscales with widget size - Per-corner smoothing:
AutoSmoothBorderRadius.only(...) - Drop-in widgets:
AutoSmoothContainer,AutoSmoothClipRRect,AutoSmoothCard - Easy integration with existing Flutter widgets
- MIT licensed and open source
Getting Started #
Add to your pubspec.yaml:
dependencies:
auto_smooth_corners:
path: ./
Import in your Dart code:
import 'package:auto_smooth_corners/auto_smooth_corners.dart';
Example #
import 'package:flutter/material.dart';
import 'package:auto_smooth_corners/auto_smooth_corners.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
backgroundColor: Colors.grey[200],
body: Center(
child: AutoSmoothContainer(
width: 120,
height: 60,
color: Colors.blue,
smoothingFactor: 0.25, // 25% of min(width, height)
autoSmoothBorderRadius: AutoSmoothBorderRadius.all(0.2),
child: const Center(child: Text('Smooth Container', style: TextStyle(color: Colors.white))),
),
),
),
);
}
}
API Reference #
AutoSmoothContainer: LikeContainer, but with smooth cornersAutoSmoothClipRRect: LikeClipRRect, but with smooth cornersAutoSmoothCard: LikeCard, but with smooth cornersAutoSmoothRectangleBorder: CustomShapeBorderfor advanced useAutoSmoothBorderRadius: Per-corner smoothing factors
License #
MIT
Author #
Zahir Badi (LinkedIn)