From 645589fa0e5c853d3799fb5cc29b736caabbf835 Mon Sep 17 00:00:00 2001 From: Aunali321 Date: Sun, 7 Aug 2022 23:35:44 +0530 Subject: [PATCH] feat: Patch Item Widget. --- lib/ui/widgets/patch_item.dart | 76 ++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 lib/ui/widgets/patch_item.dart diff --git a/lib/ui/widgets/patch_item.dart b/lib/ui/widgets/patch_item.dart new file mode 100644 index 00000000..3ffe7c85 --- /dev/null +++ b/lib/ui/widgets/patch_item.dart @@ -0,0 +1,76 @@ +import 'package:flutter/material.dart'; +import 'package:google_fonts/google_fonts.dart'; + +class PatchItem extends StatelessWidget { + final String name; + final String description; + final String version; + final bool isSelected; + + PatchItem({ + Key? key, + required this.name, + required this.description, + required this.version, + required this.isSelected, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return Container( + decoration: BoxDecoration( + color: const Color(0xFF1A1A1A), + borderRadius: BorderRadius.circular(10), + ), + padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 12), + margin: const EdgeInsets.symmetric(vertical: 4, horizontal: 8), + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Flexible( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Text( + name, + style: GoogleFonts.inter( + fontSize: 16, + fontWeight: FontWeight.w600, + ), + ), + const SizedBox(width: 4), + Text(version) + ], + ), + const SizedBox(height: 4), + Text( + description, + softWrap: true, + maxLines: 3, + overflow: TextOverflow.visible, + style: GoogleFonts.roboto( + fontSize: 14, + ), + ), + ], + ), + ), + Transform.scale( + scale: 1.2, + child: Checkbox( + value: isSelected, + onChanged: (newValue) {}, + ), + ) + ], + ) + ], + ), + ); + } +}