AppFlowy/app_flowy/lib/user/presentation/widgets/background.dart

63 lines
1.5 KiB
Dart
Raw Normal View History

2021-09-05 14:52:20 +00:00
import 'dart:math';
import 'package:flowy_infra/image.dart';
import 'package:flowy_infra/theme.dart';
2021-07-25 08:07:53 +00:00
import 'package:flowy_infra_ui/widget/spacing.dart';
2021-07-13 05:14:49 +00:00
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
2021-07-13 05:14:49 +00:00
2021-09-05 14:52:20 +00:00
class AuthFormContainer extends StatelessWidget {
2021-07-25 08:07:53 +00:00
final List<Widget> children;
2021-09-05 14:52:20 +00:00
const AuthFormContainer({
2021-07-13 05:14:49 +00:00
Key? key,
2021-07-25 08:07:53 +00:00
required this.children,
2021-07-13 05:14:49 +00:00
}) : super(key: key);
@override
Widget build(BuildContext context) {
2021-07-25 08:07:53 +00:00
final size = MediaQuery.of(context).size;
2021-07-13 05:14:49 +00:00
return SizedBox(
2021-09-05 14:52:20 +00:00
width: min(size.width, 340),
2021-07-25 08:07:53 +00:00
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: children,
),
);
}
}
2021-09-05 14:52:20 +00:00
class AuthFormTitle extends StatelessWidget {
2021-07-25 08:07:53 +00:00
final String title;
final Size logoSize;
2021-09-05 14:52:20 +00:00
const AuthFormTitle({
2021-07-25 08:07:53 +00:00
Key? key,
required this.title,
required this.logoSize,
}) : super(key: key);
@override
Widget build(BuildContext context) {
final theme = context.watch<AppTheme>();
2021-07-25 08:07:53 +00:00
return SizedBox(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
2021-09-05 14:52:20 +00:00
SizedBox.fromSize(
size: const Size.square(40),
2021-10-09 08:43:56 +00:00
child: svg("flowy_logo"),
2021-09-05 14:52:20 +00:00
),
2021-07-25 08:07:53 +00:00
const VSpace(30),
Text(
title,
style: TextStyle(
color: theme.shader1,
fontWeight: FontWeight.w600,
fontSize: 24,
2021-07-25 08:07:53 +00:00
),
)
],
),
);
2021-07-13 05:14:49 +00:00
}
}