feat : init statics

This commit is contained in:
2025-07-26 15:47:22 +03:30
parent ad456d5855
commit bafa24543d
54 changed files with 1853 additions and 1421 deletions

View File

@@ -58,6 +58,9 @@ class $AssetsIconsGen {
/// File path: assets/icons/calendar_search.svg
SvgGenImage get calendarSearch => const SvgGenImage('assets/icons/calendar_search.svg');
/// File path: assets/icons/calendar_search_outline.svg
SvgGenImage get calendarSearchOutline => const SvgGenImage('assets/icons/calendar_search_outline.svg');
/// File path: assets/icons/call.svg
SvgGenImage get call => const SvgGenImage('assets/icons/call.svg');
@@ -190,6 +193,9 @@ class $AssetsIconsGen {
/// File path: assets/icons/profile2.svg
SvgGenImage get profile2 => const SvgGenImage('assets/icons/profile2.svg');
/// File path: assets/icons/profile2_outline.svg
SvgGenImage get profile2Outline => const SvgGenImage('assets/icons/profile2_outline.svg');
/// File path: assets/icons/profile_circle.svg
SvgGenImage get profileCircle => const SvgGenImage('assets/icons/profile_circle.svg');
@@ -273,6 +279,7 @@ class $AssetsIconsGen {
buy,
calendar,
calendarSearch,
calendarSearchOutline,
call,
check,
checkSquare,
@@ -317,6 +324,7 @@ class $AssetsIconsGen {
pictureFrame,
placeHolder,
profile2,
profile2Outline,
profileCircle,
profileUser,
receiptDiscount,
@@ -403,6 +411,9 @@ class $AssetsVecGen {
/// File path: assets/vec/calendar_search.svg.vec
SvgGenImage get calendarSearchSvg => const SvgGenImage.vec('assets/vec/calendar_search.svg.vec');
/// File path: assets/vec/calendar_search_outline.svg.vec
SvgGenImage get calendarSearchOutlineSvg => const SvgGenImage.vec('assets/vec/calendar_search_outline.svg.vec');
/// File path: assets/vec/call.svg.vec
SvgGenImage get callSvg => const SvgGenImage.vec('assets/vec/call.svg.vec');
@@ -535,6 +546,9 @@ class $AssetsVecGen {
/// File path: assets/vec/profile2.svg.vec
SvgGenImage get profile2Svg => const SvgGenImage.vec('assets/vec/profile2.svg.vec');
/// File path: assets/vec/profile2_outline.svg.vec
SvgGenImage get profile2OutlineSvg => const SvgGenImage.vec('assets/vec/profile2_outline.svg.vec');
/// File path: assets/vec/profile_circle.svg.vec
SvgGenImage get profileCircleSvg => const SvgGenImage.vec('assets/vec/profile_circle.svg.vec');
@@ -618,6 +632,7 @@ class $AssetsVecGen {
buySvg,
calendarSvg,
calendarSearchSvg,
calendarSearchOutlineSvg,
callSvg,
checkSvg,
checkSquareSvg,
@@ -662,6 +677,7 @@ class $AssetsVecGen {
pictureFrameSvg,
placeHolderSvg,
profile2Svg,
profile2OutlineSvg,
profileCircleSvg,
profileUserSvg,
receiptDiscountSvg,

View File

@@ -40,6 +40,7 @@ class _ROutlinedElevatedIconState extends State<ROutlinedElevatedIcon> {
Widget build(BuildContext context) {
return OutlinedButton.icon(
icon: widget.icon,
label: Text(widget.text),
onPressed: widget.onPressed,
style: ButtonStyle(

View File

@@ -0,0 +1,127 @@
import 'package:flutter/material.dart';
import 'package:rasadyar_core/core.dart';
class ListItem extends StatelessWidget {
const ListItem({
super.key,
required this.index,
required this.child,
required this.secondChild,
required this.labelColor,
required this.labelIcon,
required this.onTap,
required this.selected,
this.labelIconColor = AppColor.mediumGreyDarkHover,
});
final int index;
final Widget child;
final Widget secondChild;
final Color labelColor;
final String labelIcon;
final Color? labelIconColor;
final VoidCallback onTap;
final bool selected;
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: onTap,
child: Container(
width: Get.width,
margin: const EdgeInsets.fromLTRB(0, 0, 10, 0),
decoration: BoxDecoration(
color: labelColor,
borderRadius: BorderRadius.circular(8),
border: Border.all(width: 1, color: AppColor.lightGreyNormalHover),
),
child: AnimatedSize(
duration: Duration(milliseconds: 400),
alignment: Alignment.center,
child: Stack(
clipBehavior: Clip.none,
alignment: Alignment.centerRight,
children: [
AnimatedSize(
duration: Duration(milliseconds: 300),
child: Container(
width: Get.width - 30,
alignment: Alignment.center,
decoration: BoxDecoration(
color: Colors.transparent,
borderRadius: BorderRadius.circular(8),
),
child: Row(
children: [
Expanded(
child: AnimatedCrossFade(
alignment: Alignment.center,
firstChild: Container(
height: 75,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
bottomLeft: Radius.zero,
bottomRight: Radius.circular(8),
topLeft: Radius.zero,
topRight: Radius.circular(8),
),
),
clipBehavior: Clip.antiAlias,
child: child,
),
secondChild: Container(
padding: EdgeInsets.fromLTRB(8, 12, 14, 12),
clipBehavior: Clip.antiAlias,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
),
child: secondChild,
),
crossFadeState: selected
? CrossFadeState.showSecond
: CrossFadeState.showFirst,
duration: Duration(milliseconds: 300),
),
),
Container(
width: 20,
child: Center(
child: SvgGenImage.vec(labelIcon).svg(
width: 16.w,
height: 16.h,
colorFilter: ColorFilter.mode(labelColor, BlendMode.srcIn),
),
),
),
],
),
),
),
Positioned(
right: -12,
child: Container(
width: index < 999 ? 24 : null,
height: index < 999 ? 24 : null,
padding: EdgeInsets.all(2),
decoration: BoxDecoration(
color: AppColor.greenLightHover,
borderRadius: BorderRadius.circular(4),
border: Border.all(width: 0.50, color: AppColor.greenDarkActive),
),
alignment: Alignment.center,
child: Text(
(index + 1).toString(),
style: AppFonts.yekan12.copyWith(color: Colors.black),
),
),
),
],
),
),
),
);
}
}

View File

@@ -0,0 +1,117 @@
import 'package:flutter/material.dart';
import 'package:rasadyar_core/core.dart';
class ListItem2 extends StatelessWidget {
const ListItem2({
super.key,
required this.index,
required this.child,
required this.secondChild,
required this.labelColor,
required this.labelIcon,
required this.onTap,
required this.selected,
this.labelIconColor = AppColor.mediumGreyDarkHover,
});
final int index;
final Widget child;
final Widget secondChild;
final Color labelColor;
final String labelIcon;
final Color? labelIconColor;
final VoidCallback onTap;
final bool selected;
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: onTap,
child: Container(
width: Get.width,
margin: const EdgeInsets.fromLTRB(0, 0, 10, 0),
decoration: BoxDecoration(
color: labelColor,
borderRadius: BorderRadius.circular(8),
border: Border.all(width: 1, color: AppColor.lightGreyNormalHover),
),
child: AnimatedSize(
duration: Duration(milliseconds: 400),
alignment: Alignment.center,
child: Stack(
clipBehavior: Clip.none,
alignment: Alignment.centerRight,
children: [
AnimatedCrossFade(
firstChild: Row(
children: [
Expanded(
child: Container(
height: 75,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
bottomLeft: Radius.zero,
bottomRight: Radius.circular(8),
topLeft: Radius.zero,
topRight: Radius.circular(8),
),
),
clipBehavior: Clip.antiAlias,
child: child,
),
),
Container(
width: 20,
child: Center(
child: SvgGenImage.vec(labelIcon).svg(
width: 16.w,
height: 16.h,
//TODO
colorFilter: ColorFilter.mode(
labelIconColor ?? AppColor.mediumGreyDarkActive,
BlendMode.srcIn,
),
),
),
),
],
),
secondChild: Container(
padding: EdgeInsets.fromLTRB(8, 8, 12, 12),
clipBehavior: Clip.antiAlias,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
),
child: secondChild,
),
crossFadeState: selected ? CrossFadeState.showSecond : CrossFadeState.showFirst,
duration: Duration(milliseconds: 300),
),
Positioned(
right: -12,
child: Container(
width: index < 999 ? 24 : null,
height: index < 999 ? 24 : null,
padding: EdgeInsets.all(2),
decoration: BoxDecoration(
color: AppColor.greenLightHover,
borderRadius: BorderRadius.circular(4),
border: Border.all(width: 0.50, color: AppColor.greenDarkActive),
),
alignment: Alignment.center,
child: Text(
(index + 1).toString(),
style: AppFonts.yekan12.copyWith(color: Colors.black),
),
),
),
],
),
),
),
);
}
}

View File

@@ -0,0 +1,104 @@
import 'package:flutter/material.dart';
import 'package:rasadyar_core/core.dart';
class ListItemWithOutCounter extends StatelessWidget {
const ListItemWithOutCounter({
super.key,
required this.child,
required this.secondChild,
required this.labelColor,
required this.labelIcon,
required this.onTap,
required this.selected,
this.labelIconColor = AppColor.mediumGreyDarkHover,
});
final Widget child;
final Widget secondChild;
final Color labelColor;
final String labelIcon;
final Color? labelIconColor;
final VoidCallback onTap;
final bool selected;
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: onTap,
child: Container(
width: Get.width,
margin: const EdgeInsets.fromLTRB(0, 0, 10, 0),
decoration: BoxDecoration(
color: labelColor,
borderRadius: BorderRadius.circular(8),
border: Border.all(width: 1, color: AppColor.lightGreyNormalHover),
),
child: AnimatedSize(
duration: Duration(milliseconds: 400),
alignment: Alignment.center,
child: AnimatedSize(
duration: Duration(milliseconds: 300),
child: Container(
width: Get.width - 30,
alignment: Alignment.center,
decoration: BoxDecoration(
color: Colors.transparent,
borderRadius: BorderRadius.circular(8),
),
child: Row(
children: [
Expanded(
child: AnimatedCrossFade(
alignment: Alignment.center,
firstChild: Container(
height: 75,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
bottomLeft: Radius.zero,
bottomRight: Radius.circular(8),
topLeft: Radius.zero,
topRight: Radius.circular(8),
),
),
clipBehavior: Clip.antiAlias,
child: child,
),
secondChild: Container(
padding: EdgeInsets.all(8),
clipBehavior: Clip.antiAlias,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
),
child: secondChild,
),
crossFadeState: selected
? CrossFadeState.showSecond
: CrossFadeState.showFirst,
duration: Duration(milliseconds: 300),
),
),
Visibility(
visible: selected==false,
child: Container(
width: 20,
child: Center(
child: SvgGenImage.vec(labelIcon).svg(
width: 16.w,
height: 16.h,
colorFilter: ColorFilter.mode(labelColor, BlendMode.srcIn),
),
),
),
),
],
),
),
),
),
),
);
}
}

View File

@@ -46,6 +46,17 @@ class _OverlayDropdownState<T> extends State<OverlayDropdownWidget<T>> {
selectedItem = widget.selectedItem ?? widget.initialValue;
}
@override
void didUpdateWidget(covariant OverlayDropdownWidget<T> oldWidget) {
super.didUpdateWidget(oldWidget);
if (widget.selectedItem != oldWidget.selectedItem) {
setState(() {
selectedItem = widget.selectedItem;
});
}
}
void _showOverlay() {
final renderBox = _key.currentContext!.findRenderObject() as RenderBox;
final size = renderBox.size;

View File

@@ -24,3 +24,8 @@ export 'vec_widget.dart';
export 'list_row_item.dart';
//inputs
export 'inputs/inputs.dart';
//list_item
export 'list_item/list_item.dart';
export 'list_item/list_item2.dart';
export 'list_item/list_item_with_out_number.dart';