feat : buy in province
This commit is contained in:
@@ -0,0 +1,80 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class AnimatedFab extends StatelessWidget {
|
||||
final VoidCallback? onPressed;
|
||||
final Color backgroundColor;
|
||||
final Color foregroundColor;
|
||||
final Widget icon;
|
||||
final double radius;
|
||||
final bool isLoading;
|
||||
final String? message;
|
||||
|
||||
const AnimatedFab({
|
||||
super.key,
|
||||
required this.onPressed,
|
||||
required this.icon,
|
||||
required this.backgroundColor,
|
||||
this.foregroundColor = Colors.white,
|
||||
this.radius = 56.0,
|
||||
this.isLoading = false,
|
||||
this.message,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return message != null
|
||||
? Tooltip(
|
||||
message: message ?? '',
|
||||
child: AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 1300),
|
||||
width: radius,
|
||||
height: radius,
|
||||
decoration: BoxDecoration(color: backgroundColor, shape: BoxShape.circle),
|
||||
child: Material(
|
||||
color: Colors.transparent,
|
||||
child: InkWell(
|
||||
borderRadius: BorderRadius.circular(radius),
|
||||
onTap: isLoading ? null : onPressed,
|
||||
child: Center(
|
||||
child: isLoading
|
||||
? SizedBox(
|
||||
height: radius / 2,
|
||||
width: radius / 2,
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 2.5,
|
||||
valueColor: AlwaysStoppedAnimation<Color>(foregroundColor),
|
||||
),
|
||||
)
|
||||
: icon,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
: AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 1300),
|
||||
width: radius,
|
||||
height: radius,
|
||||
decoration: BoxDecoration(color: backgroundColor, shape: BoxShape.circle),
|
||||
child: Material(
|
||||
color: Colors.transparent,
|
||||
child: InkWell(
|
||||
borderRadius: BorderRadius.circular(radius),
|
||||
onTap: isLoading ? null : onPressed,
|
||||
child: Center(
|
||||
child: isLoading
|
||||
? SizedBox(
|
||||
height: radius / 2,
|
||||
width: radius / 2,
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 2.5,
|
||||
valueColor: AlwaysStoppedAnimation<Color>(foregroundColor),
|
||||
),
|
||||
)
|
||||
: icon,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
export 'animated_fab.dart';
|
||||
export 'elevated.dart';
|
||||
export 'fab.dart';
|
||||
export 'fab_outlined.dart';
|
||||
export 'outline_elevated.dart';
|
||||
export 'outline_elevated_icon.dart';
|
||||
export 'text_button.dart';
|
||||
2
packages/core/lib/presentation/widget/dialog/dialog.dart
Normal file
2
packages/core/lib/presentation/widget/dialog/dialog.dart
Normal file
@@ -0,0 +1,2 @@
|
||||
export 'delete_dialog.dart';
|
||||
export 'warning_dialog.dart';
|
||||
@@ -0,0 +1,33 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../core.dart';
|
||||
|
||||
Future<void> buildWarningDialog({
|
||||
required String title,
|
||||
required String middleText,
|
||||
required Future<void> Function() onConfirm,
|
||||
required Future<void> Function() onRefresh,
|
||||
}) async {
|
||||
await Get.defaultDialog(
|
||||
title: title,
|
||||
middleText: middleText,
|
||||
confirm: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: AppColor.error,
|
||||
foregroundColor: Colors.white,
|
||||
),
|
||||
onPressed: () async {
|
||||
await onConfirm();
|
||||
onRefresh();
|
||||
Get.back();
|
||||
},
|
||||
child: Text('بله'),
|
||||
),
|
||||
cancel: ElevatedButton(
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
},
|
||||
child: Text('خیر'),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -3,14 +3,10 @@ export 'bottom_navigation/r_bottom_navigation.dart';
|
||||
export 'bottom_navigation/wave_bottom_navigation.dart';
|
||||
export 'bottom_sheet/base_bottom_sheet.dart';
|
||||
export 'bottom_sheet/date_picker_bottom_sheet.dart';
|
||||
export 'buttons/elevated.dart';
|
||||
export 'buttons/fab.dart';
|
||||
export 'buttons/outline_elevated.dart';
|
||||
export 'buttons/outline_elevated_icon.dart';
|
||||
export 'buttons/text_button.dart';
|
||||
export 'buttons/buttons.dart';
|
||||
export 'card/card_with_icon_with_border.dart';
|
||||
export 'chips/r_chips.dart';
|
||||
export 'dialog/delete_dialog.dart';
|
||||
export 'dialog/dialog.dart';
|
||||
export 'draggable_bottom_sheet/bottom_sheet_manger.dart';
|
||||
export 'draggable_bottom_sheet/draggable_bottom_sheet.dart';
|
||||
export 'draggable_bottom_sheet/draggable_bottom_sheet2.dart';
|
||||
|
||||
Reference in New Issue
Block a user