xxxxxxxxxx
import 'package:flutter/material.dart';
class GradientBox extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: <Color>[
Colors.blue,
Colors.red,
],
),
),
);
}
}
// Usage:
// Replace the contents of your widget's build method with the following:
// return Scaffold(
// body: GradientBox(),
// );