Browse Source

forgot password

master
daivph 5 years ago
parent
commit
605738cda4
7 changed files with 80 additions and 9 deletions
  1. +4
    -1
      lib/app.dart
  2. +44
    -0
      lib/presentation/custom_widgets/app_bar_widget.dart
  3. +23
    -5
      lib/presentation/screens/forgot_password/sc_forgot_password.dart
  4. +0
    -3
      lib/presentation/screens/login/view/widget_top_welcome.dart
  5. +1
    -0
      lib/utils/const_color.dart
  6. +7
    -0
      pubspec.lock
  7. +1
    -0
      pubspec.yaml

+ 4
- 1
lib/app.dart View File

@@ -5,6 +5,7 @@ import 'package:farm_tpf/utils/const_color.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:get/get.dart';
import 'package:google_fonts/google_fonts.dart';

import 'authentication/bloc/authentication_bloc.dart';
import 'data/repository/authentication_repository.dart';
@@ -52,7 +53,9 @@ class _AppViewState extends State<AppView> {
primaryColor: AppColors.DEFAULT,
accentColor: AppColors.DEFAULT,
hoverColor: AppColors.GREEN,
fontFamily: 'Roboto',
textTheme: GoogleFonts.sairaTextTheme(
Theme.of(context).textTheme,
),
),
navigatorKey: _navigatorKey,
builder: (context, child) {

+ 44
- 0
lib/presentation/custom_widgets/app_bar_widget.dart View File

@@ -0,0 +1,44 @@
import 'package:farm_tpf/utils/const_color.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';

class AppBarWidget extends StatelessWidget implements PreferredSizeWidget {
final bool isBack;
AppBarWidget({this.isBack = true});
@override
Widget build(BuildContext context) {
return Container(
child: AppBar(
backgroundColor: Colors.white,
elevation: 0,
centerTitle: false,
title: InkWell(
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(
Icons.keyboard_arrow_left,
color: AppColors.YELLOW,
size: 35,
),
Text(
'Quay lại',
maxLines: 1,
style: TextStyle(
color: AppColors.YELLOW, fontWeight: FontWeight.normal),
),
],
),
onTap: () {
if (Get.isSnackbarOpen) Get.back();
Get.back();
},
),
automaticallyImplyLeading: false,
),
);
}

@override
Size get preferredSize => AppBar().preferredSize;
}

+ 23
- 5
lib/presentation/screens/forgot_password/sc_forgot_password.dart View File

@@ -1,6 +1,6 @@
import 'package:farm_tpf/data/repository/user_repository.dart';
import 'package:farm_tpf/presentation/custom_widgets/app_bar_widget.dart';
import 'package:farm_tpf/presentation/custom_widgets/widget_loading.dart';
import 'package:farm_tpf/presentation/custom_widgets/widget_toast.dart';
import 'package:farm_tpf/presentation/custom_widgets/widget_utils.dart';
import 'package:farm_tpf/utils/const_color.dart';
import 'package:farm_tpf/utils/validators.dart';
@@ -83,17 +83,35 @@ class _ForgotPasswordScreenState extends State<ForgotPasswordScreen> {
@override
Widget build(BuildContext context) => KeyboardDismisser(
child: Scaffold(
backgroundColor: Colors.white,
key: _scaffoldKey,
appBar: AppBar(
title: Text("Gửi email khôi phục mật khẩu"),
),
appBar: AppBarWidget(),
body: Form(
key: _formKey,
autovalidate: _autoValidate,
child: SingleChildScrollView(
padding: EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SizedBox(
height: 14,
),
Text(
'Quên mật khẩu',
style: TextStyle(
fontSize: 26,
fontWeight: FontWeight.w300,
color: Colors.black),
),
SizedBox(
height: 8,
),
Text(
'Nhập email đăng ký mật khẩu vào ô bên dưới. Hệ thống sẽ gửi bạn một liên kết đặt lại mật khẩu qua email.',
style: TextStyle(
fontSize: 15,
fontWeight: FontWeight.w200,
color: Colors.black54)),
_emailField(),
SizedBox(
height: 16.0,

+ 0
- 3
lib/presentation/screens/login/view/widget_top_welcome.dart View File

@@ -1,8 +1,5 @@
import 'package:farm_tpf/utils/const_assets.dart';
import 'package:farm_tpf/utils/const_color.dart';
import 'package:farm_tpf/utils/const_icons.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';

class WidgetTopWelcome extends StatelessWidget {
@override

+ 1
- 0
lib/utils/const_color.dart View File

@@ -3,6 +3,7 @@ import 'hex_color.dart';
class AppColors {
static final HexColor DEFAULT = new HexColor("##61AE46");
static final HexColor BLUE = new HexColor("#2F80ED");
static final HexColor YELLOW = new HexColor('#EECE52');

static final HexColor DEFAULT_5 = new HexColor("#0DE81667");
static final HexColor RED = new HexColor("#F93F3E");

+ 7
- 0
pubspec.lock View File

@@ -394,6 +394,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
google_fonts:
dependency: "direct main"
description:
name: google_fonts
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.1"
graphs:
dependency: transitive
description:

+ 1
- 0
pubspec.yaml View File

@@ -49,6 +49,7 @@ dependencies:
mime: ^0.9.7
flutter_image_compress: ^0.7.0
flutter_svg: ^0.19.1
google_fonts: ^1.1.1

dev_dependencies:
flutter_test:

Loading…
Cancel
Save