imageOverlay static method

Widget imageOverlay({
  1. required Widget child,
  2. String? title,
  3. String? subtitle,
  4. List<Widget>? actions,
  5. GlassType type = GlassType.smoky,
  6. AlignmentGeometry alignment = Alignment.bottomCenter,
})

Glass image overlay

Implementation

static Widget imageOverlay({
  required Widget child,
  String? title,
  String? subtitle,
  List<Widget>? actions,
  GlassType type = GlassType.smoky,
  AlignmentGeometry alignment = Alignment.bottomCenter,
}) {
  return Stack(
    children: [
      child,
      Positioned.fill(
        child: Align(
          alignment: alignment,
          child: GlassContainer(
            type: type,
            margin: EdgeInsets.all(16.w),
            child: Column(
              mainAxisSize: MainAxisSize.min,
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                if (title != null) ...[
                  Text(
                    title,
                    style: AppTextThemes.bodyLarge(
                      color: Colors.white,
                      fontWeight: FontWeight.bold,
                    ),
                  ),
                  if (subtitle != null) SizedBox(height: 4.h),
                ],
                if (subtitle != null) ...[
                  Text(
                    subtitle,
                    style: AppTextThemes.bodyMedium(color: Colors.white70),
                  ),
                ],
                if (actions != null && actions.isNotEmpty) ...[
                  SizedBox(height: 12.h),
                  Row(
                    mainAxisAlignment: MainAxisAlignment.end,
                    children: actions,
                  ),
                ],
              ],
            ),
          ),
        ),
      ),
    ],
  );
}