From c1f1e4e78a88a0d375800468b55eb44ec7c11664 Mon Sep 17 00:00:00 2001 From: broodjeaap89 Date: Thu, 8 Jul 2021 21:29:43 +0200 Subject: [PATCH] finished initial setup of 'primary' info of a new pizza event --- lib/pages/AddPlannedPizzaPage.dart | 136 +++++++++++++++++------------ pubspec.yaml | 3 +- 2 files changed, 82 insertions(+), 57 deletions(-) diff --git a/lib/pages/AddPlannedPizzaPage.dart b/lib/pages/AddPlannedPizzaPage.dart index 532d572..c7871d0 100644 --- a/lib/pages/AddPlannedPizzaPage.dart +++ b/lib/pages/AddPlannedPizzaPage.dart @@ -1,6 +1,7 @@ import 'package:flutter/cupertino.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 { @override @@ -11,7 +12,7 @@ class AddPlannedPizzaPageState extends State { String name = ""; String pizzaType = "Neapolitan"; int pizzaCount = 1; - int doughballSize = 200; + int doughBallSize = 250; @override Widget build(BuildContext context) { return Scaffold( @@ -22,66 +23,89 @@ class AddPlannedPizzaPageState extends State { 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() - ), - Column( + Row( 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), + Icon(Icons.title), + Container(width: 25), + Expanded( + child: TextField( + decoration: InputDecoration( + hintText: "Event Name" + ), + onChanged: (String newName) { + setState(() { + name = newName; + }); + }, ), ) ] ), - 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), - ), - ) - ] + 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()) + ) + ] + ), + ] ) ) diff --git a/pubspec.yaml b/pubspec.yaml index 30dba4d..c5deed4 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -28,7 +28,8 @@ dependencies: 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 + cupertino_icons: ^1.0.3 + fluttericon: ^2.0.0 dev_dependencies: flutter_test: