Skip to content

Instantly share code, notes, and snippets.

☕️
coding

Felix Angelov felangel

☕️
coding
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 Nov 14, 2019
Equatable HashCode Sample
View main.dart
import './point1.dart' as point1;
import './point2.dart' as point2;
void main() {
final p1 = point1.Point();
final p2 = point2.Point();
print(p1 == p2); // false
print(p1.hashCode == p2.hashCode); // false
}
@felangel
felangel / main.dart
Last active Nov 12, 2019
Bloc with SearchDelegate
View main.dart
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:bloc/bloc.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@felangel
felangel / login_form.dart
Last active Oct 25, 2019
[flutter_login] Login Form
View login_form.dart
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_login/authentication/authentication.dart';
import 'package:flutter_login/login/login.dart';
class LoginForm extends StatefulWidget {
final LoginBloc loginBloc;
final AuthenticationBloc authenticationBloc;
@felangel
felangel / main.dart
Last active Oct 20, 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(
BlocProvider(
builder: (context) => MyBloc(),
child: MyApp(),
@felangel
felangel / main.dart
Last active Oct 20, 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(
BlocProvider(
builder: (context) => MyBloc(),
child: MyApp(),
@felangel
felangel / login_bloc_test.dart
Last active Oct 19, 2019
[flutter_login_unit_tests] LoginBloc Tests
View login_bloc_test.dart
import 'package:flutter_test/flutter_test.dart';
import 'package:mockito/mockito.dart';
import 'package:user_repository/user_repository.dart';
import 'package:flutter_login/authentication/authentication.dart';
import 'package:flutter_login/login/login.dart';
class MockUserRepository extends Mock implements UserRepository {}
@felangel
felangel / login_state.dart
Last active Oct 19, 2019
[flutter_login] Login State
View login_state.dart
import 'package:meta/meta.dart';
import 'package:equatable/equatable.dart';
abstract class LoginState extends Equatable {
const LoginState();
@override
List<Object> get props => [];
}
@felangel
felangel / login_event.dart
Last active Oct 19, 2019
[flutter_login] Login Event
View login_event.dart
import 'package:meta/meta.dart';
import 'package:equatable/equatable.dart';
abstract class LoginEvent extends Equatable {
const LoginEvent();
}
class LoginButtonPressed extends LoginEvent {
final String username;
final String password;
@felangel
felangel / authentication_state.dart
Last active Oct 19, 2019
[flutter_login] Authentication State
View authentication_state.dart
import 'package:equatable/equatable.dart';
abstract class AuthenticationState extends Equatable {
@override
List<Object> get props => [];
}
class AuthenticationUninitialized extends AuthenticationState {}
class AuthenticationAuthenticated extends AuthenticationState {}
@felangel
felangel / authentication_bloc_test.dart
Last active Oct 19, 2019
[flutter_login_unit_tests] AuthenticationBloc Tests Complete
View authentication_bloc_test.dart
import 'package:flutter_test/flutter_test.dart';
import 'package:mockito/mockito.dart';
import 'package:user_repository/user_repository.dart';
import 'package:flutter_login/authentication/authentication.dart';
class MockUserRepository extends Mock implements UserRepository {}
void main() {
You can’t perform that action at this time.