-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from unimegan59781/could
Could requirements
- Loading branch information
Showing
25 changed files
with
970 additions
and
90 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
import 'package:firebase_database/firebase_database.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:fyp/templates/displayText.dart'; | ||
import 'package:fyp/templates/profileView.dart'; | ||
|
||
class CompanyProfile extends StatefulWidget { | ||
final String companyId; | ||
|
||
const CompanyProfile({super.key, required this.companyId}); | ||
|
||
@override | ||
State createState() => CompanyProfileState(); | ||
} | ||
|
||
class CompanyProfileState extends State<CompanyProfile> { | ||
DatabaseReference dbhandler = FirebaseDatabase.instance.ref(); | ||
String name = "Company Name"; | ||
String imgPath = "general care"; | ||
String description = "No Description"; | ||
|
||
@override | ||
void initState() { | ||
super.initState(); | ||
setState(() { | ||
getProfile(widget.companyId); | ||
}); | ||
} | ||
|
||
void getProfile(String userId) async { | ||
await dbhandler | ||
.child('Profiles') | ||
.orderByChild('user_id') | ||
.equalTo(userId) | ||
.onValue | ||
.first | ||
.then((event) async { | ||
if (event.snapshot.value != null) { | ||
Map<dynamic, dynamic>? data = | ||
event.snapshot.value as Map<dynamic, dynamic>?; | ||
if (data != null) { | ||
var pKey = data.keys.first; | ||
var pData = data[pKey]; | ||
setState(() { | ||
name = pData['name']; | ||
imgPath = pData['img']; | ||
description = pData['description']; | ||
}); | ||
} | ||
} | ||
}); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
backgroundColor: Colors.white, | ||
body: SafeArea( | ||
child: Center( | ||
child: Column( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
children: [ | ||
const SizedBox(height: 30), | ||
const DisplayText( | ||
text: "Company Profile", fontSize: 30, colour: Colors.black), | ||
const SizedBox(height: 40), | ||
ProfileView( | ||
name: name, | ||
imgPath: imgPath, | ||
experience: "", | ||
description: description, | ||
scale: 1), | ||
const SizedBox(height: 40), | ||
const DisplayText( | ||
text: "To edit the profile go to settings", | ||
fontSize: 20, | ||
colour: Colors.deepPurple), | ||
])))); | ||
} | ||
} |
Oops, something went wrong.