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

Added organization info screen #56

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
78 changes: 78 additions & 0 deletions lib/screens/organization_info/organization_info_screen.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import './widgets/organization_info_body.dart';

///This is the screen through the details of a particular organization would be shown
///This can take 2 different forms according to the user
///If user is admin, then he can see all the settings and the details
///If the user is a member, then he can only see the details
///Note- in the #OrganizationInfoBody, pass 1 if user is admin else pass any other number
///
class OrganizationInfoScreen extends StatelessWidget {
final String header;

OrganizationInfoScreen(this.header);

@override
Widget build(BuildContext context) {
return Scaffold(
body: SingleChildScrollView(
child: SafeArea(
child: Column(
children: <Widget>[
Stack(
overflow: Overflow.visible,
alignment: AlignmentDirectional.bottomCenter,
children: <Widget>[
Image.asset(
"assets/ecell_pic.jpg", //TODO replace with a proper image
fit: BoxFit.cover,
width: double.infinity,
),
Positioned(
bottom: -60,
child: CircleAvatar(
radius: 80,
backgroundImage: AssetImage("assets/icon_ecell.png"),
//TODO replace with a proper image
backgroundColor: Colors.transparent,
),
),
],
),
//This contains the background image and the logo
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Container(
decoration: BoxDecoration(
color: Colors.grey,
borderRadius: BorderRadius.all(Radius.circular(5)),
),
margin: EdgeInsets.fromLTRB(30, 80, 0, 0),
padding: EdgeInsets.fromLTRB(5, 2, 5, 2),
child: Text(
'Position',
style: TextStyle(
fontSize: 30,
),
),
),
Container(
margin: EdgeInsets.fromLTRB(5, 80, 0, 0),
child: Icon(Icons.info_outline),
),
],
),
//This contains the position of the user and an i button
OrganizationInfoBody(
code: 1,
),
//pass 1 for admin/ any other number for normal user
],
),
),
),
);
}
}
47 changes: 47 additions & 0 deletions lib/screens/organization_info/widgets/general_info.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import './line.dart';

/// This widget creates the general information which could be viewed by anyone
/// This contains the details part of the organization
class GeneralInfo extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
child: Column(
children: <Widget>[
Padding(
padding: const EdgeInsets.fromLTRB(0, 10, 0, 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
Line(),
Text(
" About ",
style: TextStyle(
fontSize: 20,
),
),
Line(),
],
),
), //This padding contains the two lines and the Text about
Padding(
padding: const EdgeInsets.fromLTRB(10, 0, 10, 0),
child: Container(
padding: EdgeInsets.fromLTRB(10, 5, 0, 5),
color: Colors.grey[300],
child: Text(
"This is dummy data This is dummy data This is dummy data This is dummy data This is dummy data This is dummy data "
"This is dummy data This is dummy data This is dummy data This is dummy data This is dummy data This is dummy data This is dummy data "
"This is dummy data This is dummy data This is dummy data This is dummy data This is dummy data This is dummy data "
"This is dummy data This is dummy data This is dummy data This is dummy data This is dummy data This is dummy data "
"This is dummy data This is dummy data This is dummy data This is dummy data This is dummy data This is dummy data This is dummy data"
"This is dummy data This is dummy data This is dummy data This is dummy data This is dummy data "),
),
), //This padding corresponds to the details which would be shown
],
),
);
} // This widget returns the general info
}
17 changes: 17 additions & 0 deletions lib/screens/organization_info/widgets/line.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

///Simple dart file to create a line for UI purpose
class Line extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Padding(
padding: EdgeInsets.symmetric(horizontal: 10.0),
child: Container(
height: 2.0,
width: 130.0,
color: Colors.black,
),
);
} //this widget creates a line
}
75 changes: 75 additions & 0 deletions lib/screens/organization_info/widgets/organization_info_body.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
import './general_info.dart';
import './line.dart';
import './setting_option_tile.dart';

///This dart file makes up the details part of the screen
///If the user is an admin, this file would return settings button along with the details part
///else if the user is a general user, then this would return only the details part

class OrganizationInfoBody extends StatelessWidget {
final int code;

OrganizationInfoBody({@required this.code});

@override
Widget build(BuildContext context) {
if (code == 1) {
return Container(
child: Column(
children: <Widget>[
Padding(
padding: const EdgeInsets.fromLTRB(0, 10, 0, 0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
Line(),
Text(
" Manage ",
style: TextStyle(
fontSize: 20,
),
),
Line(),
],
),
), //This Padding contains two lines and text MANAGE in between
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
SettingOptionTile(
title: "Groups",
icon: Icon(Icons.group),
),
SettingOptionTile(
title: "Progress",
icon: Icon(Icons.show_chart),
),
],
), //contains first 2 settings button
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
SettingOptionTile(
title: "Invite",
icon: Icon(Icons.person_add),
),
SettingOptionTile(
title: "Certificate",
icon: Icon(Icons.card_membership),
),
],
), //contains 2nd 2 settings button
SettingOptionTile(
title: "LB settings", icon: Icon(MdiIcons.trophyAward)),
GeneralInfo(),
],
),
);
} else {
return GeneralInfo();
}
}
}
36 changes: 36 additions & 0 deletions lib/screens/organization_info/widgets/setting_option_tile.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

///This class takes in an icon and a name for the different settings button which are to be used
///by the admin and returns a button accordingly
class SettingOptionTile extends StatelessWidget {
final String title;
final Icon icon;

SettingOptionTile({@required this.title, @required this.icon});

@override
Widget build(BuildContext context) {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
Container(
margin: EdgeInsets.fromLTRB(0, 20, 0, 0),
width: 150,
height: 40,
child: FlatButton(
color: Colors.grey,
onPressed: () {},
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
icon,
Text(title),
],
),
),
),
],
);
}
}
13 changes: 10 additions & 3 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.6"
material_design_icons_flutter:
dependency: "direct main"
description:
name: material_design_icons_flutter
url: "https://pub.dartlang.org"
source: hosted
version: "4.0.5345"
meta:
dependency: transitive
description:
Expand Down Expand Up @@ -421,7 +428,7 @@ packages:
name: pedantic
url: "https://pub.dartlang.org"
source: hosted
version: "1.9.0"
version: "1.8.0+1"
petitparser:
dependency: transitive
description:
Expand Down Expand Up @@ -456,7 +463,7 @@ packages:
name: provider
url: "https://pub.dartlang.org"
source: hosted
version: "4.1.2"
version: "4.0.5+1"
pub_semver:
dependency: transitive
description:
Expand Down Expand Up @@ -625,4 +632,4 @@ packages:
version: "2.2.1"
sdks:
dart: ">=2.7.0 <3.0.0"
flutter: ">=1.16.0 <2.0.0"
flutter: ">=1.12.13+hotfix.5 <2.0.0"
2 changes: 2 additions & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ dependencies:


cupertino_icons: ^0.1.2
material_design_icons_flutter: ^4.0.5345
#provides extra icons

dev_dependencies:
flutter_test:
Expand Down