added ingredients list and dropdown textfield
This commit is contained in:
45
lib/widgets/ingredients_list.dart
Normal file
45
lib/widgets/ingredients_list.dart
Normal file
@@ -0,0 +1,45 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class IngredientsList extends StatefulWidget {
|
||||
const IngredientsList({super.key});
|
||||
|
||||
@override
|
||||
State<IngredientsList> createState() => _IngredientsListState();
|
||||
}
|
||||
|
||||
class _IngredientsListState extends State<IngredientsList> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Expanded(
|
||||
child: ListView.builder(
|
||||
itemCount: 2,
|
||||
itemBuilder: _ingredientsBuilder,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget? _ingredientsBuilder(BuildContext context, int index) {
|
||||
final screenWidth = MediaQuery.of(context).size.width;
|
||||
return Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: screenWidth / 4,
|
||||
child: const TextField(
|
||||
decoration: InputDecoration(
|
||||
label: Text('Ingredient'),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: screenWidth / 4,
|
||||
child: const TextField(
|
||||
decoration: InputDecoration(
|
||||
label: Text('Count'),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user