import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:fluttericon/font_awesome5_icons.dart'; class AddPizzaEventPage extends StatefulWidget { @override AddPizzaEventPageState createState() => AddPizzaEventPageState(); } class AddPizzaEventPageState extends State { String name = ""; String pizzaType = "Neapolitan"; int pizzaCount = 1; int doughBallSize = 250; @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text("Add Pizza Event"), ), body: Container( padding: EdgeInsets.fromLTRB(40, 10, 40, 10), child: Column( children: [ Row( children: [ Icon(Icons.title), Container(width: 25), Expanded( child: TextField( decoration: InputDecoration( hintText: "Event Name" ), onChanged: (String newName) { setState(() { name = newName; }); }, ), ) ] ), Row( children: [ Icon(FontAwesome5.pizza_slice), Container(width: 25), Expanded( child: DropdownButton( value: pizzaType, onChanged: (String? newType) { setState(() => pizzaType = newType!); }, items: ["Neapolitan", "New York", "Chicago"] .map>((String v) { return DropdownMenuItem( value: v, child: Text(v) ); }).toList() ), ) ] ), Row( children: [ Icon(FontAwesome5.hashtag), Expanded( child: Slider( value: pizzaCount.toDouble(), min: 1, max: 20, divisions: 19, label: this.pizzaCount.toString(), onChanged: (double newPizzaCount) { setState(() {this.pizzaCount = newPizzaCount.round();}); }, ) ), Container( width: 25, child: Text(this.pizzaCount.toString()) ) ] ), Row( children: [ Icon(FontAwesome5.weight_hanging), Expanded( child: Slider( value: doughBallSize.toDouble(), min: 100, max: 400, divisions: 30, label: this.doughBallSize.toString(), onChanged: (double newDoughBallSize) { setState(() {this.doughBallSize = newDoughBallSize.round();}); }, ) ), Container( width: 25, child: Text(this.doughBallSize.toString()) ) ] ), ] ) ) ); } }