import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class AddPlannedPizzaPage extends StatefulWidget { @override AddPlannedPizzaPageState createState() => AddPlannedPizzaPageState(); } class AddPlannedPizzaPageState extends State { String name = ""; String pizzaType = "Neapolitan"; @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text("Add Planned Pizza"), ), body: Container( padding: EdgeInsets.fromLTRB(40, 10, 40, 10), child: Column( children: [ TextField( decoration: InputDecoration( hintText: "Event Name" ), onChanged: (String newName) { setState(() { name = newName; }); }, ), DropdownButton( icon: const Icon(Icons.arrow_downward), value: pizzaType, isExpanded: true, onChanged: (String? newType) { setState(() { pizzaType = newType!; }); }, items: ["Neapolitan", "New York", "Chicago"] .map>((String v) { return DropdownMenuItem( value: v, child: Text(v) ); }).toList() ), ] ) ) ); } }