Skip to content

Instantly share code, notes, and snippets.

View ayoubzulfiqar's full-sized avatar
💫
Lord of Mysteries

Sensei ayoubzulfiqar

💫
Lord of Mysteries
View GitHub Profile
// accesing and requesting
Future<List<Directory>?>? _externalStorageDirectory; // this will go in future in future builder
// this will go in onPresssed if you wanna use button to request everything
void requestExternalStorageDirectory(StorageDirectory type) {
@ayoubzulfiqar
ayoubzulfiqar / rock_paper_scissors.dart
Created February 14, 2022 11:39
Rock-Paper-Scissors game against computer
void main(){
while (true) {
print("Rock, Paper, Scissors Shoot!");
String playerMove = getPlayerMove();
if (playerMove == "Quit") {
return;
}
print("You played $playerMove");
@ayoubzulfiqar
ayoubzulfiqar / api_methods.dart
Created February 11, 2022 18:24
These gist contain all the mehods to http request
// Model for Json DATA
class Posts {
Posts({
required this.userId,
required this.id,
required this.title,
required this.body,
});
late final int userId;
@ayoubzulfiqar
ayoubzulfiqar / api_calling.dart
Last active February 8, 2022 16:56
These are the basic methods to call api in dart
// The main maethod (just return the widget name to fetch the data from different methods)
import 'package:flutter/material.dart';
import 'package:flutterx/demo.dart';
import 'package:flutterx/photos.dart';
void main() {
runApp(const Experiment());
}