Skip to content

Commit

Permalink
UI Setup and Fields/Menus Working
Browse files Browse the repository at this point in the history
  • Loading branch information
3TTemi committed Apr 25, 2024
1 parent 6c46d1d commit 6dbc756
Show file tree
Hide file tree
Showing 3 changed files with 192 additions and 20 deletions.
9 changes: 9 additions & 0 deletions game/assets/images/yellow_bear_prof.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
201 changes: 182 additions & 19 deletions game/lib/profile/edit_profile.dart
Original file line number Diff line number Diff line change
@@ -1,20 +1,122 @@
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_svg/svg.dart';
import 'package:game/details_page/dropdown_widget.dart';
import 'package:google_sign_in/google_sign_in.dart';

class EditProfile extends StatelessWidget {
const EditProfile({super.key});
class EditProfileWidget extends StatefulWidget {
EditProfileWidget({
Key? key,
// required String this.userType,
// required String? this.idToken,
// required GoogleSignInAccount? this.user
}) : super(key: key);
// final scaffoldKey = GlobalKey<ScaffoldState>();
// final String userType;
// final String? idToken;
// final GoogleSignInAccount? user;

@override
Widget build(BuildContext context) {
var headingStyle = TextStyle(
color: Colors.black.withOpacity(0.800000011920929),
fontSize: 18,
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
height: 0,
);
_EditProfileState createState() => _EditProfileState();
}

class _EditProfileState extends State<EditProfileWidget> {
String _name = "";
String? _college = "Arts and Sciences";
GoogleSignInAccount? user = null;
@override
void initState() {
super.initState();
}

final _formKey = GlobalKey<FormState>();

var headingStyle = TextStyle(
color: Colors.black.withOpacity(0.8),
fontSize: 18,
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
height: 0,
);
var buttonStyle = TextStyle(
color: Colors.white,
fontSize: 16,
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
height: 0,
);
var fieldDecoration = InputDecoration(
contentPadding:
EdgeInsets.only(left: 20.0, right: 20.0, top: 10, bottom: 10),
labelStyle: TextStyle(
color: Color.fromARGB(51, 0, 0, 0), fontWeight: FontWeight.w400),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color.fromARGB(51, 0, 0, 0), width: 1.5),
borderRadius: BorderRadius.all(Radius.circular(10.0))),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)),
borderSide: BorderSide(
color: Color.fromARGB(255, 255, 170, 91),
width: 1.5,
),
),
errorBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)),
borderSide: BorderSide(
color: Color.fromARGB(153, 233, 87, 85),
width: 1.5,
),
),
focusedErrorBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)),
borderSide: BorderSide(
color: Color.fromARGB(153, 233, 87, 85),
width: 1.5,
),
),
);

List<String> _colleges = [
"Agriculture and Life Sciences",
"Architecture, Art and Planning",
"Arts and Sciences",
"Business",
// "Computing and Information Science",
"Engineering",
"Human Ecology",
"Industrial and Labor Relations (ILR)",
"Public Policy",
"Cornell Tech",
"Law School",
// "Veterinary Medicine",
// "Weill Cornell Medicine"
];
Map<String, List<String>> _majors = {
"Agriculture and Life Sciences": [],
"Architecture, Art and Planning": [],
"Business": [],
"Engineering": [
"Computer Science",
"Information Science",
"Chemical Engineering"
],
"Arts and Sciences": [
"Computer Science",
"Mathematics",
"Chemistry",
"Biology",
"Psychology"
],
"Human Ecology": [],
"Industrial and Labor Relations (ILR)": [],
"Public Policy": [],
"Cornell Tech": [],
"Law School": [],
};
List<String> _years = ["2024", "2025", "2026", "2027"];

@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Color.fromARGB(255, 255, 248, 241),
appBar: AppBar(
Expand All @@ -40,26 +142,87 @@ class EditProfile extends StatelessWidget {
body: Center(child: LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) {
return SizedBox(
width: constraints.maxWidth * 0.9,
width: constraints.maxWidth * 0.85,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.center,
children: [
Padding(
padding: EdgeInsets.only(top: 30),
child: SvgPicture.asset("assets/images/bear_prof.svg",
height: 100, width: 100),
child: SvgPicture.asset(
"assets/images/yellow_bear_prof.svg",
height: 115,
width: 115),
),
Container(
padding: EdgeInsets.only(top: 30),
alignment: Alignment.centerLeft,
width: double.infinity,
height: 80,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('Username *', style: headingStyle),
SizedBox(height: 5),
TextFormField(decoration: fieldDecoration)
],
)),
Container(
padding: EdgeInsets.only(top: 15),
width: double.infinity,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('College', style: headingStyle),
SizedBox(height: 5),
DropdownWidget(null, _colleges,
notifyParent: (val) {})
],
)),
Container(
padding: EdgeInsets.only(top: 15),
width: double.infinity,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('Major', style: headingStyle),
SizedBox(height: 5),
DropdownWidget(null,
_college == null ? null : _majors[_college],
notifyParent: (val) {})
],
)),
Container(
padding: EdgeInsets.only(top: 15),
width: double.infinity,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('Username', style: headingStyle),
Text('Graduation Year', style: headingStyle),
SizedBox(height: 5),
DropdownWidget(null, _years, notifyParent: (val) {})
],
))
4 ]));
)),
SizedBox(height: 100),
TextButton(
onPressed: () {},
style: TextButton.styleFrom(
backgroundColor: Color(0xFFB9B9B9),
padding: const EdgeInsets.symmetric(
horizontal: 138, vertical: 16),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8)),
),
child: Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
'Update',
style: buttonStyle,
),
],
),
)
]));
})));
}
}
2 changes: 1 addition & 1 deletion game/lib/profile/settings_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class SettingsPage extends StatelessWidget {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => EditProfile()));
builder: (context) => EditProfileWidget()));
},
style: TextButton.styleFrom(
padding: EdgeInsets.only(left: 20.0),
Expand Down

0 comments on commit 6dbc756

Please sign in to comment.