container.dart 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import 'package:flowy_infra/time/duration.dart';
  2. import 'package:flutter/material.dart';
  3. class FlowyContainer extends StatelessWidget {
  4. final Color color;
  5. final BorderRadiusGeometry? borderRadius;
  6. final List<BoxShadow>? shadows;
  7. final Widget? child;
  8. final double? width;
  9. final double? height;
  10. final Alignment? align;
  11. final EdgeInsets? margin;
  12. final Duration? duration;
  13. final BoxBorder? border;
  14. const FlowyContainer(this.color,
  15. {Key? key,
  16. this.borderRadius,
  17. this.shadows,
  18. this.child,
  19. this.width,
  20. this.height,
  21. this.align,
  22. this.margin,
  23. this.duration,
  24. this.border})
  25. : super(key: key);
  26. @override
  27. Widget build(BuildContext context) {
  28. return AnimatedContainer(
  29. width: width,
  30. height: height,
  31. child: child,
  32. margin: margin,
  33. alignment: align,
  34. duration: duration ?? Durations.medium,
  35. decoration: BoxDecoration(
  36. color: color,
  37. borderRadius: borderRadius,
  38. boxShadow: shadows,
  39. border: border));
  40. }
  41. }