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
Last active May 30, 2020
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 / main.dart
Last active May 21, 2020
[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 / 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 Dec 13, 2019
[flutter_bloc] Location Stream Example
View main.dart
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:bloc/bloc.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:meta/meta.dart';
import 'package:geolocator/geolocator.dart';
void main() => runApp(MyApp());
@felangel
felangel / user_repository.dart
Created Apr 26, 2019
[flutter_firebase_login] User Repository (1)
View user_repository.dart
import 'package:firebase_auth/firebase_auth.dart';
import 'package:google_sign_in/google_sign_in.dart';
class UserRepository {
final FirebaseAuth _firebaseAuth;
final GoogleSignIn _googleSignIn;
UserRepository({FirebaseAuth firebaseAuth, GoogleSignIn googleSignin})
: _firebaseAuth = firebaseAuth ?? FirebaseAuth.instance,
_googleSignIn = googleSignin ?? GoogleSignIn();
@felangel
felangel / main.dart
Created Feb 28, 2020
Recipe: Bloc Access (Generated Routes)
View main.dart
import 'package:flutter/material.dart';
import 'package:bloc/bloc.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
class SimpleBlocDelegate extends BlocDelegate {
@override
void onEvent(Bloc bloc, Object event) {
super.onEvent(bloc, event);
print(event);
}
@felangel
felangel / main.dart
Last active Feb 28, 2020
Recipe: Bloc Access (Named Routes)
View main.dart
import 'package:flutter/material.dart';
import 'package:bloc/bloc.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
class SimpleBlocDelegate extends BlocDelegate {
@override
void onEvent(Bloc bloc, Object event) {
super.onEvent(bloc, event);
print(event);
}
@felangel
felangel / main.dart
Last active Feb 28, 2020
Recipe: Bloc Access (Anonymous Routes)
View main.dart
import 'package:flutter/material.dart';
import 'package:bloc/bloc.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
class SimpleBlocDelegate extends BlocDelegate {
@override
void onEvent(Bloc bloc, Object event) {
super.onEvent(bloc, event);
print(event);
}
@felangel
felangel / main.dart
Last active Feb 27, 2020
showDialog sample
View main.dart
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:bloc/bloc.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@felangel
felangel / main.dart
Last active Feb 15, 2020
CombinedBloc + combineLatest
View main.dart
import 'dart:async';
import 'package:bloc/bloc.dart';
import 'package:equatable/equatable.dart';
import 'package:meta/meta.dart';
import 'package:rxdart/rxdart.dart';
enum CounterEvent { increment }
class CounterBloc extends Bloc<CounterEvent, int> {
You can’t perform that action at this time.