background.dart 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. import 'dart:math';
  2. import 'package:flowy_infra/image.dart';
  3. import 'package:flowy_infra/size.dart';
  4. import 'package:flowy_infra_ui/style_widget/text.dart';
  5. import 'package:flowy_infra_ui/widget/spacing.dart';
  6. import 'package:flutter/material.dart';
  7. import 'package:google_fonts/google_fonts.dart';
  8. class AuthFormContainer extends StatelessWidget {
  9. final List<Widget> children;
  10. const AuthFormContainer({
  11. Key? key,
  12. required this.children,
  13. }) : super(key: key);
  14. @override
  15. Widget build(BuildContext context) {
  16. final size = MediaQuery.of(context).size;
  17. return SizedBox(
  18. width: min(size.width, 340),
  19. child: Column(
  20. mainAxisAlignment: MainAxisAlignment.center,
  21. children: children,
  22. ),
  23. );
  24. }
  25. }
  26. class FlowyLogoTitle extends StatelessWidget {
  27. final String title;
  28. final Size logoSize;
  29. const FlowyLogoTitle({
  30. Key? key,
  31. required this.title,
  32. this.logoSize = const Size.square(40),
  33. }) : super(key: key);
  34. @override
  35. Widget build(BuildContext context) {
  36. return SizedBox(
  37. child: Column(
  38. mainAxisAlignment: MainAxisAlignment.center,
  39. children: [
  40. SizedBox.fromSize(
  41. size: logoSize,
  42. child: svgWidget('flowy_logo'),
  43. ),
  44. const VSpace(40),
  45. FlowyText.regular(
  46. title,
  47. fontSize: FontSizes.s24,
  48. fontFamily:
  49. GoogleFonts.poppins(fontWeight: FontWeight.w500).fontFamily,
  50. color: Theme.of(context).colorScheme.tertiary,
  51. ),
  52. ],
  53. ),
  54. );
  55. }
  56. }