Skip to content

Instantly share code, notes, and snippets.

View bizz84's full-sized avatar

Andrea Bizzotto bizz84

View GitHub Profile
@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 / main.dart
Last active May 10, 2024 15:35
Simple Emil & Password auth flow with Flutter & Firebase UI
import 'package:firebase_auth/firebase_auth.dart' hide EmailAuthProvider;
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_ui_auth/firebase_ui_auth.dart';
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:simple_auth_flutter_firebase_ui/firebase_options.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(
@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
@bizz84
bizz84 / go_router_nested_navigation.dart
Created March 17, 2022 10:17
Example of GoRouter nested navigation using BottomNavigationBar
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
void main() => runApp(App());
class App extends StatelessWidget {
App({Key? key}) : super(key: key);
static const title = 'GoRouter Example: Nested Navigation';
// Source code for this tutorial:
// https://codewithandrea.com/articles/shake-text-effect-flutter/
import 'dart:math';
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
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());
}