Skip to content

Instantly share code, notes, and snippets.

@jcdang
Created February 2, 2022 18:11
Show Gist options
  • Save jcdang/424363e029dd00bd4e46c8b94966e8b4 to your computer and use it in GitHub Desktop.
Save jcdang/424363e029dd00bd4e46c8b94966e8b4 to your computer and use it in GitHub Desktop.
import 'package:flutter/material.dart';
class SizedColoredBox extends StatelessWidget {
final Color color;
final double width;
final double height;
final Widget? child;
const SizedColoredBox(
{Key? key,
required this.color,
required this.width,
required this.height,
this.child})
: super(key: key);
@override
Widget build(BuildContext context) {
return SizedBox(
width: width,
height: height,
child: ColoredBox(color: color, child: child));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment