Skip to content

Instantly share code, notes, and snippets.

Avatar
💙
Fluttering

Simon Lightfoot slightfoot

💙
Fluttering
View GitHub Profile
@slightfoot
slightfoot / perform_with_retry.dart
Created May 13, 2021
Function to perform a http request with retry and back-off logic. This is modified version from NetworkImageWithRetry - by Simon Lightfoot 13/05/2021
View perform_with_retry.dart
// Copyright 2017, the Flutter project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
//
// Built from : https://github.com/flutter/flutter_image/blob/master/lib/network.dart
//
import 'dart:async';
import 'dart:convert' show ByteConversionSink;
import 'dart:io' as io;
import 'dart:math' as math;
@slightfoot
slightfoot / scroll_to_key.dart
Last active May 10, 2021
Scroll content to widget with key - by Simon Lightfoot - 13/11/2019
View scroll_to_key.dart
// MIT License
//
// Copyright (c) 2021 Simon Lightfoot
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@slightfoot
slightfoot / bubble_effect.dart
Created Mar 18, 2021
3D Style Bubble Magnifying Effect - by Simon Lightfoot and Wilson Wilson @wilsonowilson - 18/03/2021
View bubble_effect.dart
// MIT License
//
// Copyright (c) 2021 Simon Lightfoot
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@slightfoot
slightfoot / notes.txt
Created Jan 22, 2021
Example of compiling dart code as obfuscated AOT binary with separate debug info and obfuscation mapping file
View notes.txt
<DART_SDK>\bin\dart <DART_SDK>\bin\snapshots\gen_kernel.dart.snapshot --platform <DART_SDK>\lib\_internal\vm_platform_strong_product.dill --aot --output test.kernel test.dart
<DART_SDK>\bin\utils\gen_snapshot --snapshot_kind=app-aot-elf --elf=test.so --strip --obfuscate --save-debugging-info=test.debug.so --save-obfuscation-map=test.map.txt test.kernel
<DART_SDK>\bin\dartaotruntime.exe test.so
@slightfoot
slightfoot / ascii_to_bin.dart
Last active Feb 22, 2021
Functions that convert ascii text strings of integers and floats/doubles to binary values computers use - by Simon Lightfoot - 22/01/2021
View ascii_to_bin.dart
// MIT License
//
// Copyright (c) 2021 Simon Lightfoot
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@slightfoot
slightfoot / anchor_scroll.dart
Last active Jan 27, 2021
Ever wanted to scroll down to a widget in a scroll view? Now you can, Anchor Scroll to the rescue! - by Simon Lightfoot - 15/11/2019
View anchor_scroll.dart
// MIT License
//
// Copyright (c) 2019 Simon Lightfoot
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@slightfoot
slightfoot / defer_init.dart
Last active Feb 6, 2021
Defer initialization of your UI based on a background service - by Simon Lightfoot - 29/12/2020 - Null Safe!
View defer_init.dart
import 'dart:math' show Random;
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart' show RendererBinding;
void main() {
runApp(MaterialApp(
home: Home(),
));
}
@slightfoot
slightfoot / expand_card.dart
Created Dec 21, 2020
Expading cards - by Simon Lightfoot 21/12/2020
View expand_card.dart
// MIT License
//
// Copyright (c) 2020 Simon Lightfoot
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@slightfoot
slightfoot / order_progress.dart
Created Oct 26, 2020
Custom Order progress bar example - by Simon Lightfoot - 26/10/2020
View order_progress.dart
// MIT License
//
// Copyright (c) 2020 Simon Lightfoot
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@slightfoot
slightfoot / scrolling_panel.dart
Created Oct 20, 2020
Scrolling Panel - by Simon Lightfoot - 20/10/2020
View scrolling_panel.dart
// MIT License
//
// Copyright (c) 2020 Simon Lightfoot
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions: