Skip to content

Commit

Permalink
Done changes in player form ui
Browse files Browse the repository at this point in the history
  • Loading branch information
manasiPandey21 committed Oct 26, 2023
1 parent d0a2455 commit f670472
Showing 1 changed file with 63 additions and 42 deletions.
105 changes: 63 additions & 42 deletions lib/screens/player/forms/player_form.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class _PlayerFormState extends State<PlayerForm> {
Future<void> _showMyDialog() async {
return showDialog<void>(
context: context,
barrierDismissible: false, // user must tap button!
barrierDismissible: false,
builder: (BuildContext context) {
return AlertDialog(
title: const Text('Compulsary!!'),
Expand Down Expand Up @@ -75,7 +75,7 @@ class _PlayerFormState extends State<PlayerForm> {

var permissionStatus = await Permission.photos.status;

if (permissionStatus.isGranted) {
//if (permissionStatus.isGranted) {
//Select Image
// image = (await _imagePicker.getImage(source: ImageSource.gallery))!;
// var file = File(image.path);
Expand All @@ -99,18 +99,17 @@ class _PlayerFormState extends State<PlayerForm> {
} else {
print('No Image Path Received');
}
} else {
print('Permission not granted. Try Again with permission access');
}
// }
// else {
// print('Permission not granted. Try Again with permission access');
// }
}

final _formKey = GlobalKey<FormState>();

@override
Widget build(BuildContext context) {
return Scaffold(
// backgroundColor: CustomColors.primaryColor,

body: SingleChildScrollView(
child: Container(
padding: EdgeInsets.only(top: 24),
Expand All @@ -119,15 +118,18 @@ class _PlayerFormState extends State<PlayerForm> {
child: Column(
children: [
Container(
padding: EdgeInsets.all(15),
margin: EdgeInsets.only(top: 10),
padding: EdgeInsets.all(20),
width: double.infinity,
child: Text(
"Player Details Form",
style: TextStyle(color: Colors.yellow, fontSize: 30),
child: Center(
child: Text(
"Player Registration",
style: TextStyle(color: Colors.yellow, fontSize: 30),
),
),
),
SizedBox(
height: 15,
height: 12,
),
Center(
child: GestureDetector(
Expand All @@ -137,22 +139,22 @@ class _PlayerFormState extends State<PlayerForm> {
child: ClipRRect(
borderRadius: BorderRadius.circular(200),
child: Container(
width: 200,
height: 200,
width: 150,
height: 150,
decoration: BoxDecoration(color: Colors.grey),
child: _image != null
? Image.file(
_image,
width: 200.0,
height: 200.0,
width: 150.0,
height: 150.0,
fit: BoxFit.fitHeight,
)
: Container(
decoration: BoxDecoration(color: Colors.white70),
width: 200,
height: 200,
width: 150,
height: 150,
child: Icon(
Icons.camera_alt_rounded,
Icons.add_a_photo_rounded,
color: Colors.grey[800],
size: 35,
),
Expand All @@ -161,6 +163,7 @@ class _PlayerFormState extends State<PlayerForm> {
),
),
),

SizedBox(
height: 40,
),
Expand All @@ -176,11 +179,11 @@ class _PlayerFormState extends State<PlayerForm> {
style: TextStyle(
fontWeight: FontWeight.w400,
fontSize: 14,
color: Colors.yellow,
color: Colors.white,
),
decoration: InputDecoration(
hintText: "Enter Your Name",
labelText: "Your Name",
labelText: "Name",
hintStyle: TextStyle(color: Colors.white54),
filled: true,
fillColor: CustomColors.taskez1,
Expand Down Expand Up @@ -209,20 +212,22 @@ class _PlayerFormState extends State<PlayerForm> {
}
return null;
},

),
SizedBox(
height: 40.0,
),
TextFormField(
cursorColor: CustomColors.primaryColor,
controller: studentIDcontroller,
keyboardType:TextInputType.number ,
style: TextStyle(
fontWeight: FontWeight.w400,
fontSize: 14,
color: Colors.yellow,
color: Colors.white,
),
decoration: InputDecoration(
hintText: "Ex:-20195513",
hintText: " Ex:-20195513",
labelText: "Student ID",
hintStyle:
TextStyle(color: Colors.white54, fontSize: 16),
Expand Down Expand Up @@ -262,11 +267,11 @@ class _PlayerFormState extends State<PlayerForm> {
style: TextStyle(
fontWeight: FontWeight.w400,
fontSize: 14,
color: Colors.yellow,
color: Colors.white,
),
decoration: InputDecoration(
hintText: "Ex:- MadMani",
labelText: "IGN(In Game Name)",
hintText: " Ex:- MadMani",
labelText: "IGN (In Game Name)",
hintStyle: TextStyle(color: Colors.white54),
filled: true,
fillColor: CustomColors.taskez1,
Expand Down Expand Up @@ -305,7 +310,7 @@ class _PlayerFormState extends State<PlayerForm> {
style: TextStyle(
fontWeight: FontWeight.w400,
fontSize: 14,
color: Colors.yellow,
color: Colors.white,
),
obscureText: false,
decoration: InputDecoration(
Expand Down Expand Up @@ -343,7 +348,7 @@ class _PlayerFormState extends State<PlayerForm> {
},
),
SizedBox(
height: 40.0,
height: 25.0,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
Expand Down Expand Up @@ -371,28 +376,33 @@ class _PlayerFormState extends State<PlayerForm> {
child: Text(
value.toString().split('.').last,
style: TextStyle(
fontSize: 17, color: Colors.blueAccent),
color: primaryWeapons == value
? Colors.yellow // Color for selected item
: Colors.white,
fontSize: 17),
),
);
}).toList(),
onChanged: (value) {
setState(() {
// print('value is : $value');

primaryWeapons = value!;

});
},
// hint: Text(_playerStatus.toString().split('.').last),
),
],
),
SizedBox(
height: 40.0,
height: 10.0,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
" Secondary Weapon",
"Secondary Weapon",
style: TextStyle(
fontSize: 16,
color: Colors.yellow,
Expand All @@ -412,7 +422,11 @@ class _PlayerFormState extends State<PlayerForm> {
child: Text(
value.toString().split('.').last,
style: TextStyle(
fontSize: 17, color: Colors.blueAccent),
color: secondadryWeapons == value
? Colors.yellow // Color for selected item
: Colors.white, // Color for unselected items

fontSize: 17),
),
);
}).toList(),
Expand All @@ -427,15 +441,15 @@ class _PlayerFormState extends State<PlayerForm> {
],
),
SizedBox(
height: 20.0,
height: 25.0,
),
TextFormField(
controller: streamURLcontroller,
obscureText: false,
style: TextStyle(
fontWeight: FontWeight.w400,
fontSize: 14,
color: Colors.yellow,
color: Colors.white,
),
decoration: InputDecoration(
hintText:
Expand Down Expand Up @@ -526,7 +540,8 @@ class _PlayerFormState extends State<PlayerForm> {
),
)),
SizedBox(height: 20),
ElevatedButton.icon(
ElevatedButton(

onPressed: () async {
await Provider.of<Auth>(context, listen: false)
.signOut();
Expand All @@ -536,13 +551,18 @@ class _PlayerFormState extends State<PlayerForm> {
}), (route) => false);
},
style: ElevatedButton.styleFrom(
primary: Colors.blueAccent),
icon: Icon(Icons.arrow_forward),
label: Text(
'Sign Out ?',
style: TextStyle(
color: Colors.white, fontWeight: FontWeight.bold),
),
backgroundColor: Color.fromARGB(255, 73, 82, 96),
shape: RoundedRectangleBorder(borderRadius:BorderRadius.circular(15))
),

child:Padding(
padding: const EdgeInsets.all(14.0),
child: Text(
'Sign Out',
style: TextStyle(
color: Colors.white, fontWeight: FontWeight.bold),
),
),
),
],
),
Expand All @@ -554,4 +574,5 @@ class _PlayerFormState extends State<PlayerForm> {
),
);
}

}

0 comments on commit f670472

Please sign in to comment.