This commit is contained in:
Thibault Deckers 2023-01-30 13:58:23 +01:00
parent 0e56ce5e2d
commit d5e702266f
14 changed files with 23 additions and 23 deletions

View file

@ -33,7 +33,7 @@ class CollectionSectionHeader extends StatelessWidget {
height: height, height: height,
child: header, child: header,
) )
: const SizedBox.shrink(); : const SizedBox();
} }
Widget? _buildHeader(BuildContext context) { Widget? _buildHeader(BuildContext context) {

View file

@ -203,7 +203,7 @@ class _EntryLeafletMapState<T> extends State<EntryLeafletMap<T>> with TickerProv
case EntryMapStyle.stamenWatercolor: case EntryMapStyle.stamenWatercolor:
return const StamenWatercolorLayer(); return const StamenWatercolorLayer();
default: default:
return const SizedBox.shrink(); return const SizedBox();
} }
} }

View file

@ -36,7 +36,7 @@ class _DebugAndroidCodecSectionState extends State<DebugAndroidCodecSection> wit
future: _loader, future: _loader,
builder: (context, snapshot) { builder: (context, snapshot) {
if (snapshot.hasError) return Text(snapshot.error.toString()); if (snapshot.hasError) return Text(snapshot.error.toString());
if (snapshot.connectionState != ConnectionState.done) return const SizedBox.shrink(); if (snapshot.connectionState != ConnectionState.done) return const SizedBox();
final codecs = snapshot.data!.map((codec) { final codecs = snapshot.data!.map((codec) {
return codec.map((k, v) => MapEntry(k.toString(), v.toString())); return codec.map((k, v) => MapEntry(k.toString(), v.toString()));
}).toList() }).toList()

View file

@ -34,7 +34,7 @@ class _DebugAndroidDirSectionState extends State<DebugAndroidDirSection> with Au
future: _loader, future: _loader,
builder: (context, snapshot) { builder: (context, snapshot) {
if (snapshot.hasError) return Text(snapshot.error.toString()); if (snapshot.hasError) return Text(snapshot.error.toString());
if (snapshot.connectionState != ConnectionState.done) return const SizedBox.shrink(); if (snapshot.connectionState != ConnectionState.done) return const SizedBox();
final data = SplayTreeMap.of(snapshot.data!.map((k, v) => MapEntry(k.toString(), v?.toString() ?? 'null'))); final data = SplayTreeMap.of(snapshot.data!.map((k, v) => MapEntry(k.toString(), v?.toString() ?? 'null')));
return InfoRowGroup(info: data); return InfoRowGroup(info: data);
}, },

View file

@ -50,7 +50,7 @@ class _DebugAppDatabaseSectionState extends State<DebugAppDatabaseSection> with
builder: (context, snapshot) { builder: (context, snapshot) {
if (snapshot.hasError) return Text(snapshot.error.toString()); if (snapshot.hasError) return Text(snapshot.error.toString());
if (snapshot.connectionState != ConnectionState.done) return const SizedBox.shrink(); if (snapshot.connectionState != ConnectionState.done) return const SizedBox();
return Row( return Row(
children: [ children: [
@ -71,7 +71,7 @@ class _DebugAppDatabaseSectionState extends State<DebugAppDatabaseSection> with
builder: (context, snapshot) { builder: (context, snapshot) {
if (snapshot.hasError) return Text(snapshot.error.toString()); if (snapshot.hasError) return Text(snapshot.error.toString());
if (snapshot.connectionState != ConnectionState.done) return const SizedBox.shrink(); if (snapshot.connectionState != ConnectionState.done) return const SizedBox();
return Row( return Row(
children: [ children: [
@ -92,7 +92,7 @@ class _DebugAppDatabaseSectionState extends State<DebugAppDatabaseSection> with
builder: (context, snapshot) { builder: (context, snapshot) {
if (snapshot.hasError) return Text(snapshot.error.toString()); if (snapshot.hasError) return Text(snapshot.error.toString());
if (snapshot.connectionState != ConnectionState.done) return const SizedBox.shrink(); if (snapshot.connectionState != ConnectionState.done) return const SizedBox();
return Row( return Row(
children: [ children: [
@ -113,7 +113,7 @@ class _DebugAppDatabaseSectionState extends State<DebugAppDatabaseSection> with
builder: (context, snapshot) { builder: (context, snapshot) {
if (snapshot.hasError) return Text(snapshot.error.toString()); if (snapshot.hasError) return Text(snapshot.error.toString());
if (snapshot.connectionState != ConnectionState.done) return const SizedBox.shrink(); if (snapshot.connectionState != ConnectionState.done) return const SizedBox();
return Row( return Row(
children: [ children: [
@ -134,7 +134,7 @@ class _DebugAppDatabaseSectionState extends State<DebugAppDatabaseSection> with
builder: (context, snapshot) { builder: (context, snapshot) {
if (snapshot.hasError) return Text(snapshot.error.toString()); if (snapshot.hasError) return Text(snapshot.error.toString());
if (snapshot.connectionState != ConnectionState.done) return const SizedBox.shrink(); if (snapshot.connectionState != ConnectionState.done) return const SizedBox();
return Row( return Row(
children: [ children: [
@ -155,7 +155,7 @@ class _DebugAppDatabaseSectionState extends State<DebugAppDatabaseSection> with
builder: (context, snapshot) { builder: (context, snapshot) {
if (snapshot.hasError) return Text(snapshot.error.toString()); if (snapshot.hasError) return Text(snapshot.error.toString());
if (snapshot.connectionState != ConnectionState.done) return const SizedBox.shrink(); if (snapshot.connectionState != ConnectionState.done) return const SizedBox();
return Row( return Row(
children: [ children: [
@ -176,7 +176,7 @@ class _DebugAppDatabaseSectionState extends State<DebugAppDatabaseSection> with
builder: (context, snapshot) { builder: (context, snapshot) {
if (snapshot.hasError) return Text(snapshot.error.toString()); if (snapshot.hasError) return Text(snapshot.error.toString());
if (snapshot.connectionState != ConnectionState.done) return const SizedBox.shrink(); if (snapshot.connectionState != ConnectionState.done) return const SizedBox();
return Row( return Row(
children: [ children: [
@ -197,7 +197,7 @@ class _DebugAppDatabaseSectionState extends State<DebugAppDatabaseSection> with
builder: (context, snapshot) { builder: (context, snapshot) {
if (snapshot.hasError) return Text(snapshot.error.toString()); if (snapshot.hasError) return Text(snapshot.error.toString());
if (snapshot.connectionState != ConnectionState.done) return const SizedBox.shrink(); if (snapshot.connectionState != ConnectionState.done) return const SizedBox();
return Row( return Row(
children: [ children: [
@ -218,7 +218,7 @@ class _DebugAppDatabaseSectionState extends State<DebugAppDatabaseSection> with
builder: (context, snapshot) { builder: (context, snapshot) {
if (snapshot.hasError) return Text(snapshot.error.toString()); if (snapshot.hasError) return Text(snapshot.error.toString());
if (snapshot.connectionState != ConnectionState.done) return const SizedBox.shrink(); if (snapshot.connectionState != ConnectionState.done) return const SizedBox();
return Row( return Row(
children: [ children: [

View file

@ -18,7 +18,7 @@ class DebugTaskQueueOverlay extends StatelessWidget {
child: StreamBuilder<QueueState>( child: StreamBuilder<QueueState>(
stream: servicePolicy.queueStream, stream: servicePolicy.queueStream,
builder: (context, snapshot) { builder: (context, snapshot) {
if (snapshot.hasError) return const SizedBox.shrink(); if (snapshot.hasError) return const SizedBox();
final queuedEntries = <MapEntry<dynamic, int>>[]; final queuedEntries = <MapEntry<dynamic, int>>[];
if (snapshot.hasData) { if (snapshot.hasData) {
final state = snapshot.data!; final state = snapshot.data!;

View file

@ -204,7 +204,7 @@ class _AppDrawerState extends State<AppDrawer> {
stream: source.eventBus.on<AlbumsChangedEvent>(), stream: source.eventBus.on<AlbumsChangedEvent>(),
builder: (context, snapshot) { builder: (context, snapshot) {
final albums = settings.drawerAlbumBookmarks ?? AppDrawer.getDefaultAlbums(context); final albums = settings.drawerAlbumBookmarks ?? AppDrawer.getDefaultAlbums(context);
if (albums.isEmpty) return const SizedBox.shrink(); if (albums.isEmpty) return const SizedBox();
return Column( return Column(
children: [ children: [
const Divider(), const Divider(),

View file

@ -40,7 +40,7 @@ class _StorageAccessPageState extends State<StorageAccessPage> {
return Text(snapshot.error.toString()); return Text(snapshot.error.toString());
} }
if (snapshot.connectionState != ConnectionState.done && _lastPaths == null) { if (snapshot.connectionState != ConnectionState.done && _lastPaths == null) {
return const SizedBox.shrink(); return const SizedBox();
} }
_lastPaths = snapshot.data!..sort(); _lastPaths = snapshot.data!..sort();
if (_lastPaths!.isEmpty) { if (_lastPaths!.isEmpty) {

View file

@ -42,7 +42,7 @@ class _MimeDonutState extends State<MimeDonut> with AutomaticKeepAliveClientMixi
Widget build(BuildContext context) { Widget build(BuildContext context) {
super.build(context); super.build(context);
if (byMimeTypes.isEmpty) return const SizedBox.shrink(); if (byMimeTypes.isEmpty) return const SizedBox();
final l10n = context.l10n; final l10n = context.l10n;
final locale = l10n.localeName; final locale = l10n.localeName;

View file

@ -79,7 +79,7 @@ class _MetadataSectionSliverState extends State<MetadataSectionSliver> {
builder: (context, metadata, child) { builder: (context, metadata, child) {
Widget content; Widget content;
if (metadata.isEmpty) { if (metadata.isEmpty) {
content = const SizedBox.shrink(); content = const SizedBox();
} else { } else {
final durations = context.watch<DurationsData>(); final durations = context.watch<DurationsData>();
content = Column( content = Column(

View file

@ -50,7 +50,7 @@ class _MetadataThumbnailsState extends State<MetadataThumbnails> {
), ),
); );
} }
return const SizedBox.shrink(); return const SizedBox();
}); });
} }
} }

View file

@ -40,7 +40,7 @@ class _SourceViewerPageState extends State<SourceViewerPage> {
future: _loader, future: _loader,
builder: (context, snapshot) { builder: (context, snapshot) {
if (snapshot.hasError) return Text(snapshot.error.toString()); if (snapshot.hasError) return Text(snapshot.error.toString());
if (!snapshot.hasData) return const SizedBox.shrink(); if (!snapshot.hasData) return const SizedBox();
final data = snapshot.data!; final data = snapshot.data!;
final source = data.length < maxCodeSize ? data : '${data.substring(0, maxCodeSize)}\n\n*** TRUNCATED ***'; final source = data.length < maxCodeSize ? data : '${data.substring(0, maxCodeSize)}\n\n*** TRUNCATED ***';

View file

@ -164,7 +164,7 @@ class _RasterImageViewState extends State<RasterImageView> {
return ValueListenableBuilder<bool>( return ValueListenableBuilder<bool>(
valueListenable: _fullImageLoaded, valueListenable: _fullImageLoaded,
builder: (context, fullImageLoaded, child) { builder: (context, fullImageLoaded, child) {
if (fullImageLoaded) return const SizedBox.shrink(); if (fullImageLoaded) return const SizedBox();
return Center( return Center(
child: AspectRatio( child: AspectRatio(
@ -196,7 +196,7 @@ class _RasterImageViewState extends State<RasterImageView> {
child = ValueListenableBuilder<bool>( child = ValueListenableBuilder<bool>(
valueListenable: _fullImageLoaded, valueListenable: _fullImageLoaded,
builder: (context, fullImageLoaded, child) { builder: (context, fullImageLoaded, child) {
if (!fullImageLoaded) return const SizedBox.shrink(); if (!fullImageLoaded) return const SizedBox();
return CustomPaint( return CustomPaint(
painter: CheckeredPainter( painter: CheckeredPainter(

View file

@ -138,7 +138,7 @@ class _VectorImageViewState extends State<VectorImageView> {
return ValueListenableBuilder<bool>( return ValueListenableBuilder<bool>(
valueListenable: _fullImageLoaded, valueListenable: _fullImageLoaded,
builder: (context, fullImageLoaded, child) { builder: (context, fullImageLoaded, child) {
if (fullImageLoaded) return const SizedBox.shrink(); if (fullImageLoaded) return const SizedBox();
return Center( return Center(
child: AspectRatio( child: AspectRatio(