update
This commit is contained in:
parent
7fca1e79a8
commit
75cbdbf2fa
6 changed files with 157 additions and 97 deletions
52
lib/widgets/form_border_widget.dart
Normal file
52
lib/widgets/form_border_widget.dart
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
class FormBorderWidget extends StatelessWidget {
|
||||
final Widget child;
|
||||
final String? color;
|
||||
|
||||
final Color green = const Color.fromRGBO(58, 236, 27, 0.1);
|
||||
final Color blue = const Color.fromRGBO(27, 90, 236, 0.1);
|
||||
final Color red = const Color.fromRGBO(236, 27, 27, 0.2);
|
||||
final Color yellow = const Color.fromRGBO(236, 232, 27, 0.2);
|
||||
final Color teal = const Color.fromRGBO(27, 236, 229, 0.2);
|
||||
|
||||
const FormBorderWidget({super.key, required this.child, this.color});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(left: 32, right: 32),
|
||||
child: Container(
|
||||
padding: EdgeInsets.fromLTRB(32, 32, 32, 40),
|
||||
decoration: BoxDecoration(
|
||||
color: _getColor(color ?? ''),
|
||||
borderRadius: BorderRadius.all(Radius.circular(16)),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: const Color.fromRGBO(0, 0, 0, 0.2), // Subtle shadow to give depth
|
||||
spreadRadius: 0,
|
||||
blurRadius: 4,
|
||||
offset: Offset(0, 2),
|
||||
)
|
||||
]),
|
||||
child: child),
|
||||
);
|
||||
}
|
||||
|
||||
Color _getColor(String color) {
|
||||
switch (color.toLowerCase()) {
|
||||
case 'green':
|
||||
return green;
|
||||
case 'blue':
|
||||
return blue;
|
||||
case 'red':
|
||||
return red;
|
||||
case 'yellow':
|
||||
return yellow;
|
||||
case 'teal':
|
||||
return teal;
|
||||
default:
|
||||
return const Color.fromRGBO(57, 38, 62, 0.6); // Default to transparent if color is not recognized
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue