Skip to content

Commit

Permalink
Resolved conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
D-Ajay-Kumar committed Mar 25, 2021
1 parent 9cd3979 commit 862aa47
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 65 deletions.
1 change: 1 addition & 0 deletions android/settings_aar.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ':app'
16 changes: 6 additions & 10 deletions lib/screens/profile_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ProfileScreen extends StatefulWidget {

class _ProfileScreenState extends State<ProfileScreen> {
ImagePicker _imagePicker = ImagePicker();
Reference _storageReference = FirebaseStorage.instance.ref();
StorageReference _storageReference = FirebaseStorage.instance.ref();

void getImage() async {
PickedFile image = await _imagePicker.getImage(source: ImageSource.gallery);
Expand All @@ -39,15 +39,13 @@ class _ProfileScreenState extends State<ProfileScreen> {

uploadPictures(File image) async {
// uploads picture(s) to storage and return it's URL
final Reference ref =
final StorageReference ref =
_storageReference.child('${Path.basename(image.path)}}');

final UploadTask uploadTask = ref.putFile(image);
// final TaskSnapshot storageTaskSnapshot =
String pictureUrl;
await uploadTask.then((taskSnapshot) async {
pictureUrl = await taskSnapshot.ref.getDownloadURL();
});
final StorageUploadTask uploadTask = ref.putFile(image);

UploadTaskSnapshot uploadTaskSnapshot = await uploadTask.future;
String pictureUrl = uploadTaskSnapshot.downloadUrl.toString();

final userInfoProvider =
Provider.of<UserInfoServices>(context, listen: false);
Expand All @@ -58,8 +56,6 @@ class _ProfileScreenState extends State<ProfileScreen> {
userInfoProvider.setUser(currentUser);

userInfoProvider.upateProfilePictureUrl();

// return pictureUrl;
}

@override
Expand Down
31 changes: 4 additions & 27 deletions lib/widgets/header.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,15 @@ class Header extends StatelessWidget {
Widget build(BuildContext context) {
return Padding(
padding: EdgeInsets.fromLTRB(30.0, 50.0, 30.0, 30.0),

child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
Flexible(
child:SvgPicture.asset(
"assets/icons/grad_cap.svg",
height: 70.0,
),
child: SvgPicture.asset(
"assets/icons/grad_cap.svg",
height: 70.0,
),
),
Consumer<UserInfoServices>(
builder: (ctx, _userInfo, _) => Row(
children: [
Expand All @@ -34,25 +33,7 @@ class Header extends StatelessWidget {
fontWeight: FontWeight.bold,
),
),
),
Flexible(
child:Consumer<UserInfoServices>(
builder: (ctx, _userInfo, _) => FittedBox(
fit: BoxFit.fitWidth,
child: Text(
"Hello, " +
(_userInfo.hasData
? _userInfo.user.name.split(" ")[0]
: "Sir"),
style: TextStyle(
color: Colors.white,
fontSize: 25.0,
fontWeight: FontWeight.bold,
),
),
),
),
),
CircleAvatar(
radius: 25.0,
backgroundImage: _userInfo.user.profilePictureUrl.isEmpty
Expand All @@ -62,10 +43,6 @@ class Header extends StatelessWidget {
],
),
),
CircleAvatar(
radius: 25.0,
backgroundImage: AssetImage("assets/images/profile_pic.jpg"),
),
],
),
);
Expand Down
12 changes: 0 additions & 12 deletions lib/widgets/signup_form_additional_details.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,6 @@ class _SignUpFormAdditionalDetailsState
_collegeList.add('Not in the list');
}

// FirebaseFirestore _firebaseFirestore = FirebaseFirestore.instance;

// void getData() async {
// var qs = await _firebaseFirestore.collection('users').get();
// qs.docs.forEach(
// (qds) {
// print(qds.data());
// },
// );
// }

@override
void initState() {
super.initState();
Expand All @@ -68,7 +57,6 @@ class _SignUpFormAdditionalDetailsState
_age = new TextEditingController();
_formKey = new GlobalKey<FormState>();

// getData();
fetchColleges = getData();
}

Expand Down
18 changes: 2 additions & 16 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -168,21 +168,7 @@ packages:
name: firebase_storage
url: "https://pub.dartlang.org"
source: hosted
version: "7.0.0"
firebase_storage_platform_interface:
dependency: transitive
description:
name: firebase_storage_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.4"
firebase_storage_web:
dependency: transitive
description:
name: firebase_storage_web
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.1+3"
version: "0.3.2"
flutter:
dependency: "direct main"
description: flutter
Expand Down Expand Up @@ -534,4 +520,4 @@ packages:
version: "3.1.0"
sdks:
dart: ">=2.12.0 <3.0.0"
flutter: ">=1.24.0-10.1.pre"
flutter: ">=1.24.0-7.0"

0 comments on commit 862aa47

Please sign in to comment.