Skip to content

Instantly share code, notes, and snippets.

@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;
#!/bin/sh
OUTPUT="$(flutter analyze)"
echo "$OUTPUT"
echo
if grep -q "error •" <<< "$OUTPUT"; then
echo "flutter analyze found errors"
exit 1
else
echo "flutter analyze didn't find any errors"
exit 0
@slightfoot
slightfoot / carousel.dart
Last active April 20, 2022 04:02
Scrolling Carousel with centered variable width items and snapping - By Simon Lightfoot - 20/07/2020