update

parent ebc14b30
...@@ -10,6 +10,7 @@ class Favorite extends StatefulWidget { ...@@ -10,6 +10,7 @@ class Favorite extends StatefulWidget {
class _FavoriteState extends State<Favorite> { class _FavoriteState extends State<Favorite> {
bool checkBoxValue = false; bool checkBoxValue = false;
int a = 1;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
...@@ -44,7 +45,7 @@ class _FavoriteState extends State<Favorite> { ...@@ -44,7 +45,7 @@ class _FavoriteState extends State<Favorite> {
), ),
color: Color(0xFF3694A3), color: Color(0xFF3694A3),
child: Text( child: Text(
'ยืนยัน', 'เพิ่มลงในตระกร้าของฉัน',
style: TextStyle( style: TextStyle(
fontSize: SizeConfig.getFontSize(16), fontSize: SizeConfig.getFontSize(16),
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
...@@ -247,13 +248,17 @@ class _FavoriteState extends State<Favorite> { ...@@ -247,13 +248,17 @@ class _FavoriteState extends State<Favorite> {
child: Text('-'), child: Text('-'),
padding: padding:
EdgeInsets.only(right: 0), EdgeInsets.only(right: 0),
onPressed: () {}, onPressed: () {
setState(() {
a=a-1;
});
},
), ),
), ),
Padding( Padding(
padding: const EdgeInsets.only( padding: const EdgeInsets.only(
right: 8, left: 8), right: 8, left: 8),
child: Text('1'), child: Text('$a'),
), ),
SizedBox( SizedBox(
width: 20.0, width: 20.0,
...@@ -262,7 +267,9 @@ class _FavoriteState extends State<Favorite> { ...@@ -262,7 +267,9 @@ class _FavoriteState extends State<Favorite> {
child: Text('+'), child: Text('+'),
padding: padding:
EdgeInsets.only(right: 0), EdgeInsets.only(right: 0),
onPressed: () {}, onPressed: () {
a=a+1;
},
), ),
), ),
], ],
......
...@@ -11,6 +11,9 @@ class Payment extends StatefulWidget { ...@@ -11,6 +11,9 @@ class Payment extends StatefulWidget {
} }
class _PaymentState extends State<Payment> { class _PaymentState extends State<Payment> {
int a = 1;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
SizeConfig(context); SizeConfig(context);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment