Skip to content

Commit

Permalink
"more info" menu
Browse files Browse the repository at this point in the history
  • Loading branch information
apoleon33 committed Dec 31, 2023
1 parent b0c9e73 commit 0f6fc79
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/albumCard.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:cradle/moreInfoMenu.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:dio/dio.dart';
Expand Down Expand Up @@ -38,7 +39,7 @@ class _AlbumCardState extends State<AlbumCard> {
List genres = result['genre'];
setState(() {
cover = Image.network(
result['image'],
result['image']['uri'],
fit: BoxFit.fitWidth,
);
name = result['name'];
Expand Down Expand Up @@ -168,9 +169,8 @@ class _AlbumCardState extends State<AlbumCard> {
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
IconButton.filled(
onPressed: () {},
icon: const Icon(Icons.more_vert)),
const MoreInfoMenu(),

// new Spacer(),
FilledButton.icon(
icon: SvgPicture.asset(
Expand Down
34 changes: 34 additions & 0 deletions lib/moreInfoMenu.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import 'package:flutter/material.dart';

class MoreInfoMenu extends StatelessWidget {
const MoreInfoMenu({
super.key,
});

@override
Widget build(BuildContext context) {
return MenuAnchor(menuChildren: <Widget>[
MenuItemButton(
child: const Text("yup"),
onPressed: () {},
),
MenuItemButton(
child: const Text("we are here"),
onPressed: () {},
)
], builder: builder);
}

Widget builder(
BuildContext context, MenuController controller, Widget? child) {
return IconButton.filled(
onPressed: () {
if (controller.isOpen) {
controller.close();
} else {
controller.open();
}
},
icon: const Icon(Icons.more_vert));
}
}

0 comments on commit 0f6fc79

Please sign in to comment.