Remove unnecessary Containers

This commit is contained in:
Ming Ming 2021-09-15 18:50:51 +08:00
parent bc9b2a4c78
commit 94118c4a5b
6 changed files with 203 additions and 216 deletions

View file

@ -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),

View file

@ -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,

View file

@ -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(

View file

@ -131,7 +131,7 @@ class _SignInState extends State<SignIn> {
const SizedBox(height: 8),
Row(
children: [
Container(
SizedBox(
width: 64,
child: DropdownButtonHideUnderline(
child: DropdownButtonFormField<_Scheme>(

View file

@ -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>
),
),
),
),
],
);
}

View file

@ -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,