Created
September 9, 2022 11:52
-
-
Save mherman22/4d5a1b3abfbb6dfa3f228ae38b2db277 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
class CreateProfilePage extends StatefulWidget { | |
const CreateProfilePage({super.key}); | |
@override | |
State<CreateProfilePage> createState() => _CreateProfilePageState(); | |
} | |
class _CreateProfilePageState extends State<CreateProfilePage> { | |
int currentStep = 0; | |
final firstName = TextEditingController(); | |
final middleName = TextEditingController(); | |
final lastName = TextEditingController(); | |
final nameOfllc = TextEditingController(); | |
final dob = TextEditingController(); | |
final ssn = TextEditingController(); | |
final city = TextEditingController(); | |
final state = TextEditingController(); | |
final zipCode = TextEditingController(); | |
final driverLicenceNumber = TextEditingController(); | |
final email = TextEditingController(); | |
final cellPhone = TextEditingController(); | |
final workPhone = TextEditingController(); | |
final homePhone = TextEditingController(); | |
final ownersHomeAddress = TextEditingController(); | |
final lotSize = TextEditingController(); | |
final squareFeet = TextEditingController(); | |
final yearBuilt = TextEditingController(); | |
final unit = TextEditingController(); | |
final streetAddress = TextEditingController(); | |
final complexName = TextEditingController(); | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
body: Theme( | |
data: Theme.of(context).copyWith( | |
colorScheme: const ColorScheme.light(primary: Colors.teal), | |
), | |
child: Stepper( | |
steps: getSteps(), | |
currentStep: currentStep, | |
onStepContinue: () { | |
final isLastStep = currentStep == getSteps().length - 1; | |
if (isLastStep) { | |
debugPrint("completed"); | |
// this is where data is sent to the api | |
} else { | |
setState(() { | |
currentStep += 1; | |
}); | |
} | |
}, | |
onStepTapped: (value) => setState(() { | |
currentStep = value; | |
}), | |
onStepCancel: currentStep == 0 | |
? null | |
: () { | |
setState(() { | |
currentStep -= 1; | |
}); | |
}, | |
), | |
)); | |
} | |
// these are steps to followed when creating a user profile in the system | |
List<Step> getSteps() => [ | |
Step( | |
state: currentStep > 0 ? StepState.complete : StepState.indexed, | |
isActive: currentStep >= 0, | |
title: const Text("User Information"), | |
content: Column( | |
children: <Widget>[ | |
const Padding(padding: EdgeInsets.all(8)), | |
TextFormField( | |
controller: firstName, | |
decoration: const InputDecoration( | |
labelText: 'First Name', | |
), | |
), | |
TextFormField( | |
controller: middleName, | |
decoration: const InputDecoration( | |
labelText: 'Middle Name', | |
), | |
), | |
TextFormField( | |
controller: lastName, | |
decoration: const InputDecoration( | |
labelText: 'Last Name', | |
), | |
), | |
TextFormField( | |
controller: nameOfllc, | |
decoration: const InputDecoration( | |
labelText: 'Name of LLC or LLP (If Applicable)', | |
), | |
), | |
TextFormField( | |
controller: dob, | |
decoration: const InputDecoration( | |
labelText: 'Date Of Birth', | |
icon: Icon(Icons.calendar_month_rounded), | |
), | |
keyboardType: TextInputType.datetime, | |
), | |
TextFormField( | |
controller: ssn, | |
decoration: const InputDecoration( | |
labelText: 'Social Security Number', | |
), | |
), | |
TextFormField( | |
controller: driverLicenceNumber, | |
decoration: const InputDecoration( | |
labelText: 'Drivers Licence Number', | |
), | |
), | |
TextFormField( | |
controller: email, | |
decoration: const InputDecoration( | |
labelText: 'Email', | |
), | |
), | |
TextFormField( | |
controller: cellPhone, | |
decoration: const InputDecoration( | |
labelText: 'Cell Phone', | |
), | |
), | |
TextFormField( | |
controller: homePhone, | |
decoration: const InputDecoration( | |
labelText: 'Home Phone', | |
), | |
), | |
TextFormField( | |
controller: workPhone, | |
decoration: const InputDecoration( | |
labelText: 'Work Phone', | |
), | |
), | |
TextFormField( | |
controller: ownersHomeAddress, | |
decoration: const InputDecoration( | |
labelText: 'Owners Home Address', | |
), | |
), | |
], | |
), | |
), | |
Step( | |
state: currentStep > 0 ? StepState.complete : StepState.indexed, | |
isActive: currentStep >= 1, | |
title: const Text("OWNER PREFERENCES"), | |
content: Container(), | |
), | |
// Step( | |
// state: currentStep > 0 ? StepState.complete : StepState.indexed, | |
// isActive: currentStep >= 3, | |
// title: const Text("OWNER #2 INFORMATION"), | |
// content: Column( | |
// children: <Widget>[ | |
// const Padding(padding: EdgeInsets.all(8)), | |
// TextFormField( | |
// controller: firstName, | |
// decoration: const InputDecoration( | |
// labelText: 'First Name', | |
// ), | |
// ), | |
// TextFormField( | |
// controller: middleName, | |
// decoration: const InputDecoration( | |
// labelText: 'Middle Name', | |
// ), | |
// ), | |
// TextFormField( | |
// controller: lastName, | |
// decoration: const InputDecoration( | |
// labelText: 'Last Name', | |
// ), | |
// ), | |
// TextFormField( | |
// controller: nameOfllc, | |
// decoration: const InputDecoration( | |
// labelText: 'Name of LLC or LLP (If Applicable)', | |
// ), | |
// ), | |
// TextFormField( | |
// controller: dob, | |
// decoration: const InputDecoration( | |
// labelText: 'Date Of Birth', | |
// icon: Icon(Icons.calendar_month_rounded), | |
// ), | |
// ), | |
// TextFormField( | |
// controller: ssn, | |
// decoration: const InputDecoration( | |
// labelText: 'Social Security Number', | |
// ), | |
// ), | |
// TextFormField( | |
// controller: driverLicenceNumber, | |
// decoration: const InputDecoration( | |
// labelText: 'Drivers Licence Number', | |
// ), | |
// ), | |
// TextFormField( | |
// controller: email, | |
// decoration: const InputDecoration( | |
// labelText: 'Email', | |
// ), | |
// ), | |
// TextFormField( | |
// controller: cellPhone, | |
// decoration: const InputDecoration( | |
// labelText: 'Cell Phone', | |
// ), | |
// ), | |
// TextFormField( | |
// controller: homePhone, | |
// decoration: const InputDecoration( | |
// labelText: 'Home Phone', | |
// ), | |
// ), | |
// TextFormField( | |
// controller: workPhone, | |
// decoration: const InputDecoration( | |
// labelText: 'Work Phone', | |
// ), | |
// ), | |
// TextFormField( | |
// controller: ownersHomeAddress, | |
// decoration: const InputDecoration( | |
// labelText: 'Owners Home Address', | |
// ), | |
// ), | |
// TextFormField( | |
// controller: city, | |
// decoration: const InputDecoration( | |
// labelText: 'City', | |
// ), | |
// ), | |
// TextFormField( | |
// controller: state, | |
// decoration: const InputDecoration( | |
// labelText: 'State', | |
// ), | |
// ), | |
// TextFormField( | |
// controller: zipCode, | |
// decoration: const InputDecoration( | |
// labelText: 'Zip Code', | |
// ), | |
// ) | |
// ], | |
// ), | |
// ), | |
Step( | |
state: currentStep > 0 ? StepState.complete : StepState.indexed, | |
isActive: currentStep >= 4, | |
title: const Text("SPOUSE OR PARTNER INFORMATION"), | |
content: Column( | |
children: <Widget>[ | |
TextFormField( | |
controller: firstName, | |
decoration: const InputDecoration( | |
labelText: 'First Name', | |
), | |
), | |
TextFormField( | |
controller: middleName, | |
decoration: const InputDecoration( | |
labelText: 'Middle Name', | |
), | |
), | |
TextFormField( | |
controller: lastName, | |
decoration: const InputDecoration( | |
labelText: 'Last Name', | |
), | |
), | |
TextFormField( | |
controller: nameOfllc, | |
decoration: const InputDecoration( | |
labelText: 'Name of LLC or LLP (If Applicable)', | |
), | |
), | |
TextFormField( | |
controller: dob, | |
decoration: const InputDecoration( | |
labelText: 'Date Of Birth', | |
icon: Icon(Icons.calendar_month_rounded), | |
), | |
), | |
TextFormField( | |
controller: ssn, | |
decoration: const InputDecoration( | |
labelText: 'Social Security Number', | |
), | |
), | |
TextFormField( | |
controller: driverLicenceNumber, | |
decoration: const InputDecoration( | |
labelText: 'Drivers Licence Number', | |
), | |
), | |
TextFormField( | |
controller: email, | |
decoration: const InputDecoration( | |
labelText: 'Email', | |
), | |
), | |
TextFormField( | |
controller: cellPhone, | |
decoration: const InputDecoration( | |
labelText: 'Cell Phone', | |
), | |
), | |
TextFormField( | |
controller: homePhone, | |
decoration: const InputDecoration( | |
labelText: 'Home Phone', | |
), | |
), | |
TextFormField( | |
controller: workPhone, | |
decoration: const InputDecoration( | |
labelText: 'Work Phone', | |
), | |
), | |
], | |
), | |
), | |
Step( | |
state: currentStep > 0 ? StepState.complete : StepState.indexed, | |
isActive: currentStep >= 5, | |
title: const Text("PROPERTY INFORMATION"), | |
content: Column( | |
children: <Widget>[ | |
TextFormField( | |
controller: complexName, | |
decoration: const InputDecoration( | |
labelText: 'Subdivision / Complex Name', | |
), | |
), | |
TextFormField( | |
controller: streetAddress, | |
decoration: const InputDecoration( | |
labelText: 'Street Address', | |
), | |
), | |
TextFormField( | |
controller: city, | |
decoration: const InputDecoration( | |
labelText: 'City', | |
), | |
), | |
TextFormField( | |
controller: state, | |
decoration: const InputDecoration( | |
labelText: 'State', | |
), | |
), | |
TextFormField( | |
controller: zipCode, | |
decoration: const InputDecoration( | |
labelText: 'Zip Code', | |
), | |
), | |
TextFormField( | |
controller: unit, | |
decoration: const InputDecoration( | |
labelText: 'Unit#', | |
), | |
), | |
TextFormField( | |
controller: yearBuilt, | |
decoration: const InputDecoration( | |
labelText: 'Year Built', | |
), | |
), | |
TextFormField( | |
controller: lotSize, | |
decoration: const InputDecoration( | |
labelText: 'Lot Size', | |
), | |
), | |
TextFormField( | |
controller: squareFeet, | |
decoration: const InputDecoration( | |
labelText: 'Square Feet', | |
), | |
), | |
], | |
), | |
), | |
Step( | |
// isActive: currentStep >= 6, | |
title: const Text("CONFIRM"), | |
content: Container(), | |
), | |
]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment