Skip to content

Commit

Permalink
feat: adiciona botão de like.
Browse files Browse the repository at this point in the history
  • Loading branch information
larissaperinoto committed Jan 15, 2023
1 parent 95fdd0c commit 2567f74
Showing 1 changed file with 25 additions and 13 deletions.
38 changes: 25 additions & 13 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,35 @@ class _MyHomePageState extends State<MyHomePage> {

@override
Widget build(BuildContext context) {
if (currentDog.contains('mp4') || currentDog.contains('svg')) {
if (currentDog.contains('mp4') ||
currentDog.contains('svg') ||
currentDog.contains('gif')) {
changeDog();
}

return Scaffold(
body: Column(
return Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
ImageCard(dog: currentDog),
ElevatedButton(
onPressed: () {
changeDog();
print(currentDog);
},
child: const Text('Next')),
const SizedBox(height: 10),
Row(
mainAxisSize: MainAxisSize.min,
children: [
ElevatedButton.icon(
onPressed: () {},
icon: const Icon(Icons.favorite),
label: const Text('Like'),
),
const SizedBox(width: 10),
ElevatedButton(
onPressed: () {
changeDog();
},
child: const Text('Next'),
),
],
),
],
),
);
Expand All @@ -88,18 +103,15 @@ class ImageCard extends StatelessWidget {
@override
Widget build(BuildContext context) {
var theme = Theme.of(context);
/* var style = theme.textTheme.displayMedium!.copyWith(
color: theme.colorScheme.onPrimary,
); */

return Card(
color: theme.colorScheme.primary,
semanticContainer: true,
child: Padding(
padding: const EdgeInsets.all(20),
child: SizedBox(
width: 500,
child: Image.network('$dog', width: 100),
width: 200,
),
),
);
Expand Down

0 comments on commit 2567f74

Please sign in to comment.