Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Team UI🖌️ #125

Open
wants to merge 22 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
41b84dd
.
TreavVasu Jan 20, 2021
b808da1
Merge branch 'main' of https://github.com/ECellNitrr/ECellApp2021 int…
TreavVasu Jan 20, 2021
3a9143d
Merge branch 'main' of https://github.com/ECellNitrr/ECellApp2021 int…
TreavVasu Feb 5, 2021
cb0215f
Merge branch 'main' of https://github.com/ECellNitrr/ECellApp2021 int…
TreavVasu Feb 9, 2021
dc74374
Merge branch 'main' of https://github.com/ECellNitrr/ECellApp2021 int…
TreavVasu Feb 12, 2021
3e1629a
Merge branch 'main' of https://github.com/ECellNitrr/ECellApp2021 int…
TreavVasu Feb 16, 2021
2294b80
Merge branch 'main' of https://github.com/ECellNitrr/ECellApp2021 int…
TreavVasu Feb 21, 2021
2cda41c
Merge branch 'main' of https://github.com/ECellNitrr/ECellApp2021 int…
TreavVasu Feb 27, 2021
743dff3
Merge branch 'main' of https://github.com/ECellNitrr/ECellApp2021 int…
TreavVasu Mar 7, 2021
1e7bbbc
Draft
TreavVasu Mar 7, 2021
a85da73
Staging UI backbone
TreavVasu Mar 8, 2021
f4fcddb
minor fix
TreavVasu Mar 9, 2021
42e172e
Merge branch 'main' of https://github.com/ECellNitrr/ECellApp2021 int…
TreavVasu Mar 10, 2021
ce4f4f1
Merge branch 'main' of https://github.com/ECellNitrr/ECellApp2021 int…
TreavVasu Mar 12, 2021
dca67e3
Final Staging
TreavVasu Mar 12, 2021
f12febd
check fix
TreavVasu Mar 12, 2021
e094f5d
Final Commit
TreavVasu Mar 12, 2021
0510903
Last changes
TreavVasu Mar 12, 2021
36532fa
UI fix
TreavVasu Mar 13, 2021
7c358fd
check fix
TreavVasu Mar 13, 2021
e563175
UI changes
TreavVasu Mar 14, 2021
b79aad1
UI fix
TreavVasu Mar 14, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/team-frame.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions lib/core/res/colors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class C {
/// background color gradient
static final Color backgroundTop = HexColor("#4F3FA0");
static final Color backgroundBottom = HexColor("#180C58");
static final Color teamsbackground = HexColor("#372981");

/// animated rings colors (1->4 increasingsize)
static final Color ring1 = HexColor("#2DFFF9");
Expand Down
1 change: 1 addition & 0 deletions lib/core/res/strings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ class S {
static const String phoneURL = "tel:+919406220952";
static const String emailURL = "mailto:[email protected]";
static const String assetEventFrame = "assets/event-frame.png";
static const String assetTeamsFrame = "assets/team-frame.png";
static const String asset404Image = "assets/404.png";

// paragraphs
Expand Down
114 changes: 96 additions & 18 deletions lib/screens/about_us/tabs/team/team.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
import 'package:ecellapp/core/res/colors.dart';
import 'package:ecellapp/core/res/dimens.dart';
import 'package:ecellapp/models/team_category.dart';
import 'package:ecellapp/screens/about_us/tabs/team/widget/teams_card.dart';
import 'package:ecellapp/widgets/ecell_animation.dart';
import 'package:ecellapp/widgets/reload_on_error.dart';
import 'package:ecellapp/widgets/rotated_curveed_tile.dart';
import 'package:ecellapp/widgets/screen_background.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:ecellapp/widgets/stateful_wrapper.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:rxdart/rxdart.dart';

import 'cubit/team_cubit.dart';

Expand All @@ -25,7 +31,7 @@ class TeamScreen extends StatelessWidget {
leading: Container(
padding: EdgeInsets.only(left: D.horizontalPadding - 10, top: 10),
child: IconButton(
icon: Icon(Icons.arrow_back_ios, color: Colors.white, size: 30),
icon: Icon(Icons.arrow_back_ios, color: C.teamsbackground, size: 30),
onPressed: () => Navigator.of(context).pop(),
),
),
Expand All @@ -36,11 +42,11 @@ class TeamScreen extends StatelessWidget {
BlocBuilder<TeamCubit, TeamState>(
builder: (context, state) {
if (state is TeamInitial)
return _buildLoading();
return _buildLoading(context);
else if (state is TeamSuccess)
return _buildSuccess(context, state.teamList);
else if (state is TeamLoading)
return _buildLoading();
return _buildLoading(context);
else
return ReloadOnErrorWidget(() => _getAllTeamMembers(context));
},
Expand All @@ -51,25 +57,97 @@ class TeamScreen extends StatelessWidget {
);
}

Widget _buildSuccess(BuildContext context, List<TeamCategory> teamList) {
//TODO: UI
return Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Text(teamList[6].category, textAlign: TextAlign.center),
Text(teamList[6].members[0].name, textAlign: TextAlign.center),
Text(teamList[1].category, textAlign: TextAlign.center),
Text(teamList[1].members[0].name, textAlign: TextAlign.center),
],
Widget _buildSuccess(BuildContext context, List<TeamCategory> data) {
double top = MediaQuery.of(context).viewPadding.top;
ScrollController _scrollController = ScrollController();

// ignore: close_sinks
BehaviorSubject<int> subject = BehaviorSubject.seeded(0);

return DefaultTextStyle.merge(
style: GoogleFonts.roboto().copyWith(color: C.primaryUnHighlightedColor),
child: NotificationListener<OverscrollIndicatorNotification>(
onNotification: (OverscrollIndicatorNotification overscroll) {
overscroll.disallowGlow();
return true;
},
child: Container(
color: Colors.white,
child: StreamBuilder<int>(
initialData: 0,
stream: subject.stream,
builder: (context, snapshot) {
int i = snapshot.data;
return Row(
children: [
Expanded(
flex: 2,
child: Padding(
padding: const EdgeInsets.only(bottom: 40, top: 80),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
children: data.map((spon) {
String tab = spon.category;
return RotatedCurvedTile(
checked: tab == data[i].category,
name: tab,
onTap: () => subject.add(data.indexWhere((e) => e.category == tab)),
);
}).toList(),
),
),
),
),
Expanded(
flex: 15,
child: ClipRRect(
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(40),
topLeft: Radius.circular(40),
),
child: Container(
color: C.sponsorPageBackground,
width: double.infinity,
height: double.infinity,
child: SingleChildScrollView(
controller: _scrollController,
child: Column(
mainAxisSize: MainAxisSize.max,
children: [
SizedBox(height: top + 56),
Text(
"Our Team",
style: TextStyle(
fontSize: 40,
color: Colors.white,
fontWeight: FontWeight.w800,
letterSpacing: 0.5,
),
),
...data[i].members.map((e) => TeamsCard(teamMember: e)),
//! Fix to avoid non-scrollable state
Container(height: 200)
],
),
),
),
),
)
],
);
},
),
),
),
);
}

Widget _buildLoading() {
return Center(
child: CircularProgressIndicator(),
);
Widget _buildLoading(BuildContext context) {
double width = MediaQuery.of(context).size.width;
return Center(child: ECellLogoAnimation(size: width / 2));
}

void _getAllTeamMembers(BuildContext context) {
Expand Down
122 changes: 121 additions & 1 deletion lib/screens/about_us/tabs/team/team_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,127 @@ class FakeTeamRepository implements TeamRepository {
"domain": "tech",
"linkedin": null,
"facebook": null
}
},
{
"id": 4,
"name": "Bowjack",
"profile_url":
"https://i.pinimg.com/originals/83/f5/88/83f588b8414b1bacfd0ef3027b5aba7f.jpg",
"image": null,
"member_type": "EXC",
"year": 2021,
"domain": "tech",
"linkedin": "http://linkdin.com/IamBttowski",
"facebook": "http://facebook.com/IamBttowski"
},
{
"id": 5,
"name": "Agent P",
"profile_url":
"https://i.pinimg.com/originals/83/f5/88/83f588b8414b1bacfd0ef3027b5aba7f.jpg",
"image": null,
"member_type": "DIR",
"year": 2021,
"domain": "tech",
"linkedin": "http://linkdin.com/IamBttowski",
"facebook": "http://facebook.com/IamBttowski"
},
{
"id": 6,
"name": "Jack Sparrow",
"profile_url":
"https://i.pinimg.com/originals/83/f5/88/83f588b8414b1bacfd0ef3027b5aba7f.jpg",
"image": null,
"member_type": "FCT",
"year": 2021,
"domain": "tech",
"linkedin": "http://linkdin.com/IamBttowski",
"facebook": "http://facebook.com/IamBttowski"
},
{
"id": 7,
"name": "Taylor Swift",
"profile_url":
"https://i.pinimg.com/originals/83/f5/88/83f588b8414b1bacfd0ef3027b5aba7f.jpg",
"image": null,
"member_type": "HCO",
"year": 2021,
"domain": "tech",
"linkedin": "http://linkdin.com/IamBttowski",
"facebook": "http://facebook.com/IamBttowski"
},
{
"id": 8,
"name": "Pidgeot",
"profile_url":
"https://i.pinimg.com/originals/83/f5/88/83f588b8414b1bacfd0ef3027b5aba7f.jpg",
"image": null,
"member_type": "EXC",
"year": 2021,
"domain": "tech",
"linkedin": "http://linkdin.com/IamBttowski",
"facebook": "http://facebook.com/IamBttowski"
},
{
"id": 9,
"name": "Dragonite",
"profile_url":
"https://i.pinimg.com/originals/83/f5/88/83f588b8414b1bacfd0ef3027b5aba7f.jpg",
"image": null,
"member_type": "DIR",
"year": 2021,
"domain": "tech",
"linkedin": "http://linkdin.com/IamBttowski",
"facebook": "http://facebook.com/IamBttowski"
},
{
"id": 10,
"name": "Kiterestu",
"profile_url":
"https://i.pinimg.com/originals/83/f5/88/83f588b8414b1bacfd0ef3027b5aba7f.jpg",
"image": null,
"member_type": "MNG",
"year": 2021,
"domain": "tech",
"linkedin": "http://linkdin.com/IamBttowski",
"facebook": "http://facebook.com/IamBttowski"
},
{
"id": 15,
"name": "Kochikame",
"profile_url":
"https://i.pinimg.com/originals/83/f5/88/83f588b8414b1bacfd0ef3027b5aba7f.jpg",
"image": null,
"member_type": "MNG",
"year": 2021,
"domain": "tech",
"linkedin": "http://linkdin.com/IamBttowski",
"facebook": "http://facebook.com/IamBttowski"
},
{
"id": 11,
"name": "Hattori",
"profile_url":
"https://i.pinimg.com/originals/83/f5/88/83f588b8414b1bacfd0ef3027b5aba7f.jpg",
"image": null,
"member_type": "OCO",
"year": 2021,
"domain": "tech",
"linkedin": "http://linkdin.com/IamBttowski",
"facebook": "http://facebook.com/IamBttowski"
},
{
"id": 1,
"name": "Kazama",
"profile_url":
"https://i.pinimg.com/originals/83/f5/88/83f588b8414b1bacfd0ef3027b5aba7f.jpg",
"image": null,
"member_type": "EXC",
"year": 2021,
"domain": "tech",
"linkedin": "http://linkdin.com/IamBttowski",
"facebook": "http://facebook.com/IamBttowski"
},
]
};

Expand Down
84 changes: 84 additions & 0 deletions lib/screens/about_us/tabs/team/widget/teams_card.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
import 'package:ecellapp/models/team.dart';
import 'package:flutter/material.dart';

import 'package:ecellapp/core/res/colors.dart';
import 'package:ecellapp/core/res/dimens.dart';
import 'package:ecellapp/core/res/strings.dart';

class TeamsCard extends StatelessWidget {
final TeamMember teamMember;

const TeamsCard({Key key, this.teamMember}) : super(key: key);

@override
Widget build(BuildContext context) {
double ratio = MediaQuery.of(context).size.aspectRatio;
return Stack(
children: [
Container(
margin: const EdgeInsets.symmetric(horizontal: D.horizontalPaddingFrame, vertical: 20),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(22),
),
child: Container(
height: ratio > 0.5 ? 140 : 160,
margin: EdgeInsets.only(left: 130),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(22),
),
child: Center(
child: Text(
teamMember.name,
style: TextStyle(
fontSize: 20,
color: C.cardFontColor,
fontWeight: FontWeight.w600,
),
),
),
),
),
Positioned(
height: ratio > 0.5 ? 200 : 220,
width: ratio > 0.5 ? 150 : 170,
child: Stack(
children: [
Image.asset(
S.assetTeamsFrame,
fit: BoxFit.cover,
height: 220,
),
Center(
child: Container(
height: 100,
width: 100,
alignment: Alignment.center,
padding: EdgeInsets.only(bottom: 5),
decoration: BoxDecoration(
shape: BoxShape.circle,
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.25),
offset: Offset(0.0, 5),
blurRadius: 10,
),
],
),
child: CircleAvatar(
backgroundColor: Colors.blue,
backgroundImage: (teamMember.profilePic == null)
? AssetImage(S.assetEcellLogoWhite)
: NetworkImage(teamMember.profilePic),
radius: 40,
),
),
),
],
),
),
],
);
}
}