Skip to content

Instantly share code, notes, and snippets.

View bierbaumtim's full-sized avatar
🏠
Working from home

Tim Bierbaum bierbaumtim

🏠
Working from home
View GitHub Profile
@bierbaumtim
bierbaumtim / SecureStorageDelegate.swift
Created May 14, 2023 17:15
Flutter iOS Keychain Availability Handler
import Flutter
import UIKit
import os.log
public class SecureStorageDelegate: NSObject, FlutterPlugin, FlutterStreamHandler {
public static func register(with registrar: FlutterPluginRegistrar) {
let channel = FlutterMethodChannel(name: "com.example.test/secstore/commands", binaryMessenger: registrar.messenger())
let secStoreEventChannel = FlutterEventChannel(name: "com.example.test/secstore/events", binaryMessenger: registrar.messenger())
let instance = SecureStorageDelegate()
registrar.addMethodCallDelegate(instance, channel: channel)
@bierbaumtim
bierbaumtim / chat_message_render_box.dart
Created April 23, 2023 17:06 — forked from craiglabenz/chat_message_render_box.dart
Demonstrates a custom RenderObject that draws chat messages like WhatsApp, where the `sentAt` timestamp is tucked into the last line if it fits
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
_scrollController.addListener(() {
_onScroll();
if (_scrollController.position.userScrollDirection ==
ScrollDirection.reverse) {
if(showFAB) {
setState(() {
showFAB = false;
});
}
} else {
const f = (a, b) => [].concat(...a.map(d => b.map(e => [].concat(d, e))));
const cartesian = (a, b, ...c) => (b ? cartesian(f(a, b), ...c) : a);
import 'package:flutter/cupertino.dart';
void main(){
runApp(CupertinoApp(home:MyApp()));
}
class MyApp extends StatefulWidget{
@override
_MyAppState createState() => _MyAppState();
void main(){
runApp(MyApp());
}
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<Deskmodder> {
import 'dart:async';
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatefulWidget {
@override