Advertisement
harmonyV

Container

Jun 25th, 2024
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 3.60 KB | None | 0 0
  1. class HabitTileMoreDetailsCard extends StatelessWidget {
  2.   final Habit habit;
  3.   const HabitTileMoreDetailsCard({
  4.     super.key,
  5.     required this.habit,
  6.   });
  7.  
  8.   @override
  9.   Widget build(BuildContext context) {
  10.     String tempText =
  11.         "Lorem ipsum dolor sit amet consectetur. Lectus netus urna sem egestas. Venenatis feugiat feugiat vitae lobortis eu eget integer vulputate.";
  12.     return Center(
  13.       child: Container(
  14.         margin: const EdgeInsets.all(16),
  15.         padding: const EdgeInsets.all(16),
  16.         //constraints: BoxConstraints.tight(const Size.square(400)),
  17.         decoration: BoxDecoration(
  18.             borderRadius: BorderRadius.circular(16),
  19.             color: habitColorMap[habit.category]),
  20.         child: Row(
  21.           children: [
  22.             Flexible(
  23.               flex: 1,
  24.               child: Container(
  25.                 decoration: BoxDecoration(
  26.                   borderRadius: BorderRadius.circular(16),
  27.                   image: DecorationImage(
  28.                     image: AssetImage(
  29.                       habitImagePathMap[habit.category]!,
  30.                     ),
  31.                     fit: BoxFit.cover,
  32.                   ),
  33.                 ),
  34.               ),
  35.             ),
  36.             const SizedBox(
  37.               width: 12,
  38.             ),
  39.             Flexible(
  40.               flex: 2,
  41.               child: Column(
  42.                 mainAxisSize: MainAxisSize.min,
  43.                 crossAxisAlignment: CrossAxisAlignment.start,
  44.                 children: [
  45.                   Row(
  46.                     mainAxisSize: MainAxisSize.max,
  47.                     mainAxisAlignment: MainAxisAlignment.spaceBetween,
  48.                     children: [
  49.                       const Text("Mental health"),
  50.                       Row(
  51.                         mainAxisSize: MainAxisSize.min,
  52.                         mainAxisAlignment: MainAxisAlignment.end,
  53.                         children: [
  54.                           IconButton(
  55.                             onPressed: () {},
  56.                             icon: const Icon(Icons.edit_rounded),
  57.                           ),
  58.                           IconButton(
  59.                             onPressed: () {},
  60.                             icon: const Icon(Icons.delete_rounded),
  61.                           ),
  62.                         ],
  63.                       )
  64.                     ],
  65.                   ),
  66.                   const SizedBox(
  67.                     height: 4,
  68.                   ),
  69.                   Text(habit.name),
  70.                   const SizedBox(
  71.                     height: 12,
  72.                   ),
  73.                   Row(
  74.                     mainAxisAlignment: MainAxisAlignment.start,
  75.                     mainAxisSize: MainAxisSize.min,
  76.                     children: habit.itemDataKeyString.map((itemDataKeyString) {
  77.                       MyItem itemData =
  78.                           matchKeyStringsToItem(itemDataKeyString);
  79.                       MyLabel newLabel = MyLabel(
  80.                         item: itemData,
  81.                       );
  82.                       return Padding(
  83.                         padding: const EdgeInsets.only(right: 8),
  84.                         child: newLabel,
  85.                       );
  86.                     }).toList(),
  87.                   ),
  88.                   const SizedBox(
  89.                     height: 12,
  90.                   ),
  91.                   const Text("More Detail:"),
  92.                   const SizedBox(
  93.                     height: 4,
  94.                   ),
  95.                   Text(tempText),
  96.                 ],
  97.               ),
  98.             )
  99.           ],
  100.         ),
  101.       ),
  102.     );
  103.   }
  104. }
  105.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement