here is the Code -
_buildCard({
required Config config,
Color backgroundColor = Colors.transparent,
DecorationImage? backgroundImage,
double height = double.infinity,
}) {
return Expanded(
child: WaveWidget(
heightPercentange: double.infinity,
config: config,
backgroundColor: backgroundColor,
backgroundImage: backgroundImage,
size: Size(
double.infinity,
controller.value * MediaQuery.of(context).size.height,
),
waveAmplitude: 0,
),
);
}
//////// here is the Scaffold //////////////////
Widget build(BuildContext context) {
ThemeData themeData = Theme.of(context);
return Scaffold(
backgroundColor: Colors.black26,
floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat,
body: AnimatedBuilder(
animation: controller,
builder: (context, child) {
return Stack(
fit: StackFit.expand,
children: [
Align(
alignment: Alignment.bottomCenter,
child: _buildCard(
height: double.maxFinite,
backgroundColor: Colors.transparent,
config: CustomConfig(
gradients: [
[Colors.red, Color(0xEEF44336)],
[Colors.pinkAccent, Color(0x77E57373)],
[Colors.deepPurple, Color(0x66FF9800)],
[Colors.deepPurpleAccent, Color(0x55FFEB3B)]
],
durations: [35000, 19440, 10800, 6000],
heightPercentages: [0.20, 0.23, 0.25, 0.30],
gradientBegin: Alignment.bottomLeft,
gradientEnd: Alignment.topRight,
),
),
// Container(
// color: Colors.deepPurpleAccent,
// height:
// controller.value * MediaQuery.of(context).size.height,
// ),
),
here is the Code -
_buildCard({
required Config config,
Color backgroundColor = Colors.transparent,
DecorationImage? backgroundImage,
double height = double.infinity,
}) {
return Expanded(
child: WaveWidget(
heightPercentange: double.infinity,
config: config,
backgroundColor: backgroundColor,
backgroundImage: backgroundImage,
size: Size(
double.infinity,
controller.value * MediaQuery.of(context).size.height,
),
waveAmplitude: 0,
),
);
}
//////// here is the Scaffold //////////////////
Widget build(BuildContext context) {
ThemeData themeData = Theme.of(context);
return Scaffold(
backgroundColor: Colors.black26,
floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat,
body: AnimatedBuilder(
animation: controller,
builder: (context, child) {
return Stack(
fit: StackFit.expand,
children: [
Align(
alignment: Alignment.bottomCenter,
child: _buildCard(
height: double.maxFinite,
backgroundColor: Colors.transparent,
config: CustomConfig(
gradients: [
[Colors.red, Color(0xEEF44336)],
[Colors.pinkAccent, Color(0x77E57373)],
[Colors.deepPurple, Color(0x66FF9800)],
[Colors.deepPurpleAccent, Color(0x55FFEB3B)]
],
durations: [35000, 19440, 10800, 6000],
heightPercentages: [0.20, 0.23, 0.25, 0.30],
gradientBegin: Alignment.bottomLeft,
gradientEnd: Alignment.topRight,
),
),
// Container(
// color: Colors.deepPurpleAccent,
// height:
// controller.value * MediaQuery.of(context).size.height,
// ),
),