Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<script type='text/javascript' src="https://cdn.jsdelivr.net/npm/afterglowplayer@1/dist/afterglow.min.js"></script>
</head>
<style>
<html>
<head>
</head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</html>
</p>
<!--HTML-->
<html>
<head>
<style type="text/css">
/*CSS*/
* {
font-family: sans-serif; /* Change your font family */
}
import 'package:flutter/material.dart';
import 'package:date_format/date_format.dart';
class TEST extends StatefulWidget {
@override
_TESTState createState() => _TESTState();
}
class _TESTState extends State<TEST> {
String currentDate = formatDate(DateTime.now(), [mm, '-', dd, '-', yyyy]);
@faizan1947
faizan1947 / drawer.dart
Last active February 5, 2022 14:44
Flutter Custom Drawer
// ignore_for_file: prefer_const_constructors
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class MyDrawer extends StatelessWidget {
const MyDrawer({Key? key}) : super(key: key);
final imageURL = "https://avatars.githubusercontent.com/u/61882549?v=4";
@override
Widget build(BuildContext context) {
@faizan1947
faizan1947 / main.dart
Created February 19, 2022 05:09
Dart Basics
void main(){
@faizan1947
faizan1947 / function.dart
Created February 19, 2022 12:29
Create and use function
void main(){
var name = 'Faizan';
var age = 20;
var height = 1.14;
describe(name,age,height);
describe("JONI",24,22.4);
@faizan1947
faizan1947 / Dart class.dart
Last active February 20, 2022 15:02
Class and Constructor
void main() {
final person = Person(name: "Faizan", age: 33, height: 1.4);
print(person.name);
}
class Person {
Person({required this.age, required this.height, required this.name});
String name;
int age;
@faizan1947
faizan1947 / main.dart
Last active July 15, 2022 05:56
Dart Classes and Objects
void main() {
//Create Objects from Human Class
//Create 1st Object
var newHuman = Human(age:0);
print(newHuman.age);
//Create second Object
final human2 = Human(age:23,eyes:2);
@faizan1947
faizan1947 / main.dart
Created July 16, 2022 04:06
Inheritance-dart-lang
//[ Classes / Objects / Methds]
void main() {
//Creating Object [jaguar] from Car Class
var normalJaguar = Car();
//Accessing the method
normalJaguar.run('JAGUAR');