Skip to content

Commit

Permalink
Signup cubit modified
Browse files Browse the repository at this point in the history
  • Loading branch information
RohanDoshi21 committed Apr 14, 2023
1 parent 9534e0b commit bed8813
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 57 deletions.
1 change: 0 additions & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ dart_code_metrics:
- avoid-unnecessary-type-casts
- avoid-unrelated-type-assertions
- avoid-unused-parameters
- avoid-nested-conditional-expressions
- newline-before-return
- no-boolean-literal-compare
- no-empty-block
Expand Down
73 changes: 41 additions & 32 deletions lib/features/login_page/ui/sign_up.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import '../cubit/check_login_cubit.dart';
import '../logic/sign_up_cubit.dart';
import 'widgets/roundedbutton.dart';
import 'widgets/text_field.dart';
import 'package:country_code_picker/country_code_picker.dart';
import 'package:csc_picker/csc_picker.dart';

class SignUp extends StatefulWidget {
Expand Down Expand Up @@ -54,7 +53,6 @@ class _SignUpState extends State<SignUp> {
String address = "Country";
@override
Widget build(BuildContext context) {
var size = MediaQuery.of(context).size;
return Stack(
children: [
Panorama(
Expand Down Expand Up @@ -149,35 +147,35 @@ class _SignUpState extends State<SignUp> {
mainAxisAlignment: MainAxisAlignment.center,
children: [
Center(
child: Container(
child: SizedBox(
height: 60,
child: Center(
child: CSCPicker(
// onCountryChanged: (country) {},

selectedItemStyle: TextStyle(
color: Colors.white,
fontSize: 16,
fontWeight: FontWeight.w400),
defaultCountry: CscCountry.India,
selectedItemStyle: const TextStyle(
color: Colors.white,
fontSize: 16,
fontWeight: FontWeight.w400,
),
onCountryChanged: (country) {
setState(() {
countryValue = country;
address = "$countryValue";
address = countryValue;
});
},
countryDropdownLabel: address,
countrySearchPlaceholder: address,
dropdownHeadingStyle: TextStyle(
dropdownHeadingStyle: const TextStyle(
color: Colors.white,
fontWeight: FontWeight.w400,
fontSize: 50,
),

showCities: false,
showStates: false,
dropdownDecoration: BoxDecoration(
borderRadius: const BorderRadius.all(
Radius.circular(25.0)),
Radius.circular(25.0),
),
color:
AppColors.primary.withAlpha(100),
border: Border.all(
Expand All @@ -199,15 +197,17 @@ class _SignUpState extends State<SignUp> {
Column(
children: [
InkWell(
onTap: () {
isOpen = !isOpen;
setState(() {});
onTap: () => {
setState(() {
isOpen = !isOpen;
}),
},
child: Container(
height: 60,
decoration: BoxDecoration(
borderRadius: const BorderRadius.all(
Radius.circular(25.0)),
Radius.circular(25.0),
),
color: AppColors.primary.withAlpha(100),
border: Border.all(
color: Colors.black26,
Expand All @@ -218,25 +218,26 @@ class _SignUpState extends State<SignUp> {
// mainAxisAlignment:
// MainAxisAlignment.spaceBetween,
children: [
SizedBox(
const SizedBox(
width: 8,
),
Icon(
const Icon(
Icons.school_outlined,
color: Colors
.white, // add custom icons also
),
SizedBox(
const SizedBox(
width: 15,
),
Text(
selectOption,
style: (const TextStyle(
color: Colors.white,
fontWeight: FontWeight.w400,
fontSize: 16)),
color: Colors.white,
fontWeight: FontWeight.w400,
fontSize: 16,
)),
),
SizedBox(
const SizedBox(
width: 168,
),
Icon(isOpen
Expand All @@ -259,7 +260,8 @@ class _SignUpState extends State<SignUp> {
: Colors.white,
borderRadius:
const BorderRadius.all(
Radius.circular(25.0)),
Radius.circular(25.0),
),
// color: AppColors.primary.withAlpha(100),
border: Border.all(
color: Colors.black26,
Expand All @@ -270,13 +272,14 @@ class _SignUpState extends State<SignUp> {
padding:
const EdgeInsets.all(8.0),
child: InkWell(
onTap: () {
selectOption = e;
setState(() {
isOpen = false;
});
},
child: Text(e)),
onTap: () {
selectOption = e;
setState(() {
isOpen = false;
});
},
child: Text(e),
),
),
))
.toList(),
Expand Down Expand Up @@ -323,6 +326,12 @@ class _SignUpState extends State<SignUp> {

return;
}

collegeController.text =
selectOption == 'Other'
? othercollegeController.text
: "PICT";

if (firstNameController.text.isEmpty ||
lastNameController.text.isEmpty ||
phoneController.text.isEmpty ||
Expand Down
36 changes: 14 additions & 22 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ packages:
dependency: transitive
description:
name: _flutterfire_internals
sha256: cb3a948a1eebbf8efd987c43f95418269930e912a88bc7b6a5a7658423133635
sha256: f175bc1414e4edf8c5b83372c98eeabecf8353f39c9da423c2cfdf1f1f508788
url: "https://pub.dev"
source: hosted
version: "1.0.17"
version: "1.1.0"
analyzer:
dependency: transitive
description:
Expand Down Expand Up @@ -113,14 +113,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.1.1"
country_code_picker:
dependency: "direct main"
description:
name: country_code_picker
sha256: "92818885f0e47486539f80463b66f649970506a91dd3c0731ca3ba5308324a4d"
url: "https://pub.dev"
source: hosted
version: "3.0.0"
countup:
dependency: "direct main"
description:
Expand Down Expand Up @@ -229,26 +221,26 @@ packages:
dependency: "direct main"
description:
name: firebase_core
sha256: "1c121a478af23755b0b93fd4aa70d3bd32a587dd51ef0a3979091ac0d2317d32"
sha256: ed611fb8e67e43ecc7956f242cecca383d87cf71aace27287aa5dd4bdba4ac07
url: "https://pub.dev"
source: hosted
version: "2.7.1"
version: "2.9.0"
firebase_core_platform_interface:
dependency: transitive
description:
name: firebase_core_platform_interface
sha256: "5615b30c36f55b2777d0533771deda7e5730e769e5d3cb7fda79e9bed86cfa55"
sha256: "0df0a064ab0cad7f8836291ca6f3272edd7b83ad5b3540478ee46a0849d8022b"
url: "https://pub.dev"
source: hosted
version: "4.5.3"
version: "4.6.0"
firebase_core_web:
dependency: transitive
description:
name: firebase_core_web
sha256: "0c1cf1f1022d2245ac117443bb95207952ca770281524d2908e323bc063fb8ff"
sha256: "347351a8f0518f3343d79a9a0690fa67ad232fc32e2ea270677791949eac792b"
url: "https://pub.dev"
source: hosted
version: "2.2.2"
version: "2.3.0"
firebase_messaging:
dependency: "direct main"
description:
Expand Down Expand Up @@ -277,26 +269,26 @@ packages:
dependency: "direct main"
description:
name: firebase_remote_config
sha256: "6a9dcb6f4973b5107d518a7f0044dae71b3084a105a318216177087e55bbb254"
sha256: "1f998632bdbf453101116bf41f020762aada0af8c8be14d5c74fc7863bc4f204"
url: "https://pub.dev"
source: hosted
version: "3.0.14"
version: "4.0.0"
firebase_remote_config_platform_interface:
dependency: transitive
description:
name: firebase_remote_config_platform_interface
sha256: "9fab637a495cccc81db31c19cab95315005d90da32cab7da0b7ff78d9b516e26"
sha256: "008f0830065e9d6532c575e0f464225c6e5d851136c795430ea2a37b97728f6e"
url: "https://pub.dev"
source: hosted
version: "1.1.34"
version: "1.2.0"
firebase_remote_config_web:
dependency: transitive
description:
name: firebase_remote_config_web
sha256: cb965b80dc8dac191fcc32f02ae18b92019b11423488953ec8c192f43f7ce2c6
sha256: b01d23a111f1b33bc30b7c6b15db260a2000e1f9c336141556cf144d37a54396
url: "https://pub.dev"
source: hosted
version: "1.1.23"
version: "1.2.0"
flutter:
dependency: "direct main"
description: flutter
Expand Down
3 changes: 1 addition & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ environment:

dependencies:
csc_picker: ^0.2.7
country_code_picker: ^3.0.0
flutter:
sdk: flutter

Expand All @@ -21,7 +20,7 @@ dependencies:
flutter_spinkit: ^5.1.0
flutter_bloc: ^8.1.1
http: ^0.13.5
firebase_remote_config: ^3.0.9
firebase_remote_config: ^4.0.0
firebase_core: ^2.4.1
lottie: ^2.2.0
flutter_svg: ^2.0.2
Expand Down

0 comments on commit bed8813

Please sign in to comment.