Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2021-153
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2021-153
2021-153
Commits
70a26ad0
Commit
70a26ad0
authored
Sep 20, 2021
by
Weerasinghe S.W.P.N.M - IT18001808
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'IT18001808' into 'master'
Added Favourit icon dunction See merge request
!17
parents
3c0474ad
c336fd41
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
6 deletions
+33
-6
Mobile App/lib/screens/productPage/body.dart
Mobile App/lib/screens/productPage/body.dart
+25
-6
Mobile App/pubspec.lock
Mobile App/pubspec.lock
+7
-0
Mobile App/pubspec.yaml
Mobile App/pubspec.yaml
+1
-0
No files found.
Mobile App/lib/screens/productPage/body.dart
View file @
70a26ad0
import
'package:fitton/model/Product.dart'
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.dart'
;
import
'package:fluttertoast/fluttertoast.dart'
;
class
ProductPageBody
extends
StatefulWidget
{
final
Product
itemDetails
;
...
...
@@ -12,6 +13,7 @@ class ProductPageBody extends StatefulWidget {
class
_ProductPageBodyState
extends
State
<
ProductPageBody
>
{
int
nuOfItem
=
1
;
bool
isFavourite
=
false
;
@override
Widget
build
(
BuildContext
context
)
{
...
...
@@ -90,10 +92,24 @@ class _ProductPageBodyState extends State<ProductPageBody> {
),
),
Expanded
(
child:
InkWell
(
onTap:
(){
Scaffold
.
of
(
context
).
showSnackBar
(
SnackBar
(
content:
Text
(
isFavourite
?
"Removed From Favourite List"
:
"Added to the Favourite List"
),
));
setState
(()
{
isFavourite
=
!
isFavourite
;
});
},
child:
Padding
(
padding:
EdgeInsets
.
only
(
top:
10
),
child:
Icon
(
Icons
.
favorite
,
size:
30.0
,
color:
Colors
.
red
,),
child:
Icon
(
isFavourite
?
Icons
.
favorite
:
Icons
.
favorite_outline
,
size:
30.0
,
color:
Colors
.
red
,
),
)
),
)
],
),
...
...
@@ -213,6 +229,9 @@ class _ProductPageBodyState extends State<ProductPageBody> {
icon:
Icon
(
Icons
.
add_shopping_cart
,
color:
Colors
.
deepPurpleAccent
,),
onPressed:
(){
print
(
"Added to cart"
);
Scaffold
.
of
(
context
).
showSnackBar
(
SnackBar
(
content:
Text
(
"Added to the Cart"
),
));
},
),
),
...
...
@@ -249,7 +268,7 @@ class _ProductPageBodyState extends State<ProductPageBody> {
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
<
Widget
>[
Padding
(
padding:
EdgeInsets
.
only
(
top:
0
0
),
padding:
EdgeInsets
.
only
(
top:
2
0
),
child:
Text
(
"Clothes for Men"
,
style:
TextStyle
(
color:
Colors
.
white
,
fontSize:
17.0
),
...
...
@@ -284,7 +303,7 @@ class _ProductPageBodyState extends State<ProductPageBody> {
]
),
),
SizedBox
(
width:
50.0
,),
SizedBox
(
width:
size
.
height
*
0.08
,),
Expanded
(
child:
Image
.
asset
(
widget
.
itemDetails
.
images
[
0
],),
)
...
...
Mobile App/pubspec.lock
View file @
70a26ad0
...
...
@@ -149,6 +149,13 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
fluttertoast:
dependency: "direct main"
description:
name: fluttertoast
url: "https://pub.dartlang.org"
source: hosted
version: "8.0.8"
http:
dependency: transitive
description:
...
...
Mobile App/pubspec.yaml
View file @
70a26ad0
...
...
@@ -38,6 +38,7 @@ dependencies:
flutter_svg
:
^0.17.4
provider
:
^4.3.1
simple_animations
:
^1.3.3
fluttertoast
:
^8.0.8
flutter_icons
:
android
:
true
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment