sprint-1 #1
@ -10,10 +10,15 @@ class CategoriesWidget extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _CategoriesWidgetState extends State<CategoriesWidget> {
|
class _CategoriesWidgetState extends State<CategoriesWidget> {
|
||||||
|
late String selectedItem;
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
selectedItem = widget.itemsList[0];
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
String selectedItem = widget.itemsList[0];
|
|
||||||
|
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
width: width(context) * 100,
|
width: width(context) * 100,
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
@ -27,6 +32,7 @@ class _CategoriesWidgetState extends State<CategoriesWidget> {
|
|||||||
return Chips(
|
return Chips(
|
||||||
onPressed: () => {
|
onPressed: () => {
|
||||||
setState(() {
|
setState(() {
|
||||||
|
print(currentItem);
|
||||||
selectedItem = currentItem;
|
selectedItem = currentItem;
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user