mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-03-26 17:04:43 +01:00
Remove unnecessary Containers
This commit is contained in:
parent
bc9b2a4c78
commit
94118c4a5b
6 changed files with 203 additions and 216 deletions
|
@ -23,7 +23,6 @@ class _PhotoDateTimeEditDialogState extends State<PhotoDateTimeEditDialog> {
|
|||
title: Text(L10n.global().updateDateTimeDialogTitle),
|
||||
content: Form(
|
||||
key: _formKey,
|
||||
child: Container(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
|
@ -71,9 +70,8 @@ class _PhotoDateTimeEditDialogState extends State<PhotoDateTimeEditDialog> {
|
|||
onSaved: (value) {
|
||||
_formValue.month = int.parse(value!);
|
||||
},
|
||||
initialValue: widget.initialDateTime.month
|
||||
.toString()
|
||||
.padLeft(2, "0"),
|
||||
initialValue:
|
||||
widget.initialDateTime.month.toString().padLeft(2, "0"),
|
||||
),
|
||||
flex: 1,
|
||||
),
|
||||
|
@ -122,9 +120,8 @@ class _PhotoDateTimeEditDialogState extends State<PhotoDateTimeEditDialog> {
|
|||
onSaved: (value) {
|
||||
_formValue.hour = int.parse(value!);
|
||||
},
|
||||
initialValue: widget.initialDateTime.hour
|
||||
.toString()
|
||||
.padLeft(2, "0"),
|
||||
initialValue:
|
||||
widget.initialDateTime.hour.toString().padLeft(2, "0"),
|
||||
),
|
||||
flex: 1,
|
||||
),
|
||||
|
@ -160,7 +157,6 @@ class _PhotoDateTimeEditDialogState extends State<PhotoDateTimeEditDialog> {
|
|||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => _onSavePressed(context),
|
||||
|
|
|
@ -38,14 +38,12 @@ class PhotoListImage extends StatelessWidget {
|
|||
// won't work on web because the image is downloaded by the cache
|
||||
// manager instead
|
||||
// where's the preview???
|
||||
return Container(
|
||||
child: Center(
|
||||
return Center(
|
||||
child: Icon(
|
||||
Icons.image_not_supported,
|
||||
size: 64,
|
||||
color: Colors.white.withOpacity(.8),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
imageRenderMethodForWeb: ImageRenderMethodForWeb.HttpGet,
|
||||
|
@ -104,14 +102,12 @@ class PhotoListVideo extends StatelessWidget {
|
|||
errorWidget: (context, url, error) {
|
||||
// no preview for this video. Normal since video preview is disabled
|
||||
// by default
|
||||
return Container(
|
||||
child: Center(
|
||||
return Center(
|
||||
child: Icon(
|
||||
Icons.image_not_supported,
|
||||
size: 64,
|
||||
color: Colors.white.withOpacity(.8),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
imageRenderMethodForWeb: ImageRenderMethodForWeb.HttpGet,
|
||||
|
|
|
@ -101,12 +101,10 @@ class _ShareAlbumDialogState extends State<ShareAlbumDialog> {
|
|||
_processingSharee.any((element) => element == sharee.shareWith);
|
||||
final Widget trailing;
|
||||
if (isProcessing) {
|
||||
trailing = Container(
|
||||
child: const SizedBox(
|
||||
trailing = const SizedBox(
|
||||
width: 24,
|
||||
height: 24,
|
||||
child: CircularProgressIndicator(),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
trailing = Checkbox(
|
||||
|
|
|
@ -131,7 +131,7 @@ class _SignInState extends State<SignIn> {
|
|||
const SizedBox(height: 8),
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
SizedBox(
|
||||
width: 64,
|
||||
child: DropdownButtonHideUnderline(
|
||||
child: DropdownButtonFormField<_Scheme>(
|
||||
|
|
|
@ -166,8 +166,7 @@ class _VideoViewerState extends State<VideoViewer>
|
|||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
child: Align(
|
||||
Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
|
@ -181,8 +180,7 @@ class _VideoViewerState extends State<VideoViewer>
|
|||
children: [
|
||||
ValueListenableBuilder(
|
||||
valueListenable: _controller,
|
||||
builder: (context, VideoPlayerValue value, child) =>
|
||||
Text(
|
||||
builder: (context, VideoPlayerValue value, child) => Text(
|
||||
_durationToString(value.position),
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
|
@ -238,7 +236,6 @@ class _VideoViewerState extends State<VideoViewer>
|
|||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
|
|
@ -169,7 +169,7 @@ class _ViewerDetailPaneState extends State<ViewerDetailPane> {
|
|||
child: Divider(),
|
||||
),
|
||||
ListTile(
|
||||
leading: Container(
|
||||
leading: SizedBox(
|
||||
height: double.infinity,
|
||||
child: Icon(
|
||||
Icons.image_outlined,
|
||||
|
@ -181,7 +181,7 @@ class _ViewerDetailPaneState extends State<ViewerDetailPane> {
|
|||
),
|
||||
if (!widget.file.isOwned(widget.account.username))
|
||||
ListTile(
|
||||
leading: Container(
|
||||
leading: SizedBox(
|
||||
height: double.infinity,
|
||||
child: Icon(
|
||||
Icons.share_outlined,
|
||||
|
@ -206,7 +206,7 @@ class _ViewerDetailPaneState extends State<ViewerDetailPane> {
|
|||
if (widget.file.metadata?.imageWidth != null &&
|
||||
widget.file.metadata?.imageHeight != null)
|
||||
ListTile(
|
||||
leading: Container(
|
||||
leading: SizedBox(
|
||||
height: double.infinity,
|
||||
child: Icon(
|
||||
Icons.aspect_ratio,
|
||||
|
@ -219,7 +219,7 @@ class _ViewerDetailPaneState extends State<ViewerDetailPane> {
|
|||
)
|
||||
else
|
||||
ListTile(
|
||||
leading: Container(
|
||||
leading: SizedBox(
|
||||
height: double.infinity,
|
||||
child: Icon(
|
||||
Icons.aspect_ratio,
|
||||
|
@ -230,7 +230,7 @@ class _ViewerDetailPaneState extends State<ViewerDetailPane> {
|
|||
),
|
||||
if (_model != null)
|
||||
ListTile(
|
||||
leading: Container(
|
||||
leading: SizedBox(
|
||||
height: double.infinity,
|
||||
child: Icon(
|
||||
Icons.camera_outlined,
|
||||
|
|
Loading…
Add table
Reference in a new issue