Skip to content

Instantly share code, notes, and snippets.

View vraj6198's full-sized avatar
🎯
Focusing

Vraj Patel vraj6198

🎯
Focusing
View GitHub Profile
int
Integer values no larger than 64 bits.
double
64-bit (double-precision) floating-point numbers.
Both int and double are subtypes of num. The num type includes basic operators such as +, -, /, and *, and is also where you’ll find abs(), ceil(), and floor(), among other methods.
// String -> int
var one = int.parse('1');
@vraj6198
vraj6198 / Demo_function.dart
Last active March 24, 2020 06:39
Function in dart
//Define a function
/* void main(){
findperimeter();
}
void findperimeter(){
int length=4;
int breadth=5;
int perimeter= 2*(length+breadth);
print("the perimeter is $perimeter");
void main(){
// literal
var isvalid = true;
var x = 2;
var value = 45.55;
"hello";
//various way to define string literal in dart
String s1 = 'single';