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 / main.dart
Created May 2, 2019
flutter_bloc with flutter_hooks
View main.dart
import 'package:flutter/material.dart';
import 'package:bloc/bloc.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
enum CounterEvent { increment, decrement }
class CounterBloc extends Bloc<CounterEvent, int> {
@override
int get initialState => 0;
@felangel
felangel / main.dart
Created May 2, 2019
flutter_bloc with flutter_hooks
View main.dart
import 'package:flutter/material.dart';
import 'package:bloc/bloc.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
enum CounterEvent { increment, decrement }
class CounterBloc extends Bloc<CounterEvent, int> {
@override
int get initialState => 0;
@felangel
felangel / main.dart
Created Apr 29, 2019
[flutter_bloc_recipes] Navigation: Routes
View main.dart
import 'package:flutter/material.dart';
import 'package:meta/meta.dart';
import 'package:bloc/bloc.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
void main() {
runApp(MyApp());
}
enum MyEvent { eventA, eventB }
@felangel
felangel / main.dart
Created Apr 29, 2019
[flutter_bloc_recipes] Navigation: Direct
View main.dart
import 'package:flutter/material.dart';
import 'package:meta/meta.dart';
import 'package:bloc/bloc.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
void main() {
runApp(MyApp());
}
enum MyEvent { eventA, eventB }
@felangel
felangel / main.dart
Created Apr 27, 2019
[flutter_firebase_login] App (6)
View main.dart
import 'package:flutter/material.dart';
import 'package:bloc/bloc.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_firebase_login/authentication_bloc/bloc.dart';
import 'package:flutter_firebase_login/user_repository.dart';
import 'package:flutter_firebase_login/home_screen.dart';
import 'package:flutter_firebase_login/login/login.dart';
import 'package:flutter_firebase_login/splash_screen.dart';
import 'package:flutter_firebase_login/simple_bloc_delegate.dart';
@felangel
felangel / register_button.dart
Created Apr 27, 2019
[flutter_firebase_login] Register Button
View register_button.dart
import 'package:flutter/material.dart';
class RegisterButton extends StatelessWidget {
final VoidCallback _onPressed;
RegisterButton({Key key, VoidCallback onPressed})
: _onPressed = onPressed,
super(key: key);
@override
@felangel
felangel / register_form.dart
Created Apr 27, 2019
[flutter_firebase_login] Register Form
View register_form.dart
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_firebase_login/authentication_bloc/bloc.dart';
import 'package:flutter_firebase_login/register/register.dart';
class RegisterForm extends StatefulWidget {
State<RegisterForm> createState() => _RegisterFormState();
}
class _RegisterFormState extends State<RegisterForm> {
@felangel
felangel / register_screen.dart
Created Apr 27, 2019
[flutter_firebase_login] Register Screen
View register_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/register/register.dart';
class RegisterScreen extends StatefulWidget {
final UserRepository _userRepository;
RegisterScreen({Key key, @required UserRepository userRepository})
: assert(userRepository != null),
@felangel
felangel / register_bloc.dart
Created Apr 27, 2019
[flutter_firebase_login] Register Bloc
View register_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/user_repository.dart';
import 'package:flutter_firebase_login/register/register.dart';
import 'package:flutter_firebase_login/validators.dart';
class RegisterBloc extends Bloc<RegisterEvent, RegisterState> {
final UserRepository _userRepository;
@felangel
felangel / bloc.dart
Created Apr 27, 2019
[flutter_firebase_login] Register Barrel File
View bloc.dart
export 'register_bloc.dart';
export 'register_event.dart';
export 'register_state.dart';
You can’t perform that action at this time.