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
| Map.fromEntries(XmlDocument.parse( | |
| await Resource('package:plural_lint/src/cldr/plurals.xml') // 1 | |
| .readAsString(encoding: utf8)) | |
| .xpath('/supplementalData/plurals[@type="cardinal"]/pluralRules') // 2 | |
| .map((item) => item | |
| .xpath('@locales') | |
| .first | |
| .value! // 3 | |
| .split(' ') // 4 | |
| .map((locale) => MapEntry( |
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
| void main() { | |
| final input = stdin.readLineSync(); | |
| final result = PatternDefinition().build().parse(input ?? ''); | |
| if (result is Success) { | |
| print('Pattern found, result: ${result.value}'); | |
| } else { | |
| print('Pattern not found'); | |
| } | |
| } | |
| class PatternDefinition extends GrammarDefinition<int?> { |
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 certificates = await rootBundle.load('assets/openssl/google.crt'); | |
| final dio = Dio(); | |
| (dio.httpClientAdapter as IOHttpClientAdapter).onHttpClientCreate = (client) { | |
| final securityContext = SecurityContext(); //1 | |
| securityContext.setTrustedCertificatesBytes(certificates.buffer.asUint8List()); | |
| return HttpClient(context: securityContext); | |
| }; | |
| final response = await dio.getUri(Uri.parse('https://google.pl')); | |
| print(response.statusCode); |
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 securityContext = SecurityContext(); | |
| final certificates = await rootBundle.load('assets/certificates/google.crt'); //1 | |
| securityContext.setTrustedCertificatesBytes(certificates.buffer.asUint8List()); //2 | |
| final httpClient = HttpClient(context: securityContext); | |
| final httpClientRequest = await httpClient.getUrl(Uri.parse('https://google.pl')); | |
| final response = await httpClientRequest.close(); | |
| print(response.statusCode); |
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
| void main() { | |
| var labels = [1,2,6,7]; | |
| print(labels.map((l)=> ["x", l.toString()]).expand((t)=>t).toList()); | |
| } |
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
| flutter_intl: | |
| enabled: true | |
| class_name: Strings | |
| localizely: | |
| project_id: 39cf3f3a-a154-4d3f-85b5-f57e71774f3e |
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
| tasks { | |
| named("preBuild").dependsOn(register("generateNavArgsProguardRules", GenerateNavArgsProguardRulesTask::class)) | |
| } | |
| android { | |
| defaultConfig { | |
| consumerProguardFile(File(buildDir, NAVARGS_PROGUARD_RULES_PATH)) | |
| } | |
| } |
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
| tasks { | |
| named("preBuild").dependsOn(register("generateNavArgsProguardRules", GenerateNavArgsProguardRulesTask::class)) | |
| } |
NewerOlder