diff --git a/lib/pages/AddPlannedPizzaPage.dart b/lib/pages/AddPlannedPizzaPage.dart index f957e48..532d572 100644 --- a/lib/pages/AddPlannedPizzaPage.dart +++ b/lib/pages/AddPlannedPizzaPage.dart @@ -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 { 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 { value: pizzaType, isExpanded: true, onChanged: (String? newType) { - setState(() { - pizzaType = newType!; - }); + setState(() => pizzaType = newType!); }, items: ["Neapolitan", "New York", "Chicago"] .map>((String v) { @@ -46,7 +47,41 @@ class AddPlannedPizzaPageState extends State { ); }).toList() ), - + Column( + children: [ + 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: [ + 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), + ), + ) + ] + ), ] ) ) diff --git a/pubspec.yaml b/pubspec.yaml index 4964c6f..30dba4d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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