Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help to create an application using Flutter, under main.dart file, the task is to develope a simple form that a user can use

I need help to create an application using Flutter, under main.dart file, the task is to develope a simple form that a user can use to create as many instances of a particular shape.
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
The app should look like this:
image text in transcribed
Whenever you change the values it adds a new rectangle and does the calculation based on the entered values. The reset show remove the entire table as shown.
image text in transcribed
Pick one of these 5 shapes for your own application: rectangle, rhombus, triangle, cylinder or cuboid. Each of these shapes can be fully characterized using 2 or 3 geometrical dimensions. For a 2D shape, we can calculate perimeter and area, while for a 3D shape we can calculate surface area \& volume. As the user uses our form to enter the necessary dimensions for the shape, our app creates the shape and displays all created shapes in some form. The list also shows the calculated shape properties; perimeter, area, volume, ... etc. A. Class (the model) In your main.dart, define a class for the shape you picked. The class must have the following: - instance variables for the necessary geometrical dimensions - a constructor that protects again invalid dimensions by setting them to an acceptable default value - methods to calculate perimeter \& area for a 2D shape or area \& volume for a 3D shape B. Form + List (the view) Create a simple form with the following: - 2 or 3 numerical fields for entering the necessary geometrical dimensions (accept non-zero positive values only) - 1 button to create a new shape - 1 button to reset all shapes The app should have some list arrangement (up to you how to design it) that shows all shapes created by the user including dimensions \& calculated properties. When the user enters valid dimensions, a new shape should be created and added to the list of displayed shapes. When the user enters invalid dimensions, the form should show error messages : As shapes are added to the display list, the shapes with the largest perimeter/area (2D) or area/volume (3D) should be highlighted in the table somehow. Remember, the 2D shape with largest perimeter doesn't necessarily have to be the one with largest area. When the user presses the "reset" button, all shapes are cleared \& the view is reset. Technical Requirements Create a new Flutter project called "Lab5". The app should satisfy the following: 1. Uses some shape class to define objects from that class 2. Has a well designed form with necessary fields and buttons 3. Displays the created shapes 4. Don't use any external packages Rectangles Wiatia 1 Length 8 Anhiectanole Areset \begin{tabular}{|c|c|c|c|} \hline Wath & Length & Perimeter & Nese \\ \hline 5 & 5 & 20 & 25 \\ \hline 2 & 5 & 14 & 10 \\ \hline 2 & 8 & 20 & 16 \\ \hline 1 & 8 & 18 & 8 \\ \hline \end{tabular} \begin{tabular}{|l|l|l|} \hline 1 & 2 & 3 \\ \hline 4 & 5 & 6 \\ \hline 7 & 8 & 9 \\ \hline, & 0 &. \\ \hline & & \\ \hline & & \\ \hline \end{tabular} Rectangles Weth 6) Add Rectangle Ainse \begin{tabular}{|c|c|c|c|c} \hline 1 & 2 & 3 & \\ \hline 4 & 5 & 6 & \\ \hline 7 & 8 & 9 & \\ \hline, & 0 & & \\ \hline & & 0 & & = \\ \hline & & & \\ \hline \end{tabular} Pick one of these 5 shapes for your own application: rectangle, rhombus, triangle, cylinder or cuboid. Each of these shapes can be fully characterized using 2 or 3 geometrical dimensions. For a 2D shape, we can calculate perimeter and area, while for a 3D shape we can calculate surface area \& volume. As the user uses our form to enter the necessary dimensions for the shape, our app creates the shape and displays all created shapes in some form. The list also shows the calculated shape properties; perimeter, area, volume, ... etc. A. Class (the model) In your main.dart, define a class for the shape you picked. The class must have the following: - instance variables for the necessary geometrical dimensions - a constructor that protects again invalid dimensions by setting them to an acceptable default value - methods to calculate perimeter \& area for a 2D shape or area \& volume for a 3D shape B. Form + List (the view) Create a simple form with the following: - 2 or 3 numerical fields for entering the necessary geometrical dimensions (accept non-zero positive values only) - 1 button to create a new shape - 1 button to reset all shapes The app should have some list arrangement (up to you how to design it) that shows all shapes created by the user including dimensions \& calculated properties. When the user enters valid dimensions, a new shape should be created and added to the list of displayed shapes. When the user enters invalid dimensions, the form should show error messages : As shapes are added to the display list, the shapes with the largest perimeter/area (2D) or area/volume (3D) should be highlighted in the table somehow. Remember, the 2D shape with largest perimeter doesn't necessarily have to be the one with largest area. When the user presses the "reset" button, all shapes are cleared \& the view is reset. Technical Requirements Create a new Flutter project called "Lab5". The app should satisfy the following: 1. Uses some shape class to define objects from that class 2. Has a well designed form with necessary fields and buttons 3. Displays the created shapes 4. Don't use any external packages Rectangles Wiatia 1 Length 8 Anhiectanole Areset \begin{tabular}{|c|c|c|c|} \hline Wath & Length & Perimeter & Nese \\ \hline 5 & 5 & 20 & 25 \\ \hline 2 & 5 & 14 & 10 \\ \hline 2 & 8 & 20 & 16 \\ \hline 1 & 8 & 18 & 8 \\ \hline \end{tabular} \begin{tabular}{|l|l|l|} \hline 1 & 2 & 3 \\ \hline 4 & 5 & 6 \\ \hline 7 & 8 & 9 \\ \hline, & 0 &. \\ \hline & & \\ \hline & & \\ \hline \end{tabular} Rectangles Weth 6) Add Rectangle Ainse \begin{tabular}{|c|c|c|c|c} \hline 1 & 2 & 3 & \\ \hline 4 & 5 & 6 & \\ \hline 7 & 8 & 9 & \\ \hline, & 0 & & \\ \hline & & 0 & & = \\ \hline & & & \\ \hline \end{tabular}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts of Database Management

Authors: Philip J. Pratt, Mary Z. Last

8th edition

1285427106, 978-1285427102

More Books

Students also viewed these Databases questions

Question

3. I know I will be able to learn the material for this class.

Answered: 1 week ago