[Setup] Added build.yaml and check.yaml (#1)

Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
PartyDonut 2024-09-21 11:59:28 +02:00 committed by GitHub
parent 226686eb18
commit 7b3e733b76
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
112 changed files with 3926 additions and 3784 deletions

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -302,7 +302,7 @@ class _MainState extends ConsumerState<Main> with WindowListener, WidgetsBinding
context: context,
locale: AppLocalizations.supportedLocales.firstWhere(
(element) => element.languageCode == language.languageCode,
orElse: () => Locale('en', "GB"),
orElse: () => const Locale('en', "GB"),
),
child: ScaffoldMessenger(child: child ?? Container()),
),

View file

@ -72,7 +72,7 @@ class ItemBaseModel with ItemBaseModelMappable {
SortingOptions.parentalRating => overview.parentalRating != null
? Row(
children: [
Icon(
const Icon(
IconsaxBold.star_1,
size: 14,
color: Colors.yellowAccent,
@ -85,7 +85,7 @@ class ItemBaseModel with ItemBaseModelMappable {
SortingOptions.communityRating => overview.communityRating != null
? Row(
children: [
Icon(
const Icon(
IconsaxBold.star_1,
size: 14,
color: Colors.yellowAccent,

View file

@ -74,7 +74,7 @@ class EpisodeModel extends ItemStreamModel with EpisodeModelMappable {
images: images,
childCount: childCount,
primaryRatio: primaryRatio,
userData: UserData(),
userData: const UserData(),
);
@override

View file

@ -35,7 +35,7 @@ class UserData with UserDataMappable {
factory UserData.fromDto(dto.UserItemDataDto? dto) {
if (dto == null) {
return UserData();
return const UserData();
}
return UserData(
isFavourite: dto.isFavorite ?? false,

View file

@ -89,7 +89,7 @@ class SeasonModel extends ItemBaseModel with SeasonModelMappable {
images: images,
childCount: childCount,
primaryRatio: primaryRatio,
userData: UserData(),
userData: const UserData(),
);
static List<SeasonModel> seasonsFromDto(List<dto.BaseItemDto>? dto, Ref ref) {

View file

@ -113,5 +113,5 @@ class Vector2 {
@override
int get hashCode => x.hashCode ^ y.hashCode;
static fromPosition(Offset windowPosition) => Vector2(x: windowPosition.dx, y: windowPosition.dy);
static Vector2 fromPosition(Offset windowPosition) => Vector2(x: windowPosition.dx, y: windowPosition.dy);
}

View file

@ -85,7 +85,7 @@ class DashboardNotifier extends StateNotifier<HomeModel> {
final nextResponse = await api.showsNextUpGet(
limit: 16,
nextUpDateCutoff: DateTime.now()
.subtract(ref.read(clientSettingsProvider.select((value) => value.nextUpDateCutoff ?? Duration(days: 28)))),
.subtract(ref.read(clientSettingsProvider.select((value) => value.nextUpDateCutoff ?? const Duration(days: 28)))),
fields: [
ItemFields.parentid,
ItemFields.mediastreams,

View file

@ -33,7 +33,7 @@ final librarySearchProvider =
});
class LibrarySearchNotifier extends StateNotifier<LibrarySearchModel> {
LibrarySearchNotifier(this.ref) : super(LibrarySearchModel());
LibrarySearchNotifier(this.ref) : super(const LibrarySearchModel());
final Ref ref;
@ -379,7 +379,7 @@ class LibrarySearchNotifier extends StateNotifier<LibrarySearchModel> {
}
}
selectAll(bool select) => state = state.copyWith(selectedPosters: select ? state.posters : []);
LibrarySearchModel selectAll(bool select) => state = state.copyWith(selectedPosters: select ? state.posters : []);
Future<void> setSelectedAsFavorite(bool bool) async {
final Map<String, UserData> updateInfo = {};

View file

@ -23,7 +23,7 @@ class SessionInfo extends _$SessionInfo {
void _startTimer() {
_fetchData();
_timer = Timer.periodic(Duration(seconds: 2), (timer) async {
_timer = Timer.periodic(const Duration(seconds: 2), (timer) async {
await _fetchData();
});
}

View file

@ -130,7 +130,7 @@ class BookViewerSettingsNotifier extends StateNotifier<BookViewerSettingsModel>
}
}
setSavedBrightness() {
void setSavedBrightness() {
if (state.screenBrightness != null) {
ScreenBrightness().setScreenBrightness(state.screenBrightness!);
}

View file

@ -17,5 +17,5 @@ class HomeSettingsNotifier extends StateNotifier<HomeSettingsModel> {
ref.read(sharedUtilityProvider).homeSettings = value;
}
update(HomeSettingsModel Function(HomeSettingsModel currentState) value) => state = value(state);
HomeSettingsModel update(HomeSettingsModel Function(HomeSettingsModel currentState) value) => state = value(state);
}

View file

@ -27,14 +27,14 @@ class SubtitleSettingsNotifier extends StateNotifier<SubtitleSettingsModel> {
void setOutlineColor(Color e) => state = state.copyWith(outlineColor: e);
setOutlineThickness(double value) => state = state.copyWith(outlineSize: value);
SubtitleSettingsModel setOutlineThickness(double value) => state = state.copyWith(outlineSize: value);
void resetSettings({SubtitleSettingsModel? value}) => state = value ?? const SubtitleSettingsModel();
void setFontWeight(FontWeight? value) => state = state.copyWith(fontWeight: value);
setBackGroundOpacity(double value) =>
SubtitleSettingsModel setBackGroundOpacity(double value) =>
state = state.copyWith(backGroundColor: state.backGroundColor.withOpacity(value));
setShadowIntensity(double value) => state = state.copyWith(shadow: value);
SubtitleSettingsModel setShadowIntensity(double value) => state = state.copyWith(shadow: value);
}

View file

@ -36,7 +36,7 @@ class VideoPlayerSettingsProviderNotifier extends StateNotifier<VideoPlayerSetti
}
}
setSavedBrightness() {
void setSavedBrightness() {
if (state.screenBrightness != null) {
ScreenBrightness().setScreenBrightness(state.screenBrightness!);
}

View file

@ -8,9 +8,9 @@ FileDownloader backgroundDownloader(BackgroundDownloaderRef ref) {
return FileDownloader()
..trackTasks()
..configureNotification(
running: TaskNotification('Downloading', 'file: {filename}'),
complete: TaskNotification('Download finished', 'file: {filename}'),
paused: TaskNotification('Download paused', 'file: {filename}'),
running: const TaskNotification('Downloading', 'file: {filename}'),
complete: const TaskNotification('Download finished', 'file: {filename}'),
paused: const TaskNotification('Download paused', 'file: {filename}'),
progressBar: true,
);
}

View file

@ -375,7 +375,7 @@ class SyncNotifier extends StateNotifier<SyncSettingsModel> {
Future<DownloadStream?> syncVideoFile(SyncedItem syncItem, bool skipDownload) async {
final playbackResponse = await api.itemsItemIdPlaybackInfoPost(
itemId: syncItem.id,
body: PlaybackInfoDto(
body: const PlaybackInfoDto(
enableDirectPlay: true,
enableDirectStream: true,
enableTranscoding: false,

View file

@ -74,7 +74,7 @@ class VideoPlayerNotifier extends StateNotifier<MediaControlsWrapper> {
final lastPosition = ref.read(mediaPlaybackProvider.select((value) => value.lastPosition));
final diff = (position.inMilliseconds - lastPosition.inMilliseconds).abs();
if (diff > Duration(seconds: 1, milliseconds: 500).inMilliseconds) {
if (diff > const Duration(seconds: 1, milliseconds: 500).inMilliseconds) {
mediaState.update((value) => value.copyWith(
position: event,
playing: player.state.playing,

View file

@ -27,7 +27,7 @@ class BookViewerReader extends ConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
return Container(
child: Text("Web not supported."),
child: const Text("Web not supported."),
);
}
}

View file

@ -159,14 +159,14 @@ class _BookViewerScreenState extends ConsumerState<BookViewerScreen> {
),
} else ...{
const SizedBox(height: 32),
Card(
const Card(
child: Padding(
padding: const EdgeInsets.all(16),
padding: EdgeInsets.all(16),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(Icons.info_rounded),
const SizedBox(width: 16),
SizedBox(width: 16),
Text("No next chapter"),
],
),
@ -211,14 +211,14 @@ class _BookViewerScreenState extends ConsumerState<BookViewerScreen> {
),
} else ...{
const SizedBox(height: 32),
Card(
const Card(
child: Padding(
padding: const EdgeInsets.all(16),
padding: EdgeInsets.all(16),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(Icons.info_rounded),
const SizedBox(width: 16),
SizedBox(width: 16),
Text("First chapter"),
],
),

View file

@ -120,9 +120,9 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
),
),
} else if (AdaptiveLayout.of(context).isDesktop)
DefaultSliverTopBadding(),
const DefaultSliverTopBadding(),
if (AdaptiveLayout.of(context).isDesktop)
SliverToBoxAdapter(
const SliverToBoxAdapter(
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
@ -191,7 +191,7 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
posters: view.recentlyAdded,
),
)),
].whereNotNull().toList().addInBetween(SliverToBoxAdapter(child: SizedBox(height: 16))),
].whereNotNull().toList().addInBetween(const SliverToBoxAdapter(child: SizedBox(height: 16))),
const DefautlSliverBottomPadding(),
],
),

View file

@ -83,7 +83,7 @@ class OverviewHeader extends ConsumerWidget {
if (onTitleClicked != null)
IconButton(
onPressed: onTitleClicked,
icon: Transform.translate(offset: Offset(0, 1.5), child: Icon(Icons.read_more_rounded)))
icon: Transform.translate(offset: const Offset(0, 1.5), child: const Icon(Icons.read_more_rounded)))
],
),
),

View file

@ -58,7 +58,7 @@ class _SeasonDetailScreenState extends ConsumerState<SeasonDetailScreen> {
crossAxisAlignment: WrapCrossAlignment.center,
children: [
ConstrainedBox(
constraints: BoxConstraints(
constraints: const BoxConstraints(
maxWidth: 600,
),
child: Column(
@ -86,7 +86,7 @@ class _SeasonDetailScreenState extends ConsumerState<SeasonDetailScreen> {
),
),
ConstrainedBox(
constraints: BoxConstraints(maxWidth: 300),
constraints: const BoxConstraints(maxWidth: 300),
child: Card(child: FladderImage(image: details.getPosters?.primary))),
],
).padding(padding),
@ -122,7 +122,7 @@ class _SeasonDetailScreenState extends ConsumerState<SeasonDetailScreen> {
Card(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(200)),
child: SegmentedButton(
style: ButtonStyle(
style: const ButtonStyle(
elevation: WidgetStatePropertyAll(5),
side: WidgetStatePropertyAll(BorderSide.none),
),

View file

@ -41,7 +41,7 @@ class FavouritesScreen extends ConsumerWidget {
else
const DefaultSliverTopBadding(),
if (AdaptiveLayout.of(context).isDesktop)
SliverToBoxAdapter(
const SliverToBoxAdapter(
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [

View file

@ -142,7 +142,7 @@ class _LibrarySearchScreenState extends ConsumerState<LibrarySearchScreen> {
floatingActionButtonLocation:
playerState == VideoPlayerState.minimized ? FloatingActionButtonLocation.centerFloat : null,
floatingActionButton: switch (playerState) {
VideoPlayerState.minimized => Padding(
VideoPlayerState.minimized => const Padding(
padding: EdgeInsets.symmetric(horizontal: 8),
child: FloatingPlayerBar(),
),
@ -171,7 +171,7 @@ class _LibrarySearchScreenState extends ConsumerState<LibrarySearchScreen> {
label: Text(context.localized.viewPhotos),
icon: const Icon(IconsaxBold.gallery),
)
].addInBetween(SizedBox(height: 10)),
].addInBetween(const SizedBox(height: 10)),
),
),
},
@ -251,12 +251,12 @@ class _LibrarySearchScreenState extends ConsumerState<LibrarySearchScreen> {
[];
final itemCountWidget = ItemActionButton(
label: Text(context.localized.itemCount(librarySearchResults.totalItemCount)),
icon: Icon(IconsaxBold.document_1),
icon: const Icon(IconsaxBold.document_1),
);
final refreshAction = ItemActionButton(
label: Text(context.localized.forceRefresh),
action: () => refreshKey.currentState?.show(),
icon: Icon(IconsaxOutline.refresh),
icon: const Icon(IconsaxOutline.refresh),
);
final itemViewAction = ItemActionButton(
label: Text(context.localized.selectViewType),
@ -279,7 +279,7 @@ class _LibrarySearchScreenState extends ConsumerState<LibrarySearchScreen> {
.map(
(e) => FilledButton.tonal(
style: FilledButtonTheme.of(context).style?.copyWith(
padding: WidgetStatePropertyAll(
padding: const WidgetStatePropertyAll(
EdgeInsets.symmetric(
horizontal: 12, vertical: 24)),
backgroundColor: WidgetStateProperty.resolveWith(
@ -373,7 +373,7 @@ class _LibrarySearchScreenState extends ConsumerState<LibrarySearchScreen> {
}),
if (AdaptiveLayout.of(context).layout == LayoutState.phone) ...[
const SizedBox(width: 6),
SizedBox.square(dimension: 46, child: SettingsUserIcon()),
const SizedBox.square(dimension: 46, child: SettingsUserIcon()),
],
const SizedBox(width: 12)
],
@ -421,7 +421,7 @@ class _LibrarySearchScreenState extends ConsumerState<LibrarySearchScreen> {
),
),
),
Row(),
const Row(),
],
),
),
@ -429,7 +429,7 @@ class _LibrarySearchScreenState extends ConsumerState<LibrarySearchScreen> {
),
),
if (AdaptiveLayout.of(context).isDesktop)
SliverToBoxAdapter(
const SliverToBoxAdapter(
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
@ -476,15 +476,15 @@ class _LibrarySearchScreenState extends ConsumerState<LibrarySearchScreen> {
borderRadius: BorderRadius.circular(16),
),
child: Padding(
padding: EdgeInsets.all(16),
padding: const EdgeInsets.all(16),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
CircularProgressIndicator.adaptive(),
const CircularProgressIndicator.adaptive(),
Text(context.localized.fetchingLibrary, style: Theme.of(context).textTheme.titleMedium),
IconButton(
onPressed: () => libraryProvider.cancelFetch(),
icon: Icon(IconsaxOutline.close_square),
icon: const Icon(IconsaxOutline.close_square),
)
].addInBetween(const SizedBox(width: 16)),
),
@ -598,7 +598,7 @@ class _LibrarySearchBottomBar extends ConsumerWidget {
if (context.mounted) context.refreshData();
},
label: Text(context.localized.addToCollection),
icon: Icon(
icon: const Icon(
IconsaxOutline.save_add,
size: 20,
),
@ -726,7 +726,7 @@ class _LibrarySearchBottomBar extends ConsumerWidget {
),
);
},
icon: Icon(IconsaxOutline.more))
icon: const Icon(IconsaxOutline.more))
},
],
),
@ -775,7 +775,7 @@ class _LibrarySearchBottomBar extends ConsumerWidget {
),
],
),
if (AdaptiveLayout.of(context).isDesktop) SizedBox(height: 8),
if (AdaptiveLayout.of(context).isDesktop) const SizedBox(height: 8),
],
),
);

View file

@ -81,7 +81,7 @@ class LibraryViews extends ConsumerWidget {
if (ref.watch(librarySearchProvider(key!).select((value) => value.nestedCurrentItem is BoxSetModel))) ...{
ItemActionButton(
label: Text(context.localized.removeFromCollection),
icon: Icon(IconsaxOutline.archive_slash),
icon: const Icon(IconsaxOutline.archive_slash),
action: () async {
await libraryProvider.removeFromCollection(items: [item]);
if (context.mounted) {
@ -93,7 +93,7 @@ class LibraryViews extends ConsumerWidget {
if (ref.watch(librarySearchProvider(key!).select((value) => value.nestedCurrentItem is PlaylistModel))) ...{
ItemActionButton(
label: Text(context.localized.removeFromPlaylist),
icon: Icon(IconsaxOutline.archive_minus),
icon: const Icon(IconsaxOutline.archive_minus),
action: () async {
await libraryProvider.removeFromPlaylist(items: [item]);
if (context.mounted) {

View file

@ -98,8 +98,8 @@ class _SearchBarState extends ConsumerState<SuggestionSearchBar> {
},
decoration: InputDecoration(
hintText: widget.title ?? "${context.localized.search}...",
prefixIcon: Icon(IconsaxOutline.search_normal),
contentPadding: EdgeInsets.only(top: 13),
prefixIcon: const Icon(IconsaxOutline.search_normal),
contentPadding: const EdgeInsets.only(top: 13),
suffixIcon: controller.text.isNotEmpty
? IconButton(
onPressed: () {

View file

@ -116,7 +116,7 @@ class _LockScreenState extends ConsumerState<LockScreen> with WidgetsBindingObse
size: 38,
),
ConstrainedBox(
constraints: BoxConstraints(
constraints: const BoxConstraints(
maxHeight: 400,
maxWidth: 400,
),

View file

@ -57,7 +57,7 @@ class LoginEditUser extends ConsumerWidget {
),
Row(
children: [
Icon(IconsaxBold.clock),
const Icon(IconsaxBold.clock),
const SizedBox(width: 8),
Column(
mainAxisAlignment: MainAxisAlignment.start,

View file

@ -79,13 +79,13 @@ class _LoginPageState extends ConsumerState<LoginScreen> {
children: [
if (!AdaptiveLayout.of(context).isDesktop)
FloatingActionButton(
key: Key("edit_button"),
child: Icon(IconsaxOutline.edit_2),
key: const Key("edit_button"),
child: const Icon(IconsaxOutline.edit_2),
onPressed: () => setState(() => editingUsers = !editingUsers),
),
FloatingActionButton(
key: Key("new_button"),
child: Icon(IconsaxOutline.add_square),
key: const Key("new_button"),
child: const Icon(IconsaxOutline.add_square),
onPressed: startAddingNewUser,
),
].addInBetween(const SizedBox(width: 16)),
@ -98,7 +98,7 @@ class _LoginPageState extends ConsumerState<LoginScreen> {
shrinkWrap: true,
padding: const EdgeInsets.symmetric(horizontal: 32, vertical: 32),
children: [
Center(
const Center(
child: FladderLogo(),
),
AnimatedFadeSize(
@ -369,7 +369,7 @@ class _LoginPageState extends ConsumerState<LoginScreen> {
children: [
Text(context.localized.login),
const SizedBox(width: 8),
Icon(IconsaxBold.send_1),
const Icon(IconsaxBold.send_1),
],
),
),

View file

@ -88,16 +88,16 @@ class LoginUserGrid extends ConsumerWidget {
],
),
)
].addInBetween(SizedBox(width: 4, height: 4)),
].addInBetween(const SizedBox(width: 4, height: 4)),
),
if (editMode)
Align(
alignment: Alignment.topRight,
child: Card(
color: Theme.of(context).colorScheme.errorContainer,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: const Icon(
child: const Padding(
padding: EdgeInsets.all(8.0),
child: Icon(
IconsaxBold.edit_2,
size: 14,
),

View file

@ -41,7 +41,7 @@ class DiscoverServersWidget extends ConsumerWidget {
style: context.textTheme.bodyLarge,
),
const Spacer(),
Opacity(opacity: 0.65, child: Icon(IconsaxOutline.bookmark, size: 16)),
const Opacity(opacity: 0.65, child: Icon(IconsaxOutline.bookmark, size: 16)),
],
),
const SizedBox(height: 4),
@ -63,7 +63,7 @@ class DiscoverServersWidget extends ConsumerWidget {
style: context.textTheme.bodyLarge,
),
const Spacer(),
Opacity(opacity: 0.65, child: Icon(IconsaxBold.airdrop, size: 16)),
const Opacity(opacity: 0.65, child: Icon(IconsaxBold.airdrop, size: 16)),
],
),
const SizedBox(height: 4),
@ -92,7 +92,7 @@ class DiscoverServersWidget extends ConsumerWidget {
));
},
error: (error, stackTrace) => Text(context.localized.error),
loading: () => Center(
loading: () => const Center(
child: SizedBox.square(
dimension: 24.0,
child: CircularProgressIndicator.adaptive(strokeCap: StrokeCap.round),
@ -151,7 +151,7 @@ class _ServerInfoCard extends StatelessWidget {
],
),
),
Icon(IconsaxOutline.edit_2, size: 16)
const Icon(IconsaxOutline.edit_2, size: 16)
].addInBetween(const SizedBox(width: 12)),
),
),

View file

@ -82,7 +82,7 @@ class LoginIcon extends ConsumerWidget {
],
),
)
].addInBetween(SizedBox(width: 8, height: 8)),
].addInBetween(const SizedBox(width: 8, height: 8)),
),
),
FlatButton(

View file

@ -28,7 +28,7 @@ Future<ItemBaseModel?> showEditItemPopup(
);
return AdaptiveLayout.of(context).inputDevice == InputDevice.pointer
? Dialog(
insetPadding: EdgeInsets.all(64),
insetPadding: const EdgeInsets.all(64),
child: editWidget(),
)
: Dialog.fullscreen(
@ -75,11 +75,11 @@ class _EditDialogSwitcherState extends ConsumerState<EditDialogSwitcher> with Ti
final advancedFields = ref.watch(editItemProvider.notifier).advancedFields ?? {};
Map<Tab, Widget> widgets = {
Tab(text: "General"): EditFields(fields: generalFields, json: state),
Tab(text: "Primary"): EditImageContent(type: ImageType.primary),
Tab(text: "Logo"): EditImageContent(type: ImageType.logo),
Tab(text: "Backdrops"): EditImageContent(type: ImageType.backdrop),
Tab(text: "Advanced"): EditFields(fields: advancedFields, json: state),
const Tab(text: "General"): EditFields(fields: generalFields, json: state),
const Tab(text: "Primary"): const EditImageContent(type: ImageType.primary),
const Tab(text: "Logo"): const EditImageContent(type: ImageType.logo),
const Tab(text: "Backdrops"): const EditImageContent(type: ImageType.backdrop),
const Tab(text: "Advanced"): EditFields(fields: advancedFields, json: state),
};
return Card(
@ -103,7 +103,7 @@ class _EditDialogSwitcherState extends ConsumerState<EditDialogSwitcher> with Ti
style: Theme.of(context).textTheme.titleLarge,
),
),
IconButton(onPressed: () => refreshEditor(), icon: Icon(IconsaxOutline.refresh))
IconButton(onPressed: () => refreshEditor(), icon: const Icon(IconsaxOutline.refresh))
],
),
),

View file

@ -46,7 +46,7 @@ class _EditGeneralState extends ConsumerState<EditFields> {
children: [
Flexible(
child: ListView(
padding: EdgeInsets.symmetric(horizontal: 16),
padding: const EdgeInsets.symmetric(horizontal: 16),
shrinkWrap: true,
children: [
if (widget.json != null)
@ -64,7 +64,7 @@ class _EditGeneralState extends ConsumerState<EditFields> {
current: map.entries.firstWhereOrNull((element) => element.value == true)?.key ?? "",
itemBuilder: (context) => [
PopupMenuItem(
child: Text(""),
child: const Text(""),
onTap: () => ref.read(editItemProvider.notifier).updateField(MapEntry(e.key, "")),
),
...map.entries.map(
@ -119,7 +119,7 @@ class _EditGeneralState extends ConsumerState<EditFields> {
onPressed: () => ref.read(editItemProvider.notifier).updateField(
MapEntry(e.key, list..remove(genre)),
),
icon: Icon(Icons.remove_rounded))
icon: const Icon(Icons.remove_rounded))
],
),
),
@ -217,7 +217,7 @@ class _EditGeneralState extends ConsumerState<EditFields> {
ref.read(editItemProvider.notifier).updateField(
MapEntry(e.key, listToMap(list..remove(person))));
},
icon: Icon(Icons.remove_rounded))
icon: const Icon(Icons.remove_rounded))
],
),
),
@ -272,7 +272,7 @@ class _EditGeneralState extends ConsumerState<EditFields> {
personRole.text = "";
});
},
icon: Icon(Icons.add_rounded),
icon: const Icon(Icons.add_rounded),
)
],
),
@ -326,7 +326,7 @@ class _EditGeneralState extends ConsumerState<EditFields> {
message: "Open in browser",
child: IconButton(
onPressed: () => launchUrl(context, externalUrl.url),
icon: Icon(Icons.open_in_browser_rounded)),
icon: const Icon(Icons.open_in_browser_rounded)),
),
IconButton(
onPressed: () {
@ -338,7 +338,7 @@ class _EditGeneralState extends ConsumerState<EditFields> {
.toList()),
);
},
icon: Icon(Icons.remove_rounded))
icon: const Icon(Icons.remove_rounded))
],
),
),
@ -371,7 +371,7 @@ class _EditGeneralState extends ConsumerState<EditFields> {
.toList()),
);
},
icon: Icon(Icons.add_rounded),
icon: const Icon(Icons.add_rounded),
)
],
),
@ -429,7 +429,7 @@ class _EditGeneralState extends ConsumerState<EditFields> {
const Spacer(),
IconButton(
onPressed: () => setMapping(list..remove(studio)),
icon: Icon(Icons.remove_rounded))
icon: const Icon(Icons.remove_rounded))
],
),
),
@ -557,7 +557,7 @@ class _EditGeneralState extends ConsumerState<EditFields> {
.read(editItemProvider.notifier)
.updateField(MapEntry(e.key, newDate.toIso8601String()));
},
icon: Icon(IconsaxOutline.calendar_2))
icon: const Icon(IconsaxOutline.calendar_2))
],
),
DisplayOrder _ => Builder(builder: (context) {
@ -580,8 +580,8 @@ class _EditGeneralState extends ConsumerState<EditFields> {
.toList(),
),
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 12),
const Padding(
padding: EdgeInsets.symmetric(horizontal: 12),
child: Text("Order episodes by air date, DVD order, or absolute numbering."),
)
],
@ -656,7 +656,7 @@ class _EditGeneralState extends ConsumerState<EditFields> {
children: [
Text(keyLabel, style: Theme.of(context).textTheme.titleLarge),
const SizedBox(height: 6),
Text(
const Text(
"Uncheck a field to lock it and prevent its data from being changed.",
),
const SizedBox(height: 6),
@ -722,8 +722,8 @@ class _EditGeneralState extends ConsumerState<EditFields> {
},
)
else
Padding(
padding: const EdgeInsets.all(8.0),
const Padding(
padding: EdgeInsets.all(8.0),
child: Center(
child: CircularProgressIndicator.adaptive(strokeCap: StrokeCap.round),
),

View file

@ -105,7 +105,7 @@ class _EditImageContentState extends ConsumerState<EditImageContent> {
Align(
alignment: Alignment.bottomRight,
child: Transform.translate(
offset: Offset(2, 2),
offset: const Offset(2, 2),
child: IconButton.filledTonal(
style: FilledButton.styleFrom(
backgroundColor: Theme.of(context).colorScheme.error,
@ -115,10 +115,10 @@ class _EditImageContentState extends ConsumerState<EditImageContent> {
await showDialog(
context: context,
builder: (context) => AlertDialog.adaptive(
title: Text("Delete image"),
content: Text("Deleting is permanent are you sure?"),
title: const Text("Delete image"),
content: const Text("Deleting is permanent are you sure?"),
actions: [
ElevatedButton(onPressed: () => Navigator.of(context).pop(), child: Text("Cancel")),
ElevatedButton(onPressed: () => Navigator.of(context).pop(), child: const Text("Cancel")),
FilledButton(
style: FilledButton.styleFrom(
backgroundColor: Theme.of(context).colorScheme.error,
@ -128,7 +128,7 @@ class _EditImageContentState extends ConsumerState<EditImageContent> {
await ref.read(editItemProvider.notifier).deleteImage(widget.type, image);
Navigator.of(context).pop();
},
child: Text(
child: const Text(
"Delete",
),
)
@ -136,7 +136,7 @@ class _EditImageContentState extends ConsumerState<EditImageContent> {
),
);
},
icon: Icon(Icons.delete_rounded),
icon: const Icon(Icons.delete_rounded),
),
),
)
@ -208,7 +208,7 @@ class _EditImageContentState extends ConsumerState<EditImageContent> {
),
),
SettingsListTile(
label: Text("Include all languages"),
label: const Text("Include all languages"),
trailing: Switch.adaptive(
value: includeAllImages,
onChanged: (value) {
@ -231,7 +231,7 @@ class _EditImageContentState extends ConsumerState<EditImageContent> {
),
children: [...serverImageCards, ...imageCards],
),
if (loading) Center(child: CircularProgressIndicator.adaptive(strokeCap: StrokeCap.round)),
if (loading) const Center(child: CircularProgressIndicator.adaptive(strokeCap: StrokeCap.round)),
if (!loading && [...serverImageCards, ...imageCards].isEmpty)
Center(child: Text("No ${widget.type.value}s found"))
],

View file

@ -72,7 +72,7 @@ class _IdentifyScreenState extends ConsumerState<IdentifyScreen> with TickerProv
const Spacer(),
IconButton(
onPressed: () async => await ref.read(provider.notifier).fetchInformation(),
icon: Icon(IconsaxOutline.refresh)),
icon: const Icon(IconsaxOutline.refresh)),
],
),
),
@ -106,7 +106,7 @@ class _IdentifyScreenState extends ConsumerState<IdentifyScreen> with TickerProv
if (posters.isEmpty)
Center(
child: processing
? CircularProgressIndicator.adaptive(strokeCap: StrokeCap.round)
? const CircularProgressIndicator.adaptive(strokeCap: StrokeCap.round)
: Text(context.localized.noResults),
)
else
@ -181,7 +181,7 @@ class _IdentifyScreenState extends ConsumerState<IdentifyScreen> with TickerProv
launchUrl(context, url ?? "");
},
icon: Icon(Icons.launch_rounded)),
icon: const Icon(Icons.launch_rounded)),
),
Tooltip(
message: "Select result",
@ -202,7 +202,7 @@ class _IdentifyScreenState extends ConsumerState<IdentifyScreen> with TickerProv
Navigator.of(context).pop();
}
: null,
icon: Icon(Icons.save_alt_rounded),
icon: const Icon(Icons.save_alt_rounded),
),
)
],

View file

@ -125,7 +125,7 @@ class ItemInfoScreenState extends ConsumerState<ItemInfoScreen> {
style: Theme.of(context).textTheme.titleLarge,
),
),
Opacity(opacity: 0.3, child: const Divider()),
const Opacity(opacity: 0.3, child: Divider()),
Padding(
padding: const EdgeInsets.all(8.0),
child: Row(

View file

@ -214,13 +214,13 @@ class _PhotoViewerControllsState extends ConsumerState<PhotoViewerControls> with
?.copyWith(fontWeight: FontWeight.bold),
),
if (widget.loadingMoreItems)
SizedBox.square(
const SizedBox.square(
dimension: 16,
child: CircularProgressIndicator.adaptive(
strokeCap: StrokeCap.round,
),
),
].addInBetween(SizedBox(width: 6)),
].addInBetween(const SizedBox(width: 6)),
),
),
Positioned.fill(
@ -301,7 +301,7 @@ class _PhotoViewerControllsState extends ConsumerState<PhotoViewerControls> with
onPressed: widget.openOptions,
icon: IconsaxOutline.more_2,
),
Spacer(),
const Spacer(),
ElevatedIconButton(
onPressed: markAsFavourite,
color: widget.photo.userData.isFavourite ? Colors.red : null,

View file

@ -150,7 +150,7 @@ class _PhotoViewerScreenState extends ConsumerState<PhotoViewerScreen> with Widg
onExit: (event) => setState(() => _showOverlay(show: false)),
child: Scaffold(
appBar: photos.isEmpty
? FladderAppbar(
? const FladderAppbar(
automaticallyImplyLeading: true,
)
: null,
@ -242,7 +242,7 @@ class _PhotoViewerScreenState extends ConsumerState<PhotoViewerScreen> with Widg
),
),
switch (state.extendedImageLoadState) {
LoadState.loading => Center(
LoadState.loading => const Center(
child: CircularProgressIndicator.adaptive(strokeCap: StrokeCap.round),
),
LoadState.completed => switch (photo.internalType) {
@ -256,7 +256,7 @@ class _PhotoViewerScreenState extends ConsumerState<PhotoViewerScreen> with Widg
LoadState.failed || _ => Align(
alignment: Alignment.topRight,
child: Padding(
padding: EdgeInsets.all(24).copyWith(top: topPadding + 85),
padding: const EdgeInsets.all(24).copyWith(top: topPadding + 85),
child: Card(
child: Padding(
padding: const EdgeInsets.all(24),
@ -426,7 +426,7 @@ class _PhotoViewerScreenState extends ConsumerState<PhotoViewerScreen> with Widg
controller: scrollController,
children: [
Padding(
padding: EdgeInsets.symmetric(horizontal: 12),
padding: const EdgeInsets.symmetric(horizontal: 12),
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Consumer(builder: (context, ref, child) {
@ -474,7 +474,7 @@ class _PhotoViewerScreenState extends ConsumerState<PhotoViewerScreen> with Widg
}),
),
),
Divider(),
const Divider(),
...currentPhoto
.generateActions(
context,

View file

@ -109,7 +109,7 @@ class _ClientSettingsPageState extends ConsumerState<ClientSettingsPage> {
],
),
),
icon: Icon(IconsaxOutline.folder_minus),
icon: const Icon(IconsaxOutline.folder_minus),
)
: null,
),

View file

@ -10,7 +10,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
Future<void> openQuickConnectDialog(
BuildContext context,
) async {
return showDialog(context: context, builder: (context) => QuickConnectDialog());
return showDialog(context: context, builder: (context) => const QuickConnectDialog());
}
class QuickConnectDialog extends ConsumerStatefulWidget {
@ -90,7 +90,7 @@ class _QuickConnectDialogState extends ConsumerState<QuickConnectDialog> {
success = context.localized.loggedIn;
},
);
await Future.delayed(Duration(seconds: 2));
await Future.delayed(const Duration(seconds: 2));
Navigator.of(context).pop();
} else {
if (controller.text.isEmpty) {
@ -106,7 +106,7 @@ class _QuickConnectDialogState extends ConsumerState<QuickConnectDialog> {
controller.text = "";
},
child: loading
? SizedBox.square(
? const SizedBox.square(
child: CircularProgressIndicator(),
dimension: 16.0,
)

View file

@ -92,7 +92,7 @@ class _SettingsScreenState extends ConsumerState<SettingsScreen> {
},
icon: Padding(
padding: EdgeInsets.all(AdaptiveLayout.of(context).inputDevice == InputDevice.pointer ? 0 : 4),
child: Icon(IconsaxOutline.arrow_left_2),
child: const Icon(IconsaxOutline.arrow_left_2),
),
),
),
@ -126,7 +126,7 @@ class _SettingsScreenState extends ConsumerState<SettingsScreen> {
),
SettingsListTile(
label: Text(context.localized.about),
subLabel: Text("Fladder"),
subLabel: const Text("Fladder"),
suffix: Opacity(
opacity: 1,
child: FladderIconOutlined(
@ -135,7 +135,7 @@ class _SettingsScreenState extends ConsumerState<SettingsScreen> {
)),
onTap: () => showAboutDialog(
context: context,
applicationIcon: FladderIcon(size: 85),
applicationIcon: const FladderIcon(size: 85),
applicationVersion: ref.watch(applicationInfoProvider).versionAndPlatform,
applicationLegalese: "Donut Factory",
),

View file

@ -7,7 +7,7 @@ import 'package:fladder/util/list_padding.dart';
import 'package:fladder/util/localization_helper.dart';
import 'package:flutter/material.dart';
showAuthOptionsDialogue(
void showAuthOptionsDialogue(
BuildContext context,
AccountModel currentUser,
Function(AccountModel) setMethod,

View file

@ -225,7 +225,7 @@ class _CategoryChipEditorState<T> extends State<CategoryChipEditor<T>> {
onChanged: (value) => updateKey(MapEntry(element.key, value == null ? null : element.value)),
);
}),
Divider(),
const Divider(),
},
...otherItems.mapIndexed((index, element) {
return CheckboxListTile.adaptive(

View file

@ -87,7 +87,7 @@ class _DefaultTitleBarState extends ConsumerState<DefaultTitleBar> with WindowLi
}
},
icon: Transform.translate(
offset: Offset(0, -2),
offset: const Offset(0, -2),
child: Icon(
Icons.minimize_rounded,
color: iconColor,
@ -126,7 +126,7 @@ class _DefaultTitleBarState extends ConsumerState<DefaultTitleBar> with WindowLi
}
},
icon: Transform.translate(
offset: Offset(0, 0),
offset: const Offset(0, 0),
child: Icon(
maximized ? Icons.maximize_rounded : Icons.crop_square_rounded,
color: iconColor,
@ -148,7 +148,7 @@ class _DefaultTitleBarState extends ConsumerState<DefaultTitleBar> with WindowLi
windowManager.close();
},
icon: Transform.translate(
offset: Offset(0, -2),
offset: const Offset(0, -2),
child: Icon(
Icons.close_rounded,
color: iconColor,

View file

@ -72,7 +72,7 @@ class _DetailScreenState extends ConsumerState<DetailScreen> {
),
//Small offset to match detailscaffold
child: Transform.translate(
offset: Offset(0, -5), child: FladderImage(image: widget.item?.getPosters?.primary)),
offset: const Offset(0, -5), child: FladderImage(image: widget.item?.getPosters?.primary)),
),
),
AnimatedFadeSize(
@ -140,8 +140,8 @@ class _DetailScaffoldState extends ConsumerState<DetailScaffold> {
child: Scaffold(
floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat,
floatingActionButton: switch (playerState) {
VideoPlayerState.minimized => Padding(
padding: const EdgeInsets.all(8.0),
VideoPlayerState.minimized => const Padding(
padding: EdgeInsets.all(8.0),
child: FloatingPlayerBar(),
),
_ => null,
@ -204,11 +204,11 @@ class _DetailScaffoldState extends ConsumerState<DetailScaffold> {
IconTheme(
data: IconThemeData(color: Theme.of(context).colorScheme.onSurface),
child: Transform.translate(
offset: Offset(0, kToolbarHeight),
offset: const Offset(0, kToolbarHeight),
child: Row(
children: [
Padding(
padding: EdgeInsets.only(left: 16),
padding: const EdgeInsets.only(left: 16),
child: IconButton.filledTonal(
style: IconButton.styleFrom(
backgroundColor: backGroundColor,
@ -223,7 +223,7 @@ class _DetailScaffoldState extends ConsumerState<DetailScaffold> {
icon: Padding(
padding:
EdgeInsets.all(AdaptiveLayout.of(context).inputDevice == InputDevice.pointer ? 0 : 4),
child: Icon(IconsaxOutline.arrow_left_2),
child: const Icon(IconsaxOutline.arrow_left_2),
),
),
),
@ -273,17 +273,17 @@ class _DetailScaffoldState extends ConsumerState<DetailScaffold> {
message: context.localized.refresh,
child: IconButton(
onPressed: () => context.refreshData(),
icon: Icon(IconsaxOutline.refresh),
icon: const Icon(IconsaxOutline.refresh),
),
),
)
else
SizedBox(height: 30, width: 30, child: SettingsUserIcon()),
const SizedBox(height: 30, width: 30, child: SettingsUserIcon()),
Tooltip(
message: context.localized.home,
child: IconButton(
onPressed: () => context.routeGo(DashboardRoute()),
icon: Icon(IconsaxOutline.home),
icon: const Icon(IconsaxOutline.home),
),
),
],

View file

@ -94,7 +94,7 @@ class _FilePickerBarState extends ConsumerState<FilePickerBar> {
},
onDragExited: (details) => setState(() => dragStart = false),
child: Container(
constraints: BoxConstraints(minHeight: 50, minWidth: 50),
constraints: const BoxConstraints(minHeight: 50, minWidth: 50),
decoration: BoxDecoration(
color: Colors.grey,
gradient: LinearGradient(
@ -106,7 +106,7 @@ class _FilePickerBarState extends ConsumerState<FilePickerBar> {
),
),
child: AnimatedSwitcher(
duration: Duration(milliseconds: 250),
duration: const Duration(milliseconds: 250),
child: inputField
? OutlinedTextField(
controller: controller,

View file

@ -20,7 +20,7 @@ void fladderSnackbar(
clipBehavior: Clip.none,
showCloseIcon: showCloseButton,
duration: duration,
padding: EdgeInsets.all(18),
padding: const EdgeInsets.all(18),
action: action,
));
}

View file

@ -32,7 +32,7 @@ class IntInputField extends ConsumerWidget {
onSubmitted: (value) => onSubmitted?.call(int.tryParse(value)),
textAlign: TextAlign.center,
decoration: InputDecoration(
contentPadding: EdgeInsets.all(0),
contentPadding: const EdgeInsets.all(0),
hintText: placeHolder,
suffixText: suffix,
border: InputBorder.none,

View file

@ -36,7 +36,7 @@ class _CarouselBannerState extends ConsumerState<CarouselBanner> {
double dragIntensity = 1;
double slidePosition = 1;
late final RestartableTimer timer = RestartableTimer(Duration(seconds: 8), () => nextSlide());
late final RestartableTimer timer = RestartableTimer(const Duration(seconds: 8), () => nextSlide());
@override
void initState() {
@ -121,7 +121,7 @@ class _CarouselBannerState extends ConsumerState<CarouselBanner> {
fit: StackFit.expand,
children: [
Dismissible(
key: Key("Dismissable"),
key: const Key("Dismissable"),
direction: DismissDirection.horizontal,
onUpdate: (details) {
setState(() {
@ -137,10 +137,10 @@ class _CarouselBannerState extends ConsumerState<CarouselBanner> {
return false;
},
child: AnimatedOpacity(
duration: Duration(milliseconds: 125),
duration: const Duration(milliseconds: 125),
opacity: dragOpacity.abs(),
child: AnimatedSwitcher(
duration: Duration(milliseconds: 125),
duration: const Duration(milliseconds: 125),
child: Container(
key: Key(currentItem.id),
clipBehavior: Clip.hardEdge,
@ -228,7 +228,7 @@ class _CarouselBannerState extends ConsumerState<CarouselBanner> {
),
),
),
].addInBetween(SizedBox(height: 6)),
].addInBetween(const SizedBox(height: 6)),
),
),
),
@ -248,7 +248,7 @@ class _CarouselBannerState extends ConsumerState<CarouselBanner> {
),
],
),
].addInBetween(SizedBox(height: 16)),
].addInBetween(const SizedBox(height: 16)),
),
),
),
@ -256,13 +256,13 @@ class _CarouselBannerState extends ConsumerState<CarouselBanner> {
padding: const EdgeInsets.symmetric(horizontal: 12),
child: AnimatedOpacity(
opacity: showControls ? 1 : 0,
duration: Duration(milliseconds: 250),
duration: const Duration(milliseconds: 250),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
IconButton.filledTonal(
onPressed: () => nextSlide(),
icon: Icon(IconsaxOutline.arrow_right_3),
icon: const Icon(IconsaxOutline.arrow_right_3),
)
],
),
@ -335,7 +335,7 @@ class _CarouselBannerState extends ConsumerState<CarouselBanner> {
width: 28,
height: 28,
child: AnimatedContainer(
duration: Duration(milliseconds: 125),
duration: const Duration(milliseconds: 125),
width: currentItem == e ? 22 : 6,
height: currentItem == e ? 10 : 6,
decoration: BoxDecoration(

View file

@ -89,7 +89,7 @@ class _PosterImageState extends ConsumerState<PosterImage> {
@override
Widget build(BuildContext context) {
final poster = widget.poster;
final padding = EdgeInsets.all(5);
final padding = const EdgeInsets.all(5);
return Hero(
tag: currentTag,
child: MouseRegion(
@ -169,7 +169,7 @@ class _PosterImageState extends ConsumerState<PosterImage> {
mainAxisSize: MainAxisSize.min,
children: [
if (widget.poster.userData.isFavourite)
Row(
const Row(
children: [
StatusCard(
color: Colors.red,
@ -327,7 +327,7 @@ class _PosterImageState extends ConsumerState<PosterImage> {
child: Padding(
padding: const EdgeInsets.all(10),
child: Container(
decoration: BoxDecoration(
decoration: const BoxDecoration(
shape: BoxShape.circle,
color: Colors.amber,
),
@ -347,8 +347,8 @@ class _PosterImageState extends ConsumerState<PosterImage> {
.textTheme
.labelLarge
?.copyWith(fontSize: 20, fontWeight: FontWeight.bold, shadows: [
BoxShadow(blurRadius: 8, spreadRadius: 16),
BoxShadow(blurRadius: 2, spreadRadius: 16),
const BoxShadow(blurRadius: 8, spreadRadius: 16),
const BoxShadow(blurRadius: 2, spreadRadius: 16),
]),
),
),

View file

@ -39,7 +39,7 @@ class EpisodeDetailsList extends ConsumerWidget {
ref.watch(clientSettingsProvider.select((value) => value.posterSize)));
final decimals = size - size.toInt();
return AnimatedSwitcher(
duration: Duration(milliseconds: 250),
duration: const Duration(milliseconds: 250),
child: switch (viewType) {
EpisodeDetailsViewType.list => ListView.builder(
shrinkWrap: true,

View file

@ -59,7 +59,7 @@ class _EpisodePosterState extends ConsumerState<EpisodePosters> {
label: widget.label,
titleActions: [
if (episodesBySeason.isNotEmpty && episodesBySeason.length > 1) ...{
SizedBox(width: 12),
const SizedBox(width: 12),
EnumBox(
current: selectedSeason != null ? "${context.localized.season(1)} $selectedSeason" : context.localized.all,
itemBuilder: (context) => [
@ -210,7 +210,7 @@ class EpisodePoster extends ConsumerWidget {
);
}),
if (episode.userData.isFavourite)
StatusCard(
const StatusCard(
color: Colors.red,
child: Icon(
Icons.favorite_rounded,
@ -219,7 +219,7 @@ class EpisodePoster extends ConsumerWidget {
if (episode.userData.played)
StatusCard(
color: Theme.of(context).colorScheme.primary,
child: Icon(
child: const Icon(
Icons.check_rounded,
),
),

View file

@ -54,7 +54,7 @@ class PosterListItem extends ConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
return Padding(
padding: EdgeInsets.symmetric(vertical: 2),
padding: const EdgeInsets.symmetric(vertical: 2),
child: Card(
color: Theme.of(context).colorScheme.surface,
child: SizedBox(
@ -151,7 +151,7 @@ class PosterListItem extends ConsumerWidget {
children: [
if (subTitle != null) ...[
subTitle!,
Spacer(),
const Spacer(),
],
if (poster.subText != null && poster.subText != poster.name)
ClickableText(
@ -180,7 +180,7 @@ class PosterListItem extends ConsumerWidget {
),
),
if (poster.userData.isFavourite)
Icon(
const Icon(
IconsaxBold.heart,
color: Colors.red,
),
@ -206,7 +206,7 @@ class PosterListItem extends ConsumerWidget {
.popupMenuItems(useIcons: true),
),
)
].addInBetween(SizedBox(width: 8)),
].addInBetween(const SizedBox(width: 8)),
),
),
),

View file

@ -85,7 +85,7 @@ class PosterWidget extends ConsumerWidget {
opacity: opacity,
child: subTitle!,
),
Spacer()
const Spacer()
],
if (poster.subText?.isNotEmpty ?? false)
Flexible(

View file

@ -55,7 +55,7 @@ class SeasonPoster extends ConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
placeHolder(String title) {
Padding placeHolder(String title) {
return Padding(
padding: const EdgeInsets.all(4),
child: Container(
@ -104,7 +104,7 @@ class SeasonPoster extends ConsumerWidget {
child: Center(
child: Text(
season.userData.unPlayedItemCount.toString(),
style: TextStyle(fontWeight: FontWeight.w700, fontSize: 14),
style: const TextStyle(fontWeight: FontWeight.w700, fontSize: 14),
),
),
),
@ -114,7 +114,7 @@ class SeasonPoster extends ConsumerWidget {
alignment: Alignment.topRight,
child: StatusCard(
color: Theme.of(context).colorScheme.primary,
child: Icon(
child: const Icon(
Icons.check_rounded,
),
),

View file

@ -20,8 +20,8 @@ class NestedScaffold extends ConsumerWidget {
floatingActionButton: switch (AdaptiveLayout.layoutOf(context)) {
LayoutState.phone => null,
_ => switch (playerState) {
VideoPlayerState.minimized => Padding(
padding: const EdgeInsets.symmetric(horizontal: 8),
VideoPlayerState.minimized => const Padding(
padding: EdgeInsets.symmetric(horizontal: 8),
child: FloatingPlayerBar(),
),
_ => null,

View file

@ -35,7 +35,7 @@ class NestedSliverAppBar extends ConsumerWidget {
backgroundColor: WidgetStatePropertyAll(Theme.of(context).colorScheme.surface),
),
onPressed: () => Scaffold.of(parent).openDrawer(),
icon: Icon(
icon: const Icon(
IconsaxBold.menu,
size: 28,
),
@ -59,10 +59,10 @@ class NestedSliverAppBar extends ConsumerWidget {
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Icon(IconsaxOutline.search_normal),
const Icon(IconsaxOutline.search_normal),
const SizedBox(width: 16),
Transform.translate(
offset: Offset(0, 2.5), child: Text(searchTitle ?? "${context.localized.search}...")),
offset: const Offset(0, 2.5), child: Text(searchTitle ?? "${context.localized.search}...")),
],
),
),
@ -71,7 +71,7 @@ class NestedSliverAppBar extends ConsumerWidget {
),
),
),
SettingsUserIcon()
const SettingsUserIcon()
].addInBetween(const SizedBox(width: 16)),
),
),

View file

@ -84,7 +84,7 @@ class _OutlinedTextFieldState extends ConsumerState<OutlinedTextField> {
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 6),
child: AnimatedContainer(
duration: Duration(milliseconds: 250),
duration: const Duration(milliseconds: 250),
decoration: BoxDecoration(
color: widget.fillColor ?? getColor(),
borderRadius: FladderTheme.defaultShape.borderRadius,

View file

@ -44,11 +44,11 @@ class _SplashScreenState extends ConsumerState<SplashScreen> {
@override
Widget build(BuildContext context) {
return Scaffold(
return const Scaffold(
body: Center(
child: FractionallySizedBox(
heightFactor: 0.4,
child: const FladderLogo(),
child: FladderLogo(),
),
),
);

View file

@ -56,7 +56,7 @@ class _SyncButtonState extends ConsumerState<SyncButton> {
if ((progress?.progress ?? 0) > 0)
IgnorePointer(
child: SizedBox.fromSize(
size: Size.fromRadius(10),
size: const Size.fromRadius(10),
child: CircularProgressIndicator(
strokeCap: StrokeCap.round,
strokeWidth: 2,

View file

@ -76,12 +76,12 @@ class _SyncItemDetailsState extends ConsumerState<SyncItemDetails> {
),
IconButton(
onPressed: () => Navigator.pop(context),
icon: Icon(IconsaxBold.close_circle),
icon: const Icon(IconsaxBold.close_circle),
)
],
),
if (baseItem != null) ...{
Divider(),
const Divider(),
Padding(
padding: const EdgeInsets.symmetric(vertical: 8),
child: Row(
@ -128,24 +128,24 @@ class _SyncItemDetailsState extends ConsumerState<SyncItemDetails> {
IconButton(
onPressed: () =>
ref.read(backgroundDownloaderProvider).pause(combinedStream!.task!),
icon: Icon(IconsaxBold.pause),
icon: const Icon(IconsaxBold.pause),
),
if (combinedStream?.status == TaskStatus.paused) ...[
IconButton(
onPressed: () =>
ref.read(backgroundDownloaderProvider).resume(combinedStream!.task!),
icon: Icon(IconsaxBold.play),
icon: const Icon(IconsaxBold.play),
),
IconButton(
onPressed: () => ref.read(syncProvider.notifier).deleteFullSyncFiles(syncedItem),
icon: Icon(IconsaxBold.stop),
icon: const Icon(IconsaxBold.stop),
),
],
const SizedBox(width: 16)
},
if (combinedStream != null && combinedStream.hasDownload)
SizedBox.fromSize(
size: Size.fromRadius(35),
size: const Size.fromRadius(35),
child: Stack(
fit: StackFit.expand,
alignment: Alignment.center,
@ -168,7 +168,7 @@ class _SyncItemDetailsState extends ConsumerState<SyncItemDetails> {
if (!hasFile && !downloadTask.hasDownload && syncedItem.hasVideoFile)
IconButtonAwait(
onPressed: () async => await ref.read(syncProvider.notifier).syncVideoFile(syncedItem, false),
icon: Icon(IconsaxOutline.cloud_change),
icon: const Icon(IconsaxOutline.cloud_change),
)
else if (hasFile)
IconButtonAwait(
@ -187,13 +187,13 @@ class _SyncItemDetailsState extends ConsumerState<SyncItemDetails> {
context.localized.cancel,
);
},
icon: Icon(IconsaxOutline.trash),
icon: const Icon(IconsaxOutline.trash),
),
].addInBetween(const SizedBox(width: 16)),
),
),
},
Divider(),
const Divider(),
if (syncChildren.isNotEmpty == true)
Flexible(
child: ListView(

View file

@ -38,8 +38,8 @@ class SyncListItemState extends ConsumerState<SyncListItem> {
child: Dismissible(
background: Container(
color: Theme.of(context).colorScheme.errorContainer,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: const Padding(
padding: EdgeInsets.all(8.0),
child: Row(
children: [Icon(IconsaxBold.trash)],
),
@ -130,11 +130,11 @@ class SyncListItemState extends ConsumerState<SyncListItem> {
)),
IconButton(
onPressed: () => showSyncItemDetails(context, syncedItem, ref),
icon: Icon(IconsaxOutline.more_square),
icon: const Icon(IconsaxOutline.more_square),
),
],
),
].addInBetween(SizedBox(width: 16)),
].addInBetween(const SizedBox(width: 16)),
),
),
),

View file

@ -50,7 +50,7 @@ class SyncProgressBar extends ConsumerWidget {
final downloadProgress = task.progress;
final downloadTask = task.task;
if (!task.hasDownload) {
return SizedBox.shrink();
return const SizedBox.shrink();
}
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
@ -73,20 +73,20 @@ class SyncProgressBar extends ConsumerWidget {
if (downloadStatus != TaskStatus.paused)
IconButton(
onPressed: () => ref.read(backgroundDownloaderProvider).pause(downloadTask),
icon: Icon(IconsaxBold.pause),
icon: const Icon(IconsaxBold.pause),
)
},
if (downloadStatus == TaskStatus.paused && downloadTask != null) ...[
IconButton(
onPressed: () => ref.read(backgroundDownloaderProvider).resume(downloadTask),
icon: Icon(IconsaxBold.play),
icon: const Icon(IconsaxBold.play),
),
IconButton(
onPressed: () => ref.read(syncProvider.notifier).deleteFullSyncFiles(item),
icon: Icon(IconsaxBold.stop),
icon: const Icon(IconsaxBold.stop),
)
],
].addInBetween(SizedBox(width: 8)),
].addInBetween(const SizedBox(width: 8)),
),
const SizedBox(width: 6),
],

View file

@ -48,7 +48,7 @@ class _SyncedScreenState extends ConsumerState<SyncedScreen> {
const DefaultSliverTopBadding(),
SliverToBoxAdapter(
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 16),
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Text(
context.localized.syncedItems,
style: Theme.of(context).textTheme.titleLarge,
@ -56,7 +56,7 @@ class _SyncedScreenState extends ConsumerState<SyncedScreen> {
),
),
SliverPadding(
padding: EdgeInsets.symmetric(horizontal: 16),
padding: const EdgeInsets.symmetric(horizontal: 16),
sliver: SliverList.builder(
itemBuilder: (context, index) {
final item = items[index];
@ -78,7 +78,7 @@ class _SyncedScreenState extends ConsumerState<SyncedScreen> {
style: Theme.of(context).textTheme.titleMedium,
),
const SizedBox(width: 16),
Icon(
const Icon(
IconsaxOutline.cloud_cross,
)
],

View file

@ -29,9 +29,9 @@ class SyncMarkedForDelete extends ConsumerWidget {
strokeCap: StrokeCap.round,
valueColor: AlwaysStoppedAnimation(Theme.of(context).colorScheme.error),
),
Text("Deleting"),
Icon(IconsaxOutline.trash)
].addPadding(EdgeInsets.symmetric(horizontal: 16)),
const Text("Deleting"),
const Icon(IconsaxOutline.trash)
].addPadding(const EdgeInsets.symmetric(horizontal: 16)),
),
),
)

View file

@ -95,7 +95,7 @@ class _SyncedEpisodeItemState extends ConsumerState<SyncedEpisodeItem> {
if (!hasFile && !downloadTask.hasDownload)
IconButtonAwait(
onPressed: () async => await ref.read(syncProvider.notifier).syncVideoFile(syncedItem, false),
icon: Icon(IconsaxOutline.cloud_change),
icon: const Icon(IconsaxOutline.cloud_change),
)
else if (hasFile)
IconButtonAwait(
@ -114,7 +114,7 @@ class _SyncedEpisodeItemState extends ConsumerState<SyncedEpisodeItem> {
context.localized.cancel,
);
},
icon: Icon(IconsaxOutline.trash),
icon: const Icon(IconsaxOutline.trash),
)
].addInBetween(const SizedBox(width: 16)),
);

View file

@ -54,7 +54,7 @@ class _SyncedSeasonPosterState extends ConsumerState<SyncedSeasonPoster> {
)
],
),
Spacer(),
const Spacer(),
IconButton(
onPressed: () {
setState(() {
@ -63,16 +63,16 @@ class _SyncedSeasonPosterState extends ConsumerState<SyncedSeasonPoster> {
},
icon: Icon(!expanded ? Icons.keyboard_arrow_down_rounded : Icons.keyboard_arrow_up_rounded),
)
].addPadding(EdgeInsets.symmetric(horizontal: 6)),
].addPadding(const EdgeInsets.symmetric(horizontal: 6)),
),
AnimatedFadeSize(
duration: const Duration(milliseconds: 250),
child: expanded && children.isNotEmpty
? ListView(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
physics: const NeverScrollableScrollPhysics(),
children: <Widget>[
Divider(),
const Divider(),
...children.map(
(item) {
final baseItem = ref.read(syncProvider.notifier).getItem(item);
@ -85,7 +85,7 @@ class _SyncedSeasonPosterState extends ConsumerState<SyncedSeasonPoster> {
);
},
)
].addPadding(EdgeInsets.symmetric(vertical: 10)),
].addPadding(const EdgeInsets.symmetric(vertical: 10)),
)
: Container(),
)

View file

@ -8,7 +8,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
Future<void> showVideoPlaybackInformation(BuildContext context) {
return showDialog(
context: context,
builder: (context) => _VideoPlaybackInformation(),
builder: (context) => const _VideoPlaybackInformation(),
);
}
@ -28,11 +28,11 @@ class _VideoPlaybackInformation extends ConsumerWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text("Playback information", style: Theme.of(context).textTheme.titleMedium),
Divider(),
const Divider(),
...[
Row(
mainAxisSize: MainAxisSize.min,
children: [Text('type: '), Text(playbackModel.label ?? "")],
children: [const Text('type: '), Text(playbackModel.label ?? "")],
),
if (sessionInfo.transCodeInfo != null) ...[
const SizedBox(height: 6),
@ -40,34 +40,34 @@ class _VideoPlaybackInformation extends ConsumerWidget {
if (sessionInfo.transCodeInfo?.transcodeReasons?.isNotEmpty == true)
Row(
mainAxisSize: MainAxisSize.min,
children: [Text('reason: '), Text(sessionInfo.transCodeInfo?.transcodeReasons.toString() ?? "")],
children: [const Text('reason: '), Text(sessionInfo.transCodeInfo?.transcodeReasons.toString() ?? "")],
),
if (sessionInfo.transCodeInfo?.completionPercentage != null)
Row(
mainAxisSize: MainAxisSize.min,
children: [
Text('transcode progress: '),
const Text('transcode progress: '),
Text("${sessionInfo.transCodeInfo?.completionPercentage?.toStringAsFixed(2)} %")
],
),
if (sessionInfo.transCodeInfo?.container != null)
Row(
mainAxisSize: MainAxisSize.min,
children: [Text('container: '), Text(sessionInfo.transCodeInfo!.container.toString())],
children: [const Text('container: '), Text(sessionInfo.transCodeInfo!.container.toString())],
),
],
Row(
mainAxisSize: MainAxisSize.min,
children: [Text('resolution: '), Text(playbackModel?.item.streamModel?.resolutionText ?? "")],
children: [const Text('resolution: '), Text(playbackModel?.item.streamModel?.resolutionText ?? "")],
),
Row(
mainAxisSize: MainAxisSize.min,
children: [
Text('container: '),
const Text('container: '),
Text(playbackModel?.playbackInfo?.mediaSources?.firstOrNull?.container ?? "")
],
),
].addPadding(EdgeInsets.symmetric(vertical: 3))
].addPadding(const EdgeInsets.symmetric(vertical: 3))
],
),
),

View file

@ -5,7 +5,7 @@ import 'package:fladder/widgets/shared/horizontal_list.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
showPlayerChapterDialogue(
void showPlayerChapterDialogue(
BuildContext context, {
required List<Chapter> chapters,
required Function(Chapter chapter) onChapterTapped,

View file

@ -80,7 +80,7 @@ class _VideoOptionsMobileState extends ConsumerState<VideoOptions> {
],
),
const Spacer(),
Opacity(opacity: 0.1, child: Icon(Icons.info_outline_rounded))
const Opacity(opacity: 0.1, child: Icon(Icons.info_outline_rounded))
],
),
),
@ -93,7 +93,7 @@ class _VideoOptionsMobileState extends ConsumerState<VideoOptions> {
title: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Flexible(flex: 1, child: const Text("Screen Brightness")),
const Flexible(flex: 1, child: Text("Screen Brightness")),
Flexible(
child: Row(
children: [
@ -250,7 +250,7 @@ class _VideoOptionsMobileState extends ConsumerState<VideoOptions> {
Navigator.of(context).pop();
showInfoScreen(context, currentItem);
},
title: Text('Media info'),
title: const Text('Media info'),
),
}
],
@ -337,7 +337,7 @@ Future<void> showSubSelection(BuildContext context) {
final playbackModel = ref.watch(playBackModel);
final player = ref.watch(videoPlayerProvider);
return SimpleDialog(
contentPadding: EdgeInsets.only(top: 8, bottom: 24),
contentPadding: const EdgeInsets.only(top: 8, bottom: 24),
title: Row(
children: [
const Text("Subtitle"),
@ -388,7 +388,7 @@ Future<void> showAudioSelection(BuildContext context) {
final playbackModel = ref.watch(playBackModel);
final player = ref.watch(videoPlayerProvider);
return SimpleDialog(
contentPadding: EdgeInsets.only(top: 8, bottom: 24),
contentPadding: const EdgeInsets.only(top: 8, bottom: 24),
title: Row(
children: [
const Text("Subtitle"),

View file

@ -5,7 +5,7 @@ import 'package:fladder/widgets/navigation_scaffold/components/fladder_appbar.da
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
showFullScreenItemQueue(
void showFullScreenItemQueue(
BuildContext context, {
required List<ItemBaseModel> items,
ValueChanged<List<ItemBaseModel>>? onListChanged,

View file

@ -304,7 +304,7 @@ class _ChapterProgressSliderState extends ConsumerState<ChapterProgressSlider> {
AnimatedContainer(
duration: const Duration(milliseconds: 250),
child: ConstrainedBox(
constraints: BoxConstraints(maxHeight: 250),
constraints: const BoxConstraints(maxHeight: 250),
child: ClipRRect(
borderRadius: const BorderRadius.all(Radius.circular(8)),
child: trickPlay == null || trickPlay.images.isEmpty
@ -313,7 +313,7 @@ class _ChapterProgressSliderState extends ConsumerState<ChapterProgressSlider> {
image: chapter.imageProvider,
fit: BoxFit.contain,
)
: SizedBox.shrink()
: const SizedBox.shrink()
: AspectRatio(
aspectRatio: trickPlay.width.toDouble() / trickPlay.height.toDouble(),
child: TrickplayImage(

View file

@ -108,15 +108,15 @@ class _VideoSubtitleControlsState extends ConsumerState<VideoSubtitleControls> {
multiSelectionEnabled: false,
segments: [
ButtonSegment(
label: Text(context.localized.light, style: TextStyle(fontWeight: FontWeight.w100)),
label: Text(context.localized.light, style: const TextStyle(fontWeight: FontWeight.w100)),
value: FontWeight.w100,
),
ButtonSegment(
label: Text(context.localized.normal, style: TextStyle(fontWeight: FontWeight.w500)),
label: Text(context.localized.normal, style: const TextStyle(fontWeight: FontWeight.w500)),
value: FontWeight.normal,
),
ButtonSegment(
label: Text(context.localized.bold, style: TextStyle(fontWeight: FontWeight.w900)),
label: Text(context.localized.bold, style: const TextStyle(fontWeight: FontWeight.w900)),
value: FontWeight.bold,
),
],

View file

@ -60,7 +60,7 @@ class _VideoVolumeSliderState extends ConsumerState<VideoVolumeSlider> {
textAlign: TextAlign.center,
),
),
].addInBetween(SizedBox(width: 6)),
].addInBetween(const SizedBox(width: 6)),
);
}
}

View file

@ -114,7 +114,7 @@ class _VideoPlayerState extends ConsumerState<VideoPlayer> with WidgetsBindingOb
);
}),
),
DesktopControls(),
const DesktopControls(),
if (errorPlaying) const _VideoErrorWidget(),
],
),

View file

@ -242,7 +242,7 @@ class _DesktopControlsState extends ConsumerState<DesktopControls> {
.update((state) => state.copyWith(state: VideoPlayerState.minimized));
Navigator.of(context).pop();
},
icon: Icon(
icon: const Icon(
IconsaxOutline.arrow_down_1,
size: 24,
),
@ -256,7 +256,7 @@ class _DesktopControlsState extends ConsumerState<DesktopControls> {
),
)
else
Flexible(child: Align(alignment: Alignment.topRight, child: DefaultTitleBar()))
const Flexible(child: Align(alignment: Alignment.topRight, child: DefaultTitleBar()))
],
),
),
@ -279,7 +279,7 @@ class _DesktopControlsState extends ConsumerState<DesktopControls> {
child: Padding(
padding: EdgeInsets.only(bottom: bottomPadding)
.copyWith(bottom: 21)
.add(EdgeInsets.symmetric(vertical: 16))
.add(const EdgeInsets.symmetric(vertical: 16))
.add(EdgeInsets.symmetric(horizontal: AdaptiveLayout.of(context).isDesktop ? 32 : 0)),
child: Column(
children: [
@ -362,7 +362,7 @@ class _DesktopControlsState extends ConsumerState<DesktopControls> {
children: [
Tooltip(
message: "Stop",
child: IconButton(onPressed: () => closePlayer(), icon: Icon(IconsaxOutline.stop))),
child: IconButton(onPressed: () => closePlayer(), icon: const Icon(IconsaxOutline.stop))),
const Spacer(),
if (AdaptiveLayout.of(context).isDesktop && ref.read(videoPlayerProvider).player != null) ...{
// OpenQueueButton(x),
@ -457,7 +457,7 @@ class _DesktopControlsState extends ConsumerState<DesktopControls> {
),
),
}
].addPadding(EdgeInsets.symmetric(horizontal: 4)),
].addPadding(const EdgeInsets.symmetric(horizontal: 4)),
),
const SizedBox(height: 4),
SizedBox(
@ -558,9 +558,9 @@ class _DesktopControlsState extends ConsumerState<DesktopControls> {
onPressed: () => seekForward(mediaPlaybackModel),
tooltip: "15",
iconSize: 40,
icon: Stack(
icon: const Stack(
children: [
const Icon(IconsaxOutline.forward_15_seconds),
Icon(IconsaxOutline.forward_15_seconds),
],
),
);

View file

@ -28,8 +28,8 @@ class FladderTheme {
static RoundedRectangleBorder get defaultShape => RoundedRectangleBorder(borderRadius: BorderRadius.circular(8));
static RoundedRectangleBorder get largeShape => RoundedRectangleBorder(borderRadius: BorderRadius.circular(16));
static Color get darkBackgroundColor => Color.fromARGB(255, 10, 10, 10);
static Color get lightBackgroundColor => Color.fromARGB(237, 255, 255, 255);
static Color get darkBackgroundColor => const Color.fromARGB(255, 10, 10, 10);
static Color get lightBackgroundColor => const Color.fromARGB(237, 255, 255, 255);
static ThemeData theme(ColorScheme? colorScheme) {
final ColorScheme? scheme = generateDynamicColourSchemes(colorScheme);
@ -50,7 +50,7 @@ class FladderTheme {
margin: EdgeInsets.zero,
shape: defaultShape,
),
progressIndicatorTheme: ProgressIndicatorThemeData(),
progressIndicatorTheme: const ProgressIndicatorThemeData(),
floatingActionButtonTheme: FloatingActionButtonThemeData(
backgroundColor: scheme?.secondaryContainer,
foregroundColor: scheme?.onSecondaryContainer,
@ -65,7 +65,7 @@ class FladderTheme {
),
tooltipTheme: TooltipThemeData(
textAlign: TextAlign.center,
waitDuration: Duration(milliseconds: 500),
waitDuration: const Duration(milliseconds: 500),
textStyle: TextStyle(
color: scheme?.onSurface,
),
@ -77,21 +77,21 @@ class FladderTheme {
switchTheme: SwitchThemeData(
thumbIcon: WidgetStateProperty.resolveWith((states) {
if (states.contains(WidgetState.selected)) {
return Icon(Icons.check_rounded);
return const Icon(Icons.check_rounded);
}
return null;
}),
trackOutlineWidth: WidgetStatePropertyAll(1),
trackOutlineWidth: const WidgetStatePropertyAll(1),
),
iconButtonTheme: IconButtonThemeData(
style: ButtonStyle(
shape: WidgetStatePropertyAll(defaultShape),
),
),
navigationBarTheme: NavigationBarThemeData(),
navigationBarTheme: const NavigationBarThemeData(),
dialogTheme: DialogTheme(shape: defaultShape),
scrollbarTheme: ScrollbarThemeData(
radius: Radius.circular(16),
radius: const Radius.circular(16),
thumbColor: WidgetStateProperty.resolveWith((states) {
if (states.contains(WidgetState.hovered)) {
return colorScheme?.primary;

View file

@ -183,9 +183,9 @@ class _AdaptiveLayoutBuilderState extends ConsumerState<AdaptiveLayoutBuilder> {
isDesktop: isDesktop,
router: router,
posterDefaults: switch (layout) {
LayoutState.phone => PosterDefaults(size: 300, ratio: 0.55),
LayoutState.tablet => PosterDefaults(size: 350, ratio: 0.55),
LayoutState.desktop => PosterDefaults(size: 400, ratio: 0.55),
LayoutState.phone => const PosterDefaults(size: 300, ratio: 0.55),
LayoutState.tablet => const PosterDefaults(size: 350, ratio: 0.55),
LayoutState.desktop => const PosterDefaults(size: 400, ratio: 0.55),
},
child: widget.child,
);

View file

@ -26,7 +26,7 @@ class FloatingActionButtonAnimated extends ConsumerWidget {
onPressed: onPressed,
foregroundColor: alternate ? Theme.of(context).colorScheme.onSecondary : null,
backgroundColor: alternate ? Theme.of(context).colorScheme.secondary : null,
extendedPadding: EdgeInsets.all(14),
extendedPadding: const EdgeInsets.all(14),
label: AnimatedSize(
duration: const Duration(milliseconds: 250),
child: isExtended

View file

@ -79,7 +79,7 @@ extension ItemBaseModelExtensions on ItemBaseModel {
if (playAble)
ItemActionButton(
action: () => play(context, ref),
icon: Icon(IconsaxOutline.play),
icon: const Icon(IconsaxOutline.play),
label: Text(playButtonLabel(context)),
),
if (parentId?.isNotEmpty == true) ...[
@ -99,7 +99,7 @@ extension ItemBaseModelExtensions on ItemBaseModel {
if (!galleryItem && !exclude.contains(ItemActions.details))
ItemActionButton(
action: () async => await navigateTo(context),
icon: Icon(IconsaxOutline.main_component),
icon: const Icon(IconsaxOutline.main_component),
label: Text(context.localized.showDetails),
)
else if (!exclude.contains(ItemActions.showAlbum) && galleryItem)
@ -111,7 +111,7 @@ extension ItemBaseModelExtensions on ItemBaseModel {
if (!exclude.contains(ItemActions.playFromStart))
if ((userData.progress) > 0)
ItemActionButton(
icon: Icon(IconsaxOutline.refresh),
icon: const Icon(IconsaxOutline.refresh),
action: (this is BookModel)
? () => ((this as BookModel).play(context, ref, currentPage: 0))
: () => play(context, ref, startPosition: Duration.zero),
@ -123,7 +123,7 @@ extension ItemBaseModelExtensions on ItemBaseModel {
if (!exclude.contains(ItemActions.addCollection))
if (type != FladderItemType.boxset)
ItemActionButton(
icon: Icon(IconsaxOutline.archive_add),
icon: const Icon(IconsaxOutline.archive_add),
action: () async {
await addItemToCollection(context, [this]);
if (context.mounted) {
@ -135,7 +135,7 @@ extension ItemBaseModelExtensions on ItemBaseModel {
if (!exclude.contains(ItemActions.addPlaylist))
if (type != FladderItemType.playlist)
ItemActionButton(
icon: Icon(IconsaxOutline.archive_add),
icon: const Icon(IconsaxOutline.archive_add),
action: () async {
await addItemToPlaylist(context, [this]);
if (context.mounted) {
@ -146,7 +146,7 @@ extension ItemBaseModelExtensions on ItemBaseModel {
),
if (!exclude.contains(ItemActions.markPlayed))
ItemActionButton(
icon: Icon(IconsaxOutline.eye),
icon: const Icon(IconsaxOutline.eye),
action: () async {
final userData = await ref.read(userProvider.notifier).markAsPlayed(true, id);
onUserDataChanged?.call(userData?.bodyOrThrow);
@ -156,7 +156,7 @@ extension ItemBaseModelExtensions on ItemBaseModel {
),
if (!exclude.contains(ItemActions.markUnplayed))
ItemActionButton(
icon: Icon(IconsaxOutline.eye_slash),
icon: const Icon(IconsaxOutline.eye_slash),
label: Text(context.localized.markAsUnwatched),
action: () async {
final userData = await ref.read(userProvider.notifier).markAsPlayed(false, id);
@ -178,7 +178,7 @@ extension ItemBaseModelExtensions on ItemBaseModel {
ItemActionDivider(),
if (!exclude.contains(ItemActions.editMetaData) && isAdmin)
ItemActionButton(
icon: Icon(IconsaxOutline.edit),
icon: const Icon(IconsaxOutline.edit),
action: () async {
final newItem = await showEditItemPopup(context, id);
if (newItem != null) {
@ -189,7 +189,7 @@ extension ItemBaseModelExtensions on ItemBaseModel {
),
if (!exclude.contains(ItemActions.refreshMetaData) && isAdmin)
ItemActionButton(
icon: Icon(IconsaxOutline.global_refresh),
icon: const Icon(IconsaxOutline.global_refresh),
action: () async {
showRefreshPopup(context, id, detailedName(context) ?? name);
},
@ -198,7 +198,7 @@ extension ItemBaseModelExtensions on ItemBaseModel {
if (!exclude.contains(ItemActions.download) && downloadEnabled) ...{
if (syncedItem == null)
ItemActionButton(
icon: Icon(IconsaxOutline.arrow_down_2),
icon: const Icon(IconsaxOutline.arrow_down_2),
label: Text(context.localized.sync),
action: () => ref.read(syncProvider.notifier).addSyncItem(context, this),
)
@ -212,7 +212,7 @@ extension ItemBaseModelExtensions on ItemBaseModel {
if (canDelete == true)
ItemActionButton(
icon: Container(
child: Icon(
child: const Icon(
IconsaxOutline.trash,
),
),
@ -231,7 +231,7 @@ extension ItemBaseModelExtensions on ItemBaseModel {
),
if (!exclude.contains(ItemActions.identify) && identifiable && isAdmin)
ItemActionButton(
icon: Icon(IconsaxOutline.search_normal),
icon: const Icon(IconsaxOutline.search_normal),
action: () async {
showIdentifyScreen(context, this);
},
@ -239,7 +239,7 @@ extension ItemBaseModelExtensions on ItemBaseModel {
),
if (!exclude.contains(ItemActions.mediaInfo))
ItemActionButton(
icon: Icon(IconsaxOutline.info_circle),
icon: const Icon(IconsaxOutline.info_circle),
action: () async {
showInfoScreen(context, this);
},

View file

@ -320,7 +320,7 @@ class PlaybackDialogue extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16).add(EdgeInsets.only(top: 16, bottom: 8)),
padding: const EdgeInsets.symmetric(horizontal: 16).add(const EdgeInsets.only(top: 16, bottom: 8)),
child: Text(
"Playback type",
style: Theme.of(context).textTheme.titleLarge,

View file

@ -2,7 +2,7 @@
import 'package:uuid/uuid.dart';
String get jellyId {
var uuid = Uuid();
var uuid = const Uuid();
var guid = uuid.v4().replaceAll('-', ''); // Remove hyphens
return guid.substring(0, 32); // Take only the first 32 characters
}

View file

@ -2,7 +2,7 @@ import 'package:collection/collection.dart';
import 'package:flutter/material.dart';
extension ListExtensions on List<Widget> {
addInBetween(Widget widget) {
List<Widget> addInBetween(Widget widget) {
return mapIndexed(
(index, element) {
if (element != last) {
@ -14,7 +14,7 @@ extension ListExtensions on List<Widget> {
).expand((element) => element).toList();
}
addPadding(EdgeInsets padding) {
List<Widget> addPadding(EdgeInsets padding) {
return map((e) {
if (e is Expanded || e is Spacer || e is Flexible) return e;
return Padding(
@ -29,7 +29,7 @@ extension ListExtensions on List<Widget> {
}).toList();
}
addSize({double? width, double? height}) {
List<Widget> addSize({double? width, double? height}) {
return map((e) {
if (e is Expanded || e is Spacer || e is Flexible) return e;
return SizedBox(

View file

@ -61,7 +61,7 @@ class _GappedContainerPainter extends CustomPainter {
thumbCenterDxFraction.isFinite ? thumbCenterDxFraction * size.width : 0.0; // Default to 0 if invalid fraction
final Radius trackCornerRadius = Radius.circular(trackRect.shortestSide / 2);
final Radius trackInsideCornerRadius = Radius.circular(2.0);
final Radius trackInsideCornerRadius = const Radius.circular(2.0);
final RRect trackRRect = RRect.fromRectAndCorners(
trackRect,

View file

@ -29,7 +29,7 @@ class FladderAppbar extends StatelessWidget implements PreferredSize {
height: height,
child: Row(
children: [
if (automaticallyImplyLeading && context.canPop()) BackButton(),
if (automaticallyImplyLeading && context.canPop()) const BackButton(),
Expanded(
child: DefaultTitleBar(
label: label,
@ -44,7 +44,7 @@ class FladderAppbar extends StatelessWidget implements PreferredSize {
backgroundColor: Theme.of(context).colorScheme.surface.withOpacity(0),
scrolledUnderElevation: 0,
elevation: 0,
systemOverlayStyle: SystemUiOverlayStyle(),
systemOverlayStyle: const SystemUiOverlayStyle(),
title: const Text(""),
automaticallyImplyLeading: automaticallyImplyLeading,
);

View file

@ -56,7 +56,7 @@ class _CurrentlyPlayingBarState extends ConsumerState<FloatingPlayerBar> {
final playbackModel = ref.watch(playBackModel.select((value) => value?.item));
final progress = playbackInfo.position.inMilliseconds / playbackInfo.duration.inMilliseconds;
return Dismissible(
key: Key("CurrentlyPlayingBar"),
key: const Key("CurrentlyPlayingBar"),
confirmDismiss: (direction) async {
if (direction == DismissDirection.up) {
await openFullScreenPlayer();
@ -73,7 +73,7 @@ class _CurrentlyPlayingBarState extends ConsumerState<FloatingPlayerBar> {
child: Card(
elevation: 3,
child: ConstrainedBox(
constraints: BoxConstraints(minHeight: 50, maxHeight: 85),
constraints: const BoxConstraints(minHeight: 50, maxHeight: 85),
child: LayoutBuilder(builder: (context, constraints) {
return Row(
children: [
@ -108,7 +108,7 @@ class _CurrentlyPlayingBarState extends ConsumerState<FloatingPlayerBar> {
Positioned.fill(
child: Tooltip(
message: "Expand player",
waitDuration: Duration(milliseconds: 500),
waitDuration: const Duration(milliseconds: 500),
child: AnimatedOpacity(
opacity: showExpandButton ? 1 : 0,
duration: const Duration(milliseconds: 125),
@ -116,7 +116,7 @@ class _CurrentlyPlayingBarState extends ConsumerState<FloatingPlayerBar> {
color: Colors.black.withOpacity(0.6),
child: FlatButton(
onTap: () async => openFullScreenPlayer(),
child: Icon(Icons.keyboard_arrow_up_rounded),
child: const Icon(Icons.keyboard_arrow_up_rounded),
),
),
),
@ -157,8 +157,8 @@ class _CurrentlyPlayingBarState extends ConsumerState<FloatingPlayerBar> {
child: IconButton.filledTonal(
onPressed: () => ref.read(videoPlayerProvider).playOrPause(),
icon: playbackInfo.playing
? Icon(Icons.pause_rounded)
: Icon(Icons.play_arrow_rounded),
? const Icon(Icons.pause_rounded)
: const Icon(Icons.play_arrow_rounded),
),
),
if (constraints.maxWidth > 500) ...{
@ -176,14 +176,14 @@ class _CurrentlyPlayingBarState extends ConsumerState<FloatingPlayerBar> {
),
Tooltip(
message: "Stop playback",
waitDuration: Duration(milliseconds: 500),
waitDuration: const Duration(milliseconds: 500),
child: IconButton(
onPressed: () async => stopPlayer(),
icon: Icon(IconsaxBold.stop),
icon: const Icon(IconsaxBold.stop),
),
),
},
].addInBetween(SizedBox(width: 8)),
].addInBetween(const SizedBox(width: 8)),
),
),
),

View file

@ -137,7 +137,7 @@ class _NavigationBodyState extends ConsumerState<NavigationBody> {
],
const Spacer(),
IconTheme(
data: IconThemeData(size: 28),
data: const IconThemeData(size: 28),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
@ -155,8 +155,8 @@ class _NavigationBodyState extends ConsumerState<NavigationBody> {
child: widget.currentLocation.contains(SettingsRoute().route)
? Card(
color: Theme.of(context).colorScheme.primaryContainer,
child: Padding(
padding: const EdgeInsets.all(10),
child: const Padding(
padding: EdgeInsets.all(10),
child: Icon(IconsaxBold.setting_3),
),
)

View file

@ -55,9 +55,9 @@ class _NavigationButtonState extends ConsumerState<NavigationButton> {
Flexible(
child: ElevatedButton(
style: ButtonStyle(
elevation: WidgetStatePropertyAll(0),
padding: WidgetStatePropertyAll(EdgeInsets.zero),
backgroundColor: WidgetStatePropertyAll(Colors.transparent),
elevation: const WidgetStatePropertyAll(0),
padding: const WidgetStatePropertyAll(EdgeInsets.zero),
backgroundColor: const WidgetStatePropertyAll(Colors.transparent),
foregroundColor: WidgetStateProperty.resolveWith((states) {
return widget.selected
? Theme.of(context).colorScheme.primary
@ -88,7 +88,7 @@ class _NavigationButtonState extends ConsumerState<NavigationButton> {
],
),
AnimatedContainer(
duration: Duration(milliseconds: 250),
duration: const Duration(milliseconds: 250),
margin: EdgeInsets.only(top: widget.selected ? 8 : 0),
height: widget.selected ? 6 : 0,
width: widget.selected ? 14 : 0,

View file

@ -95,7 +95,7 @@ class NestedNavigationDrawer extends ConsumerWidget {
actions: [
ItemActionButton(
label: Text(context.localized.scanLibrary),
icon: Icon(IconsaxOutline.refresh),
icon: const Icon(IconsaxOutline.refresh),
action: () => showRefreshPopup(context, library.id, library.name),
),
],
@ -109,7 +109,7 @@ class NestedNavigationDrawer extends ConsumerWidget {
const Divider(indent: 28, endIndent: 28),
if (isExpanded)
Transform.translate(
offset: Offset(-8, 0),
offset: const Offset(-8, 0),
child: DrawerListButton(
label: context.localized.settings,
selectedIcon: const Icon(IconsaxBold.setting_3),
@ -131,8 +131,8 @@ class NestedNavigationDrawer extends ConsumerWidget {
else
DrawerListButton(
label: context.localized.settings,
selectedIcon: Icon(IconsaxBold.setting_2),
icon: Icon(IconsaxOutline.setting_2),
selectedIcon: const Icon(IconsaxBold.setting_2),
icon: const Icon(IconsaxOutline.setting_2),
selected: currentLocation.contains(SettingsRoute().basePath),
onPressed: () {
switch (AdaptiveLayout.of(context).size) {

View file

@ -66,8 +66,8 @@ class _NavigationScaffoldState extends ConsumerState<NavigationScaffold> {
playerState == VideoPlayerState.minimized ? FloatingActionButtonLocation.centerFloat : null,
floatingActionButton: AdaptiveLayout.of(context).layout == LayoutState.phone
? switch (playerState) {
VideoPlayerState.minimized => Padding(
padding: const EdgeInsets.symmetric(horizontal: 8),
VideoPlayerState.minimized => const Padding(
padding: EdgeInsets.symmetric(horizontal: 8),
child: FloatingPlayerBar(),
),
_ => widget.destinations.elementAtOrNull(currentIndex)?.floatingActionButton?.normal,
@ -87,7 +87,7 @@ class _NavigationScaffoldState extends ConsumerState<NavigationScaffold> {
controller: AppRoutes.scrollController,
child: NestedBottomAppBar(
child: Transform.translate(
offset: Offset(0, 8),
offset: const Offset(0, 8),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.stretch,

View file

@ -65,7 +65,7 @@ class ElevatedIconButtonLabel extends StatelessWidget {
return Tooltip(
message: label,
child: ConstrainedBox(
constraints: BoxConstraints(maxWidth: 65),
constraints: const BoxConstraints(maxWidth: 65),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [

View file

@ -58,7 +58,7 @@ class EnumSelection<T> extends StatelessWidget {
final Text label;
final String current;
final List<PopupMenuEntry<T>> Function(BuildContext context) itemBuilder;
const EnumSelection({
const EnumSelection({super.key,
required this.label,
required this.current,
required this.itemBuilder,

View file

@ -30,7 +30,7 @@ class FladderScrollbar extends ConsumerWidget {
? Theme.of(context).colorScheme.secondary
: Theme.of(context).colorScheme.secondaryContainer.withOpacity(0.75),
),
duration: Duration(milliseconds: 250),
duration: const Duration(milliseconds: 250),
);
},
)

View file

@ -12,19 +12,19 @@ abstract class ItemAction {
}
class ItemActionDivider extends ItemAction {
Widget toWidget() => Divider();
Widget toWidget() => const Divider();
@override
Divider toMenuItemButton() => Divider();
Divider toMenuItemButton() => const Divider();
@override
PopupMenuEntry toPopupMenuItem({bool useIcons = false}) => PopupMenuDivider(height: 3);
PopupMenuEntry toPopupMenuItem({bool useIcons = false}) => const PopupMenuDivider(height: 3);
@override
Widget toLabel() => Container();
@override
Widget toListItem(BuildContext context, {bool useIcons = false, bool shouldPop = true}) => Divider();
Widget toListItem(BuildContext context, {bool useIcons = false, bool shouldPop = true}) => const Divider();
}
class ItemActionButton extends ItemAction {
@ -67,7 +67,7 @@ class ItemActionButton extends ItemAction {
iconTheme: IconThemeData(color: Theme.of(context).colorScheme.onSurface),
),
child: Row(
children: [if (icon != null) icon!, SizedBox(width: 8), if (label != null) Flexible(child: label!)],
children: [if (icon != null) icon!, const SizedBox(width: 8), if (label != null) Flexible(child: label!)],
),
),
);
@ -97,7 +97,7 @@ class ItemActionButton extends ItemAction {
iconTheme: IconThemeData(color: Theme.of(context).colorScheme.onSurface),
),
child: Row(
children: [if (icon != null) icon!, SizedBox(width: 8), if (label != null) Flexible(child: label!)],
children: [if (icon != null) icon!, const SizedBox(width: 8), if (label != null) Flexible(child: label!)],
),
);
})

Some files were not shown because too many files have changed in this diff Show more