This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |