Test | Time (Microseconds) |
---|---|
ValueNotifier | 0.14619362615225495 |
StateNotifier | 0.6242255 |
Cubit | 1.2855485 |
StreamController | 1.3412715 |
macOS Mac Mini - 3.2 GHz 6-Core Intel Core i7, running under Flutter Release Mode
import 'package:ioc_container/ioc_container.dart'; | |
import 'package:test/test.dart'; | |
///Example service | |
class BigService { | |
final String name; | |
BigService(this.name); | |
Future<void> callApi() => Future<void>.delayed(Duration(seconds: 1)); |
module Tests | |
open Xunit | |
type Factory<'T> = unit -> 'T | |
let factoryFunction<'T> () : 'T = | |
if typeof<'T> = typeof<string> then "String" :> obj | |
elif typeof<'T> = typeof<int> then 1 :> obj | |
else failwith "Unsupported type" |
module Thing | |
type Factory<'T> = unit -> 'T | |
type Printer () = | |
static member FactoryInstance : Factory<'T> = Printer.FactoryFunction | |
static member DoPrinting () = | |
let factory = Printer.FactoryInstance |
name: Flutter Integration Test iOS | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] |
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); | |
} |
Test | Time (Microseconds) |
---|---|
ValueNotifier | 0.14619362615225495 |
StateNotifier | 0.6242255 |
Cubit | 1.2855485 |
StreamController | 1.3412715 |
macOS Mac Mini - 3.2 GHz 6-Core Intel Core i7, running under Flutter Release Mode
final records = <({String name, int value})>[ | |
(name: 'test1', value: 1), | |
(name: 'test2', value: 12), | |
]; | |
void main(List<String> arguments) { | |
print(records.first.name); | |
} |
import 'dart:async'; | |
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(const MainApp()); | |
} | |
class DelayedTextEditingController { | |
DelayedTextEditingController( | |
this.onValidated, |
import 'package:flutter/material.dart'; | |
void main() { | |
runApp( | |
MaterialApp( | |
home: Scaffold( | |
body: Center( | |
child: Row(children: [ | |
Container( | |
color: Colors.red, |
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( |