feat : location details
This commit is contained in:
@@ -5,6 +5,7 @@ class Assets {
|
||||
static const String iconsAdd = 'assets/icons/add.svg';
|
||||
static const String iconsArrowLeft = 'assets/icons/arrow_left.svg';
|
||||
static const String iconsArrowRight = 'assets/icons/arrow_right.svg';
|
||||
static const String iconsCalendar = 'assets/icons/calendar.svg';
|
||||
static const String iconsCall = 'assets/icons/call.svg';
|
||||
static const String iconsDownload = 'assets/icons/download.svg';
|
||||
static const String iconsEdit = 'assets/icons/edit.svg';
|
||||
|
||||
@@ -3,6 +3,7 @@ import 'package:rasadyar_app/presentation/pages/auth/auth_with_use_and_pass/logi
|
||||
import 'package:rasadyar_app/presentation/pages/auth/auth_with_use_and_pass/view.dart';
|
||||
import 'package:rasadyar_app/presentation/pages/splash/logic.dart';
|
||||
import 'package:rasadyar_app/presentation/pages/splash/view.dart';
|
||||
import 'package:rasadyar_app/presentation/pages/system_design/system_design.dart';
|
||||
import 'package:supervision/supervision.dart';
|
||||
|
||||
part 'app_paths.dart';
|
||||
@@ -11,8 +12,10 @@ sealed class AppPages {
|
||||
AppPages._();
|
||||
|
||||
static const String initRoutes = AppPaths.splash;
|
||||
static const String initDesignSystem = AppPaths.systemDesignPage;
|
||||
|
||||
static List<GetPage> pages = [
|
||||
GetPage(name: AppPaths.systemDesignPage, page: () => SystemDesignPage()),
|
||||
GetPage(
|
||||
name: AppPaths.splash,
|
||||
page: () => SplashPage(),
|
||||
|
||||
@@ -6,4 +6,5 @@ sealed class AppPaths {
|
||||
static const String splash = '/splash';
|
||||
static const String authWithUserAndPass = '/authWithUserAndPass';
|
||||
static const String authWithOtp = '/authWithOtp';
|
||||
static const String systemDesignPage = '/systemDesignPage';
|
||||
}
|
||||
|
||||
103
lib/presentation/widget/buttons/outline_elevated_icon.dart
Normal file
103
lib/presentation/widget/buttons/outline_elevated_icon.dart
Normal file
@@ -0,0 +1,103 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_app/presentation/common/app_color.dart';
|
||||
import 'package:rasadyar_app/presentation/common/app_fonts.dart';
|
||||
import 'package:rasadyar_app/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.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: widget.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,
|
||||
);
|
||||
}),
|
||||
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 AppColor.blueNormal.withAlpha(38);
|
||||
}
|
||||
return 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),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:rasadyar_app/presentation/common/app_color.dart';
|
||||
import 'package:vector_graphics/vector_graphics.dart';
|
||||
|
||||
SvgPicture vecWidget(
|
||||
@@ -64,3 +65,69 @@ Widget vecWidget2(
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
class ColoredSvgButton extends StatefulWidget {
|
||||
final String svgPath;
|
||||
final String text;
|
||||
final VoidCallback? onPressed;
|
||||
|
||||
const ColoredSvgButton({
|
||||
required this.svgPath,
|
||||
required this.text,
|
||||
this.onPressed,
|
||||
super.key,
|
||||
});
|
||||
|
||||
@override
|
||||
State<ColoredSvgButton> createState() => _ColoredSvgButtonState();
|
||||
}
|
||||
|
||||
class _ColoredSvgButtonState extends State<ColoredSvgButton> {
|
||||
bool _isPressed = false;
|
||||
bool _isHovered = false;
|
||||
|
||||
Color _getIconColor() {
|
||||
if (_isPressed) return Colors.white;
|
||||
if (_isHovered) return AppColor.blueNormal.withAlpha(50);
|
||||
return AppColor.blueNormal;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MouseRegion(
|
||||
onEnter: (_) => setState(() => _isHovered = true),
|
||||
onExit: (_) => setState(() {
|
||||
_isHovered = false;
|
||||
_isPressed = false;
|
||||
}),
|
||||
child: GestureDetector(
|
||||
onTapDown: (_) => setState(() => _isPressed = true),
|
||||
onTapUp: (_) => setState(() => _isPressed = false),
|
||||
onTapCancel: () => setState(() => _isPressed = false),
|
||||
child: OutlinedButton.icon(
|
||||
icon: SvgPicture.asset(
|
||||
widget.svgPath,
|
||||
width: 24,
|
||||
height: 24,
|
||||
color: _getIconColor(),
|
||||
),
|
||||
label: Text(widget.text),
|
||||
onPressed: widget.onPressed,
|
||||
style: OutlinedButton.styleFrom(
|
||||
side: BorderSide(
|
||||
color: AppColor.blueNormal,
|
||||
width: 2,
|
||||
),
|
||||
foregroundColor: AppColor.blueNormal,
|
||||
backgroundColor: _isPressed ? AppColor.blueNormal : null,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user