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:io'; | |
| class HttpExampleClient { | |
| IOClient httpClient; | |
| bool _checkCert(X509Certificate cert, String host, int port) { | |
| print(cert); | |
| return false; | |
| } |
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:convert'; | |
| void main()async{ | |
| var result = await getSomeData().then((String data ){ | |
| return jsonDecode(data); | |
| }).then(( json){ | |
| return SomeData.fromMap(json); | |
| }); | |
| print(result.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 'package:flutter/material.dart'; | |
| const Color darkBlue = Color.fromARGB(255, 18, 32, 47); | |
| void main() { | |
| runApp(MyApp()); | |
| } | |
| class MyApp extends StatelessWidget { | |
| @override |
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'; | |
| class Item { | |
| Item(this.id, this.name, this.color); | |
| final int id; | |
| final String name; | |
| final Color color; | |
| final int price = 42; |
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
| package main | |
| import ( | |
| "fmt" | |
| "sort" | |
| ) | |
| var counter int = 0 | |
| func 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
| /* | |
| Лена узнала, что на ее любимом маркетплейсе действует интересная акция. Согласно её условиям, организаторы раздают подарки всем клиентам, впервые сделавшим заказ, номер которого окажется палиндромом. Лена заметила, что номера заказов формируются в порядке возрастания, и решила перехитрить организаторов: в нужный момент очень быстро оформить подряд несколько мелких заказов, чтобы гарантированно «выбить» счастливый номер. | |
| Помогите Лене определить, насколько близко номер текущего заказа к ближайшему за ним «счастливому» номеру. | |
| Примечание: Число является палиндромом, если читается слева направо так же, как справа налево. | |
| Пример палиндрома: 123321 | |
| Примечание к примерам: |
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
| main(){ | |
| print(1+2); | |
| print('hello world'); | |
| } |
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 z = asyncFunc(); | |
| print(z.toList()); | |
| } | |
| Stream<int> asyncFunc() async* { | |
| for(var i =0; i<10;i++){ | |
| print(i); | |
| if(i == 5){ |
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
| main() { | |
| var multiply= (a,b,c) => a*b*c; | |
| var multiplyby2 = (a,b) => multiply(a,b,2); | |
| var multiplyby2by3 = (a) => multiplyby2(a,3); | |
| print(multiplyby2by3(7)); | |
| } |
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
| main() { | |
| int? r; | |
| var result = r?.apply<int,int>((a)=>a+1); | |
| var result2 = r!= null? add2(r):null; | |
| } | |
| add2(int a) => a+2; | |
| typedef R ApplyFunction<T,R>(T ); |
OlderNewer