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
<Button onTap={() => { | |
this.nextPage(); | |
}}>Next<Button> |
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
<button | |
onClick={() => { | |
this.setState({ count: this.state.count + 1 }); | |
}}> | |
COUNT ({this.state.count}) | |
</button> |
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
render() { | |
return ( | |
<ListView | |
items={items} | |
render={({ item }) => (<div>{item.label}</div>)} | |
/> | |
); | |
} |
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
export default class CounterApp extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { count: 0 }; | |
} | |
render() { | |
return ( | |
<div className="App"> | |
<button | |
onClick={() => { |
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
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 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 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 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 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 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( |