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 / splash_page.dart
Created Oct 24, 2018
[flutter_login] Splash Page
View splash_page.dart
import 'package:flutter/material.dart';
class SplashPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Text('Splash Screen'),
),
);
@felangel
felangel / main.dart
Created Dec 12, 2018
dynamic Event in Bloc
View main.dart
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:bloc/bloc.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
class SimpleBlocDelegate extends BlocDelegate {
@override
void onTransition(Transition transition) {
@felangel
felangel / main.dart
Created Dec 22, 2018
Sharing Bloc Across Routes
View main.dart
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:bloc/bloc.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
class SimpleBlocDelegate extends BlocDelegate {
@override
void onTransition(Transition transition) {
@felangel
felangel / main.dart
Created Dec 26, 2018
StatefulWidget Issues
View main.dart
import 'package:flutter/material.dart';
void main() {
runApp(
MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text('Example'),
),
body: PageA(),
@felangel
felangel / sample_data.json
Created Dec 27, 2018
[flutter_infinite_list] jsonplaceholder sample
View sample_data.json
[
{
"userId": 1,
"id": 1,
"title": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit",
"body": "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto"
},
{
"userId": 1,
"id": 2,
@felangel
felangel / main.dart
Created Dec 27, 2018
[flutter_infinite_list] main main_function
View main.dart
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
@felangel
felangel / main.dart
Created Dec 27, 2018
[flutter_infinite_list] bottom loader
View main.dart
class BottomLoader extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
alignment: Alignment.center,
child: Center(
child: SizedBox(
width: 33,
height: 33,
child: CircularProgressIndicator(
@felangel
felangel / main.dart
Created Dec 27, 2018
[flutter_infinite_list] post widget
View main.dart
class PostWidget extends StatelessWidget {
final Post post;
const PostWidget({Key key, @required this.post}) : super(key: key);
@override
Widget build(BuildContext context) {
return ListTile(
leading: Text(
post.id.toString(),
@felangel
felangel / bloc_provider.dart
Created Jan 6, 2019
[WIP] BlocProvider w/multiple Blocs
View bloc_provider.dart
import 'package:flutter/material.dart';
import 'package:bloc/bloc.dart';
/// A Flutter widget which provides a bloc to its children via `BlocProvider.of(context)`.
/// It is used as a DI widget so that a single instance of a bloc can be provided
/// to multiple widgets within a subtree.
class BlocProvider extends StatefulWidget {
/// The Blocs which are to be made available throughout the subtree.
/// If multiple blocs are provided, the blocs will be inserted in the same order they are specified.
@felangel
felangel / post_event.dart
Last active Jan 7, 2019
[flutter_infinite_list] post_event
View post_event.dart
import 'package:equatable/equatable.dart';
abstract class PostEvent extends Equatable {}
class Fetch extends PostEvent {
@override
String toString() => 'Fetch';
}
You can’t perform that action at this time.