Skip to content

Instantly share code, notes, and snippets.

View natintosh's full-sized avatar
🚀

Ogunye Nathaniel Oluwatobiloba natintosh

🚀
View GitHub Profile
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'dart:math' as math;
class CustomLayout extends MultiChildRenderObjectWidget {
CustomLayout({
Key key,
List<Widget> children = const <Widget>[],
}) : super(key: key, children: children);
@RikkaW
RikkaW / gist:0ae7f51117768a03c6581c956d75958c
Last active February 1, 2024 14:25
insert general file with MediaStore
Context context = view.getContext();
ContentResolver cr = context.getContentResolver();
ContentValues values;
try {
// create a file for test
File file = new File(context.getFilesDir(), "1234568");
file.createNewFile();
try (OutputStream os = new FileOutputStream(file)) {
os.write("test".getBytes());
@natintosh
natintosh / phone_format_as_you_type.dart
Created December 16, 2019 09:09
A class formats phone number input as you type
typedef OnInputFormatted<T> = void Function(T value);
class PhoneFormatter extends TextInputFormatter {
final RegExp separatorChars = RegExp(r'[^\d]+');
final RegExp allowedChars = RegExp(r'[\d+]');
final String isoCode;
final String dialCode;
final OnInputFormatted<TextEditingValue> onInputFormatted;
import 'package:flutter/services.dart';
import 'package:string_mask/string_mask.dart';
class PhoneMaskInputFormatter extends TextInputFormatter {
final String mask;
final String escapeChar;
final RegExp regExp = RegExp(r'[^\d]+');
Map<int, String> _separatorMap;
I am not a fan of Xcode. Here are ~160~ 200 problems, the first hundred or so issues were filed mostly in
July and August 2016 in a fit of rage. Mostly on weekends working (slowly) on side-projects. I have also
taken days of my employer's time filing others of these - so the company was not getting value for my time.
I believe a paid intern could have found many of these - just start a screen recorder, and when you see something,
stop and cut a quick movie. Many have been around for several major versions.
I'm volunteering chunks of my life (15-30 minutes per) to one of the most valuable companies in the world, which seems
kind of messed up. Things get worse the more complex the project and the longer Xcode been's running.
Apple folks - check out rdar://22524679