Skip to content

Commit

Permalink
Gradiente ListView
Browse files Browse the repository at this point in the history
  • Loading branch information
Anahi Salgado committed Dec 6, 2018
1 parent 5b63003 commit 4c4bb6c
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 8 deletions.
Binary file added platzi_trips_app/assets/img/ann.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 platzi_trips_app/assets/img/girl.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions platzi_trips_app/lib/gradient_back.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import 'package:flutter/material.dart';

class GradientBack extends StatelessWidget {
@override
Widget build(BuildContext context) {
// TODO: implement build
return Container(
height: 250.0,
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [
Color(0xFF4268D3),
Color(0xFF584CD1)
],
begin: FractionalOffset(0.2, 0.0),
end: FractionalOffset(1.0, 0.6),
stops: [0.0, 0.6],
tileMode: TileMode.clamp
)
),
);
}

}
17 changes: 14 additions & 3 deletions platzi_trips_app/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import 'package:flutter/material.dart';
import 'description_place.dart';
import 'review_list.dart';
import 'gradient_back.dart';

void main() => runApp(MyApp());

Expand All @@ -23,10 +25,19 @@ class MyApp extends StatelessWidget {
primarySwatch: Colors.blue,
),
home: Scaffold(
appBar: AppBar(
title: Text("Hola Mundo Feliz"),
//body: new DescriptionPlace("Bahamas", 4, descriptionDummy),
body: Stack(
children: <Widget>[
ListView(
children: <Widget>[
DescriptionPlace("Bahamas", 4, descriptionDummy),
ReviewList()

],
),
GradientBack()
],
),
body: new DescriptionPlace("Bahamas", 4, descriptionDummy),
)//MyHomePage(title: 'Flutter Demo Home Page'),
);
}
Expand Down
8 changes: 4 additions & 4 deletions platzi_trips_app/lib/review.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import 'package:flutter/material.dart';

class Review extends StatelessWidget {

String pathImage = "asset/img/people.jpg";
String pathImage = "assets/img/people.jpg";
String name = "Varuna Yasas";
String details = "1 review 5 photos";
String details = "1 review · 5 photos";
String comment = "There is an amazing place in Sri Lanka";

Review(this.pathImage, this.name, this.details, this.comment);
Expand All @@ -19,7 +19,7 @@ class Review extends StatelessWidget {
),

child: Text(
details,
comment,
textAlign: TextAlign.left,
style: TextStyle(
fontFamily: "Lato",
Expand Down Expand Up @@ -98,7 +98,7 @@ class Review extends StatelessWidget {
return Row (
children: <Widget>[
photo,
userComment
userDetails

],
);
Expand Down
11 changes: 10 additions & 1 deletion platzi_trips_app/lib/review_list.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
import 'package:flutter/material.dart';
import 'review.dart';

class ReviewList extends StatelessWidget {
@override
Widget build(BuildContext context) {
// TODO: implement build
return null;
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Review("assets/img/people.jpg", "Varuna Yasas", "1 review · 5 photos", "There is an amazing place in Sri Lanka"),
Review("assets/img/ann.jpg", "Anahí Salgado", "2 review · 5 photos", "There is an amazing place in Sri Lanka"),
Review("assets/img/girl.jpg", "Gissele Thomas", "2 review · 2 photos", "There is an amazing place in Sri Lanka"),

],
);
}

}
2 changes: 2 additions & 0 deletions platzi_trips_app/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ flutter:
# see https://flutter.io/custom-fonts/#from-packages
assets:
- assets/img/people.jpg
- assets/img/ann.jpg
- assets/img/girl.jpg

fonts:
- family: Lato
Expand Down

0 comments on commit 4c4bb6c

Please sign in to comment.