2021-09-05 22:52:20 +08:00
|
|
|
import 'dart:math';
|
|
|
|
|
2021-09-05 18:02:49 +08:00
|
|
|
import 'package:flowy_infra/image.dart';
|
2022-11-22 20:00:21 +08:00
|
|
|
import 'package:flowy_infra/size.dart';
|
2022-10-25 19:49:58 +08:00
|
|
|
import 'package:flowy_infra_ui/style_widget/text.dart';
|
2021-07-25 16:07:53 +08:00
|
|
|
import 'package:flowy_infra_ui/widget/spacing.dart';
|
2021-07-13 13:14:49 +08:00
|
|
|
import 'package:flutter/material.dart';
|
2023-06-06 17:19:53 +08:00
|
|
|
import 'package:google_fonts/google_fonts.dart';
|
2021-07-13 13:14:49 +08:00
|
|
|
|
2021-09-05 22:52:20 +08:00
|
|
|
class AuthFormContainer extends StatelessWidget {
|
2021-07-25 16:07:53 +08:00
|
|
|
final List<Widget> children;
|
2021-09-05 22:52:20 +08:00
|
|
|
const AuthFormContainer({
|
2021-07-13 13:14:49 +08:00
|
|
|
Key? key,
|
2021-07-25 16:07:53 +08:00
|
|
|
required this.children,
|
2021-07-13 13:14:49 +08:00
|
|
|
}) : super(key: key);
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2021-07-25 16:07:53 +08:00
|
|
|
final size = MediaQuery.of(context).size;
|
2021-07-13 13:14:49 +08:00
|
|
|
return SizedBox(
|
2021-09-05 22:52:20 +08:00
|
|
|
width: min(size.width, 340),
|
2021-07-25 16:07:53 +08:00
|
|
|
child: Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
children: children,
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-11-08 14:11:10 +08:00
|
|
|
class FlowyLogoTitle extends StatelessWidget {
|
2021-07-25 16:07:53 +08:00
|
|
|
final String title;
|
|
|
|
final Size logoSize;
|
2021-11-08 14:11:10 +08:00
|
|
|
const FlowyLogoTitle({
|
2021-07-25 16:07:53 +08:00
|
|
|
Key? key,
|
|
|
|
required this.title,
|
2021-11-08 14:11:10 +08:00
|
|
|
this.logoSize = const Size.square(40),
|
2021-07-25 16:07:53 +08:00
|
|
|
}) : super(key: key);
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return SizedBox(
|
|
|
|
child: Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
children: [
|
2021-09-05 22:52:20 +08:00
|
|
|
SizedBox.fromSize(
|
2021-11-08 14:11:10 +08:00
|
|
|
size: logoSize,
|
2023-06-06 17:19:53 +08:00
|
|
|
child: svgWidget('flowy_logo'),
|
2021-09-05 22:52:20 +08:00
|
|
|
),
|
2023-06-06 17:19:53 +08:00
|
|
|
const VSpace(40),
|
|
|
|
FlowyText.regular(
|
2021-07-25 16:07:53 +08:00
|
|
|
title,
|
2022-11-22 20:00:21 +08:00
|
|
|
fontSize: FontSizes.s24,
|
2023-06-06 17:19:53 +08:00
|
|
|
fontFamily:
|
|
|
|
GoogleFonts.poppins(fontWeight: FontWeight.w500).fontFamily,
|
2023-03-29 20:44:37 -05:00
|
|
|
color: Theme.of(context).colorScheme.tertiary,
|
2022-10-25 19:49:58 +08:00
|
|
|
),
|
2021-07-25 16:07:53 +08:00
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
2021-07-13 13:14:49 +08:00
|
|
|
}
|
|
|
|
}
|