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
module Thing | |
type Factory<'T> = unit -> 'T | |
type Printer () = | |
static member FactoryInstance : Factory<'T> = Printer.FactoryFunction | |
static member DoPrinting () = | |
let factory = Printer.FactoryInstance |
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
name: Flutter Integration Test iOS | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [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
using Microsoft.Extensions.Caching.Distributed; | |
using Microsoft.Extensions.Caching.Memory; | |
namespace Cache; | |
public interface ISerializationAdapter | |
{ | |
T? Deserialize<T>(string key, byte[]? value); | |
byte[] Serialize(object value); | |
} |
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
final records = <({String name, int value})>[ | |
(name: 'test1', value: 1), | |
(name: 'test2', value: 12), | |
]; | |
void main(List<String> arguments) { | |
print(records.first.name); | |
} |
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 'dart:async'; | |
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(const MainApp()); | |
} | |
class DelayedTextEditingController { | |
DelayedTextEditingController( | |
this.onValidated, |
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'; | |
void main() { | |
runApp( | |
MaterialApp( | |
home: Scaffold( | |
body: Center( | |
child: Row(children: [ | |
Container( | |
color: Colors.red, |
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'; | |
extension NavigationExtension on BuildContext { | |
Future<void> navigateTo(String routeName, {Object? arguments}) { | |
return Navigator.pushNamed(this, routeName, arguments: arguments); | |
} | |
} | |
void main() { | |
runApp(MaterialApp( |
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'; | |
int? hexToInteger(String hex) => int.tryParse(hex, radix: 16); | |
extension StringColorExtensions on String { | |
Color? toColor() { | |
var number = hexToInteger(this); | |
if (number == null) { | |
return null; | |
} |
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
class Vehicle { | |
//Defaults to car | |
String get type => "car"; | |
void drive() { | |
print("You're driving a $type."); | |
} | |
} | |
class Tractor implements Vehicle { | |
@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
import 'dart:async'; | |
import 'dart:convert'; | |
import 'dart:math'; | |
import 'package:flutter/material.dart'; | |
import 'package:http/http.dart' as http; | |
final random = Random(); | |
void main() => runApp(const MyApp()); |