refactor : inspection
This commit is contained in:
@@ -96,7 +96,7 @@ abstract class Poultry with _$Poultry {
|
|||||||
String? key,
|
String? key,
|
||||||
String? fullname,
|
String? fullname,
|
||||||
String? mobile,
|
String? mobile,
|
||||||
String? city,
|
int? city,
|
||||||
String? unitName,
|
String? unitName,
|
||||||
int? killingAveAge,
|
int? killingAveAge,
|
||||||
int? activeLeftOver,
|
int? activeLeftOver,
|
||||||
|
|||||||
@@ -1619,7 +1619,7 @@ as String?,
|
|||||||
/// @nodoc
|
/// @nodoc
|
||||||
mixin _$Poultry {
|
mixin _$Poultry {
|
||||||
|
|
||||||
String? get key; String? get fullname; String? get mobile; String? get city; String? get unitName; int? get killingAveAge; int? get activeLeftOver; int? get killingAveCount; double? get realKillingAveWeight; double? get realKillingLiveWeight; double? get realKillingCarcassesWeight; double? get realKillingLossWeightPercent;
|
String? get key; String? get fullname; String? get mobile; int? get city; String? get unitName; int? get killingAveAge; int? get activeLeftOver; int? get killingAveCount; double? get realKillingAveWeight; double? get realKillingLiveWeight; double? get realKillingCarcassesWeight; double? get realKillingLossWeightPercent;
|
||||||
/// Create a copy of Poultry
|
/// Create a copy of Poultry
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
@@ -1652,7 +1652,7 @@ abstract mixin class $PoultryCopyWith<$Res> {
|
|||||||
factory $PoultryCopyWith(Poultry value, $Res Function(Poultry) _then) = _$PoultryCopyWithImpl;
|
factory $PoultryCopyWith(Poultry value, $Res Function(Poultry) _then) = _$PoultryCopyWithImpl;
|
||||||
@useResult
|
@useResult
|
||||||
$Res call({
|
$Res call({
|
||||||
String? key, String? fullname, String? mobile, String? city, String? unitName, int? killingAveAge, int? activeLeftOver, int? killingAveCount, double? realKillingAveWeight, double? realKillingLiveWeight, double? realKillingCarcassesWeight, double? realKillingLossWeightPercent
|
String? key, String? fullname, String? mobile, int? city, String? unitName, int? killingAveAge, int? activeLeftOver, int? killingAveCount, double? realKillingAveWeight, double? realKillingLiveWeight, double? realKillingCarcassesWeight, double? realKillingLossWeightPercent
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@@ -1675,7 +1675,7 @@ key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable
|
|||||||
as String?,fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable
|
as String?,fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable
|
||||||
as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable
|
as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable
|
||||||
as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable
|
as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable
|
||||||
as String?,unitName: freezed == unitName ? _self.unitName : unitName // ignore: cast_nullable_to_non_nullable
|
as int?,unitName: freezed == unitName ? _self.unitName : unitName // ignore: cast_nullable_to_non_nullable
|
||||||
as String?,killingAveAge: freezed == killingAveAge ? _self.killingAveAge : killingAveAge // ignore: cast_nullable_to_non_nullable
|
as String?,killingAveAge: freezed == killingAveAge ? _self.killingAveAge : killingAveAge // ignore: cast_nullable_to_non_nullable
|
||||||
as int?,activeLeftOver: freezed == activeLeftOver ? _self.activeLeftOver : activeLeftOver // ignore: cast_nullable_to_non_nullable
|
as int?,activeLeftOver: freezed == activeLeftOver ? _self.activeLeftOver : activeLeftOver // ignore: cast_nullable_to_non_nullable
|
||||||
as int?,killingAveCount: freezed == killingAveCount ? _self.killingAveCount : killingAveCount // ignore: cast_nullable_to_non_nullable
|
as int?,killingAveCount: freezed == killingAveCount ? _self.killingAveCount : killingAveCount // ignore: cast_nullable_to_non_nullable
|
||||||
@@ -1768,7 +1768,7 @@ return $default(_that);case _:
|
|||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
|
||||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String? key, String? fullname, String? mobile, String? city, String? unitName, int? killingAveAge, int? activeLeftOver, int? killingAveCount, double? realKillingAveWeight, double? realKillingLiveWeight, double? realKillingCarcassesWeight, double? realKillingLossWeightPercent)? $default,{required TResult orElse(),}) {final _that = this;
|
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String? key, String? fullname, String? mobile, int? city, String? unitName, int? killingAveAge, int? activeLeftOver, int? killingAveCount, double? realKillingAveWeight, double? realKillingLiveWeight, double? realKillingCarcassesWeight, double? realKillingLossWeightPercent)? $default,{required TResult orElse(),}) {final _that = this;
|
||||||
switch (_that) {
|
switch (_that) {
|
||||||
case _Poultry() when $default != null:
|
case _Poultry() when $default != null:
|
||||||
return $default(_that.key,_that.fullname,_that.mobile,_that.city,_that.unitName,_that.killingAveAge,_that.activeLeftOver,_that.killingAveCount,_that.realKillingAveWeight,_that.realKillingLiveWeight,_that.realKillingCarcassesWeight,_that.realKillingLossWeightPercent);case _:
|
return $default(_that.key,_that.fullname,_that.mobile,_that.city,_that.unitName,_that.killingAveAge,_that.activeLeftOver,_that.killingAveCount,_that.realKillingAveWeight,_that.realKillingLiveWeight,_that.realKillingCarcassesWeight,_that.realKillingLossWeightPercent);case _:
|
||||||
@@ -1789,7 +1789,7 @@ return $default(_that.key,_that.fullname,_that.mobile,_that.city,_that.unitName,
|
|||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
|
||||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String? key, String? fullname, String? mobile, String? city, String? unitName, int? killingAveAge, int? activeLeftOver, int? killingAveCount, double? realKillingAveWeight, double? realKillingLiveWeight, double? realKillingCarcassesWeight, double? realKillingLossWeightPercent) $default,) {final _that = this;
|
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String? key, String? fullname, String? mobile, int? city, String? unitName, int? killingAveAge, int? activeLeftOver, int? killingAveCount, double? realKillingAveWeight, double? realKillingLiveWeight, double? realKillingCarcassesWeight, double? realKillingLossWeightPercent) $default,) {final _that = this;
|
||||||
switch (_that) {
|
switch (_that) {
|
||||||
case _Poultry():
|
case _Poultry():
|
||||||
return $default(_that.key,_that.fullname,_that.mobile,_that.city,_that.unitName,_that.killingAveAge,_that.activeLeftOver,_that.killingAveCount,_that.realKillingAveWeight,_that.realKillingLiveWeight,_that.realKillingCarcassesWeight,_that.realKillingLossWeightPercent);case _:
|
return $default(_that.key,_that.fullname,_that.mobile,_that.city,_that.unitName,_that.killingAveAge,_that.activeLeftOver,_that.killingAveCount,_that.realKillingAveWeight,_that.realKillingLiveWeight,_that.realKillingCarcassesWeight,_that.realKillingLossWeightPercent);case _:
|
||||||
@@ -1809,7 +1809,7 @@ return $default(_that.key,_that.fullname,_that.mobile,_that.city,_that.unitName,
|
|||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
|
||||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String? key, String? fullname, String? mobile, String? city, String? unitName, int? killingAveAge, int? activeLeftOver, int? killingAveCount, double? realKillingAveWeight, double? realKillingLiveWeight, double? realKillingCarcassesWeight, double? realKillingLossWeightPercent)? $default,) {final _that = this;
|
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String? key, String? fullname, String? mobile, int? city, String? unitName, int? killingAveAge, int? activeLeftOver, int? killingAveCount, double? realKillingAveWeight, double? realKillingLiveWeight, double? realKillingCarcassesWeight, double? realKillingLossWeightPercent)? $default,) {final _that = this;
|
||||||
switch (_that) {
|
switch (_that) {
|
||||||
case _Poultry() when $default != null:
|
case _Poultry() when $default != null:
|
||||||
return $default(_that.key,_that.fullname,_that.mobile,_that.city,_that.unitName,_that.killingAveAge,_that.activeLeftOver,_that.killingAveCount,_that.realKillingAveWeight,_that.realKillingLiveWeight,_that.realKillingCarcassesWeight,_that.realKillingLossWeightPercent);case _:
|
return $default(_that.key,_that.fullname,_that.mobile,_that.city,_that.unitName,_that.killingAveAge,_that.activeLeftOver,_that.killingAveCount,_that.realKillingAveWeight,_that.realKillingLiveWeight,_that.realKillingCarcassesWeight,_that.realKillingLossWeightPercent);case _:
|
||||||
@@ -1830,7 +1830,7 @@ class _Poultry implements Poultry {
|
|||||||
@override final String? key;
|
@override final String? key;
|
||||||
@override final String? fullname;
|
@override final String? fullname;
|
||||||
@override final String? mobile;
|
@override final String? mobile;
|
||||||
@override final String? city;
|
@override final int? city;
|
||||||
@override final String? unitName;
|
@override final String? unitName;
|
||||||
@override final int? killingAveAge;
|
@override final int? killingAveAge;
|
||||||
@override final int? activeLeftOver;
|
@override final int? activeLeftOver;
|
||||||
@@ -1873,7 +1873,7 @@ abstract mixin class _$PoultryCopyWith<$Res> implements $PoultryCopyWith<$Res> {
|
|||||||
factory _$PoultryCopyWith(_Poultry value, $Res Function(_Poultry) _then) = __$PoultryCopyWithImpl;
|
factory _$PoultryCopyWith(_Poultry value, $Res Function(_Poultry) _then) = __$PoultryCopyWithImpl;
|
||||||
@override @useResult
|
@override @useResult
|
||||||
$Res call({
|
$Res call({
|
||||||
String? key, String? fullname, String? mobile, String? city, String? unitName, int? killingAveAge, int? activeLeftOver, int? killingAveCount, double? realKillingAveWeight, double? realKillingLiveWeight, double? realKillingCarcassesWeight, double? realKillingLossWeightPercent
|
String? key, String? fullname, String? mobile, int? city, String? unitName, int? killingAveAge, int? activeLeftOver, int? killingAveCount, double? realKillingAveWeight, double? realKillingLiveWeight, double? realKillingCarcassesWeight, double? realKillingLossWeightPercent
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@@ -1896,7 +1896,7 @@ key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable
|
|||||||
as String?,fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable
|
as String?,fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable
|
||||||
as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable
|
as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable
|
||||||
as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable
|
as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable
|
||||||
as String?,unitName: freezed == unitName ? _self.unitName : unitName // ignore: cast_nullable_to_non_nullable
|
as int?,unitName: freezed == unitName ? _self.unitName : unitName // ignore: cast_nullable_to_non_nullable
|
||||||
as String?,killingAveAge: freezed == killingAveAge ? _self.killingAveAge : killingAveAge // ignore: cast_nullable_to_non_nullable
|
as String?,killingAveAge: freezed == killingAveAge ? _self.killingAveAge : killingAveAge // ignore: cast_nullable_to_non_nullable
|
||||||
as int?,activeLeftOver: freezed == activeLeftOver ? _self.activeLeftOver : activeLeftOver // ignore: cast_nullable_to_non_nullable
|
as int?,activeLeftOver: freezed == activeLeftOver ? _self.activeLeftOver : activeLeftOver // ignore: cast_nullable_to_non_nullable
|
||||||
as int?,killingAveCount: freezed == killingAveCount ? _self.killingAveCount : killingAveCount // ignore: cast_nullable_to_non_nullable
|
as int?,killingAveCount: freezed == killingAveCount ? _self.killingAveCount : killingAveCount // ignore: cast_nullable_to_non_nullable
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ _Poultry _$PoultryFromJson(Map<String, dynamic> json) => _Poultry(
|
|||||||
key: json['key'] as String?,
|
key: json['key'] as String?,
|
||||||
fullname: json['fullname'] as String?,
|
fullname: json['fullname'] as String?,
|
||||||
mobile: json['mobile'] as String?,
|
mobile: json['mobile'] as String?,
|
||||||
city: json['city'] as String?,
|
city: (json['city'] as num?)?.toInt(),
|
||||||
unitName: json['unit_name'] as String?,
|
unitName: json['unit_name'] as String?,
|
||||||
killingAveAge: (json['killing_ave_age'] as num?)?.toInt(),
|
killingAveAge: (json['killing_ave_age'] as num?)?.toInt(),
|
||||||
activeLeftOver: (json['active_left_over'] as num?)?.toInt(),
|
activeLeftOver: (json['active_left_over'] as num?)?.toInt(),
|
||||||
|
|||||||
@@ -2,9 +2,11 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:rasadyar_chicken/data/models/response/hatching/hatching_models.dart';
|
import 'package:rasadyar_chicken/data/models/response/hatching/hatching_models.dart';
|
||||||
import 'package:rasadyar_chicken/data/models/response/hatching_report/hatching_report.dart';
|
import 'package:rasadyar_chicken/data/models/response/hatching_report/hatching_report.dart';
|
||||||
import 'package:rasadyar_chicken/presentation/pages/poultry_science/root/logic.dart';
|
import 'package:rasadyar_chicken/presentation/pages/poultry_science/root/logic.dart';
|
||||||
|
import 'package:rasadyar_chicken/presentation/utils/utils.dart';
|
||||||
import 'package:rasadyar_core/core.dart';
|
import 'package:rasadyar_core/core.dart';
|
||||||
|
|
||||||
class InspectionPoultryScienceLogic extends GetxController {
|
class InspectionPoultryScienceLogic extends GetxController {
|
||||||
|
BaseLogic baseLogic = Get.find<BaseLogic>();
|
||||||
Rx<Resource<PaginationModel<HatchingModel>>> hatchingList =
|
Rx<Resource<PaginationModel<HatchingModel>>> hatchingList =
|
||||||
Resource<PaginationModel<HatchingModel>>.loading().obs;
|
Resource<PaginationModel<HatchingModel>>.loading().obs;
|
||||||
|
|
||||||
@@ -41,6 +43,8 @@ class InspectionPoultryScienceLogic extends GetxController {
|
|||||||
routesName.removeLast();
|
routesName.removeLast();
|
||||||
routesName.add(callback == 0 ? 'بازرسی' : 'بایگانی');
|
routesName.add(callback == 0 ? 'بازرسی' : 'بایگانی');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -63,7 +67,9 @@ class InspectionPoultryScienceLogic extends GetxController {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
void onClose() {
|
void onClose() {
|
||||||
// TODO: implement onClose
|
baseLogic.isSearchSelected.value=false;
|
||||||
|
baseLogic.textEditingController.clear();
|
||||||
|
baseLogic.searchValue.value=null;
|
||||||
super.onClose();
|
super.onClose();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -247,8 +253,9 @@ class InspectionPoultryScienceLogic extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void setSearchValue(String? data) {
|
void setSearchValue(String? data) {
|
||||||
|
dLog('Search Value: $data');
|
||||||
searchedValue.value = data?.trim();
|
searchedValue.value = data?.trim();
|
||||||
final isReporter = selectedSegmentIndex.value == 0;
|
final isReporter = selectedSegmentIndex.value == 1;
|
||||||
if (isReporter) {
|
if (isReporter) {
|
||||||
getHatchingReport();
|
getHatchingReport();
|
||||||
} else {
|
} else {
|
||||||
@@ -256,3 +263,4 @@ class InspectionPoultryScienceLogic extends GetxController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,12 +18,12 @@ class InspectionPoultrySciencePage extends GetView<InspectionPoultryScienceLogic
|
|||||||
hasBack: true,
|
hasBack: true,
|
||||||
hasFilter: true,
|
hasFilter: true,
|
||||||
hasSearch: true,
|
hasSearch: true,
|
||||||
filteringWidget: filterBottomSheet(),
|
onFilterTap: () {
|
||||||
|
Get.bottomSheet(filterBottomSheet());
|
||||||
|
},
|
||||||
onSearchChanged: (data) => controller.setSearchValue(data),
|
onSearchChanged: (data) => controller.setSearchValue(data),
|
||||||
backId: poultryFirstKey,
|
backId: poultryFirstKey,
|
||||||
routes: controller.routesName,
|
routes: controller.routesName,
|
||||||
|
|
||||||
//routesWidget: ObxValue((route) => buildContainerPageRoute(route), controller.routesName),
|
|
||||||
widgets: [
|
widgets: [
|
||||||
SizedBox(height: 50, child: segmentWidget()),
|
SizedBox(height: 50, child: segmentWidget()),
|
||||||
ObxValue((data) {
|
ObxValue((data) {
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ RAppBar chickenAppBar({
|
|||||||
isBase: isBase,
|
isBase: isBase,
|
||||||
backId: backId,
|
backId: backId,
|
||||||
hasFilter: hasFilter,
|
hasFilter: hasFilter,
|
||||||
|
onFilterTap: onFilterTap,
|
||||||
onSearchTap: onSearchTap,
|
onSearchTap: onSearchTap,
|
||||||
onBackTap: onBackTap,
|
onBackTap: onBackTap,
|
||||||
onNotificationTap: onNotificationTap,
|
onNotificationTap: onNotificationTap,
|
||||||
|
|||||||
@@ -84,6 +84,7 @@ class ChickenBasePage extends GetView<BaseLogic> {
|
|||||||
widgets: widgets,
|
widgets: widgets,
|
||||||
child: child,
|
child: child,
|
||||||
scrollable: scrollable,
|
scrollable: scrollable,
|
||||||
|
onSearchChanged: onSearchChanged,
|
||||||
floatingActionButtonLocation: floatingActionButtonLocation,
|
floatingActionButtonLocation: floatingActionButtonLocation,
|
||||||
floatingActionButton: floatingActionButton,
|
floatingActionButton: floatingActionButton,
|
||||||
backGroundWidget: backGroundWidget ?? chickenBackground(),
|
backGroundWidget: backGroundWidget ?? chickenBackground(),
|
||||||
@@ -100,8 +101,8 @@ class ChickenBasePage extends GetView<BaseLogic> {
|
|||||||
onBackTap: onBackTap,
|
onBackTap: onBackTap,
|
||||||
hasNotification: hasNotification,
|
hasNotification: hasNotification,
|
||||||
onNotificationTap: onNotificationTap,
|
onNotificationTap: onNotificationTap,
|
||||||
onFilterTap: hasFilter ? _onFilterTap : null,
|
onFilterTap: onFilterTap ?? _onFilterTap,
|
||||||
//onSearchTap: widget.hasSearch ? controller.toggleSearch : null,
|
onSearchTap: hasSearch ? controller.toggleSearch : null,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ class BaseLogic extends GetxController {
|
|||||||
final TextEditingController textEditingController = TextEditingController();
|
final TextEditingController textEditingController = TextEditingController();
|
||||||
|
|
||||||
void setSearchCallback(void Function(String?)? onSearchChanged) {
|
void setSearchCallback(void Function(String?)? onSearchChanged) {
|
||||||
|
fLog("sssssssssssssssssssssssssssssssss");
|
||||||
debounce<String?>(searchValue, (val) {
|
debounce<String?>(searchValue, (val) {
|
||||||
if (val != null && val.trim().isNotEmpty) {
|
if (val != null && val.trim().isNotEmpty) {
|
||||||
onSearchChanged?.call(val);
|
onSearchChanged?.call(val);
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ class BasePage extends GetView<BaseLogic> {
|
|||||||
this.backGroundWidget,
|
this.backGroundWidget,
|
||||||
this.onPopScopTaped,
|
this.onPopScopTaped,
|
||||||
this.backId,
|
this.backId,
|
||||||
|
this.onSearchChanged,
|
||||||
});
|
});
|
||||||
|
|
||||||
final List<String>? routes;
|
final List<String>? routes;
|
||||||
@@ -28,13 +29,18 @@ class BasePage extends GetView<BaseLogic> {
|
|||||||
final Widget? floatingActionButton;
|
final Widget? floatingActionButton;
|
||||||
final VoidCallback? onPopScopTaped;
|
final VoidCallback? onPopScopTaped;
|
||||||
final int? backId;
|
final int? backId;
|
||||||
|
final void Function(String?)? onSearchChanged;
|
||||||
|
|
||||||
Widget _buildHeader() {
|
Widget _buildHeader() {
|
||||||
|
if (appBar?.hasSearch == true) {
|
||||||
|
controller.setSearchCallback(onSearchChanged);
|
||||||
|
}
|
||||||
|
|
||||||
return Column(
|
return Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
routesWidget ?? TextBreadcrumb(routes: routes!),
|
routesWidget ?? ContainerBreadcrumb(routes: routes!),
|
||||||
if (controller.isSearchSelected.value) ...{SearchWidget()},
|
SearchWidget(),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ class TextBreadcrumb extends Breadcrumb {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class ContainerBreadcrumb extends Breadcrumb {
|
class ContainerBreadcrumb extends Breadcrumb {
|
||||||
const ContainerBreadcrumb({super.key, super.routes});
|
const ContainerBreadcrumb({super.key, super.routes});
|
||||||
|
|
||||||
@@ -35,24 +34,32 @@ class ContainerBreadcrumb extends Breadcrumb {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget buildContainerPageRoute(List<String> route) {
|
Widget buildContainerPageRoute(List<String> route) {
|
||||||
return Container(
|
return Row(
|
||||||
height: 24.h,
|
children: [
|
||||||
margin: EdgeInsets.symmetric(horizontal: 8.w, vertical: 4.h),
|
Container(
|
||||||
decoration: BoxDecoration(color: Color(0xFFE3E3E3), borderRadius: BorderRadius.circular(2.r)),
|
height: 24.h,
|
||||||
padding: EdgeInsets.symmetric(horizontal: 6.w),
|
margin: EdgeInsets.symmetric(horizontal: 8.w, vertical: 4.h),
|
||||||
child: ListView.separated(
|
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(2.r)),
|
||||||
scrollDirection: Axis.horizontal,
|
padding: EdgeInsets.symmetric(horizontal: 6.w),
|
||||||
physics: NeverScrollableScrollPhysics(),
|
child: ListView.separated(
|
||||||
shrinkWrap: true,
|
scrollDirection: Axis.horizontal,
|
||||||
itemBuilder: (context, index) => Center(
|
physics: NeverScrollableScrollPhysics(),
|
||||||
child: Text(route[index], style: AppFonts.yekan14.copyWith(color: AppColor.labelTextColor)),
|
shrinkWrap: true,
|
||||||
|
itemBuilder: (context, index) => Center(
|
||||||
|
child: Text(
|
||||||
|
route[index],
|
||||||
|
style: AppFonts.yekan14.copyWith(color: AppColor.labelTextColor),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
separatorBuilder: (context, index) => Assets.vec.arrowLeftSvg.svg(
|
||||||
|
height: 24.h,
|
||||||
|
fit: BoxFit.fitHeight,
|
||||||
|
colorFilter: ColorFilter.mode(Color(0xFFD6DEEE), BlendMode.srcIn),
|
||||||
|
),
|
||||||
|
itemCount: route.length,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
separatorBuilder: (context, index) =>
|
],
|
||||||
Assets.vec.arrowLeftSvg.svg(height: 24.h, fit: BoxFit.fitHeight),
|
|
||||||
itemCount: route.length,
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
import 'dart:developer';
|
|
||||||
|
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:rasadyar_core/core.dart';
|
import 'package:rasadyar_core/core.dart';
|
||||||
@@ -32,6 +30,7 @@ class RAppBar extends StatelessWidget implements PreferredSizeWidget {
|
|||||||
/// Preferred size widget for the AppBar bottom.
|
/// Preferred size widget for the AppBar bottom.
|
||||||
final PreferredSizeWidget? bottom;
|
final PreferredSizeWidget? bottom;
|
||||||
|
|
||||||
|
|
||||||
const RAppBar({
|
const RAppBar({
|
||||||
super.key,
|
super.key,
|
||||||
this.children,
|
this.children,
|
||||||
@@ -72,16 +71,19 @@ class RAppBar extends StatelessWidget implements PreferredSizeWidget {
|
|||||||
if (hasNews)
|
if (hasNews)
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: onNewsTap,
|
onTap: onNewsTap,
|
||||||
child: Badge.count(
|
|
||||||
count: 5,
|
child: Icon(CupertinoIcons.news_solid, color: Colors.white),
|
||||||
child: Icon(CupertinoIcons.news_solid, color: Colors.white),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
if (hasNews) SizedBox(width: 8.w),
|
if (hasNews) SizedBox(width: 8.w),
|
||||||
|
|
||||||
if (hasNotification)
|
if (hasNotification)
|
||||||
Badge.count(count: 2, child: Icon(CupertinoIcons.bell_fill, color: Colors.white)),
|
GestureDetector(
|
||||||
|
onTap: onNotificationTap,
|
||||||
|
child: Icon(CupertinoIcons.bell_fill, color: Colors.white),
|
||||||
|
),
|
||||||
|
|
||||||
if (hasNotification) SizedBox(width: 8.w),
|
if (hasNotification) SizedBox(width: 8.w),
|
||||||
|
|
||||||
if (!isBase) ...{
|
if (!isBase) ...{
|
||||||
if (hasFilter)
|
if (hasFilter)
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
@@ -94,7 +96,14 @@ class RAppBar extends StatelessWidget implements PreferredSizeWidget {
|
|||||||
),
|
),
|
||||||
if (hasBack) SizedBox(width: 8.w),
|
if (hasBack) SizedBox(width: 8.w),
|
||||||
|
|
||||||
if (hasSearch) SearchWidget(),
|
if (hasSearch) GestureDetector(
|
||||||
|
onTap: onSearchTap,
|
||||||
|
child: Assets.vec.searchSvg.svg(
|
||||||
|
width: 24.w,
|
||||||
|
height: 24.h,
|
||||||
|
colorFilter: ColorFilter.mode(Colors.white, BlendMode.srcIn),
|
||||||
|
),
|
||||||
|
),
|
||||||
if (hasSearch) SizedBox(width: 8.w),
|
if (hasSearch) SizedBox(width: 8.w),
|
||||||
},
|
},
|
||||||
if (hasBack)
|
if (hasBack)
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import 'package:rasadyar_core/core.dart';
|
|||||||
class SearchWidget extends GetView<BaseLogic> {
|
class SearchWidget extends GetView<BaseLogic> {
|
||||||
const SearchWidget({super.key});
|
const SearchWidget({super.key});
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return ObxValue((data) {
|
return ObxValue((data) {
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ class _BasePageState extends State<BasePage> {
|
|||||||
children: [
|
children: [
|
||||||
//widget.routesWidget != null ? widget.routesWidget! : buildPageRoute(widget.routes!),
|
//widget.routesWidget != null ? widget.routesWidget! : buildPageRoute(widget.routes!),
|
||||||
if (!widget.isBase && widget.hasSearch && widget.defaultSearch) ...{
|
if (!widget.isBase && widget.hasSearch && widget.defaultSearch) ...{
|
||||||
SearchWidget(onSearchChanged: widget.onSearchChanged),
|
SearchWidget2(onSearchChanged: widget.onSearchChanged),
|
||||||
},
|
},
|
||||||
...widget.widgets,
|
...widget.widgets,
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -3,16 +3,16 @@ import 'package:rasadyar_core/core.dart';
|
|||||||
import 'package:rasadyar_inspection/presentation/widget/base_page/logic.dart' hide BaseLogic;
|
import 'package:rasadyar_inspection/presentation/widget/base_page/logic.dart' hide BaseLogic;
|
||||||
|
|
||||||
|
|
||||||
class SearchWidget extends StatefulWidget {
|
class SearchWidget2 extends StatefulWidget {
|
||||||
const SearchWidget({super.key, this.onSearchChanged});
|
const SearchWidget2({super.key, this.onSearchChanged});
|
||||||
|
|
||||||
final void Function(String?)? onSearchChanged;
|
final void Function(String?)? onSearchChanged;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<SearchWidget> createState() => _SearchWidgetState();
|
State<SearchWidget2> createState() => _SearchWidgetState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _SearchWidgetState extends State<SearchWidget> {
|
class _SearchWidgetState extends State<SearchWidget2> {
|
||||||
late final BaseLogic controller;
|
late final BaseLogic controller;
|
||||||
final TextEditingController textEditingController = TextEditingController();
|
final TextEditingController textEditingController = TextEditingController();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user