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

Changes to the project structure #8

Open
wants to merge 5 commits into
base: develop
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
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: Feature request
about: Suggest an idea for the project PothGula
title: ''
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
<!--A clear and concise description of what the problem is.-->

**Describe the solution you'd like**
<!--A clear and concise description of what you want to happen.-->

**Describe alternatives you've considered**
<!--A clear and concise description of any alternative solutions or features you've considered.-->

**Additional context**
<!--Add any other context or screenshots about the feature request here.-->

**Would you like to work on the issue?**

<!--Let us know if this issue should be assigned to you or tell us who you think could help to solve this issue.-->
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/let-s-report-a-bug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Let's report a bug
about: Report a bug which you have noticed, to help us improve PothGula
title: ''
labels: bug
assignees: ''

---

Please follow the issue template to **report a bug**

**Actual Behaviour**

<!--Please state here what is currently happening.-->

**Expected Behaviour**

<!--State here what the feature should enable the user to do.-->

**Steps to reproduce it**

<!--Add steps to reproduce bugs or add information on the place where the feature should be implemented. Add links to a sample deployment or code.-->

**LogCat for the issue**

<!--Provide logs for the crash here.-->

**Screenshots of the issue**

<!--Where-ever possible add a screenshot of the issue.-->

- Device: (e.g. iPhone6)
- OS: (e.g. iOS8.1)
- Flutter version:

**Would you like to work on the issue?**

<!--Let us know if this issue should be assigned to you or tell us who you think could help to solve this issue.-->
Binary file added assets/fonts/Oxygen-Bold.ttf
Binary file not shown.
Binary file added assets/fonts/Oxygen-Light.ttf
Binary file not shown.
Binary file added assets/fonts/Oxygen-Regular.ttf
Binary file not shown.
Binary file added assets/images/gamperliya.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/kaliyugaya.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/lila.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/madolduwa.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 10 additions & 8 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import 'package:flutter/material.dart';
import 'package:poth_gula/screens/home_screen.dart';

void main() => runApp(MyApp());
void main() => runApp(
MaterialApp(
title: 'PothGula',
home: HomeScreen(),
),
);

class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
// TODO: implement build
return null;
}
}
ThemeData appTheme = ThemeData(
primaryColor: Colors.blue
);
Empty file added lib/manager/database.dart
Empty file.
147 changes: 147 additions & 0 deletions lib/screens/home_screen.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
import 'package:flutter/material.dart';
import 'package:poth_gula/widgets/custom_choice_chips.dart';
import 'package:poth_gula/widgets/custom_popup_button.dart';
import 'package:poth_gula/widgets/custom_shape_clipper.dart';

class HomeScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Column(
children: <Widget>[
HomeScreenTopPart(),
],
),
);
}
}

Color firstColor = Color(0xFF2F80ED);
Color secondColor = Color(0xFF56CCF2);

List<String> searchArea = ['Colombo', 'Koswatte', 'Nawala'];

class HomeScreenTopPart extends StatefulWidget {
@override
_HomeScreenTopPartState createState() => _HomeScreenTopPartState();
}

class _HomeScreenTopPartState extends State<HomeScreenTopPart> {
var selectedArea = 0;
var isShareSelected = true;

@override
void initState() {
super.initState();
}

@override
void dispose() {
super.dispose();
}

@override
Widget build(BuildContext context) {
return Stack(
children: <Widget>[
ClipPath(
clipper: CustomShapeClipper(),
child: Container(
height: 400.0,
decoration: BoxDecoration(
gradient: LinearGradient(colors: [firstColor, secondColor])),
child: Column(
children: <Widget>[
SizedBox(height: 50.0),
Padding(
padding: const EdgeInsets.all(16.0),
child: Row(
children: <Widget>[
Icon(
Icons.location_on,
color: Colors.white,
),
SizedBox(
width: 16.0,
),
CustomPopupMenuButton(searchArea),
// have to capture the selectedItem from the CustomPopupMenuButton
Spacer(),
Icon(Icons.location_searching, color: Colors.white)
],
),
),
SizedBox(
height: 37.0,
),
Text(
'What would\nyou want to read?',
style: TextStyle(fontSize: 24.0, color: Colors.white),
textAlign: TextAlign.center,
),
SizedBox(
height: 30.0,
),
Padding(
padding: EdgeInsets.symmetric(horizontal: 32.0),
child: Material(
elevation: 5.0,
borderRadius: BorderRadius.all(Radius.circular(30.0)),
child: TextField(
controller: TextEditingController(text: "Gamperaliya"),
style: TextStyle(color: Colors.black54, fontSize: 16.0),
cursorColor: Colors.blue[900],
decoration: InputDecoration(
contentPadding: EdgeInsets.symmetric(
horizontal: 32.0, vertical: 14.0),
suffixIcon: Material(
elevation: 2.0,
borderRadius:
BorderRadius.all(Radius.circular(30.0)),
child: Icon(
Icons.search,
color: Colors.black,
),
),
border: InputBorder.none),
),
),
),
SizedBox(
height: 21.0,
),
Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
InkWell(
child: CustomChoiceChip(
Icons.donut_large, "Share", isShareSelected),
onTap: () {
setState(() {
isShareSelected = true;
});
},
),
SizedBox(
width: 20.0,
),
InkWell(
child: CustomChoiceChip(
Icons.donut_large, "Exchage", !isShareSelected),
onTap: () {
setState(() {
isShareSelected = false;
});
},
),
],
)
],
),
),
)
],
);
}
}
50 changes: 50 additions & 0 deletions lib/widgets/custom_choice_chips.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import 'package:flutter/material.dart';

class CustomChoiceChip extends StatefulWidget {
final IconData icon;
final String text;
final bool isSelected;

CustomChoiceChip(this.icon, this.text, this.isSelected);

@override
_CustomChoiceChipState createState() => _CustomChoiceChipState();
}

class _CustomChoiceChipState extends State<CustomChoiceChip> {
@override
void initState() {
super.initState();
}

@override
void dispose() {
super.dispose();
}

@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.symmetric(horizontal: 18.0, vertical: 8.0),
decoration: widget.isSelected ? BoxDecoration(
color: Colors.white.withOpacity(0.15),
borderRadius: BorderRadius.all(Radius.circular(20.0))) : null,
child: Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Icon(
widget.icon,
size: 20.0,
color: Colors.white,
),
SizedBox(
width: 8.0,
),
Text(widget.text,
style: TextStyle(color: Colors.white, fontSize: 14.0))
],
),
);
}
}
62 changes: 62 additions & 0 deletions lib/widgets/custom_popup_button.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import 'package:flutter/material.dart';


var _dropdownLabelStyle = TextStyle(color: Colors.white, fontSize: 16.0);
var _dropdownMenuItemStyle = TextStyle(color: Colors.black, fontSize: 16.0);
var selectedItemFromMenu = 0;

class CustomPopupMenuButton extends StatefulWidget {
final List<String> popupMenuItemList;

CustomPopupMenuButton(this.popupMenuItemList);

@override
_CustomPopupMenuButtonState createState() => _CustomPopupMenuButtonState();
}

class _CustomPopupMenuButtonState extends State<CustomPopupMenuButton>{
@override
void initState() {
super.initState();

}

@override
void dispose() {
super.dispose();
}

@override
Widget build(BuildContext context) => PopupMenuButton(
onSelected: (int index){
setState(() {
selectedItemFromMenu = index;
});
},
child: Row(
children: <Widget>[
Text(widget.popupMenuItemList[selectedItemFromMenu],
style: _dropdownLabelStyle),
Icon(
Icons.keyboard_arrow_down,
color: Colors.white,
)
],
),
itemBuilder: (BuildContext context) => <PopupMenuItem<int>>[
PopupMenuItem(
child: Text(
widget.popupMenuItemList[0],
style: _dropdownMenuItemStyle,
),
value: 0,
),
PopupMenuItem(
child: Text(
widget.popupMenuItemList[1],
style: _dropdownMenuItemStyle,
),
value: 1,
)
]);
}
26 changes: 26 additions & 0 deletions lib/widgets/custom_shape_clipper.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import 'package:flutter/material.dart';

class CustomShapeClipper extends CustomClipper<Path>{
@override
getClip(Size size) {

final Path path = Path();
path.lineTo(0.0, size.height);

var firstEndPoint = Offset(size.width*0.5, size.height-30.0);
var firstControllPoint = Offset(size.width*0.25, size.height-50.0);
path.quadraticBezierTo(firstControllPoint.dx, firstControllPoint.dy, firstEndPoint.dx, firstEndPoint.dy);

var secondEndPoint = Offset(size.width, size.height-80.0);
var secondControllPoint = Offset(size.width*0.75, size.height-10.0);
path.quadraticBezierTo(secondControllPoint.dx, secondControllPoint.dy, secondEndPoint.dx, secondEndPoint.dy);

path.lineTo(size.width, 0.0);
path.close();
return path;
}

@override
bool shouldReclip(CustomClipper oldClipper) => false;

}
Loading