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
import os | |
from fontTools import ttLib | |
# Declare your font file names and the correct weights here | |
to_change = { | |
'Galano Grotesque Thin.otf': 100, | |
'Galano Grotesque Thin Italic.otf': 100, | |
'Galano Grotesque Extra Light.otf': 200, | |
'Galano Grotesque Extra Light Italic.otf': 200, | |
'Galano Grotesque Light.otf': 300, |
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
{ | |
"USD": { | |
"symbol": "$", | |
"name": "US Dollar", | |
"symbol_native": "$", | |
"decimal_digits": 2, | |
"rounding": 0, | |
"code": "USD", | |
"name_plural": "US dollars" | |
}, |
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_driver/driver_extension.dart'; | |
import 'package:intlphonenumberinputtest/main.dart' as app; | |
main() { | |
enableFlutterDriverExtension(); | |
app.main(); | |
} |
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
void main() { | |
print(resistorColor('Red')); | |
} | |
const List<String> colors = [ | |
'Black', | |
'Brown', | |
'Red', | |
'Orange', | |
'Yellow', |
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
void main() { | |
print(resistorColor('Red')); | |
} | |
const List<String> colors = [ | |
'Black', | |
'Brown', | |
'Red', | |
'Orange', | |
'Yellow', |
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
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file | |
// for details. All rights reserved. Use of this source code is governed by a | |
// BSD-style license that can be found in the LICENSE file. | |
import 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override |
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; |
NewerOlder