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> | |
| <title>Quick and Easy Authentication with useAuth()</title> | |
| <meta charset="utf-8"> | |
| <style> | |
| @import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz); | |
| @import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic); | |
| @import url(https://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700,400italic); |
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
| /// imports widgets from the material design | |
| import 'package:flutter/material.dart'; | |
| void main() => runApp(TodoApp()); | |
| /// Stateless widgets must implement the build() method and return a widget. | |
| /// The first parameter passed to build function is the context in which this widget is built | |
| class TodoApp extends StatelessWidget { | |
| @override | |
| Widget build(BuildContext context) { |
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
| class Todo { | |
| final String label; | |
| bool completed; | |
| Todo(this.label, this.completed); | |
| } |
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
| /// State is composed all the variables declared in the State implementation of a Stateful widget | |
| class TodoListState extends State<TodoList> { | |
| final List<Todo> todos = List<Todo>(); | |
| @override | |
| Widget build(BuildContext context) { | |
| return Scaffold( | |
| appBar: AppBar( | |
| title: Text('Todo'), | |
| ), | |
| body: Padding( |
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
| floatingActionButton: FloatingActionButton( | |
| child: Icon(Icons.add), /// uses the built-in icons | |
| onPressed: () => _promptDialog(context), | |
| ), |
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
| /// display a dialog that accepts text | |
| _promptDialog(BuildContext context) { | |
| String _todoLabel = ''; | |
| return showDialog( | |
| context: context, | |
| builder: (context) { | |
| return AlertDialog( | |
| title: Text('Enter TODO item'), | |
| content: TextField( | |
| onChanged: (value) => _todoLabel = value, |
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'; | |
| import 'dart:math'; | |
| void main() => runApp(MyApp()); | |
| class MyApp extends StatelessWidget { | |
| final Random random = new Random(); | |
| @override | |
| Widget build(BuildContext context) { | |
| return MaterialApp( |
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:flutter/material.dart'; | |
| import 'package:url_launcher/url_launcher.dart'; | |
| import 'package:splashscreen/splashscreen.dart'; | |
| import 'package:http/http.dart' as http; | |
| void main() => runApp(MyApp()); | |
| Color getColorFromHex(String hexColor) { |
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
| export NVM_DIR="$HOME/.nvm" | |
| [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm | |
| # edit this file | |
| alias srcedit='nano +99999 ~/.zshrc && source ~/.zshrc' | |
| alias srcupdate='source ~/.zshrc' | |
| # npm | |
| alias npms='npm run start' | |
| alias npmd='npm run start:development' |
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
| export default class CounterApp extends React.Component { | |
| constructor(props) { | |
| super(props); | |
| this.state = { count: 0 }; | |
| } | |
| render() { | |
| return ( | |
| <div className="App"> | |
| <button | |
| onClick={() => { |