|
@@ -2,6 +2,7 @@ import 'package:app_flowy/startup/startup.dart';
|
|
import 'package:app_flowy/user/application/sign_in/sign_in_bloc.dart';
|
|
import 'package:app_flowy/user/application/sign_in/sign_in_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/sign_in/widgets/background.dart';
|
|
import 'package:app_flowy/user/presentation/sign_in/widgets/background.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';
|
|
import 'package:flowy_infra_ui/widget/spacing.dart';
|
|
import 'package:flowy_infra_ui/widget/spacing.dart';
|
|
@@ -10,6 +11,7 @@ import 'package:flowy_sdk/protobuf/flowy-user/user_profile.pb.dart';
|
|
import 'package:flutter/material.dart';
|
|
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';
|
|
|
|
|
|
class SignInScreen extends StatelessWidget {
|
|
class SignInScreen extends StatelessWidget {
|
|
final IAuthRouter router;
|
|
final IAuthRouter router;
|
|
@@ -71,6 +73,7 @@ class SignInForm extends StatelessWidget {
|
|
const EmailTextField(),
|
|
const EmailTextField(),
|
|
const PasswordTextField(),
|
|
const PasswordTextField(),
|
|
ForgetPasswordButton(router: router),
|
|
ForgetPasswordButton(router: router),
|
|
|
|
+ const VSpace(30),
|
|
const LoginButton(),
|
|
const LoginButton(),
|
|
const VSpace(10),
|
|
const VSpace(10),
|
|
SignUpPrompt(router: router),
|
|
SignUpPrompt(router: router),
|
|
@@ -94,18 +97,19 @@ class SignUpPrompt extends StatelessWidget {
|
|
|
|
|
|
@override
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
Widget build(BuildContext context) {
|
|
|
|
+ final theme = context.watch<AppTheme>();
|
|
return Row(
|
|
return Row(
|
|
children: [
|
|
children: [
|
|
- const Text("Dont't have an account",
|
|
|
|
- style: TextStyle(color: Colors.blueGrey, fontSize: 12)),
|
|
|
|
|
|
+ Text("Dont't have an account",
|
|
|
|
+ style: TextStyle(color: theme.shader3, fontSize: 12)),
|
|
TextButton(
|
|
TextButton(
|
|
style: TextButton.styleFrom(
|
|
style: TextButton.styleFrom(
|
|
textStyle: const TextStyle(fontSize: 12),
|
|
textStyle: const TextStyle(fontSize: 12),
|
|
),
|
|
),
|
|
onPressed: () => router.showSignUpScreen(context),
|
|
onPressed: () => router.showSignUpScreen(context),
|
|
- child: const Text(
|
|
|
|
|
|
+ child: Text(
|
|
'Sign Up',
|
|
'Sign Up',
|
|
- style: TextStyle(color: Colors.lightBlue),
|
|
|
|
|
|
+ style: TextStyle(color: theme.main1),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
],
|
|
@@ -121,11 +125,12 @@ class LoginButton extends StatelessWidget {
|
|
|
|
|
|
@override
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
Widget build(BuildContext context) {
|
|
|
|
+ final theme = context.watch<AppTheme>();
|
|
return RoundedTextButton(
|
|
return RoundedTextButton(
|
|
title: 'Login',
|
|
title: 'Login',
|
|
height: 45,
|
|
height: 45,
|
|
borderRadius: BorderRadius.circular(10),
|
|
borderRadius: BorderRadius.circular(10),
|
|
- color: Colors.lightBlue,
|
|
|
|
|
|
+ color: theme.main1,
|
|
press: () {
|
|
press: () {
|
|
context
|
|
context
|
|
.read<SignInBloc>()
|
|
.read<SignInBloc>()
|
|
@@ -145,14 +150,15 @@ class ForgetPasswordButton extends StatelessWidget {
|
|
|
|
|
|
@override
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
Widget build(BuildContext context) {
|
|
|
|
+ final theme = context.watch<AppTheme>();
|
|
return TextButton(
|
|
return TextButton(
|
|
style: TextButton.styleFrom(
|
|
style: TextButton.styleFrom(
|
|
textStyle: const TextStyle(fontSize: 12),
|
|
textStyle: const TextStyle(fontSize: 12),
|
|
),
|
|
),
|
|
onPressed: () => router.showForgetPasswordScreen(context),
|
|
onPressed: () => router.showForgetPasswordScreen(context),
|
|
- child: const Text(
|
|
|
|
|
|
+ child: Text(
|
|
'Forgot Password?',
|
|
'Forgot Password?',
|
|
- style: TextStyle(color: Colors.lightBlue),
|
|
|
|
|
|
+ style: TextStyle(color: theme.main1),
|
|
),
|
|
),
|
|
);
|
|
);
|
|
}
|
|
}
|
|
@@ -165,15 +171,18 @@ class PasswordTextField extends StatelessWidget {
|
|
|
|
|
|
@override
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
Widget build(BuildContext context) {
|
|
|
|
+ final theme = context.watch<AppTheme>();
|
|
return BlocBuilder<SignInBloc, SignInState>(
|
|
return BlocBuilder<SignInBloc, SignInState>(
|
|
buildWhen: (previous, current) =>
|
|
buildWhen: (previous, current) =>
|
|
previous.passwordError != current.passwordError,
|
|
previous.passwordError != current.passwordError,
|
|
builder: (context, state) {
|
|
builder: (context, state) {
|
|
return RoundedInputField(
|
|
return RoundedInputField(
|
|
obscureText: true,
|
|
obscureText: true,
|
|
|
|
+ obscureIcon: svgWidgetWithName("home/Hide.svg"),
|
|
|
|
+ obscureHideIcon: svgWidgetWithName("home/Show.svg"),
|
|
hintText: 'password',
|
|
hintText: 'password',
|
|
- normalBorderColor: Colors.green,
|
|
|
|
- highlightBorderColor: Colors.red,
|
|
|
|
|
|
+ normalBorderColor: theme.shader4,
|
|
|
|
+ highlightBorderColor: theme.red,
|
|
errorText: context
|
|
errorText: context
|
|
.read<SignInBloc>()
|
|
.read<SignInBloc>()
|
|
.state
|
|
.state
|
|
@@ -195,14 +204,15 @@ class EmailTextField extends StatelessWidget {
|
|
|
|
|
|
@override
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
Widget build(BuildContext context) {
|
|
|
|
+ final theme = context.watch<AppTheme>();
|
|
return BlocBuilder<SignInBloc, SignInState>(
|
|
return BlocBuilder<SignInBloc, SignInState>(
|
|
buildWhen: (previous, current) =>
|
|
buildWhen: (previous, current) =>
|
|
previous.emailError != current.emailError,
|
|
previous.emailError != current.emailError,
|
|
builder: (context, state) {
|
|
builder: (context, state) {
|
|
return RoundedInputField(
|
|
return RoundedInputField(
|
|
hintText: 'email',
|
|
hintText: 'email',
|
|
- normalBorderColor: Colors.green,
|
|
|
|
- highlightBorderColor: Colors.red,
|
|
|
|
|
|
+ normalBorderColor: theme.shader4,
|
|
|
|
+ highlightBorderColor: theme.red,
|
|
errorText: context
|
|
errorText: context
|
|
.read<SignInBloc>()
|
|
.read<SignInBloc>()
|
|
.state
|
|
.state
|