mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-17 03:06:39 -07:00
feature: Improved banners, made banner settings easier to understand. (#71)
Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
parent
11e0e106d3
commit
476bdc130e
29 changed files with 916 additions and 666 deletions
51
lib/screens/shared/media/banner_play_button.dart
Normal file
51
lib/screens/shared/media/banner_play_button.dart
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:ficonsax/ficonsax.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:square_progress_indicator/square_progress_indicator.dart';
|
||||
|
||||
import 'package:fladder/models/item_base_model.dart';
|
||||
import 'package:fladder/util/item_base_model/play_item_helpers.dart';
|
||||
|
||||
class BannerPlayButton extends ConsumerWidget {
|
||||
final ItemBaseModel item;
|
||||
const BannerPlayButton({
|
||||
super.key,
|
||||
required this.item,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
return Align(
|
||||
alignment: Alignment.bottomRight,
|
||||
child: Opacity(
|
||||
opacity: 0.9,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Card(
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
|
||||
child: Stack(
|
||||
children: [
|
||||
Positioned.fill(
|
||||
child: SquareProgressIndicator(
|
||||
value: item.userData.progress / 100,
|
||||
borderRadius: 12,
|
||||
strokeCap: StrokeCap.round,
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () => item.play(context, ref),
|
||||
icon: const Icon(
|
||||
IconsaxBold.play,
|
||||
size: 30,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue