Skip to content

Commit

Permalink
Button InkWell
Browse files Browse the repository at this point in the history
  • Loading branch information
Anahi Salgado committed Dec 7, 2018
1 parent d016554 commit d335634
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 1 deletion.
61 changes: 61 additions & 0 deletions platzi_trips_app/lib/button_purple.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import 'package:flutter/material.dart';


class ButtonPurple extends StatelessWidget {

String buttonText = "Navigate";

ButtonPurple(this.buttonText);

@override
Widget build(BuildContext context) {
// TODO: implement build
return InkWell(
onTap: () {
Scaffold.of(context).showSnackBar(
SnackBar(
content: Text("Navegando"),
)
);
},
child: Container(
margin: EdgeInsets.only(
top: 30.0,
left: 20.0,
right: 20.0
),
height: 50.0,
width: 180.0,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(30.0),
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

)

),

child: Center(
child: Text(
buttonText,
style: TextStyle(
fontSize: 18.0,
fontFamily: "Lato",
color: Colors.white
),

),
),

),
);
}

}
5 changes: 4 additions & 1 deletion platzi_trips_app/lib/description_place.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'button_purple.dart';

class DescriptionPlace extends StatelessWidget {

Expand Down Expand Up @@ -105,9 +106,11 @@ class DescriptionPlace extends StatelessWidget {
);

return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
title_stars,
description
description,
ButtonPurple("Navigate")
],
);

Expand Down

0 comments on commit d335634

Please sign in to comment.