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 screen navigation and updated code structure #1

Open
wants to merge 1 commit into
base: master
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
3 changes: 1 addition & 2 deletions lib/Constants/constants.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@

final String MAIN_UI = "main_ui";
final String SPLASH_SCREEN = "splash_screen";
final String SPLASH_SCREEN = "splash_screen";
5 changes: 2 additions & 3 deletions lib/Model/categoryModel.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
class Category{
class Category {
String title;
String icon;

Category(this.title, this.icon);

}
}
5 changes: 2 additions & 3 deletions lib/Model/productModel.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class Product{
class Product {
int adID;
String dateAdded;
String title;
Expand All @@ -12,5 +12,4 @@ class Product{

Product(this.adID, this.dateAdded, this.title, this.desc, this.price,
this.warranty, this.category, this.mobileNo, this.image, this.negotiable);

}
}
20 changes: 12 additions & 8 deletions lib/UI/Widgets/custom_appbar.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:flutter/material.dart';

class CustomAppBar extends StatelessWidget {
String title;
final String title;

CustomAppBar(this.title);

Expand All @@ -10,25 +10,29 @@ class CustomAppBar extends StatelessWidget {
double height = MediaQuery.of(context).size.height;
double width = MediaQuery.of(context).size.width;
return Container(
height: height/10,
height: height / 10,
width: width,
padding: EdgeInsets.only(left: 10, top: 25),
decoration: BoxDecoration(
gradient: LinearGradient(
colors:[Colors.orange[200], Colors.pinkAccent],
)
),
colors: [Colors.orange[200], Colors.pinkAccent],
)),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
IconButton(
icon: Icon(Icons.arrow_back_ios),
onPressed: (){
onPressed: () {
print("pop");
Navigator.of(context).pop();
}),
SizedBox(width: 10,),
Text('$title', style: TextStyle(fontWeight: FontWeight.bold, fontSize: 24),)
SizedBox(
width: 10,
),
Text(
'$title',
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 24),
)
],
),
);
Expand Down
36 changes: 15 additions & 21 deletions lib/UI/Widgets/custom_shape.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,31 @@ class CustomShapeClipper extends CustomClipper<Path> {
@override
Path getClip(Size size) {
final Path path = Path();
path.lineTo(0.0, size.height-80);
path.lineTo(0.0, size.height - 80);

var firstEndPoint = Offset(size.width, 0);
var firstControlPoint = Offset(size.width * .5, size.height/1.5);
path.quadraticBezierTo(firstControlPoint.dx, firstControlPoint.dy, firstEndPoint.dx, firstEndPoint.dy);
var firstControlPoint = Offset(size.width * .5, size.height / 1.5);
path.quadraticBezierTo(firstControlPoint.dx, firstControlPoint.dy,
firstEndPoint.dx, firstEndPoint.dy);

path.close();
return path;
}

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


}

class CustomShapeClipper2 extends CustomClipper<Path> {
@override
Path getClip(Size size) {
final Path path = Path();
path.lineTo(0.0, size.height-20);

var firstEndPoint = Offset(size.width , size.height /2);
var firstControlPoint = Offset(size.width * 0.5, size.height+10);
path.quadraticBezierTo(firstControlPoint.dx, firstControlPoint.dy, firstEndPoint.dx, firstEndPoint.dy);
path.lineTo(0.0, size.height - 20);

var firstEndPoint = Offset(size.width, size.height / 2);
var firstControlPoint = Offset(size.width * 0.5, size.height + 10);
path.quadraticBezierTo(firstControlPoint.dx, firstControlPoint.dy,
firstEndPoint.dx, firstEndPoint.dy);

path.lineTo(size.width, 0);
path.close();
Expand All @@ -38,21 +37,18 @@ class CustomShapeClipper2 extends CustomClipper<Path> {

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


}


class CustomShapeClipper3 extends CustomClipper<Path> {
@override
Path getClip(Size size) {
final Path path = Path();
path.lineTo(0.0, size.height -30);

var firstEndPoint = Offset(size.width , size.height/1.25);
var firstControlPoint = Offset(size.width * 0.5, size.height+20);
path.quadraticBezierTo(firstControlPoint.dx, firstControlPoint.dy, firstEndPoint.dx, firstEndPoint.dy);
path.lineTo(0.0, size.height - 30);

var firstEndPoint = Offset(size.width, size.height / 1.25);
var firstControlPoint = Offset(size.width * 0.5, size.height + 20);
path.quadraticBezierTo(firstControlPoint.dx, firstControlPoint.dy,
firstEndPoint.dx, firstEndPoint.dy);

path.lineTo(size.width, 0);
path.close();
Expand All @@ -61,6 +57,4 @@ class CustomShapeClipper3 extends CustomClipper<Path> {

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


}
}
48 changes: 27 additions & 21 deletions lib/UI/Widgets/mainui_customcard.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,22 @@ class CustomCard extends StatelessWidget {
String image;
String location;



CustomCard({this.title, this.price, this.dateAdded, this.category,
this.description, this.image, this.location});
CustomCard(
{this.title,
this.price,
this.dateAdded,
this.category,
this.description,
this.image,
this.location});

@override
Widget build(BuildContext context) {
_width= MediaQuery.of(context).size.width;
_width = MediaQuery.of(context).size.width;
_height = MediaQuery.of(context).size.height;
return Card(
elevation: 3,
shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(16.0)),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16.0)),
color: Colors.white,
child: Container(
padding: EdgeInsets.only(left: 10, top: 10, right: 5, bottom: 10),
Expand All @@ -33,11 +36,11 @@ class CustomCard extends StatelessWidget {
children: <Widget>[
Column(
crossAxisAlignment: CrossAxisAlignment.start,

children: <Widget>[
Text(
title,
style: TextStyle(fontWeight: FontWeight.bold, fontSize: _height/40),
style: TextStyle(
fontWeight: FontWeight.bold, fontSize: _height / 40),
),
Container(
width: _width / 2.75,
Expand Down Expand Up @@ -76,7 +79,7 @@ class CustomCard extends StatelessWidget {
child: Text(
description,
style: TextStyle(
fontSize: _height/70,
fontSize: _height / 70,
),
maxLines: 2,
overflow: TextOverflow.ellipsis,
Expand All @@ -93,30 +96,33 @@ class CustomCard extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Flexible(
child: GestureDetector(
child: Icon(Icons.favorite_border, size: _height/30,),
onTap: (){
print('Fav');
},
child: GestureDetector(
child: Icon(
Icons.favorite_border,
size: _height / 30,
),
onTap: () {
print('Fav');
},
),
),
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
dateAdded,
style: TextStyle(fontSize: _height/65),
style: TextStyle(fontSize: _height / 65),
),
Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Icon(
Icons.location_on,
size: _height/65,
size: _height / 65,
),
Text(
location,
style: TextStyle(fontSize: _height/65),
style: TextStyle(fontSize: _height / 65),
)
],
),
Expand All @@ -132,7 +138,7 @@ class CustomCard extends StatelessWidget {
width: 10,
),
Container(
width: _width/2.5,
width: _width / 2.5,
decoration: BoxDecoration(
shape: BoxShape.rectangle,
color: Colors.orange[50],
Expand All @@ -142,8 +148,8 @@ class CustomCard extends StatelessWidget {
child: Image.asset(
image,
fit: BoxFit.cover,
height: _height/4,
width: _width/4,
height: _height / 4,
width: _width / 4,
),
),
],
Expand Down
18 changes: 11 additions & 7 deletions lib/UI/Widgets/splash_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class SplashScreenState extends State<AnimatedSplashScreen>
animationController = new AnimationController(
vsync: this, duration: new Duration(seconds: 2));
animation =
new CurvedAnimation(parent: animationController, curve: Curves.easeOut);
new CurvedAnimation(parent: animationController, curve: Curves.easeOut);

animation.addListener(() => this.setState(() {}));
animationController.forward();
Expand All @@ -52,11 +52,15 @@ class SplashScreenState extends State<AnimatedSplashScreen>
mainAxisAlignment: MainAxisAlignment.end,
mainAxisSize: MainAxisSize.min,
children: <Widget>[

Padding(padding: EdgeInsets.only(bottom: 30.0),child:new Image.asset('assets/images/powered_by.png',height: 25.0,fit: BoxFit.scaleDown,))


],),
Padding(
padding: EdgeInsets.only(bottom: 30.0),
child: new Image.asset(
'assets/images/powered_by.png',
height: 25.0,
fit: BoxFit.scaleDown,
))
],
),
new Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Expand All @@ -71,4 +75,4 @@ class SplashScreenState extends State<AnimatedSplashScreen>
),
);
}
}
}
Loading