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 name = domain(portalId:'wilson'); | |
| print(name); | |
| } | |
| domain({String portalId}) { | |
| var url = "https://%12345%.peopleaps.com"; | |
| return url.replaceAll('%12345%', portalId); | |
| } |
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(new MyApp()); | |
| class MyApp extends StatelessWidget { | |
| @override | |
| Widget build(BuildContext context) { | |
| return new MaterialApp( |
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 mixedList = [1,2,3,'Orange','Apple']; | |
| mixedList.add(2.3); | |
| mixedList.add([100,200,300]); | |
| print(mixedList); | |
| } | |
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 planets = []; | |
| List colors = List(); | |
| planets.add('mercury'); | |
| planets.addAll(['venus','earth']); | |
| print(planets.length); | |
| planets.remove('venus'); | |
| print(planets); | |
| planets.clear(); | |
| print(planets); |
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 x = int.parse('12'); | |
| print(x*2); | |
| double y = double.parse('12.2'); | |
| print(y); | |
| String sample = 3.toString(); | |
| print (sample); | |
| String sample1 = 'Hello'; | |
| String sample2 = 'Erin'; | |
| String sample3 = sample1 + sample2; |
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() { | |
| String sample = 'aaaa where are ayou now?'; | |
| bool res = sample.endsWith('as'); | |
| var x = sample.split('a'); | |
| print(sample.toUpperCase()); | |
| } |
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() { | |
| String first = 'erin'; | |
| String second = "This is erin"; | |
| int x = 45; | |
| int y = 21; | |
| String newString = '$first $second $x $y'; | |
| print(newString); | |
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() { | |
| String first = 'erin'; | |
| String second = "This is erin"; | |
| String third = 'This is erin dart'; | |
| String multiline = ''' | |
| This is a multiline | |
| String in dart | |
| as you can see. | |
| '''; | |
| print(multiline); |
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 m = 1; | |
| double n = 1.33; | |
| print (m>>1); | |
| print (m<<1);//0001 | |
| print (m & 3); | |
| print (m | 4); | |
| print('hello'); | |
| print(n.ceil()); | |
| print(n.floor()); |
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:math'; | |
| abstract class Shape { | |
| factory Shape(String type) { | |
| if (type == 'circle') return Circle(2); | |
| if (type == 'square') return Square(2); | |
| throw 'Can\'t create $type.'; | |
| } | |
| num get area; | |
| } |
NewerOlder