Created
February 2, 2022 18:11
-
-
Save jcdang/424363e029dd00bd4e46c8b94966e8b4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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