You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hmg-mohemm-flutter-app/lib/ui/dialogs/id/employee_digital_id_dialog....

137 lines
5.6 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart';
import 'package:mohem_flutter_app/extensions/string_extensions.dart';
class EmployeeDigitialIdDialog extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
width: double.infinity,
// height: 700.0,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Padding(
padding: const EdgeInsets.all(20.0),
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
44.height,
Container(
width: 141,
height: 141,
decoration: const BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(12)),
boxShadow: [BoxShadow(color: Colors.white60, blurRadius: 10, spreadRadius: 10)],
),
clipBehavior: Clip.antiAlias,
child: (AppState().memberInformationList!.eMPLOYEEIMAGE == null || AppState().memberInformationList!.eMPLOYEEIMAGE!.isEmpty)
? Container(
color: Colors.grey[300],
child: SvgPicture.asset("assets/images/user.svg"),
)
: Image.memory(
Utils.dataFromBase64String(
AppState().memberInformationList!.eMPLOYEEIMAGE ?? "",
),
fit: BoxFit.cover,
),
),
5.height,
(AppState().memberInformationList!.eMPLOYEENUMBER ?? "").toText21(),
27.height,
(AppState().memberInformationList!.eMPLOYEENAME ?? "").toText21(),
(AppState().memberInformationList!.getPositionName() ?? "").toText16(color: Colors.grey[800]),
20.height,
Image.memory(
Utils.getPostBytes(AppState().memberInformationList!.employeeQR ?? ""),
width: 150,
height: 150,
),
27.height,
Image.asset("assets/images/logos/bn_hmg_logo.png"),
],
),
),
],
// children: [
// Image.asset("assets/images/bn_logo.png"),
// Padding(
// padding: const EdgeInsets.all(20.0),
// child: Column(
// mainAxisSize: MainAxisSize.min,
// mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Row(
// children: [
// Container(
// width: 80,
// height: 80,
// decoration: const BoxDecoration(
// color: Colors.white,
// borderRadius: BorderRadius.all(Radius.circular(12)),
// boxShadow: [BoxShadow(color: Colors.white60, blurRadius: 10, spreadRadius: 10)],
// ),
// clipBehavior: Clip.antiAlias,
// child: (AppState().memberInformationList!.eMPLOYEEIMAGE == null || AppState().memberInformationList!.eMPLOYEEIMAGE!.isEmpty)
// ? Container(
// color: Colors.grey[300],
// child: SvgPicture.asset("assets/images/user.svg"),
// )
// : Image.memory(
// Utils.dataFromBase64String(
// AppState().memberInformationList!.eMPLOYEEIMAGE ?? "",
// ),
// fit: BoxFit.cover,
// ),
// ),
// 16.width,
// (AppState().memberInformationList!.eMPLOYEENUMBER ?? "").toText20(),
// ],
// ),
// Container(
// width: double.infinity,
// child: Column(
// mainAxisAlignment: MainAxisAlignment.start,
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// 12.height,
// (AppState().memberInformationList!.eMPLOYEEDISPLAYNAME ?? "").toText16(),
// 4.height,
// (showJobName(AppState().memberInformationList!.pOSITIONNAME ?? "")).toText12(isBold: false),
// ],
// ),
// ),
// Image.memory(
// Utils.getPostBytes(AppState().memberInformationList!.employeeQR ?? ""),
// width: 160,
// height: 160,
// ),
// DefaultButton(LocaleKeys.close.tr(), () {
// Navigator.pop(context);
// })
// ],
// ),
// ),
// ],
),
);
}
String showJobName(String position) {
try {
var p = position.split(".");
return p[0] + " " + p[1];
} catch (e) {
return "";
}
}
}