Skip to content

Instantly share code, notes, and snippets.

@McLarenCollege
McLarenCollege / questions.dart
Created Oct 7, 2019
Questions for Day 6 App
View questions.dart
Question('The Mahabharata is a part of The Bhagavad Gita', false),
Question('The National Security Guards are also known as Black Cat Commandos due to their uniforms.', true),
Question('Approximately one quarter of human bones are in the feet.', true),
Question('The Census in India occur after every 8 years.', false),
Question('The Indian Penal Code came into operation on 1st January, 1862', true),
Question('It is illegal to pee in the Ocean in Portugal.', true),
Question(
'No piece of square dry paper can be folded in half more than 7 times.',
false),
Question(
View Catchup QuizApp.dart
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
void main() {
runApp(Quizlr());
}
class Quizlr extends StatelessWidget {
@override
Widget build(BuildContext context) {
View BareBone.dart
import 'package:flutter/material.dart';
class InputPage extends StatefulWidget {
@override
_InputPageState createState() => _InputPageState();
}
class _InputPageState extends State<InputPage> {
Container dummy = Container(
margin: EdgeInsets.all(12),
View Catchup BMI P1.dart
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
class InputPage extends StatefulWidget {
@override
_InputPageState createState() => _InputPageState();
}
class _InputPageState extends State<InputPage> {
int gender; // Male = 0, Female = 1
@McLarenCollege
McLarenCollege / kismet_story.json
Created Oct 15, 2019
Kismet story in JSON form
View kismet_story.json
[
{
"storyNumber": 0,
"story": "You have gone on a trek with your friends but got lost in the forest. You don't have any devices and it is now pitch dark. You are wandering in hope to see another human, and suddenly you see a wooden cabin with some fire light. Would you go and knock the door of the cabin?\".",
"choice1": "I'll go to the cabin and ask for help",
"choice1_result": 1,
"choice2": "I'll ignore the cabin because who possibly can live in the middle of a Jungle",
"choice2_result": 3
},
{
View network_helper.dart
import 'dart:convert';
import 'package:http/http.dart';
class NetworkHelper {
String url;
final String api_key = '4f7b32dc58f4ac156caec77d106358f8';
NetworkHelper(this.url);
// 'https://api.openweathermap.org/daa/2.5/weather?lat=${location.latitude}&lon=${location.longitude}&appid=$api_key'
View gist:230d55166d8cba137919c0e66d726cdc
import 'package:flutter/material.dart';
import "package:flutter_test/flutter_test.dart";
import 'package:tic_tac_toe_starter/gamelogic.dart';
void main() {
test("test fullBoard", () {
List<List<Icon>> board = [
[null, null, null],
[null, null, null],
[null, null, null]
View animation_catchup.dart
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Animation Demo',
home: Center(
View TicTacRefactoredMain.dart
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'gamelogic.dart';
//import 'package:flutter/animation.dart';
void main() {
// List<List<Icon>> board = [
// [null, null, null],
View GameLogic.dart
// import 'package:flutter/material.dart';
enum Token {
x, o
}
List<List<Token>> board = [
[null, null, null],
[null, null, null],