82 lines
2.1 KiB
Dart
82 lines
2.1 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:glassmorphism/glassmorphism.dart';
|
|
|
|
Widget commonGlassContainer({
|
|
required double width,
|
|
required double height,
|
|
required double borderradius,
|
|
required Widget customWidget,
|
|
required double border,
|
|
double opacity1 = 0.04,
|
|
double opacity2 = 0.05,
|
|
}) {
|
|
return GlassmorphicContainer(
|
|
width: width,
|
|
height: height,
|
|
borderRadius: borderradius,
|
|
blur: 10,
|
|
alignment: Alignment.topCenter,
|
|
border: border,
|
|
linearGradient: LinearGradient(
|
|
begin: Alignment.topLeft,
|
|
end: Alignment.bottomRight,
|
|
colors: [
|
|
Color(0xFFFFFFFF).withOpacity(opacity1),
|
|
const Color(0xFFFFFFFF).withOpacity(opacity2),
|
|
],
|
|
stops: const [
|
|
0.1,
|
|
1,
|
|
],
|
|
),
|
|
borderGradient: LinearGradient(
|
|
begin: Alignment.topLeft,
|
|
end: Alignment.bottomRight,
|
|
colors: [
|
|
Color(0xff434A53),
|
|
Color(0xFF434A53),
|
|
],
|
|
),
|
|
child: customWidget);
|
|
}
|
|
|
|
// Widget commonGlassContainerOpacity(
|
|
// {required double width,
|
|
// required double height,
|
|
// required double borderradius,
|
|
// required Widget customWidget,
|
|
// required double border,
|
|
// double opacity1,
|
|
// double opacity2,
|
|
// }) {
|
|
// return GlassmorphicContainer(
|
|
// width: width,
|
|
// height: height,
|
|
// borderRadius: borderradius,
|
|
// blur: 10,
|
|
// alignment: Alignment.topCenter,
|
|
// border: border,
|
|
// linearGradient: LinearGradient(
|
|
// begin: Alignment.topLeft,
|
|
// end: Alignment.bottomRight,
|
|
// colors: [
|
|
// Color(0xFFFFFFFF).withOpacity(opacity1),
|
|
// const Color(0xFFFFFFFF).withOpacity(opacity2),
|
|
// ],
|
|
// stops: const [
|
|
// 0.1,
|
|
// 1,
|
|
// ],
|
|
// ),
|
|
// borderGradient: LinearGradient(
|
|
// begin: Alignment.topLeft,
|
|
// end: Alignment.bottomRight,
|
|
// colors: [
|
|
// Color(0xff434A53),
|
|
// Color(0xFF434A53),
|
|
// ],
|
|
// ),
|
|
// child: customWidget);
|
|
// }
|
|
|