Skip to content

Instantly share code, notes, and snippets.

View jscarl's full-sized avatar
🏠
Working from home

joshua carl jscarl

🏠
Working from home
  • Jakarta, Indonesia
View GitHub Profile
@brianegan
brianegan / future_widget_test.dart
Created August 16, 2019 13:37
Demonstrates how to Mock Futures in Widiget tests to check the various expected ouputs depending on the loading / success / error state of the Future
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility that Flutter provides. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
import 'dart:convert';
import 'package:flutter/material.dart';
@denesh-raymond
denesh-raymond / debounced_button.dart
Created November 28, 2020 01:06
Debounced Button in Flutter
import 'dart:async';
import 'package:flutter/material.dart';
class DebouncedButton extends StatefulWidget {
final String _text;
final VoidCallback _onPressed;
final Duration _duration;
DebouncedButton({