Skip to content

Instantly share code, notes, and snippets.

View bizz84's full-sized avatar

Andrea Bizzotto bizz84

View GitHub Profile
@bizz84
bizz84 / flutter_bootstrap.js
Created May 21, 2024 08:40
Custom Flutter Web App Initialization Logic with CSS Loader
{{flutter_js}}
{{flutter_build_config}}
// Manipulate the DOM to add a loading spinner will be rendered with this HTML:
// <div class="loading">
// <div class="loader" />
// </div>
const loadingDiv = document.createElement('div');
loadingDiv.className = "loading";
document.body.appendChild(loadingDiv);
@bizz84
bizz84 / logger_interceptor.dart
Created May 13, 2024 07:38
Simple logger interceptor for Dio without extra dependencies
import 'dart:developer';
import 'package:dio/dio.dart';
/// A simple interceptor used to log all network requests
/// For more details, see: https://github.com/bizz84/flutter-tips-and-tricks/blob/main/tips/0152-log-status-code-emoji/index.md
class LoggerInterceptor implements Interceptor {
final stopwatches = <String, Stopwatch>{};
@override
@bizz84
bizz84 / app_release_template.json
Last active May 3, 2024 15:18
An app release checklist template for Flutter app development
{
"template": "App Release",
"version": 3,
"epics": [
{
"id": "ff",
"epic": "Flutter Flavors",
"tasks": [
{ "id": "B2A42464", "name": "Add Dev, Stg, Prod flavors on iOS" },
{ "id": "C9FB1D58", "name": "Add Dev, Stg, Prod flavors on Android" },
@bizz84
bizz84 / responsive_center_scrollable.dart
Last active April 30, 2024 08:05
A responsive centered scrollable layout that enables mouse scrolling outside the centered scrollable area
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
void main() {
runApp(const MainApp());
}
class MainApp extends StatelessWidget {
const MainApp({super.key});
@bizz84
bizz84 / privacy-manifest-list.txt
Created March 27, 2024 12:18
Bash script to check if the Podfile.lock contains any SDKs that should be declared in the privacy manifest file
Abseil
AFNetworking
Alamofire
AppAuth
BoringSSL / openssl_grpc
Capacitor
Charts
connectivity_plus
Cordova
device_info_plus
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
@bizz84
bizz84 / scroll_to_index_dynamic_height.dart
Created January 14, 2024 10:22
Example showing how to scroll to a list item by index when all items can have different heights
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:scroll_to_index/scroll_to_index.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
@bizz84
bizz84 / find-flutter-logo-page-flip.dart
Created December 11, 2023 14:18
A game where the player needs to find out under which card the Flutter logo is hiding.
import 'dart:math';
import 'package:flutter/material.dart';
// To use this package, run:
// dart pub add page_flip_builder
import 'package:page_flip_builder/page_flip_builder.dart';
void main() {
runApp(const MyApp());
}
@bizz84
bizz84 / macOS-Podfile
Last active October 5, 2023 01:42
macOS Podfile template for Flutter apps
# Set the platform at the top
platform :osx, '10.15'
# Rest of the pod file
# Update post_install step
post_install do |installer|
# Ensure pods use the minimum deployment target set above
# https://stackoverflow.com/a/64385584/436422
pods_project = installer.pods_project
@bizz84
bizz84 / iOS-Podfile
Last active October 12, 2023 08:40
iOS Podfile template for Flutter apps
# Set the platform at the top
platform :ios, '13.0'
# Rest of the pod file
# Update post_install step
post_install do |installer|
# Ensure pods use the minimum deployment target set above
# https://stackoverflow.com/a/64385584/436422
pods_project = installer.pods_project