|
|
|
|
@ -1,11 +1,14 @@
|
|
|
|
|
import 'dart:convert';
|
|
|
|
|
|
|
|
|
|
import 'package:easy_localization/easy_localization.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/classes/colors.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/extensions/int_extensions.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/extensions/string_extensions.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/models/itg_forms_models/itg_worklist_table_model.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/widgets/bottom_sheet.dart';
|
|
|
|
|
|
|
|
|
|
class ItemDetailView extends StatelessWidget {
|
|
|
|
|
final String title;
|
|
|
|
|
@ -40,7 +43,7 @@ class ItemDetailViewCol extends StatelessWidget {
|
|
|
|
|
children: [
|
|
|
|
|
"$title:".toText12(isBold: true, color: const Color(0xff2BB8A6), maxLine: 2),
|
|
|
|
|
4.width,
|
|
|
|
|
(value.isEmpty ? "--" : value).toText12(color: MyColors.normalTextColor, maxLine: 5),
|
|
|
|
|
Flexible(child: (value.isEmpty ? "--" : value).toText12(color: MyColors.normalTextColor, maxLine: null)),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
@ -84,18 +87,51 @@ class ItemDetailViewGridItem extends StatelessWidget {
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: [
|
|
|
|
|
title != null ? Flexible(child: "$title:".toText12Auto(isBold: true, color: const Color(0xff2BB8A6))) : Container(),
|
|
|
|
|
title != null ? Flexible(child: "$title:".toText12(isBold: true, color: const Color(0xff2BB8A6))) : Container(),
|
|
|
|
|
4.width,
|
|
|
|
|
type != null
|
|
|
|
|
? type!.toLowerCase() == "table"
|
|
|
|
|
? getStringFromJSON(value!)
|
|
|
|
|
// : Flexible(child: (value!.isEmpty ? "--" : value).toString().toText12Auto(color: MyColors.normalTextColor, maxLine: 5))
|
|
|
|
|
: (value!.isEmpty ? "--" : value).toString().toText12Auto(color: MyColors.normalTextColor, maxLine: maxLine)
|
|
|
|
|
: (value!.isEmpty ? "--" : value).toString().toText12(color: MyColors.normalTextColor, maxLine: 2)
|
|
|
|
|
: Container(),
|
|
|
|
|
if (value!.length > 100)
|
|
|
|
|
GestureDetector(
|
|
|
|
|
onTap: () {
|
|
|
|
|
showModalBottomSheet(
|
|
|
|
|
context: context,
|
|
|
|
|
enableDrag: true,
|
|
|
|
|
isDismissible: true,
|
|
|
|
|
shape: const RoundedRectangleBorder(
|
|
|
|
|
borderRadius: BorderRadius.only(topLeft: Radius.circular(12), topRight: Radius.circular(12)),
|
|
|
|
|
),
|
|
|
|
|
backgroundColor: Colors.white,
|
|
|
|
|
builder: (context) {
|
|
|
|
|
return openWorkListBottomSheet(context, value, title);
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.only(top: 4),
|
|
|
|
|
child: Text(
|
|
|
|
|
LocaleKeys.showMore.tr(),
|
|
|
|
|
textAlign: TextAlign.right,
|
|
|
|
|
style: const TextStyle(
|
|
|
|
|
color: Color(0xff2BB8A6),
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
).paddingOnly(top: showSpaceAfterLine ? 16 : 0),
|
|
|
|
|
|
|
|
|
|
).paddingOnly(top: showSpaceAfterLine ? 16 : 0, left: 2, right: 2),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class ItemDetailGrid extends StatelessWidget {
|
|
|
|
|
@ -153,3 +189,4 @@ Widget getStringFromJSON(String jsonString) {
|
|
|
|
|
return Flexible(child: ("-").toString().toText12Auto(color: MyColors.normalTextColor));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|