background.dart 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. import 'dart:math';
  2. import 'package:appflowy/generated/flowy_svgs.g.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: const FlowySvg(
  43. FlowySvgs.flowy_logo_xl,
  44. blendMode: null,
  45. ),
  46. ),
  47. const VSpace(40),
  48. FlowyText.regular(
  49. title,
  50. fontSize: FontSizes.s24,
  51. fontFamily:
  52. GoogleFonts.poppins(fontWeight: FontWeight.w500).fontFamily,
  53. color: Theme.of(context).colorScheme.tertiary,
  54. ),
  55. ],
  56. ),
  57. );
  58. }
  59. }