finished initial setup of 'primary' info of a new pizza event

This commit is contained in:
broodjeaap89 2021-07-08 21:29:43 +02:00
parent c43a4b7264
commit c1f1e4e78a
2 changed files with 82 additions and 57 deletions

View file

@ -1,6 +1,7 @@
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:numberpicker/numberpicker.dart'; import 'package:flutter/services.dart';
import 'package:fluttericon/font_awesome5_icons.dart';
class AddPlannedPizzaPage extends StatefulWidget { class AddPlannedPizzaPage extends StatefulWidget {
@override @override
@ -11,7 +12,7 @@ class AddPlannedPizzaPageState extends State<AddPlannedPizzaPage> {
String name = ""; String name = "";
String pizzaType = "Neapolitan"; String pizzaType = "Neapolitan";
int pizzaCount = 1; int pizzaCount = 1;
int doughballSize = 200; int doughBallSize = 250;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
@ -22,7 +23,12 @@ class AddPlannedPizzaPageState extends State<AddPlannedPizzaPage> {
padding: EdgeInsets.fromLTRB(40, 10, 40, 10), padding: EdgeInsets.fromLTRB(40, 10, 40, 10),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
TextField( Row(
children: <Widget>[
Icon(Icons.title),
Container(width: 25),
Expanded(
child: TextField(
decoration: InputDecoration( decoration: InputDecoration(
hintText: "Event Name" hintText: "Event Name"
), ),
@ -32,10 +38,16 @@ class AddPlannedPizzaPageState extends State<AddPlannedPizzaPage> {
}); });
}, },
), ),
DropdownButton<String>( )
icon: const Icon(Icons.arrow_downward), ]
),
Row(
children: <Widget>[
Icon(FontAwesome5.pizza_slice),
Container(width: 25),
Expanded(
child: DropdownButton<String>(
value: pizzaType, value: pizzaType,
isExpanded: true,
onChanged: (String? newType) { onChanged: (String? newType) {
setState(() => pizzaType = newType!); setState(() => pizzaType = newType!);
}, },
@ -47,41 +59,53 @@ class AddPlannedPizzaPageState extends State<AddPlannedPizzaPage> {
); );
}).toList() }).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( Row(
children: <Widget>[ children: <Widget>[
Text("Doughball Size: "), Icon(FontAwesome5.hashtag),
NumberPicker( Expanded(
value: doughballSize, child: Slider(
minValue: 100, value: pizzaCount.toDouble(),
maxValue: 10000, min: 1,
step: 10, max: 20,
itemHeight: 30, divisions: 19,
axis: Axis.horizontal, label: this.pizzaCount.toString(),
onChanged: (newDoughballSize) => setState(() => this.doughballSize = newDoughballSize), onChanged: (double newPizzaCount) {
decoration: BoxDecoration( setState(() {this.pizzaCount = newPizzaCount.round();});
borderRadius: BorderRadius.circular(16), },
border: Border.all(color: Colors.black26), )
), ),
Container(
width: 25,
child: Text(this.pizzaCount.toString())
) )
] ]
), ),
Row(
children: <Widget>[
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())
)
]
),
] ]
) )
) )

View file

@ -28,7 +28,8 @@ dependencies:
numberpicker: ^2.1.1 numberpicker: ^2.1.1
# The following adds the Cupertino Icons font to your application. # The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons. # Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2 cupertino_icons: ^1.0.3
fluttericon: ^2.0.0
dev_dependencies: dev_dependencies:
flutter_test: flutter_test: