awesome_flutter_widgets 0.1.0
awesome_flutter_widgets: ^0.1.0 copied to clipboard
Awesome flutter widget is a customized package with easy-to-use, animated widgets from Flutter.
awesome_flutter_widgets #
awesome flutter widgets
Widget lists #
- ellipsis_text
- custom_dialog
- custom_fab
- custom_animated_icons
- animated_snack_bar
- and some utils (regex, timeAgo..)
⚡ Installation #
dependencies:
awesome_flutter_widgets: ^<latest_version>
💪 Widgets #
1. ellipsis_text #
ellipsis text is a widget that allows you to customize text in ellipsis when text exceeds maxLines.
EllipsisText(
text: "Lorem Ipsum is simply dummy text of the printing and typesetting industry. "
"Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, "
"when an unknown printer took a galley of type and scrambled it to make a type specimen book. "
"It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.",
ellipsis: "..show more",
maxLines: 2, // default
style: TextStyle(), // add if you want
isShowMore: true, // default
startScaleIsSmall: true, // default
)
2. custom_dialog #
This widget is a simple dialog that deviates from the complex dialog of the flutter. You can also add an animation icon instead of a title.
CustomDialog.dialog(
context: context,
title: "Check",
content: "Save successfully",
iconTitle: true
);
also you can customize sizes, widget and fonts ...
static dialog({
required BuildContext context,
required String title,
bool? iconTitle,
String? content,
Widget? widgets,
Color? primaryColor,
bool? canGoBack,
double? radius,
double? insetPadding,
double? topToTitleGap,
double? titleToContentGap,
double? contentToButtonGap,
double? buttonToBottomGap,
TextStyle? titleStyle,
TextStyle? contentStyle,
Color? defaultButtonTextColor,
});
3. custom_fab #
Simple animated FAB! (maximum 3)
floatingActionButton: CustomFAB(
firstOnClick: () {
/// do something!
},
firstButtonIcon: Icons.add,
secondOnClick: () {
/// do something!
},
secondButtonIcon: Icons.close,
thirdOnClick: () {
/// do something!
},
thirdButtonIcon: Icons.add,
),
4. custom_animated_icons #
Simple animated Icons! (It will be added frequently)
- set animations
class _FooClassState extends State<FooClass> with SingleTickerProviderStateMixin {
late AnimationController _animationController;
late Animation<double> _animation;
@override
void initState() {
_animationController = AnimationController(vsync: this, duration: const Duration(milliseconds: 700));
_animation = Tween<double>(begin: 0, end: 1).animate(CurvedAnimation(parent: _animationController, curve: Curves.easeInOutCirc));
super.initState();
}
void _showIcon() {
_animationController.forward();
}
...
- add widget
CustomAnimatedIcons(
color: Colors.green,
progress: _animation,
size: 40,
iconType: IconType.check,
),
CustomAnimatedIcons(
color: Colors.red,
progress: _animation,
size: 40,
iconType: IconType.fail,
),
CustomAnimatedIcons(
color: Colors.black,
progress: _animation,
size: 40,
iconType: IconType.alert,
),
- trigger widget animation
_showIcon()
/// If you want to do the reverse
/// do this
/// _animationController.reverse();
5. animated_snack_bar #
This widget is a snack bar with a customized animation. There are two animations for each state.
ElevatedButton(
onPressed: () {
AnimatedSnackBar.style1(
context: context,
label: "Save successfully",
snackBarType: SnackBarType.saveSecondAnimation
);
},
child: const Text("Save"),
),