mirror of
https://github.com/simon-ding/polaris.git
synced 2026-06-26 10:45:21 +08:00
ui: improve external link display
This commit is contained in:
@@ -113,30 +113,49 @@ class _DetailCardState extends ConsumerState<DetailCard> {
|
|||||||
label: Text(
|
label: Text(
|
||||||
"${(widget.details.limiter!.sizeMin).readableFileSize()} - ${(widget.details.limiter!.sizeMax).readableFileSize()}"))
|
"${(widget.details.limiter!.sizeMin).readableFileSize()} - ${(widget.details.limiter!.sizeMax).readableFileSize()}"))
|
||||||
: const SizedBox(),
|
: const SizedBox(),
|
||||||
Chip(
|
MenuAnchor(
|
||||||
|
style: MenuStyle(alignment: Alignment.bottomRight),
|
||||||
|
menuChildren: [
|
||||||
|
ActionChip.elevated(
|
||||||
|
onPressed: () => launchUrl(url),
|
||||||
clipBehavior: Clip.hardEdge,
|
clipBehavior: Clip.hardEdge,
|
||||||
|
backgroundColor: Colors.indigo[700],
|
||||||
shape: ContinuousRectangleBorder(
|
shape: ContinuousRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(100.0)),
|
borderRadius:
|
||||||
|
BorderRadius.circular(100.0)),
|
||||||
padding: EdgeInsets.all(0),
|
padding: EdgeInsets.all(0),
|
||||||
label: InkWell(
|
label: Text("TMDB")),
|
||||||
child: Text("TMDB"),
|
|
||||||
onTap: () => launchUrl(url),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
isBlank(widget.details.imdbid)
|
isBlank(widget.details.imdbid)
|
||||||
? SizedBox()
|
? SizedBox()
|
||||||
: Chip(
|
: ActionChip.elevated(
|
||||||
|
onPressed: () => launchUrl(imdbUrl),
|
||||||
|
backgroundColor: Colors.indigo[700],
|
||||||
clipBehavior: Clip.hardEdge,
|
clipBehavior: Clip.hardEdge,
|
||||||
shape: ContinuousRectangleBorder(
|
shape: ContinuousRectangleBorder(
|
||||||
borderRadius:
|
borderRadius:
|
||||||
BorderRadius.circular(100.0)),
|
BorderRadius.circular(100.0)),
|
||||||
padding: EdgeInsets.all(0),
|
padding: EdgeInsets.all(0),
|
||||||
label: InkWell(
|
label: Text("IMDB"),
|
||||||
child: Text("IMDB"),
|
|
||||||
onTap: () => launchUrl(imdbUrl),
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
|
builder: (context, controller, child) {
|
||||||
|
return ActionChip.elevated(
|
||||||
|
onPressed: () {
|
||||||
|
if (controller.isOpen) {
|
||||||
|
controller.close();
|
||||||
|
} else {
|
||||||
|
controller.open();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
clipBehavior: Clip.hardEdge,
|
||||||
|
shape: ContinuousRectangleBorder(
|
||||||
|
borderRadius:
|
||||||
|
BorderRadius.circular(100.0)),
|
||||||
|
padding: EdgeInsets.all(0),
|
||||||
|
label: Text("外部链接"));
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
const Text("", style: TextStyle(height: 1)),
|
const Text("", style: TextStyle(height: 1)),
|
||||||
Expanded(
|
Expanded(
|
||||||
|
|||||||
Reference in New Issue
Block a user