Skip to content

Instantly share code, notes, and snippets.

View androidfanatic's full-sized avatar
🏠
Working from home

ManishRaj androidfanatic

🏠
Working from home
View GitHub Profile
<Button onTap={() => {
this.nextPage();
}}>Next<Button>
<button
onClick={() => {
this.setState({ count: this.state.count + 1 });
}}>
COUNT ({this.state.count})
</button>
render() {
return (
<ListView
items={items}
render={({ item }) => (<div>{item.label}</div>)}
/>
);
}
export default class CounterApp extends React.Component {
constructor(props) {
super(props);
this.state = { count: 0 };
}
render() {
return (
<div className="App">
<button
onClick={() => {
@androidfanatic
androidfanatic / .bashrc
Last active October 3, 2022 01:51
.bashrc
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'
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) {
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(
/// 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,
floatingActionButton: FloatingActionButton(
child: Icon(Icons.add), /// uses the built-in icons
onPressed: () => _promptDialog(context),
),
/// 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(