Advertisement
harmonyV

OverLay

Jul 17th, 2024
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 3.32 KB | None | 0 0
  1. class CarouselOverLay extends StatelessWidget {
  2.   final CarouselController carouselController;
  3.  
  4.   const CarouselOverLay({
  5.     super.key,
  6.     required this.carouselController,
  7.   });
  8.  
  9.   @override
  10.   Widget build(BuildContext context) {
  11.     TextTheme textTheme = Theme.of(context).textTheme;
  12.     // ignore: unused_local_variable
  13.     ColorScheme colorScheme = Theme.of(context).colorScheme;
  14.  
  15.     HabitCategoryData habitCategoryData =
  16.         Provider.of<HabitCategoryProvider>(context).habitCategoryData;
  17.  
  18.     return Row(
  19.       crossAxisAlignment: CrossAxisAlignment.end,
  20.       mainAxisSize: MainAxisSize.max,
  21.       mainAxisAlignment: MainAxisAlignment.spaceBetween,
  22.       children: [
  23.         Row(
  24.           mainAxisSize: MainAxisSize.min,
  25.           crossAxisAlignment: CrossAxisAlignment.end,
  26.           children: [
  27.             InkWell(
  28.               onTap: carouselController.previousPage,
  29.               child: Container(
  30.                 padding: const EdgeInsets.symmetric(
  31.                   horizontal: 8,
  32.                   vertical: 12,
  33.                 ),
  34.                 alignment: Alignment.center,
  35.                 decoration: BoxDecoration(
  36.                   shape: BoxShape.circle,
  37.                   color: Colors.white.withOpacity(0.7),
  38.                 ),
  39.                 child: const Icon(
  40.                   Icons.arrow_back_ios_rounded,
  41.                 ),
  42.               ),
  43.             ),
  44.             Padding(
  45.               padding: const EdgeInsets.symmetric(horizontal: 8.0),
  46.               child: Column(
  47.                 crossAxisAlignment: CrossAxisAlignment.start,
  48.                 children: [
  49.                   Material(
  50.                     color: Colors.white.withOpacity(0.7),
  51.                     borderRadius: const BorderRadius.all(Radius.circular(8)),
  52.                     child: Padding(
  53.                       padding: const EdgeInsets.symmetric(horizontal: 8.0),
  54.                       child: Text(
  55.                         "New Habit",
  56.                         style: textTheme.bodyLarge!
  57.                             .copyWith(fontWeight: FontWeight.bold),
  58.                       ),
  59.                     ),
  60.                   ),
  61.                   const SizedBox(
  62.                     height: 4,
  63.                   ),
  64.                   Material(
  65.                     color: Colors.white.withOpacity(0.7),
  66.                     borderRadius: const BorderRadius.all(Radius.circular(12)),
  67.                     child: Padding(
  68.                       padding: const EdgeInsets.all(4.0),
  69.                       child: Text(
  70.                         habitCategoryData.title,
  71.                         style: textTheme.headlineSmall,
  72.                       ),
  73.                     ),
  74.                   ),
  75.                 ],
  76.               ),
  77.             ),
  78.           ],
  79.         ),
  80.         InkWell(
  81.           onTap: carouselController.nextPage,
  82.           child: Container(
  83.             padding: const EdgeInsets.symmetric(
  84.               horizontal: 8,
  85.               vertical: 10,
  86.             ),
  87.             alignment: Alignment.center,
  88.             decoration: BoxDecoration(
  89.               shape: BoxShape.circle,
  90.               color: Colors.white.withOpacity(0.7),
  91.             ),
  92.             child: const Icon(
  93.               Icons.arrow_forward_ios_rounded,
  94.             ),
  95.           ),
  96.         ),
  97.       ],
  98.     );
  99.   }
  100. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement