Skip to content

Instantly share code, notes, and snippets.

☕️
coding

Felix Angelov felangel

Block or report user

Report or block felangel

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@felangel
felangel / register_event.dart
Created Apr 27, 2019
[flutter_firebase_login] Register Events
View register_event.dart
import 'package:equatable/equatable.dart';
import 'package:meta/meta.dart';
@immutable
abstract class RegisterEvent extends Equatable {
RegisterEvent([List props = const []]) : super(props);
}
class EmailChanged extends RegisterEvent {
final String email;
@felangel
felangel / register_state.dart
Created Apr 27, 2019
[flutter_firebase_login] Register States
View register_state.dart
import 'package:meta/meta.dart';
@immutable
class RegisterState {
final bool isEmailValid;
final bool isPasswordValid;
final bool isSubmitting;
final bool isSuccess;
final bool isFailure;
@felangel
felangel / create_account_button.dart
Created Apr 27, 2019
[flutter_firebase_login] Create Account Button
View create_account_button.dart
import 'package:flutter/material.dart';
import 'package:flutter_firebase_login/user_repository.dart';
import 'package:flutter_firebase_login/register/register.dart';
class CreateAccountButton extends StatelessWidget {
final UserRepository _userRepository;
CreateAccountButton({Key key, @required UserRepository userRepository})
: assert(userRepository != null),
_userRepository = userRepository,
@felangel
felangel / google_login_button.dart
Created Apr 27, 2019
[flutter_firebase_login] Google Login Button
View google_login_button.dart
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_firebase_login/login/login.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
class GoogleLoginButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
return RaisedButton.icon(
shape: RoundedRectangleBorder(
@felangel
felangel / login_button.dart
Created Apr 27, 2019
[flutter_firebase_login] Login Button
View login_button.dart
import 'package:flutter/material.dart';
class LoginButton extends StatelessWidget {
final VoidCallback _onPressed;
LoginButton({Key key, VoidCallback onPressed})
: _onPressed = onPressed,
super(key: key);
@override
@felangel
felangel / login_form.dart
Created Apr 27, 2019
[flutter_firebase_login] Login Form
View login_form.dart
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_firebase_login/user_repository.dart';
import 'package:flutter_firebase_login/authentication_bloc/bloc.dart';
import 'package:flutter_firebase_login/login/login.dart';
class LoginForm extends StatefulWidget {
final UserRepository _userRepository;
LoginForm({Key key, @required UserRepository userRepository})
@felangel
felangel / login_screen.dart
Created Apr 27, 2019
[flutter_firebase_login] Login Screen
View login_screen.dart
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_firebase_login/user_repository.dart';
import 'package:flutter_firebase_login/login/login.dart';
class LoginScreen extends StatefulWidget {
final UserRepository _userRepository;
LoginScreen({Key key, @required UserRepository userRepository})
: assert(userRepository != null),
@felangel
felangel / validators.dart
Created Apr 27, 2019
[flutter_firbase_login] Validators
View validators.dart
class Validators {
static final RegExp _emailRegExp = RegExp(
r'^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$',
);
static final RegExp _passwordRegExp = RegExp(
r'^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{8,}$',
);
static isValidEmail(String email) {
return _emailRegExp.hasMatch(email);
@felangel
felangel / login_bloc.dart
Created Apr 27, 2019
[flutter_firebase_login] Login Bloc
View login_bloc.dart
import 'dart:async';
import 'package:bloc/bloc.dart';
import 'package:meta/meta.dart';
import 'package:rxdart/rxdart.dart';
import 'package:flutter_firebase_login/login/login.dart';
import 'package:flutter_firebase_login/user_repository.dart';
import 'package:flutter_firebase_login/validators.dart';
class LoginBloc extends Bloc<LoginEvent, LoginState> {
UserRepository _userRepository;
@felangel
felangel / bloc.dart
Created Apr 27, 2019
[flutter_firebase_login] Login Barrel
View bloc.dart
export 'login_bloc.dart';
export 'login_event.dart';
export 'login_state.dart';
You can’t perform that action at this time.