This file contains 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
<header class="main_header"> | |
<h1>My Task</h1> | |
</header> |
This file contains 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
<script> | |
import { onDestroy } from 'svelte'; | |
import Task from "./Task.svelte"; | |
import TaskItem from "./task-store"; | |
import Button from '../UIComponent/Button.svelte'; | |
//list title variable | |
export let title; | |
let tasks; |
This file contains 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 { writable } from 'svelte/store'; | |
let id = 0; | |
const tasks = writable([ | |
{ | |
id: ++id, | |
title: "Learning TigerGraph", | |
checkLists: [], | |
done: false |
This file contains 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
<script> | |
import TaskItems from "./task-store"; | |
import EditTask from "./EditTask.svelte"; | |
import { onMount } from "svelte"; | |
export let task = null; | |
onMount(() => { | |
console.log(task.title); | |
}); |
This file contains 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
<script> | |
import { createEventDispatcher } from "svelte"; | |
import Button from "./Button.svelte"; | |
const dispatch = createEventDispatcher(); | |
function closeModal() { | |
dispatch("cancel"); | |
} | |
</script> |
This file contains 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
<script> | |
import Modal from "../UIComponent/Modal.svelte"; | |
import Button from "../UIComponent/Button.svelte"; | |
import TaskItems from "./task-store"; | |
import { writable } from "svelte/store"; | |
import { onDestroy, onMount } from "svelte"; | |
// import { debug } from "svelte/internal"; | |
//progress variable | |
let progress = writable(0); |
This file contains 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
//flutter expose to use | |
import 'package:flutter/material.dart'; | |
import './result.dart'; | |
import './quiz.dart'; | |
//entry for the application | |
void main() => runApp(MyApp()); | |
//When external input data change, StatefulWidget should be rebuilt basically | |
//Why does it have two classes(MyApp, MyAppState) |
This file contains 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'; | |
import './question.dart'; | |
import './answer.dart'; | |
class Quiz extends StatelessWidget { | |
final List<Map<String, Object>> questions; | |
final int questionIndex; | |
final Function answerQuestion; |
This file contains 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'; | |
class Result extends StatelessWidget { | |
final int resultScore; | |
final Function resetHandler; | |
Result(this.resultScore, this.resetHandler); | |
String get resultPhrase { | |
String resultText; |
This file contains 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/cupertino.dart'; | |
class Question extends StatelessWidget { | |
final String questionText; | |
Question(this.questionText) {} | |
@override | |
Widget build(BuildContext context) { | |
// container take full size of screen now |
OlderNewer