This file contains hidden or 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(const MyApp()); | |
| // Declares the SizedBox as a named constant | |
| const SizedBox mySpacer = SizedBox(height: 20); | |
| class MyApp extends StatelessWidget { | |
| const MyApp({super.key}); |
This file contains hidden or 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:io'; | |
| import 'package:flutter/material.dart'; | |
| void main() => HttpOverrides.runWithHttpOverrides( | |
| () => runApp( | |
| const MainApp(), | |
| ), | |
| FakeHttpOverrides(), |
This file contains hidden or 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: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)); |
This file contains hidden or 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 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" |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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, |