Skip to content

Instantly share code, notes, and snippets.

View iapicca's full-sized avatar
🎯
Focusing

Francesco Iapicca iapicca

🎯
Focusing
View GitHub Profile
@iapicca
iapicca / builder.dart
Created October 4, 2024 04:19 — forked from rodydavis/builder.dart
SQLite3 Sync UI
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:sqlite3/common.dart';
import '../src/database/types.dart';
class SqlBuilder extends StatefulWidget {
const SqlBuilder({
super.key,
@iapicca
iapicca / builder.dart
Created October 4, 2024 04:19 — forked from rodydavis/builder.dart
SQLite3 Sync UI
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:sqlite3/common.dart';
import '../src/database/types.dart';
class SqlBuilder extends StatefulWidget {
const SqlBuilder({
super.key,
@iapicca
iapicca / main.dart
Created September 9, 2024 18:01
DeviceOrientation web
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@iapicca
iapicca / main.dart
Last active September 9, 2024 09:52
DeviceOrientation example
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@iapicca
iapicca / main.dart
Created July 31, 2024 09:43
issue_152607
import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart';
final class SharedPreferencesKeys {
static const action = 'action';
}
void main() async {
final prefsWithCache = await SharedPreferencesWithCache.create(
cacheOptions: const SharedPreferencesWithCacheOptions(
@iapicca
iapicca / main.dart
Last active August 25, 2024 08:27
SharedPreferences web example
import 'package:flutter/foundation.dart' show ValueListenable;
import 'package:shared_preferences/shared_preferences.dart'
show SharedPreferences;
import 'package:flutter/material.dart';
void main() async {
final counter = await SharedCounter.instance();
runApp(
MaterialApp(
home: Scaffold(
@iapicca
iapicca / main.dart
Created April 28, 2024 14:41
extensio types stop being Object
import 'dart:ui';
typedef SomethingToString<T extends Object> = void Function(T);
class Foo extends Object {
const Foo();
}
extension type Bar(Foo foo) {}
@iapicca
iapicca / Example.md
Created April 21, 2024 15:35 — forked from Sunbreak/Example.md
RenderProxyBox

RenderProxyBox

@iapicca
iapicca / main.dart
Last active April 4, 2024 17:22
Future.wait behavior
void main() async {
final futures = [
for (var i = 0; i < 100000; ++i) Future.sync(DateTime.now),
];
final dateTimes = await Future.wait(futures);
final delta = dateTimes.last.difference(dateTimes.first);
print(delta.inMilliseconds);
}
@iapicca
iapicca / main.dart
Created February 11, 2024 09:32
scroll view workaround
/// https://codepen.io/sldsrg/pen/RwagmrL
import 'dart:async';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
void main() {
runApp(
MaterialApp(