mirror of
https://git.meshkee.com/applications/cssd.git
synced 2026-10-11 18:58:55 +03:30
150 lines
5.1 KiB
Dart
150 lines
5.1 KiB
Dart
import 'package:cssd/config/routes.dart';
|
|
import 'package:cssd/models/label_models.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
|
|
|
class LabelItemBox extends StatelessWidget {
|
|
final LabelResultObject item;
|
|
const LabelItemBox({
|
|
Key key,
|
|
@required double deviceBlockSize,
|
|
this.item,
|
|
}) : _deviceBlockSize = deviceBlockSize,
|
|
super(key: key);
|
|
|
|
final double _deviceBlockSize;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return GestureDetector(
|
|
onTap: () => Navigator.of(context).pushNamed(
|
|
Routes.labelDetailScreen,
|
|
arguments: item.id,
|
|
),
|
|
child: Card(
|
|
elevation: 1,
|
|
child: Container(
|
|
padding: EdgeInsets.all(10),
|
|
child: Row(
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
children: <Widget>[
|
|
Container(
|
|
padding: const EdgeInsets.all(8.0),
|
|
child: Text(
|
|
item.id,
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w700,
|
|
fontSize: 5 * _deviceBlockSize,
|
|
),
|
|
),
|
|
),
|
|
SizedBox(
|
|
width: 3 * _deviceBlockSize,
|
|
),
|
|
// Spacer(),
|
|
Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: <Widget>[
|
|
Container(
|
|
width: 30 * _deviceBlockSize,
|
|
child: Text(
|
|
'Package:',
|
|
style: TextStyle(
|
|
fontSize: 3 * _deviceBlockSize,
|
|
color: Colors.grey,
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
width: 40 * _deviceBlockSize,
|
|
child: Text(
|
|
item.package,
|
|
overflow: TextOverflow.ellipsis,
|
|
),
|
|
),
|
|
Container(
|
|
width: 30 * _deviceBlockSize,
|
|
child: Row(
|
|
children: <Widget>[
|
|
Text(
|
|
'Exp:',
|
|
style: TextStyle(
|
|
color: Colors.grey,
|
|
fontSize: 3 * _deviceBlockSize,
|
|
),
|
|
),
|
|
Text(
|
|
item.expireDate,
|
|
style: TextStyle(
|
|
fontSize: 3 * _deviceBlockSize,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
)
|
|
],
|
|
),
|
|
Spacer(),
|
|
Column(
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
children: <Widget>[
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
children: <Widget>[
|
|
InkWell(
|
|
customBorder: CircleBorder(),
|
|
onTap: () {
|
|
Navigator.of(context).pushReplacementNamed(
|
|
Routes.labelUpdateScreen,
|
|
arguments: item.id,
|
|
);
|
|
},
|
|
child: Container(
|
|
padding: EdgeInsets.all(7),
|
|
width: 10 * _deviceBlockSize,
|
|
decoration: BoxDecoration(
|
|
shape: BoxShape.circle,
|
|
color: Colors.black,
|
|
),
|
|
child: Icon(
|
|
Icons.edit,
|
|
size: 6 * _deviceBlockSize,
|
|
color: Colors.white,
|
|
),
|
|
),
|
|
),
|
|
SizedBox(width: _deviceBlockSize,),
|
|
InkWell(
|
|
customBorder: CircleBorder(),
|
|
onTap: () {
|
|
Navigator.of(context).pushNamed(
|
|
Routes.labelDetailScreen,
|
|
arguments: item.id,
|
|
);
|
|
},
|
|
child: Container(
|
|
padding: EdgeInsets.all(7),
|
|
width: 10 * _deviceBlockSize,
|
|
decoration: BoxDecoration(
|
|
shape: BoxShape.circle,
|
|
color: Colors.black,
|
|
),
|
|
child: Icon(
|
|
FontAwesomeIcons.fileAlt,
|
|
size: 6 * _deviceBlockSize,
|
|
color: Colors.white,
|
|
),
|
|
),
|
|
),
|
|
],
|
|
)
|
|
],
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|