asset open to details screen

main_production_attahment_type
Sikander Saleem 3 days ago
parent 9fbb2efa55
commit 1d4ed83a4b

@ -32,6 +32,7 @@ import 'package:test_sa/providers/ppm_task_status_provider.dart';
import 'package:test_sa/views/widgets/bottom_sheets/asset_detail_bottom_sheet.dart';
import 'package:test_sa/views/widgets/date_and_time/date_picker.dart';
import 'package:test_sa/views/widgets/date_and_time/time_picker.dart';
import 'package:test_sa/views/widgets/equipment/asset_detail_page.dart';
import 'package:test_sa/views/widgets/images/multi_image_picker.dart';
import 'package:test_sa/views/widgets/item_views/info_header_widget.dart';
import 'package:test_sa/views/widgets/item_views/info_text_widget.dart';
@ -61,7 +62,10 @@ class _WoInfoFormState extends State<WoInfoForm> {
calculateWorkingTime();
if (widget.planPreventiveVisit.preventiveVisitAttachments != null && widget.planPreventiveVisit.preventiveVisitAttachments!.isNotEmpty) {
ppmProvider.ppmPlanAttachments = [];
ppmProvider.ppmPlanAttachments.addAll(widget.planPreventiveVisit.preventiveVisitAttachments!.whereType<GenericAttachmentModel>().map((e) => GenericAttachmentModel(id: e.id, name: e.name ?? '',documentType: e.documentType)).toList());
ppmProvider.ppmPlanAttachments.addAll(widget.planPreventiveVisit.preventiveVisitAttachments!
.whereType<GenericAttachmentModel>()
.map((e) => GenericAttachmentModel(id: e.id, name: e.name ?? '', documentType: e.documentType))
.toList());
}
});
@ -156,23 +160,9 @@ class _WoInfoFormState extends State<WoInfoForm> {
children: [
InfoHeader16Widget(widget.planPreventiveVisit.assetName ?? '').expanded,
// widget.planPreventiveVisit.assetName!.bodyText(context).custom(color: AppColor.headingTextColor(context)).expanded,
"info_icon".toSvgAsset(height: 17, width: 17).onPress(
() {
// There is only limited information for asset is returned from backend to show all info need to return the whole model from backend...
showModalBottomSheet(
context: context,
backgroundColor: AppColor.bottomSheetColor(context),
isScrollControlled: true,
// shape: const RoundedRectangleBorder(
// borderRadius: BorderRadius.vertical(
// top: Radius.circular(20),
// ),
// ),
clipBehavior: Clip.antiAliasWithSaveLayer,
builder: (BuildContext context) => _buildAssetDetailBottomSheet(context),
);
},
)
const Icon(Icons.open_in_new_rounded, color: AppColor.primary10, size: 20).onPress(() {
Navigator.of(context).pushNamed(AssetDetailPage.id, arguments: widget.planPreventiveVisit.asset!.id);
}),
],
),
// 2.height,

@ -10,6 +10,7 @@ import 'package:test_sa/views/widgets/qr/asset_scan_qr.dart';
import '../../../models/device/asset.dart';
import '../../../new_views/app_style/app_color.dart';
import 'asset_detail_page.dart';
class AssetPicker extends StatelessWidget {
final Function(Asset)? onPick;
@ -185,21 +186,13 @@ class AssetPicker extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
InfoHeaderWidget(
device.modelDefinition?.assetName?.cleanupWhitespace.capitalizeFirstOfEach ?? "",
).toShimmer(isShow: showLoading, context: context).expanded,
Icon(Icons.info, color: AppColor.icon2Color(context), size: 20).onPress(() {
showModalBottomSheet(
context: context,
isScrollControlled: true,
backgroundColor: AppColor.bottomSheetColor(context),
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(top: Radius.circular(20)),
),
clipBehavior: Clip.antiAliasWithSaveLayer,
builder: (BuildContext context) => AssetDetailBottomSheet(device),
);
const Icon(Icons.open_in_new_rounded, color: AppColor.primary10, size: 20).onPress(() {
Navigator.of(context).pushNamed(AssetDetailPage.id, arguments: device.id);
}),
if (multiSelection) ...[
4.width,

Loading…
Cancel
Save