Skip to content

Instantly share code, notes, and snippets.

Avatar
coding

Felix Angelov felangel

coding
View GitHub Profile
@felangel
felangel / main.dart
Last active Jun 19, 2020
StatefulRebuilder
View main.dart
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
debugShowCheckedModeBanner: false,
@felangel
felangel / main.dart
Created Jun 18, 2020
StatefulWidget demo
View main.dart
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
debugShowCheckedModeBanner: false,
@felangel
felangel / main.dart
Last active Jun 18, 2020
StatefulBuilder Demo
View main.dart
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
debugShowCheckedModeBanner: false,
@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 Jun 9, 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> {
@felangel
felangel / main.dart
Created Feb 14, 2020
bloc + combineLatest
View main.dart
import 'dart:async';
import 'package:bloc/bloc.dart';
import 'package:rxdart/rxdart.dart';
enum CounterEvent { increment }
class CounterBloc extends Bloc<CounterEvent, int> {
@override
int get initialState => 0;
View game_bloc.dart
import 'dart:async';
import 'dart:io';
import 'package:flutter/foundation.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:equatable/equatable.dart';
import 'package:flutter_cards/models/models.dart';
part 'game_event.dart';
part 'game_state.dart';
@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 / 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
}
You can’t perform that action at this time.