feat : location details

This commit is contained in:
2025-04-15 17:27:48 +03:30
parent a754ac6873
commit 63395c557b
13 changed files with 614 additions and 5 deletions

View File

@@ -6,8 +6,8 @@ import 'package:rasadyar_core/presentation/utils/color_utils.dart';
class ROutlinedElevated extends StatefulWidget {
ROutlinedElevated({
super.key,
required this.text,
required this.onPressed,
this.text,
this.onPressed,
this.foregroundColor,
this.backgroundColor,
this.borderColor,
@@ -15,11 +15,12 @@ class ROutlinedElevated extends StatefulWidget {
this.pressedBackgroundColor,
this.radius,
this.textStyle,
this.child,
this.width = 150.0,
this.height = 56.0,
});
final String text;
final String? text;
final VoidCallback? onPressed;
final double width;
final double height;
@@ -32,6 +33,7 @@ class ROutlinedElevated extends StatefulWidget {
Color? pressedBackgroundColor;
double? radius;
TextStyle? textStyle;
Widget? child;
@override
State<ROutlinedElevated> createState() => _ROutlinedElevatedState();
@@ -95,7 +97,7 @@ class _ROutlinedElevatedState extends State<ROutlinedElevated> {
AppFonts.yekan24.copyWith(color: AppColor.blueNormal),
),
),
child: Text(widget.text),
child: widget.child ?? Text(widget.text!, style: widget.textStyle),
);
}
}

View File

@@ -0,0 +1,132 @@
import 'package:flutter/material.dart';
import 'package:rasadyar_core/core.dart';
import 'package:rasadyar_core/data/utils.dart';
import 'package:rasadyar_core/presentation/utils/color_utils.dart';
class ROutlinedElevatedIcon extends StatefulWidget {
ROutlinedElevatedIcon({
super.key,
required this.text,
required this.onPressed,
this.foregroundColor,
this.backgroundColor,
this.borderColor,
this.disabledBackgroundColor,
this.pressedBackgroundColor,
this.radius,
this.textStyle,
this.icon,
this.width = 150.0,
this.height = 56.0,
});
final String text;
final VoidCallback? onPressed;
final double width;
final double height;
Color? foregroundColor;
Color? backgroundColor;
Color? borderColor;
Color? disabledBackgroundColor;
Color? pressedBackgroundColor;
double? radius;
TextStyle? textStyle;
Widget? icon;
@override
State<ROutlinedElevatedIcon> createState() => _ROutlinedElevatedStateIcon();
}
class _ROutlinedElevatedStateIcon extends State<ROutlinedElevatedIcon> {
@override
Widget build(BuildContext context) {
return OutlinedButton.icon(
icon: widget.icon,
label: Text(widget.text),
onPressed: () {},
style: ButtonStyle(
side: WidgetStateProperty.resolveWith<BorderSide?>((states) {
if (states.contains(WidgetState.pressed)) {
return BorderSide(
color: widget.borderColor ?? AppColor.blueNormal,
width: 2,
);
} else if (states.contains(WidgetState.disabled)) {
return BorderSide(
color: widget.borderColor ?? AppColor.blueNormal.withAlpha(38),
width: 2,
);
}
return BorderSide(
color: widget.borderColor ?? AppColor.blueNormal,
width: 2,
);
}),
iconColor: WidgetStateProperty.resolveWith<Color?>((states) {
if (states.contains(WidgetState.pressed)) {
return Colors.white;
} else if (states.contains(WidgetState.disabled)) {
return widget.foregroundColor?.disabledColor ??
AppColor.blueNormal.withAlpha(38);
} else if (states.contains(WidgetState.hovered)) {
return widget.foregroundColor?.hoverColor ??
AppColor.blueNormal.withAlpha(50);
}
return widget.foregroundColor ?? AppColor.blueNormal;
}),
backgroundColor: WidgetStateProperty.resolveWith<Color?>((states) {
if (states.contains(WidgetState.pressed)) {
if (widget.pressedBackgroundColor != null) {
return widget.pressedBackgroundColor;
}
return widget.backgroundColor?.pressedColor ?? AppColor.blueNormal;
} else if (states.contains(WidgetState.hovered)) {
return widget.backgroundColor?.hoverColor ??
AppColor.blueNormal.hoverColor;
} else if (states.contains(WidgetState.disabled)) {
return widget.backgroundColor?.disabledColor ?? Colors.transparent;
}
return widget.backgroundColor;
}),
foregroundColor: WidgetStateProperty.resolveWith<Color?>((states) {
if (states.contains(WidgetState.pressed)) {
return Colors.white;
} else if (states.contains(WidgetState.disabled)) {
return widget.foregroundColor?.disabledColor ??
AppColor.blueNormal.withAlpha(38);
} else if (states.contains(WidgetState.hovered)) {
return widget.foregroundColor?.hoverColor ??
AppColor.blueNormal.withAlpha(50);
}
return widget.foregroundColor ?? AppColor.blueNormal;
}),
shape: WidgetStatePropertyAll(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(widget.radius ?? 8),
),
),
fixedSize: WidgetStatePropertyAll(Size(widget.width, widget.height)),
padding: WidgetStatePropertyAll(EdgeInsets.zero),
textStyle: WidgetStatePropertyAll(
widget.textStyle ??
AppFonts.yekan24.copyWith(color: AppColor.blueNormal),
),
),
);
}
}
Color? _getIconColor(BuildContext context) {
var ss =WidgetStateProperty.resolveWith<Color?>((states) {
if (states.contains(WidgetState.pressed)) {
return Colors.white;
} else if (states.contains(WidgetState.disabled)) {
return Colors.grey.withAlpha(38);
} else if (states.contains(WidgetState.hovered)) {
return Colors.blue.withAlpha(50);
}
return Colors.blue;
}).resolve({});
fLog(ss);
return ss;
}

View File

@@ -1,5 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:rasadyar_core/presentation/common/app_color.dart';
import 'package:rasadyar_core/presentation/utils/color_utils.dart';
import 'package:vector_graphics/vector_graphics.dart';
SvgPicture vecWidget(
@@ -85,3 +87,4 @@ Widget vecWidget2(
),
);
}

View File

@@ -2,3 +2,6 @@ export 'vec_widget.dart';
export 'bottom_navigation/bottom_navigation_1.dart';
export 'draggable_bottom_sheet/draggable_bottom_sheet.dart';
export 'draggable_bottom_sheet/draggable_bottom_sheet_controller.dart';
export 'buttons/outline_elevated_icon.dart';
export 'buttons/outline_elevated.dart';