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

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:get/get.dart'; import 'package:get/get.dart';
import 'package:google_fonts/google_fonts.dart';


import 'authentication/bloc/authentication_bloc.dart'; import 'authentication/bloc/authentication_bloc.dart';
import 'data/repository/authentication_repository.dart'; import 'data/repository/authentication_repository.dart';
primaryColor: AppColors.DEFAULT, primaryColor: AppColors.DEFAULT,
accentColor: AppColors.DEFAULT, accentColor: AppColors.DEFAULT,
hoverColor: AppColors.GREEN, hoverColor: AppColors.GREEN,
fontFamily: 'Roboto',
textTheme: GoogleFonts.sairaTextTheme(
Theme.of(context).textTheme,
),
), ),
navigatorKey: _navigatorKey, navigatorKey: _navigatorKey,
builder: (context, child) { builder: (context, child) {

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

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

import 'package:farm_tpf/data/repository/user_repository.dart'; 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_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/presentation/custom_widgets/widget_utils.dart';
import 'package:farm_tpf/utils/const_color.dart'; import 'package:farm_tpf/utils/const_color.dart';
import 'package:farm_tpf/utils/validators.dart'; import 'package:farm_tpf/utils/validators.dart';
@override @override
Widget build(BuildContext context) => KeyboardDismisser( Widget build(BuildContext context) => KeyboardDismisser(
child: Scaffold( child: Scaffold(
backgroundColor: Colors.white,
key: _scaffoldKey, key: _scaffoldKey,
appBar: AppBar(
title: Text("Gửi email khôi phục mật khẩu"),
),
appBar: AppBarWidget(),
body: Form( body: Form(
key: _formKey, key: _formKey,
autovalidate: _autoValidate,
child: SingleChildScrollView( child: SingleChildScrollView(
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ 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(), _emailField(),
SizedBox( SizedBox(
height: 16.0, height: 16.0,

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

import 'package:farm_tpf/utils/const_assets.dart'; 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/material.dart';
import 'package:flutter_svg/svg.dart';


class WidgetTopWelcome extends StatelessWidget { class WidgetTopWelcome extends StatelessWidget {
@override @override

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

class AppColors { class AppColors {
static final HexColor DEFAULT = new HexColor("##61AE46"); static final HexColor DEFAULT = new HexColor("##61AE46");
static final HexColor BLUE = new HexColor("#2F80ED"); 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 DEFAULT_5 = new HexColor("#0DE81667");
static final HexColor RED = new HexColor("#F93F3E"); static final HexColor RED = new HexColor("#F93F3E");

+ 7
- 0
pubspec.lock View File

url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0" 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: graphs:
dependency: transitive dependency: transitive
description: description:

+ 1
- 0
pubspec.yaml View File

mime: ^0.9.7 mime: ^0.9.7
flutter_image_compress: ^0.7.0 flutter_image_compress: ^0.7.0
flutter_svg: ^0.19.1 flutter_svg: ^0.19.1
google_fonts: ^1.1.1


dev_dependencies: dev_dependencies:
flutter_test: flutter_test:

Loading…
Cancel
Save