|
@@ -2,6 +2,7 @@ import 'package:app_flowy/startup/startup.dart';
|
|
import 'package:app_flowy/user/application/sign_up_bloc.dart';
|
|
import 'package:app_flowy/user/application/sign_up_bloc.dart';
|
|
import 'package:app_flowy/user/domain/i_auth.dart';
|
|
import 'package:app_flowy/user/domain/i_auth.dart';
|
|
import 'package:app_flowy/user/presentation/widgets/background.dart';
|
|
import 'package:app_flowy/user/presentation/widgets/background.dart';
|
|
|
|
+import 'package:easy_localization/easy_localization.dart';
|
|
import 'package:flowy_infra/theme.dart';
|
|
import 'package:flowy_infra/theme.dart';
|
|
import 'package:flowy_infra_ui/widget/rounded_button.dart';
|
|
import 'package:flowy_infra_ui/widget/rounded_button.dart';
|
|
import 'package:flowy_infra_ui/widget/rounded_input_field.dart';
|
|
import 'package:flowy_infra_ui/widget/rounded_input_field.dart';
|
|
@@ -13,6 +14,7 @@ import 'package:flutter/material.dart';
|
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
import 'package:dartz/dartz.dart';
|
|
import 'package:dartz/dartz.dart';
|
|
import 'package:flowy_infra/image.dart';
|
|
import 'package:flowy_infra/image.dart';
|
|
|
|
+import 'package:app_flowy/generated/locale_keys.g.dart';
|
|
|
|
|
|
class SignUpScreen extends StatelessWidget {
|
|
class SignUpScreen extends StatelessWidget {
|
|
final IAuthRouter router;
|
|
final IAuthRouter router;
|
|
@@ -53,9 +55,9 @@ class SignUpForm extends StatelessWidget {
|
|
alignment: Alignment.center,
|
|
alignment: Alignment.center,
|
|
child: AuthFormContainer(
|
|
child: AuthFormContainer(
|
|
children: [
|
|
children: [
|
|
- const FlowyLogoTitle(
|
|
|
|
- title: 'Sign Up to Appflowy',
|
|
|
|
- logoSize: Size(60, 60),
|
|
|
|
|
|
+ FlowyLogoTitle(
|
|
|
|
+ title: LocaleKeys.signUp_title.tr(),
|
|
|
|
+ logoSize: const Size(60, 60),
|
|
),
|
|
),
|
|
const VSpace(30),
|
|
const VSpace(30),
|
|
const EmailTextField(),
|
|
const EmailTextField(),
|
|
@@ -86,13 +88,13 @@ class SignUpPrompt extends StatelessWidget {
|
|
return Row(
|
|
return Row(
|
|
children: [
|
|
children: [
|
|
Text(
|
|
Text(
|
|
- "Already have an account?",
|
|
|
|
|
|
+ LocaleKeys.signUp_alreadyHaveAnAccount.tr(),
|
|
style: TextStyle(color: theme.shader3, fontSize: 12),
|
|
style: TextStyle(color: theme.shader3, fontSize: 12),
|
|
),
|
|
),
|
|
TextButton(
|
|
TextButton(
|
|
style: TextButton.styleFrom(textStyle: const TextStyle(fontSize: 12)),
|
|
style: TextButton.styleFrom(textStyle: const TextStyle(fontSize: 12)),
|
|
onPressed: () => Navigator.pop(context),
|
|
onPressed: () => Navigator.pop(context),
|
|
- child: Text('Sign In', style: TextStyle(color: theme.main1)),
|
|
|
|
|
|
+ child: Text(LocaleKeys.signIn_buttonText.tr(), style: TextStyle(color: theme.main1)),
|
|
),
|
|
),
|
|
],
|
|
],
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
@@ -109,7 +111,7 @@ class SignUpButton extends StatelessWidget {
|
|
Widget build(BuildContext context) {
|
|
Widget build(BuildContext context) {
|
|
final theme = context.watch<AppTheme>();
|
|
final theme = context.watch<AppTheme>();
|
|
return RoundedTextButton(
|
|
return RoundedTextButton(
|
|
- title: 'Get Started',
|
|
|
|
|
|
+ title: LocaleKeys.signUp_getStartedText.tr(),
|
|
height: 48,
|
|
height: 48,
|
|
color: theme.main1,
|
|
color: theme.main1,
|
|
onPressed: () {
|
|
onPressed: () {
|
|
@@ -135,7 +137,7 @@ class PasswordTextField extends StatelessWidget {
|
|
obscureIcon: svg("home/hide"),
|
|
obscureIcon: svg("home/hide"),
|
|
obscureHideIcon: svg("home/show"),
|
|
obscureHideIcon: svg("home/show"),
|
|
style: const TextStyle(fontSize: 14, fontWeight: FontWeight.w500),
|
|
style: const TextStyle(fontSize: 14, fontWeight: FontWeight.w500),
|
|
- hintText: "Password",
|
|
|
|
|
|
+ hintText: LocaleKeys.signUp_passwordHint.tr(),
|
|
normalBorderColor: theme.shader4,
|
|
normalBorderColor: theme.shader4,
|
|
highlightBorderColor: theme.red,
|
|
highlightBorderColor: theme.red,
|
|
cursorColor: theme.main1,
|
|
cursorColor: theme.main1,
|
|
@@ -163,7 +165,7 @@ class RepeatPasswordTextField extends StatelessWidget {
|
|
obscureIcon: svg("home/hide"),
|
|
obscureIcon: svg("home/hide"),
|
|
obscureHideIcon: svg("home/show"),
|
|
obscureHideIcon: svg("home/show"),
|
|
style: const TextStyle(fontSize: 14, fontWeight: FontWeight.w500),
|
|
style: const TextStyle(fontSize: 14, fontWeight: FontWeight.w500),
|
|
- hintText: "Repeate password",
|
|
|
|
|
|
+ hintText: LocaleKeys.signUp_repeatPasswordHint.tr(),
|
|
normalBorderColor: theme.shader4,
|
|
normalBorderColor: theme.shader4,
|
|
highlightBorderColor: theme.red,
|
|
highlightBorderColor: theme.red,
|
|
cursorColor: theme.main1,
|
|
cursorColor: theme.main1,
|
|
@@ -187,7 +189,7 @@ class EmailTextField extends StatelessWidget {
|
|
buildWhen: (previous, current) => previous.emailError != current.emailError,
|
|
buildWhen: (previous, current) => previous.emailError != current.emailError,
|
|
builder: (context, state) {
|
|
builder: (context, state) {
|
|
return RoundedInputField(
|
|
return RoundedInputField(
|
|
- hintText: 'Email',
|
|
|
|
|
|
+ hintText: LocaleKeys.signUp_emailHint.tr(),
|
|
style: const TextStyle(fontSize: 14, fontWeight: FontWeight.w500),
|
|
style: const TextStyle(fontSize: 14, fontWeight: FontWeight.w500),
|
|
normalBorderColor: theme.shader4,
|
|
normalBorderColor: theme.shader4,
|
|
highlightBorderColor: theme.red,
|
|
highlightBorderColor: theme.red,
|