In between commit with numberpickers for number of pizzas and doughball size
This commit is contained in:
parent
259a4d5ddf
commit
c43a4b7264
2 changed files with 40 additions and 4 deletions
|
@ -1,5 +1,6 @@
|
|||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:numberpicker/numberpicker.dart';
|
||||
|
||||
class AddPlannedPizzaPage extends StatefulWidget {
|
||||
@override
|
||||
|
@ -9,6 +10,8 @@ class AddPlannedPizzaPage extends StatefulWidget {
|
|||
class AddPlannedPizzaPageState extends State<AddPlannedPizzaPage> {
|
||||
String name = "";
|
||||
String pizzaType = "Neapolitan";
|
||||
int pizzaCount = 1;
|
||||
int doughballSize = 200;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
|
@ -34,9 +37,7 @@ class AddPlannedPizzaPageState extends State<AddPlannedPizzaPage> {
|
|||
value: pizzaType,
|
||||
isExpanded: true,
|
||||
onChanged: (String? newType) {
|
||||
setState(() {
|
||||
pizzaType = newType!;
|
||||
});
|
||||
setState(() => pizzaType = newType!);
|
||||
},
|
||||
items: <String>["Neapolitan", "New York", "Chicago"]
|
||||
.map<DropdownMenuItem<String>>((String v) {
|
||||
|
@ -46,7 +47,41 @@ class AddPlannedPizzaPageState extends State<AddPlannedPizzaPage> {
|
|||
);
|
||||
}).toList()
|
||||
),
|
||||
|
||||
Column(
|
||||
children: <Widget>[
|
||||
Text("# Of Pizzas: "),
|
||||
NumberPicker(
|
||||
value: pizzaCount,
|
||||
minValue: 1,
|
||||
maxValue: 1000,
|
||||
itemHeight: 30,
|
||||
axis: Axis.horizontal,
|
||||
onChanged: (newPizzaCount) => setState(() => this.pizzaCount = newPizzaCount),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
border: Border.all(color: Colors.black26),
|
||||
),
|
||||
)
|
||||
]
|
||||
),
|
||||
Column(
|
||||
children: <Widget>[
|
||||
Text("Doughball Size: "),
|
||||
NumberPicker(
|
||||
value: doughballSize,
|
||||
minValue: 100,
|
||||
maxValue: 10000,
|
||||
step: 10,
|
||||
itemHeight: 30,
|
||||
axis: Axis.horizontal,
|
||||
onChanged: (newDoughballSize) => setState(() => this.doughballSize = newDoughballSize),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
border: Border.all(color: Colors.black26),
|
||||
),
|
||||
)
|
||||
]
|
||||
),
|
||||
]
|
||||
)
|
||||
)
|
||||
|
|
|
@ -25,6 +25,7 @@ dependencies:
|
|||
sdk: flutter
|
||||
|
||||
intl: ^0.17.0
|
||||
numberpicker: ^2.1.1
|
||||
# The following adds the Cupertino Icons font to your application.
|
||||
# Use with the CupertinoIcons class for iOS style icons.
|
||||
cupertino_icons: ^1.0.2
|
||||
|
|
Loading…
Add table
Reference in a new issue