Skip to content

Instantly share code, notes, and snippets.

View guid-empty's full-sized avatar

guid-empty guid-empty

View GitHub Profile
@PlugFox
PlugFox / example.dart
Last active April 23, 2024 13:40
Flutter Shimmer & Skeleton
void main() => runZonedGuarded<void>(
() => runApp(const App()),
(error, stackTrace) => log('Top level exception $error'),
);
class App extends StatelessWidget {
const App({super.key});
@override
Widget build(BuildContext context) => MaterialApp(
@PlugFox
PlugFox / dependencies.dart
Last active March 2, 2024 09:23
Log collector and application initialization with dependencies
/// Dependencies
abstract interface class Dependencies {
/// The state from the closest instance of this class.
factory Dependencies.of(BuildContext context) => InheritedDependencies.of(context);
/// Database
abstract final Database database;
}
final class $MutableDependencies implements Dependencies {
@apgapg
apgapg / logging_interceptor.dart
Created April 9, 2020 05:37
Logging interceptor for dio, flutter
import 'dart:async';
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
/// [LoggingInterceptor] is used to print logs during network requests.
/// It's better to add [LoggingInterceptor] to the tail of the interceptor queue,
/// otherwise the changes made in the interceptor behind A will not be printed out.
/// This is because the execution of interceptors is in the order of addition.
class LoggingInterceptor extends Interceptor {
@santisbon
santisbon / Search my gists.md
Last active May 11, 2024 03:50
How to search gists.

Enter this in the search box along with your search terms:

Get all gists from the user santisbon.
user:santisbon

Find all gists with a .yml extension.
extension:yml

Find all gists with HTML files.
language:html