Skip to content

Commit

Permalink
Theme changes (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
harshtaliwal30 committed Oct 23, 2021
1 parent 59cecd1 commit c8cc354
Show file tree
Hide file tree
Showing 14 changed files with 454 additions and 415 deletions.
116 changes: 50 additions & 66 deletions lib/screens/contact_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,25 @@ import 'package:mlsa_amu/utils/size_config.dart';
import 'package:url_launcher/url_launcher.dart';

class ContactScreen extends StatelessWidget {
ContactScreen({Key? key}) : super(key: key);

final TextEditingController feedbackController = TextEditingController();
final String github = "https://github.com/mlsa-amu";
final String email = "Paste Email Here"; // TODO: Add Email Address
final String linkedIn = "Paste LinkedIn URL Here"; // TODO : Add Linkedin URL
final String email = "mlsaamu1@gmail.com";
final String linkedIn = "https://www.linkedin.com/company/mlsa-amu";

//Launch URL Function
Future<void> _launchUrl(String url) async {
//final encodedUrl = Uri.encodeFull(url);
if (await canLaunch(url)) {
await launch(url);
} else {
throw 'Could not launch $url';
}
_launchURLBrowser(String url) async {
await launch(url);
}

@override
Widget build(BuildContext context) {
//SizeConfig.initOnStartUp(context); //SizeConfig Initiation
return Container(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomLeft,
end: Alignment.bottomRight,
colors: [
Colors.blue.shade900,
Color(0XFF792adc),
Color(0XFF792adc),
Color(0XFF17181C),
Color(0XFF0B0B0D),
],
),
),
Expand All @@ -45,7 +35,6 @@ class ContactScreen extends StatelessWidget {
title: Text(
"Contact Us",
style: TextStyle(
fontSize: SizeConfig.baseFontSize * 6.5,
color: Colors.white,
),
),
Expand All @@ -61,14 +50,15 @@ class ContactScreen extends StatelessWidget {
SizedBox(height: SizeConfig.screenHeight * 0.02),
Image.asset(
'assets/images/mlsa-logo.png',
height: SizeConfig.screenHeight * 0.35,
height: SizeConfig.screenHeight * 0.25,
),
SizedBox(
height: SizeConfig.screenHeight * 0.03,
height: SizeConfig.screenHeight * 0.08,
),
Padding(
padding: EdgeInsets.symmetric(
horizontal: SizeConfig.safeBlockHorizontal * 8),
horizontal: SizeConfig.safeBlockHorizontal * 4,
),
child: Column(
children: [
Row(
Expand All @@ -79,7 +69,7 @@ class ContactScreen extends StatelessWidget {
"Reach Out to Us",
textAlign: TextAlign.left,
style: TextStyle(
fontSize: SizeConfig.baseFontSize * 5.5,
fontSize: SizeConfig.baseFontSize * 5,
fontWeight: FontWeight.bold,
color: Colors.white,
),
Expand All @@ -90,36 +80,36 @@ class ContactScreen extends StatelessWidget {
height: SizeConfig.screenHeight * 0.01,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
IconButton(
onPressed: () {
_launchUrl(github);
_launchURLBrowser(github);
},
iconSize: SizeConfig.screenWidth * 0.15,
icon: Icon(FontAwesomeIcons.github),
),
SizedBox(
width: SizeConfig.screenWidth * 0.07,
iconSize:
SizeConfig.iconGeneralHeightAndWidth * 1.6,
icon: Icon(
FontAwesomeIcons.github,
color: Colors.white,
),
),
IconButton(
onPressed: () {
_launchUrl("mailto:" + email);
_launchURLBrowser("mailto:" + email);
},
iconSize: SizeConfig.screenWidth * 0.15,
iconSize:
SizeConfig.iconGeneralHeightAndWidth * 1.6,
icon: Image.asset("assets/images/gmail.png"),
),
SizedBox(
width: SizeConfig.screenWidth * 0.07,
),
IconButton(
onPressed: () {
_launchUrl(linkedIn);
_launchURLBrowser(linkedIn);
},
iconSize: SizeConfig.screenWidth * 0.15,
iconSize:
SizeConfig.iconGeneralHeightAndWidth * 1.6,
icon: Icon(FontAwesomeIcons.linkedin),
color: Colors.blue[900],
color: Colors.blue[600],
),
],
),
Expand All @@ -131,7 +121,8 @@ class ContactScreen extends StatelessWidget {
),
Padding(
padding: EdgeInsets.symmetric(
horizontal: SizeConfig.safeBlockHorizontal * 8),
horizontal: SizeConfig.safeBlockHorizontal * 4,
),
child: Column(
children: <Widget>[
Row(
Expand All @@ -142,7 +133,7 @@ class ContactScreen extends StatelessWidget {
"Your Feedback",
textAlign: TextAlign.left,
style: TextStyle(
fontSize: SizeConfig.baseFontSize * 5.5,
fontSize: SizeConfig.baseFontSize * 5,
fontWeight: FontWeight.bold,
color: Colors.white,
),
Expand All @@ -152,43 +143,36 @@ class ContactScreen extends StatelessWidget {
SizedBox(
height: SizeConfig.screenHeight * 0.01,
),
Row(
children: [
Expanded(
child: Container(
height: SizeConfig.screenHeight * 0.15,
child: TextField(
controller: feedbackController,
maxLines: 4,
decoration: const InputDecoration(
fillColor: Colors.white,
filled: true,
border: OutlineInputBorder(
borderRadius: BorderRadius.all(
Radius.circular(20),
),
),
hintText: 'Feedback...',
),
Container(
height: SizeConfig.screenHeight * 0.15,
child: TextField(
controller: feedbackController,
maxLines: 4,
decoration: const InputDecoration(
fillColor: Colors.white,
filled: true,
border: OutlineInputBorder(
borderRadius: BorderRadius.all(
Radius.circular(20),
),
),
)
],
hintText: 'Feedback...',
),
),
),
SizedBox(
height: SizeConfig.screenHeight * 0.01,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
TextButton(
onPressed: () {
Service()
.submitFeedback(feedbackController.text)
.then(
(value) {
_launchUrl(
_launchURLBrowser(
"mailto:" +
email +
"?subject=Feedback&body=" +
Expand All @@ -198,15 +182,15 @@ class ContactScreen extends StatelessWidget {
);
},
);
}, // TODO: Need Fix for Submit Method
},
style: TextButton.styleFrom(
padding: EdgeInsets.symmetric(
horizontal: SizeConfig.safeBlockHorizontal * 4,
horizontal: SizeConfig.safeBlockHorizontal * 6,
),
backgroundColor: Colors.cyan,
backgroundColor: Colors.blue[400],
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(
Radius.circular(10),
Radius.circular(5),
),
),
),
Expand All @@ -215,7 +199,7 @@ class ContactScreen extends StatelessWidget {
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: SizeConfig.baseFontSize * 4.5,
fontSize: SizeConfig.baseFontSize * 4,
),
),
)
Expand Down
41 changes: 21 additions & 20 deletions lib/screens/contributors_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:mlsa_amu/api/api.dart';
import 'package:mlsa_amu/models/repo_details.dart';
import 'package:mlsa_amu/screens/starred_user_screen.dart';
import 'package:mlsa_amu/screens/stargazers_screen.dart';
import 'package:mlsa_amu/utils/size_config.dart';
import 'package:mlsa_amu/widgets/contributors_header.dart';
import 'package:mlsa_amu/widgets/user_details_card.dart';
Expand All @@ -26,11 +26,15 @@ class _ContributorsScreenState extends State<ContributorsScreen> {
API().fetchRepoDetails().then((value) async {
if (value != null) {
repoDetails = RepoDetailsModel.fromJson(value);
await API().fetchUsersDetails(repoDetails.contributorsUrl!).then((value) async {
await API()
.fetchUsersDetails(repoDetails.contributorsUrl!)
.then((value) async {
if (value != null) {
await value.forEach((item) async {
UserDetails contributorsModel = UserDetails.fromMap(item);
await API().fetchUsersDetails(contributorsModel.apiUrl!).then((value) {
await API()
.fetchUsersDetails(contributorsModel.apiUrl!)
.then((value) {
if (value != null) {
contributorsModel.bio = value['bio'];
setState(() {
Expand All @@ -40,23 +44,26 @@ class _ContributorsScreenState extends State<ContributorsScreen> {
});
});
}
setState(() {});
});
}
setState(() {});
});
}

@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Color(0XFF17181C),
backgroundColor: Color(0XFF0B0B0D),
appBar: AppBar(
title: Text(
"Contributors",
style: TextStyle(
color: Colors.white,
),
),
backgroundColor: Color(0XFF0B0B0D),
// backgroundColor: Color(0XFF0B0B0D),
backgroundColor: Colors.transparent,
elevation: 0,
),
body: repoDetails.contributorsList == null
Expand All @@ -67,7 +74,6 @@ class _ContributorsScreenState extends State<ContributorsScreen> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
color: Color(0XFF0B0B0D),
padding: EdgeInsets.symmetric(
vertical: SizeConfig.safeBlockVertical * 4,
horizontal: SizeConfig.safeBlockHorizontal * 4,
Expand Down Expand Up @@ -117,7 +123,8 @@ class _ContributorsScreenState extends State<ContributorsScreen> {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => StarredUserScreen(repoDetails.starUrl!),
builder: (context) => StargazersScreen(
repoDetails.starUrl!),
),
);
},
Expand Down Expand Up @@ -145,11 +152,12 @@ class _ContributorsScreenState extends State<ContributorsScreen> {
],
),
),
Padding(
padding: EdgeInsets.only(
top: SizeConfig.safeBlockVertical * 2,
left: SizeConfig.safeBlockHorizontal * 4,
right: SizeConfig.safeBlockHorizontal * 4,
Container(
color: Color(0XFF17181C),
width: double.infinity,
padding: EdgeInsets.symmetric(
vertical: SizeConfig.safeBlockVertical * 2,
horizontal: SizeConfig.safeBlockHorizontal * 4,
),
child: Text(
"Contributors",
Expand All @@ -171,14 +179,7 @@ class _ContributorsScreenState extends State<ContributorsScreen> {
),
),
)
: ListView.separated(
separatorBuilder: (_, __) => SizedBox(
height: 30,
),
padding: EdgeInsets.symmetric(
vertical: SizeConfig.safeBlockVertical * 4,
horizontal: SizeConfig.safeBlockHorizontal * 4,
),
: ListView.builder(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemCount: repoDetails.contributorsList!.length,
Expand Down

0 comments on commit c8cc354

Please sign in to comment.