Skip to content

Instantly share code, notes, and snippets.

☕️
coding

Felix Angelov felangel

View GitHub Profile
View chat_event.dart
import 'package:equatable/equatable.dart';
import 'package:flutter_app/network/response/message_response.dart';
abstract class ChatEvent extends Equatable {
ChatEvent([List props = const []]) : super(props);
}
class SendMessageEvent extends ChatEvent {
final MessagesResponse newMessage;
View chat_state.dart
import 'package:equatable/equatable.dart';
import 'package:flutter_app/network/response/message_response.dart';
abstract class ChatState extends Equatable {
ChatState([List props = const []]) : super(props);
}
class ChatInitial extends ChatState {
@override
String toString() => 'ChatInitial';
View chat_bloc.dart
import 'dart:async';
import 'package:bloc/bloc.dart';
import 'package:flutter/material.dart';
import 'package:flutter_app/chat_page/chat.dart';
import 'package:flutter_app/network/request/send_message_request.dart';
import 'package:flutter_app/network/response/message_response.dart';
import 'package:flutter_app/network/response/send_message_response.dart';
import 'package:flutter_app/network/service/base_call_back.dart';
import 'package:flutter_app/network/service/network_factory.dart';
@felangel
felangel / main.dart
Created Mar 21, 2019
BlocBuilder Race Condition Test
View main.dart
import 'package:flutter/material.dart';
import 'package:bloc/bloc.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
abstract class DataState {}
class InitialDataState extends DataState {}
class LoadedDataState extends DataState {
final String data;
@felangel
felangel / main.dart
Created Mar 16, 2019
[flutter_todos] main
View main.dart
import 'package:flutter/material.dart';
import 'package:bloc/bloc.dart';
import 'package:path_provider/path_provider.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:todos_repository_simple/todos_repository_simple.dart';
import 'package:todos_app_core/todos_app_core.dart';
import 'package:flutter_todos/localization.dart';
import 'package:flutter_todos/blocs/blocs.dart';
import 'package:flutter_todos/models/models.dart';
import 'package:flutter_todos/screens/screens.dart';
@felangel
felangel / main.dart
Created Mar 16, 2019
[flutter_todos] todos app
View main.dart
class TodosApp extends StatelessWidget {
final todosBloc = TodosBloc(
todosRepository: const TodosRepositoryFlutter(
fileStorage: const FileStorage(
'__flutter_bloc_app__',
getApplicationDocumentsDirectory,
),
),
);
@felangel
felangel / main.dart
Created Mar 16, 2019
[flutter_todos] main run app
View main.dart
void main() {
BlocSupervisor().delegate = SimpleBlocDelegate();
runApp(TodosApp());
}
@felangel
felangel / stats.dart
Created Mar 16, 2019
[flutter_todos] stats
View stats.dart
import 'package:flutter/material.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:todos_app_core/todos_app_core.dart';
import 'package:flutter_todos/blocs/stats/stats.dart';
import 'package:flutter_todos/widgets/widgets.dart';
import 'package:flutter_todos/flutter_todos_keys.dart';
class Stats extends StatelessWidget {
@felangel
felangel / loading_indicator.dart
Created Mar 16, 2019
[flutter_todos] loading indicator
View loading_indicator.dart
import 'package:flutter/material.dart';
class LoadingIndicator extends StatelessWidget {
LoadingIndicator({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Center(
child: CircularProgressIndicator(),
);
@felangel
felangel / delete_todo_snack_bar.dart
Created Mar 16, 2019
[flutter_todos] delete todo snackbar
View delete_todo_snack_bar.dart
import 'package:flutter/material.dart';
import 'package:todos_app_core/todos_app_core.dart';
import 'package:flutter_todos/models/models.dart';
class DeleteTodoSnackBar extends SnackBar {
final ArchSampleLocalizations localizations;
DeleteTodoSnackBar({
Key key,
@required Todo todo,
You can’t perform that action at this time.