72 lines
1.7 KiB
Dart
72 lines
1.7 KiB
Dart
import 'package:educa_controle_acesso/widgets/text_custom.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:intl/intl.dart';
|
|
|
|
import '../utils/colors.dart';
|
|
|
|
class ItemAcesso extends StatelessWidget {
|
|
bool check;
|
|
String ID_USUARIO;
|
|
String NO_USUARIO_SISTEMA;
|
|
String DATA;
|
|
String CADASTRADO_POR;
|
|
String CIDADE;
|
|
var onChanged;
|
|
int index;
|
|
|
|
ItemAcesso({
|
|
required this.check,
|
|
required this.ID_USUARIO,
|
|
required this.NO_USUARIO_SISTEMA,
|
|
required this.DATA,
|
|
required this.CADASTRADO_POR,
|
|
required this.CIDADE,
|
|
required this.onChanged,
|
|
required this.index,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
|
|
double width = MediaQuery.of(context).size.width;
|
|
|
|
String formataData = DATA == '00/00/0000'?'00/00/0000': DateFormat('dd/MM/yyyy hh:mm').format(DateTime.parse(DATA));
|
|
|
|
double resto = index%2;
|
|
|
|
return Container(
|
|
color: resto==0?Colors.white:PaletteColors.greySearch,
|
|
height: 50,
|
|
alignment: Alignment.centerLeft,
|
|
child: Row(
|
|
children: [
|
|
Checkbox(
|
|
value: check,
|
|
onChanged:onChanged
|
|
),
|
|
Container(
|
|
width: width*0.12,
|
|
child: TextCustom(text: ID_USUARIO)
|
|
),
|
|
Container(
|
|
width: width*0.2,
|
|
child: TextCustom(text: NO_USUARIO_SISTEMA)
|
|
),
|
|
Container(
|
|
width: width*0.1,
|
|
child: TextCustom(text: formataData)
|
|
),
|
|
Container(
|
|
width: width*0.1,
|
|
child: TextCustom(text: CADASTRADO_POR)
|
|
),
|
|
Container(
|
|
width: width*0.1,
|
|
child: TextCustom(text: CIDADE)
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|