Skip to content

Instantly share code, notes, and snippets.

Avatar

Aaron K Saunders aaronksaunders

View GitHub Profile
View 2-MessageListItem.stories.js
import React from "react";
import { action } from "@storybook/addon-actions";
import MessageListItem from "../components/MessageListItem";
import { IonList } from "@ionic/react";
export default {
title: "MessageListItem",
component: MessageListItem,
};
@aaronksaunders
aaronksaunders / Home.tsx
Created Apr 23, 2020
Ionic Native Plugins in ReactJS with Capacitor
View Home.tsx
import React from "react";
import {
IonContent,
IonHeader,
IonPage,
IonTitle,
IonToolbar,
IonButton,
} from "@ionic/react";
import "./Home.css";
@aaronksaunders
aaronksaunders / App.tsx
Created Mar 11, 2020
Typscript version of react-hook-form code with Ionic Framework
View App.tsx
import React, { useState } from "react";
import {
IonApp,
IonPage,
IonHeader,
IonContent,
IonItem,
IonLabel,
IonInput,
IonRadioGroup,
@aaronksaunders
aaronksaunders / Markdium-Dart.dart
Created Jun 19, 2019
Markdium-Flutter Tabs w/ State Management
View Markdium-Dart.dart
void main() => runApp(
ChangeNotifierProvider(
child: TabBarDemo(),
builder: (BuildContext context) {
return CartModel();
},
),
);
@aaronksaunders
aaronksaunders / Markdium-Dart.dart
Created Jun 19, 2019
Markdium-Flutter Tabs w/ State Management
View Markdium-Dart.dart
class TabBarDemo extends StatelessWidget {
@override
Widget build(BuildContext context) {
var count = Provider.of(context).items.length;
@aaronksaunders
aaronksaunders / Markdium-Dart.dart
Created Jun 19, 2019
Markdium-Flutter Tabs w/ State Management
View Markdium-Dart.dart
RaisedButton(
child: Text("Add Item"),
onPressed: () async {
final form = _formKey.currentState;
form.save();
if (form.validate()) {
Provider.of(context)
.add(new Item(_name, num.parse(_price)));
} else {
print('validate failed');
@aaronksaunders
aaronksaunders / Markdium-Dart.dart
Created Jun 19, 2019
Markdium-Flutter Tabs w/ State Management
View Markdium-Dart.dart
import 'dart:collection';
import 'package:flutter/material.dart';
class Item {
String name;
num price;
Item(this.name, this.price);
}
@aaronksaunders
aaronksaunders / Markdium-Dart.dart
Created Jun 19, 2019
Markdium-Flutter Tabs w/ State Management
View Markdium-Dart.dart
RaisedButton(
child: Text("Add Item"),
onPressed: () async {
final form = _formKey.currentState;
form.save();
if (form.validate()) {
Provider.of(context)
.add(new Item(_name, num.parse(_price)));
} else {
print('validate failed');
@aaronksaunders
aaronksaunders / Markdium-Dart.dart
Created Jun 19, 2019
Markdium-Flutter Tabs w/ State Management
View Markdium-Dart.dart
class TabBarDemo extends StatelessWidget {
@override
Widget build(BuildContext context) {
var count = Provider.of(context).items.length;
@aaronksaunders
aaronksaunders / Markdium-Dart.dart
Created Jun 19, 2019
Markdium-Flutter Tabs w/ State Management
View Markdium-Dart.dart
import 'dart:collection';
import 'package:flutter/material.dart';
class Item {
String name;
num price;
Item(this.name, this.price);
}