| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- import 'package:flutter/material.dart';
- class WCadre extends StatelessWidget {
- const WCadre(
- {required this.child,
- this.title = "",
- this.titleleft,
- this.titleright,
- this.bottom,
- this.bottomright,
- this.bottomleft,
- this.color = Colors.grey,
- this.background = Colors.black,
- this.height,
- super.key});
- final dynamic title;
- final Widget? titleright;
- final Widget? titleleft;
- final Widget child;
- final dynamic bottom;
- final Widget? bottomright;
- final Widget? bottomleft;
- final Color color;
- final Color background;
- final double? height;
- @override
- Widget build(BuildContext context) {
- return Container(
- // width: 300,
- height: height,
- decoration: BoxDecoration(
- color: Colors.black,
- border: Border.all(
- width: 3,
- color: Colors.grey,
- ),
- ),
- child: Column(
- children: [
- if (titleleft != null || title != "" || titleright != null) ...[
- Row(
- mainAxisSize: MainAxisSize.max,
- children: [
- if (titleleft != null) titleleft!,
- Expanded(
- child: Container(
- alignment: Alignment.center,
- child: (title is Widget)
- ? title
- : Text(
- "$title",
- style: const TextStyle(
- fontSize: 22,
- fontWeight: FontWeight.w600,
- color: Colors.blue),
- ))),
- if (titleright != null) titleright!,
- ],
- ),
- Divider(
- height: 3,
- thickness: 2,
- color: color,
- )
- ],
- if (height == null)
- child
- else
- Expanded(
- child: SingleChildScrollView(
- child: child,
- ),
- ),
- if (bottomleft != null || bottom != null || bottomright != null) ...[
- Divider(
- height: 2,
- thickness: 1,
- color: color,
- ),
- Row(
- children: [
- if (bottomleft != null) bottomleft!,
- Expanded(
- child: Container(
- alignment: Alignment.center,
- child: (bottom is Widget)
- ? bottom
- : Text(
- "${bottom ?? ''}",
- style: const TextStyle(
- fontSize: 12, color: Colors.grey),
- )),
- ),
- if (bottomright != null) bottomright!,
- ],
- )
- ],
- ],
- ),
- );
- }
- }
|