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
/** | |
* called when an item in the ListView is clicked; we will get the section | |
* index, and addition event information | |
* | |
* @param {Object} _event | |
*/ | |
function loadMoreBtnClicked(_event) { | |
alert('not implemented yet'); | |
} |
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
void main() => runApp( | |
ChangeNotifierProvider( | |
child: TabBarDemo(), | |
builder: (BuildContext context) { | |
return CartModel(); | |
}, | |
), | |
); |
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 TabBarDemo extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
var count = Provider.of(context).items.length; |
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
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'); |
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:collection'; | |
import 'package:flutter/material.dart'; | |
class Item { | |
String name; | |
num price; | |
Item(this.name, this.price); | |
} |
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
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'); |
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 TabBarDemo extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
var count = Provider.of(context).items.length; |
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:collection'; | |
import 'package:flutter/material.dart'; | |
class Item { | |
String name; | |
num price; | |
Item(this.name, this.price); | |
} |
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
void main() => runApp( | |
ChangeNotifierProvider( | |
child: TabBarDemo(), | |
builder: (BuildContext context) { | |
return CartModel(); | |
}, | |
), | |
); |
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
// FILE: App.tsx | |
} /> |