Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- return Padding(
- padding: const EdgeInsets.symmetric(
- vertical: 4.0,
- ),
- child: Slidable(
- startActionPane: ActionPane(
- motion: const StretchMotion(),
- children: <SlidableAction>[
- // edit HabitTile
- SlidableAction(
- backgroundColor: Theme.of(context).colorScheme.inversePrimary,
- borderRadius: BorderRadius.circular(16),
- onPressed: (context) {
- editHabitDialogBox();
- },
- icon: Icons.edit,
- label: "Edit",
- ),
- // delete HabitTile
- SlidableAction(
- backgroundColor: Colors.red,
- borderRadius: BorderRadius.circular(16),
- onPressed: (context) {
- deleteHabitDialogBox();
- },
- icon: Icons.delete,
- label: "Delete",
- )
- ],
- ),
- child: GestureDetector(
- onTap: () {
- checkHabitOnAndOff(habit, !isCompleted);
- },
- child: Container(
- decoration: BoxDecoration(
- color: Theme.of(context).colorScheme.primaryContainer,
- border: Border.all(
- color: Theme.of(context).colorScheme.outline,
- ),
- borderRadius: BorderRadius.circular(16)),
- padding: const EdgeInsets.all(8),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- mainAxisSize: MainAxisSize.max,
- children: [
- Row(
- mainAxisSize: MainAxisSize.min,
- children: [
- Row(
- mainAxisAlignment: MainAxisAlignment.start,
- mainAxisSize: MainAxisSize.min,
- children: [
- Container(
- height: 67,
- width: 67,
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(12),
- border: Border.all(color: Colors.blue)),
- child: const Icon(Icons.account_circle_outlined),
- ),
- const SizedBox(
- width: 8,
- ),
- const Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- mainAxisSize: MainAxisSize.min,
- children: [
- MyLabel(labelText: "Label1", myIcon: Icons.person),
- SizedBox(
- height: 8,
- ),
- MyLabel(labelText: "Label2", myIcon: null)
- ],
- )
- ],
- ),
- const SizedBox(
- width: 8,
- ),
- // Text that isn't wraping to the second line
- Text(
- habit.name,
- style: Theme.of(context).textTheme.bodyMedium!.copyWith(
- color: Theme.of(context)
- .colorScheme
- .onSecondaryContainer,
- ),
- softWrap: true,
- maxLines: 2,
- overflow: TextOverflow.fade,
- ),
- ],
- ),
- Checkbox(
- activeColor: Colors.green,
- checkColor: Colors.white,
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(6),
- ),
- side: BorderSide(
- color: Theme.of(context).colorScheme.outline),
- value: isCompleted,
- onChanged: (value) => checkHabitOnAndOff(habit, value)),
- ],
- ),
- ),
- ),
- ),
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement