|
|
|
|
@ -1,5 +1,3 @@
|
|
|
|
|
import 'dart:developer';
|
|
|
|
|
|
|
|
|
|
import 'package:auto_route/auto_route.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
|
|
|
|
@ -12,7 +10,7 @@ class TopControlAppBar extends ConsumerWidget with PreferredSizeWidget {
|
|
|
|
|
required this.onMoreInfoPressed,
|
|
|
|
|
required this.onDownloadPressed,
|
|
|
|
|
required this.onSharePressed,
|
|
|
|
|
this.loading = false
|
|
|
|
|
this.loading = false,
|
|
|
|
|
}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
final AssetResponseDto asset;
|
|
|
|
|
@ -26,6 +24,8 @@ class TopControlAppBar extends ConsumerWidget with PreferredSizeWidget {
|
|
|
|
|
double iconSize = 18.0;
|
|
|
|
|
|
|
|
|
|
return AppBar(
|
|
|
|
|
// iconTheme: IconThemeData(color: Colors.grey[100]),
|
|
|
|
|
// actionsIconTheme: IconThemeData(color: Colors.grey[100]),
|
|
|
|
|
foregroundColor: Colors.grey[100],
|
|
|
|
|
toolbarHeight: 60,
|
|
|
|
|
backgroundColor: Colors.black,
|
|
|
|
|
@ -33,37 +33,32 @@ class TopControlAppBar extends ConsumerWidget with PreferredSizeWidget {
|
|
|
|
|
onPressed: () {
|
|
|
|
|
AutoRouter.of(context).pop();
|
|
|
|
|
},
|
|
|
|
|
icon: const Icon(
|
|
|
|
|
icon: Icon(
|
|
|
|
|
Icons.arrow_back_ios_new_rounded,
|
|
|
|
|
size: 20.0,
|
|
|
|
|
color: Colors.grey[200],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
actions: [
|
|
|
|
|
if (loading) Center(
|
|
|
|
|
child: Container(
|
|
|
|
|
margin: const EdgeInsets.symmetric(horizontal: 15.0),
|
|
|
|
|
width: iconSize,
|
|
|
|
|
height: iconSize,
|
|
|
|
|
child: const CircularProgressIndicator(strokeWidth: 2.0),
|
|
|
|
|
if (loading)
|
|
|
|
|
Center(
|
|
|
|
|
child: Container(
|
|
|
|
|
margin: const EdgeInsets.symmetric(horizontal: 15.0),
|
|
|
|
|
width: iconSize,
|
|
|
|
|
height: iconSize,
|
|
|
|
|
child: const CircularProgressIndicator(strokeWidth: 2.0),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
) ,
|
|
|
|
|
IconButton(
|
|
|
|
|
iconSize: iconSize,
|
|
|
|
|
splashRadius: iconSize,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
onDownloadPressed();
|
|
|
|
|
},
|
|
|
|
|
icon: const Icon(Icons.cloud_download_rounded),
|
|
|
|
|
),
|
|
|
|
|
IconButton(
|
|
|
|
|
iconSize: iconSize,
|
|
|
|
|
splashRadius: iconSize,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
log("favorite");
|
|
|
|
|
},
|
|
|
|
|
icon: asset.isFavorite
|
|
|
|
|
? const Icon(Icons.favorite_rounded)
|
|
|
|
|
: const Icon(Icons.favorite_border_rounded),
|
|
|
|
|
icon: Icon(
|
|
|
|
|
Icons.cloud_download_rounded,
|
|
|
|
|
color: Colors.grey[200],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
IconButton(
|
|
|
|
|
iconSize: iconSize,
|
|
|
|
|
@ -71,7 +66,10 @@ class TopControlAppBar extends ConsumerWidget with PreferredSizeWidget {
|
|
|
|
|
onPressed: () {
|
|
|
|
|
onSharePressed();
|
|
|
|
|
},
|
|
|
|
|
icon: const Icon(Icons.share),
|
|
|
|
|
icon: Icon(
|
|
|
|
|
Icons.share,
|
|
|
|
|
color: Colors.grey[200],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
IconButton(
|
|
|
|
|
iconSize: iconSize,
|
|
|
|
|
@ -79,7 +77,10 @@ class TopControlAppBar extends ConsumerWidget with PreferredSizeWidget {
|
|
|
|
|
onPressed: () {
|
|
|
|
|
onMoreInfoPressed();
|
|
|
|
|
},
|
|
|
|
|
icon: const Icon(Icons.more_horiz_rounded),
|
|
|
|
|
icon: Icon(
|
|
|
|
|
Icons.more_horiz_rounded,
|
|
|
|
|
color: Colors.grey[200],
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
|