animated_item_action 0.0.1 animated_item_action: ^0.0.1 copied to clipboard
A Very Good Project created by Very Good CLI.
import 'package:example/src/item_card.dart';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Animated Item Menu Example',
theme: ThemeData(useMaterial3: true),
home: MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key});
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
int price = 1199;
int qty = 1;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Animated Item Menu Example'),
),
body: Center(
child: ItemCard(
qty: qty,
price: price,
onQtyChange: (int value) {
qty = value;
setState(() {});
},
),
),
);
}
}