|
- import 'package:farm_tpf/utils/formatter.dart';
- import 'package:flutter/material.dart';
-
- import '../../../../themes/app_colors.dart';
- import '../../../../themes/styles_text.dart';
- import '../models/stamp_timeline.dart';
-
- class ItemCodeTimeline extends StatelessWidget {
- final Function onPressed;
- final ContentTimeline item;
- const ItemCodeTimeline({
- super.key,
- required this.onPressed,
- required this.item,
- });
-
- @override
- Widget build(BuildContext context) {
- return Container(
- child: Stack(
- children: [
- Row(
- children: [
- const SizedBox(
- width: 16,
- height: 20,
- ),
- Expanded(child: _widgetTimeLine()),
- ],
- ),
- Positioned(
- top: 0,
- left: 8,
- child: Container(
- color: Colors.white,
- width: 16,
- height: 24,
- child: Column(
- children: [
- Container(
- width: 16,
- height: 16,
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(
- 16,
- ),
- color: Colors.green,
- ),
- ),
- ],
- ),
- ),
- ),
- ],
- ),
- );
- }
-
- Widget _widgetTimeLine() {
- return Container(
- width: double.infinity,
- padding: const EdgeInsets.only(
- left: 12,
- right: 8,
- ),
- margin: const EdgeInsets.only(
- bottom: 8,
- ),
- decoration: BoxDecoration(
- border: Border(
- left: BorderSide(color: Colors.blue),
- ),
- ),
- child: Column(
- children: [
- Row(
- mainAxisAlignment: MainAxisAlignment.start,
- children: [
- Text(
- '${item.activityTypeDescription ?? ''} - ',
- style: StylesText.body5,
- ),
- Text(
- '${item.executeDate?.format_DDMMYY()}',
- style: StylesText.caption3.copyWith(),
- )
- ],
- ),
- const SizedBox(
- height: 8,
- ),
- _widgetItemInfoCompleted(
- title: 'Mô tả',
- actionDate: item.description ?? '',
- location: 'dsfsdfsd f sdf dsf sd fds ',
- ),
- ],
- ),
- );
- }
-
- Widget _widgetItemInfoCompleted({
- required String title,
- required String actionDate,
- String? location,
- }) {
- return Container(
- padding: const EdgeInsets.all(8),
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(8),
- color: AppColors.background1,
- ),
- child: Column(
- mainAxisAlignment: MainAxisAlignment.start,
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Row(
- children: [
- Expanded(
- child: Text(
- title,
- style: StylesText.caption2.copyWith(
- color: AppColors.neutral1,
- ),
- ),
- ),
- Text(
- actionDate,
- style: StylesText.caption3.copyWith(
- color: AppColors.neutral1,
- ),
- ),
- ],
- ),
- Padding(
- padding: const EdgeInsets.symmetric(vertical: 8.0),
- child: Text(
- location ?? '',
- style: StylesText.caption3.copyWith(
- color: AppColors.neutral1,
- ),
- ),
- ),
- ],
- ),
- );
- }
- }
|