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.
		
		
		
		
		
			
		
			
				
	
	
		
			71 lines
		
	
	
		
			2.3 KiB
		
	
	
	
		
			Dart
		
	
			
		
		
	
	
			71 lines
		
	
	
		
			2.3 KiB
		
	
	
	
		
			Dart
		
	
import 'package:flutter/material.dart';
 | 
						|
import 'package:provider/provider.dart';
 | 
						|
import 'package:test_sa/controllers/localization/localization.dart';
 | 
						|
import 'package:test_sa/models/device/device_transfer_info.dart';
 | 
						|
import 'package:test_sa/views/app_style/colors.dart';
 | 
						|
import 'package:test_sa/views/widgets/loaders/image_loader.dart';
 | 
						|
import 'package:test_sa/views/widgets/requests/info_row.dart';
 | 
						|
import 'package:test_sa/views/widgets/requests/request_status.dart';
 | 
						|
 | 
						|
import '../../../controllers/providers/api/user_provider.dart';
 | 
						|
 | 
						|
class DeviceTransferInfoSection extends StatelessWidget {
 | 
						|
  final DeviceTransferInfo info;
 | 
						|
  final bool isSender;
 | 
						|
  final VoidCallback onEdit;
 | 
						|
 | 
						|
  const DeviceTransferInfoSection({Key key, this.info, this.onEdit, this.isSender}) : super(key: key);
 | 
						|
 | 
						|
  @override
 | 
						|
  Widget build(BuildContext context) {
 | 
						|
    info.userName = Provider.of<UserProvider>(context).user.username;
 | 
						|
    final subtitle = AppLocalization.of(context).subtitle;
 | 
						|
    print("url:${info.signature}");
 | 
						|
    return Column(
 | 
						|
      children: [
 | 
						|
        RequestInfoRow(
 | 
						|
          title: subtitle.hospital,
 | 
						|
          info: info.client.name,
 | 
						|
        ),
 | 
						|
        RequestInfoRow(
 | 
						|
          title: subtitle.department,
 | 
						|
          info: info.department.name,
 | 
						|
        ),
 | 
						|
        RequestInfoRow(
 | 
						|
          title: isSender ? "Sender Name " : "Receiver Name",
 | 
						|
          info: info.userName,
 | 
						|
        ),
 | 
						|
        RequestInfoRow(
 | 
						|
          title: subtitle.workingHours,
 | 
						|
          info: info.workingHours,
 | 
						|
        ),
 | 
						|
        RequestInfoRow(
 | 
						|
          title: subtitle.travelingHours,
 | 
						|
          info: info.travelingHours,
 | 
						|
        ),
 | 
						|
        RequestInfoRow(
 | 
						|
          title: "Comment",
 | 
						|
          info: info.comment,
 | 
						|
        ),
 | 
						|
        RequestInfoRow(
 | 
						|
          title: "Assigned Engineer",
 | 
						|
          info: info.assignedEmployeeName,
 | 
						|
        ),
 | 
						|
        RequestInfoRow(
 | 
						|
          title: "Signature",
 | 
						|
          info: info.signature?.isEmpty != false ? subtitle.noDateFound : null,
 | 
						|
          contentWidget: info.signature?.isEmpty != false
 | 
						|
              ? null
 | 
						|
              : ImageLoader(
 | 
						|
                  url: info.signature,
 | 
						|
                ),
 | 
						|
        ),
 | 
						|
        RequestInfoRow(
 | 
						|
          title: subtitle.status,
 | 
						|
          infoWidget: StatusLabel(label: info.status?.name, color: AColors.getGasStatusColor(info.status?.id)),
 | 
						|
        ),
 | 
						|
      ],
 | 
						|
    );
 | 
						|
  }
 | 
						|
}
 |