import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; class DatasBox extends StatelessWidget { const DatasBox({ Key key, @required this.datas, @required double deviceBlockSize, }) : _deviceBlockSize = deviceBlockSize, super(key: key); final Map datas; final double _deviceBlockSize; @override Widget build(BuildContext context) { return Padding( padding: EdgeInsets.all(20), child: Container( padding: EdgeInsets.all(10), decoration: BoxDecoration( color: Color.fromRGBO(230, 230, 230, 1), border: Border( left: BorderSide( color: Colors.pink, width: 2, ), ), ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ Text( DateFormat.yMMMd().format( DateTime.parse( datas['date'], ), ), style: TextStyle( color: Colors.red, ), ), Divider(), Text( datas['test_type_name'], style: TextStyle( color: Colors.red, fontWeight: FontWeight.w700, ), ), SizedBox( height: 30, ), Row( children: [ Container( width: 35 * _deviceBlockSize, child: Text( 'CSSD ID', style: TextStyle( color: Colors.grey, ), ), ), Container( width: 45 * _deviceBlockSize, child: Text( datas['id'].toString(), style: TextStyle( fontWeight: FontWeight.w700, ), overflow: TextOverflow.clip, ), ), ], ), Divider(), SizedBox( height: 5, ), Row( children: [ Container( width: 35 * _deviceBlockSize, child: Text( 'Autocleave ID', style: TextStyle( color: Colors.grey, ), ), ), Container( width: 45 * _deviceBlockSize, child: Text( datas['auto_cleave_id'].toString(), style: TextStyle( fontWeight: FontWeight.w700, ), overflow: TextOverflow.clip, ), ), ], ), Divider(), SizedBox( height: 5, ), Row( children: [ Container( width: 35 * _deviceBlockSize, child: Text( 'Test Code', style: TextStyle( color: Colors.grey, ), ), ), Container( width: 45 * _deviceBlockSize, child: Text( datas['test_code'].toString(), style: TextStyle( fontWeight: FontWeight.w700, ), overflow: TextOverflow.clip, ), ), ], ), Divider(), SizedBox( height: 5, ), Row( children: [ Container( width: 35 * _deviceBlockSize, child: Text( 'Date', style: TextStyle( color: Colors.grey, ), ), ), Container( width: 45 * _deviceBlockSize, child: Text( DateFormat('d-M-y').format( DateTime.parse( datas['date'], ), ), style: TextStyle( fontWeight: FontWeight.w700, ), overflow: TextOverflow.clip, ), ), ], ), Divider(), SizedBox( height: 5, ), Row( children: [ Container( width: 35 * _deviceBlockSize, child: Text( 'Status', style: TextStyle( color: Colors.grey, ), ), ), Container( width: 45 * _deviceBlockSize, child: Text( datas['verified'] == 'NotVerified' ? 'Rejected' : 'Verified', style: TextStyle( fontWeight: FontWeight.w700, color: datas['verified'] == 'NotVerified' ? Colors.red : Colors.blueAccent, ), overflow: TextOverflow.clip, ), ), ], ), Divider(), SizedBox( height: 5, ), Row( children: [ Container( width: 35 * _deviceBlockSize, child: Text( 'Description', style: TextStyle( color: Colors.grey, ), ), ), Container( width: 45 * _deviceBlockSize, child: Text( datas['description'].toString(), style: TextStyle( fontWeight: FontWeight.w700, ), overflow: TextOverflow.clip, ), ), ], ), Divider(), ], ), ), ); } }