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
// PlayerMotor | |
private Vector3 rotation = Vector3.zero; | |
// Gets a rotational vector | |
public void Rotate(Vector3 _rotation){ | |
rotation = _rotation; | |
} | |
void FixedUpdate (){ |
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
// PlayerController.cs | |
using UnityEngine; | |
[RequireComponent(typeof(PlayerMotor))] | |
public class PlayerController : MonoBehaviour { | |
[SerializeField] //will show up on the inspector, however, still having the protection as a private variable | |
private float speed = 5f; |
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
// Player Motor | |
private Vector3 cameraRotation = Vector3.zero; | |
public void RotateCamera(Vector3 _cameraRotation){ | |
cameraRotation = _cameraRotation; | |
} | |
void PerformRotation () { | |
rb.MoveRotation (rb.rotation * Quaternion.Euler (rotation)); |
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 './pages/landing_page.dart'; | |
void main() { | |
runApp(Tododo()); | |
} | |
class Tododo extends StatelessWidget { | |
@override | |
Widget build(BuildContext context){ |
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
class EditTodoPage extends StatefulWidget{ | |
final Map<String, String> todo; | |
final String todoID; | |
EditTodoPage({Key key, this.todo, this.todoID}) : super (key: key); | |
// Optional parameters, global key, | |
} |
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
Future _showAlert(data) async{ | |
return showDialog<Null>( | |
context: context, | |
barrierDismissible: true, | |
builder: (BuildContext context) { | |
return new AlertDialog( | |
title: new Text('Would you like to make changes?', style: new TextStyle(fontSize: 17.0)), | |
actions: <Widget>[ | |
new FlatButton( | |
child: new Text('Edit'), |
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
class EditTodoPageState extends State<EditTodoPage> { | |
String selectedTodoId; | |
DocumentReference documentReference = Firestore.instance.collection('todo_list').document(); | |
@override | |
void initState(){ | |
selectedTodoId = widget.todoID; | |
documentReference = Firestore.instance.collection('todo_list').document(selectedTodoId); | |
super.initState(); | |
} |
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
return new StreamBuilder<QuerySnapshot>( | |
stream: Firestore.instance.collection('todo_list').where('finished', isEqualTo: false).snapshots, | |
builder: (BuildContext context, AsyncSnapshot<QuerySnapshot> snapshot) { | |
if (!snapshot.hasData) return new Text('Loading...'); | |
return new ListView( | |
children: snapshot.data.documents.map((DocumentSnapshot document) { | |
return new ListTile( | |
title: new Row( | |
children: <Widget>[ | |
new Expanded(child: new Text(document['task'])), |
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 'package:flutter/gestures.dart'; | |
void main() => runApp(new MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return new MaterialApp( | |
theme: new ThemeData( |
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 React from 'react'; | |
import { StyleSheet, Text, View, Button, FlatList, TouchableOpacity } from 'react-native'; | |
// import { FontAwesome } from '@expo/vector-icons'; | |
import { Icon } from 'react-native-elements'; | |
class FinalProject extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { |
OlderNewer