mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-08 23:18:16 -07:00
feature: Auto next-up preview, skip to next in queue. (#96)
Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
parent
f72ae9e3ca
commit
66f2b6cd4e
13 changed files with 971 additions and 137 deletions
|
|
@ -1,21 +1,20 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:ficonsax/ficonsax.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
import 'package:fladder/util/list_padding.dart';
|
||||
|
||||
enum MessageType {
|
||||
info,
|
||||
warning,
|
||||
error;
|
||||
|
||||
Color color(BuildContext context) {
|
||||
switch (this) {
|
||||
case info:
|
||||
return Theme.of(context).colorScheme.surface;
|
||||
case warning:
|
||||
return Theme.of(context).colorScheme.primaryContainer;
|
||||
case error:
|
||||
return Theme.of(context).colorScheme.errorContainer;
|
||||
}
|
||||
}
|
||||
Color color(BuildContext context) => switch (this) {
|
||||
MessageType.info => Theme.of(context).colorScheme.secondaryContainer,
|
||||
MessageType.warning => Theme.of(context).colorScheme.primaryContainer,
|
||||
MessageType.error => Theme.of(context).colorScheme.errorContainer,
|
||||
};
|
||||
}
|
||||
|
||||
class SettingsMessageBox extends ConsumerWidget {
|
||||
|
|
@ -38,7 +37,20 @@ class SettingsMessageBox extends ConsumerWidget {
|
|||
color: messageType.color(context),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Text(message),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(
|
||||
switch (messageType) {
|
||||
MessageType.info => IconsaxOutline.information,
|
||||
MessageType.warning => IconsaxOutline.warning_2,
|
||||
MessageType.error => IconsaxOutline.danger,
|
||||
},
|
||||
),
|
||||
Flexible(
|
||||
child: Text(message),
|
||||
),
|
||||
].addInBetween(const SizedBox(width: 12)),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue