Skip to content

Instantly share code, notes, and snippets.

@slightfoot
slightfoot / backend.dart
Last active October 3, 2019 05:46
Mock Chat App - Results of the #HumpDayQandA - Wednesday 15 August 2018
import 'model.dart';
typedef OnChatMessageCallback = void Function(int index, ChatMessage message);
abstract class ChatManager {
ChatManager();
ChatSession getNamedSession(String name);
}
class MyApp extends StatelessWidget {
Stream<int> _countUp() async* {
for (int i = 1; i <= 10; i++) {
yield await Future.delayed(Duration(seconds: 1), () => i);
}
}
@override
Widget build(BuildContext context) {
return MaterialApp(
@MarcinusX
MarcinusX / infinite_listview.dart
Created April 16, 2018 19:47
This is source code for a blog post.
import 'dart:async';
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
@slightfoot
slightfoot / error_capture.dart
Last active April 26, 2021 12:03
Crash Reporting / Error Capture for Flutter
///
/// Flutter Captured Error Reporting
/// Created by Simon Lightfoot
///
/// Copyright (C) DevAngels Limited 2018
/// License: APACHE 2.0 - https://www.apache.org/licenses/LICENSE-2.0
///
import 'dart:async';
import 'dart:io';
import 'dart:ui' as ui show window;