Skip to content

Instantly share code, notes, and snippets.

View Erinziyi's full-sized avatar
🎯
Focusing

Erin Erinziyi

🎯
Focusing
View GitHub Profile
main() {
var name = domain(portalId:'wilson');
print(name);
}
domain({String portalId}) {
var url = "https://%12345%.peopleaps.com";
return url.replaceAll('%12345%', portalId);
}
@Erinziyi
Erinziyi / infinite_listview.dart
Created September 13, 2019 09:54 — forked from MarcinusX/infinite_listview.dart
This is source code for a blog post.
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(
@Erinziyi
Erinziyi / Type in List Dart
Created March 14, 2019 09:47
Type in List Dart
void main(){
var mixedList = [1,2,3,'Orange','Apple'];
mixedList.add(2.3);
mixedList.add([100,200,300]);
print(mixedList);
}
@Erinziyi
Erinziyi / List in Dart
Created March 14, 2019 07:55
List in Dart
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);
@Erinziyi
Erinziyi / Parsing in Dart
Last active March 14, 2019 06:01
Parsing in Dart
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;
@Erinziyi
Erinziyi / dart
Last active February 26, 2019 03:42
String functions
main() {
String sample = 'aaaa where are ayou now?';
bool res = sample.endsWith('as');
var x = sample.split('a');
print(sample.toUpperCase());
}
main() {
String first = 'erin';
String second = "This is erin";
int x = 45;
int y = 21;
String newString = '$first $second $x $y';
print(newString);
@Erinziyi
Erinziyi / String Dart
Last active February 25, 2019 10:02
String Dart
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);
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());
@Erinziyi
Erinziyi / Implement an interface
Created February 12, 2019 08:57
Dart for Java Developers
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;
}