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:convert'; | |
| import 'package:http/http.dart' as http; | |
| void main() async{ | |
| final graphQLQuery = { | |
| 'query': '''query GetSections { | |
| getSections { | |
| id |
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:convert'; | |
| import 'package:http/http.dart' as http; | |
| void main() async{ | |
| final graphQLQuery = { | |
| 'query': '''mutation Mutation { | |
| upsertCourse(classId: 1, title: "english", description:"fff" , creatorId: 1) { | |
| id |
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:convert'; | |
| import 'package:http/http.dart' as http; | |
| void main() async{ | |
| final graphQLQuery = { | |
| "query": """mutation { | |
| upsertSection(courseId: 1, topic: "work") { | |
| id | |
| courseId | |
| topic |
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 'package:flutter/material.dart'; | |
| void main() { | |
| for (int i = 0; i < 5; i++) { | |
| print('hello ${i + 1}'); | |
| } | |
| final course = Course(creatorId: '', courseTitle: '', courseDescription: '', | |
| courseSection: [] |
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() { | |
| List<Meal> meals = [ | |
| Meal( | |
| id: 'm1', | |
| categories: [ | |
| 'c1', | |
| 'c2', | |
| ], | |
| title: 'Spaghetti with Tomato Sauce', | |
| affordability: Affordability.affordable, |
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'; | |
| void main() { | |
| final List<Transactions> transactions = [ | |
| Transactions( | |
| '1', 'Shoes', 2500.34, DateTime.now()), | |
| Transactions('3', 'Bag', 1500, DateTime.now()), | |
| ]; | |
| var id = Random().nextInt(100) + 900; | |
| print(id); |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>validation</title> | |
| <link rel="stylesheet" href="styles.css"> | |
| <script type="application/dart" src="main.dart"></script> | |
| </head> |
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:convert'; | |
| import 'dart:math'; | |
| import 'package:http/http.dart' show get; | |
| void main() async { | |
| final clientID = 'ha_NzNADHFGe6F3m0BDREK-WDj8mqABkeRTYW8JFhFk'; | |
| final response = await get(Uri.parse('https://api.unsplash.com/photos?client_id=$clientID')); | |
| //print(jsonDecode(response.body)); | |
| var result = ImageModel.fromJson(jsonDecode(response.body)); | |
| print(result.url); | |
| print('This are the likes: $result'); |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>more-streams</title> | |
| <link rel="stylesheet" href="styles.css"> | |
| <script type="application/dart" src="main.dart"></script> | |
| </head> |
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'; | |
| void main() { | |
| final controller = StreamController(); | |
| final order = Order('chocolate'); | |
| final baker = StreamTransformer.fromHandlers( | |
| handleData:(cakeType,sink){ | |
| if(cakeType == 'chocolate'){ | |
| sink.add(Cake()); | |
| }else { |