Skip to content

Commit e68fca6

Browse files
committed
fixed issues
1 parent c9058f9 commit e68fca6

4 files changed

Lines changed: 87 additions & 84 deletions

File tree

lib/components/cards/image_details_card.dart

Lines changed: 52 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -67,63 +67,62 @@ class ImageDetailsCard extends StatelessWidget {
6767
),
6868
);
6969

70-
Widget _imageDetails(context) => Container(
71-
margin: EdgeInsets.symmetric(vertical: 8.0),
72-
padding: EdgeInsets.only(top: 8.0, bottom: 8.0, right: 8.0),
73-
decoration: BoxDecoration(
74-
borderRadius: BorderRadius.horizontal(right: Radius.circular(10.0)),
75-
color: Theme.of(context).cardColor,
76-
),
77-
child: Column(
78-
crossAxisAlignment: CrossAxisAlignment.stretch,
79-
children: [
80-
Text(
81-
"${image.width}x${image.height} pixels",
82-
maxLines: 1,
83-
overflow: TextOverflow.ellipsis,
84-
style: Theme.of(context).textTheme.bodySmall,
85-
),
86-
Padding(
87-
padding: const EdgeInsets.only(top: 4.0),
88-
child: Row(
89-
children: [
90-
Flexible(
91-
child: Text(
92-
image.file.replaceAll('', '\u200B').split(path.extension(image.file))[0],
93-
maxLines: 1,
94-
overflow: TextOverflow.ellipsis,
95-
style: Theme.of(context).textTheme.bodySmall,
96-
),
97-
),
98-
Text(
99-
path.extension(image.file),
70+
Widget _imageDetails(context) {
71+
return Container(
72+
margin: EdgeInsets.symmetric(vertical: 8.0),
73+
padding: EdgeInsets.only(top: 8.0, bottom: 8.0, right: 8.0),
74+
decoration: BoxDecoration(
75+
borderRadius: BorderRadius.horizontal(right: Radius.circular(10.0)),
76+
color: Theme.of(context).cardColor,
77+
),
78+
child: Column(
79+
crossAxisAlignment: CrossAxisAlignment.stretch,
80+
children: [
81+
Text(
82+
"${image.width}x${image.height} pixels",
83+
maxLines: 1,
84+
overflow: TextOverflow.ellipsis,
85+
style: Theme.of(context).textTheme.bodySmall,
86+
),
87+
Padding(
88+
padding: const EdgeInsets.only(top: 4.0),
89+
child: Row(
90+
children: [
91+
Flexible(
92+
child: Text(
93+
image.file.replaceAll('', '\u200B').split(path.extension(image.file))[0],
94+
maxLines: 1,
10095
overflow: TextOverflow.ellipsis,
10196
style: Theme.of(context).textTheme.bodySmall,
10297
),
103-
],
104-
),
105-
),
106-
if (image.dateAvailable != null)
107-
Padding(
108-
padding: const EdgeInsets.only(top: 4.0),
109-
child: Flexible(
110-
child: Builder(builder: (context) {
111-
LocaleNotifier localeNotifier = Provider.of<LocaleNotifier>(context, listen: false);
112-
String date =
113-
DateFormat.yMMMMd(localeNotifier.locale.languageCode).format(DateTime.parse(image.dateAvailable!));
114-
String time = DateFormat.Hms(localeNotifier.locale.languageCode).format(DateTime.parse(image.dateAvailable!));
115-
return Text(
116-
"$date $time",
117-
maxLines: 2,
118-
overflow: TextOverflow.ellipsis,
119-
style: Theme.of(context).textTheme.bodySmall,
120-
);
121-
}),
12298
),
123-
),
124-
],
125-
),
126-
);
99+
Text(
100+
path.extension(image.file),
101+
overflow: TextOverflow.ellipsis,
102+
style: Theme.of(context).textTheme.bodySmall,
103+
),
104+
],
105+
),
106+
),
107+
if (image.dateAvailable != null)
108+
Padding(
109+
padding: const EdgeInsets.only(top: 4.0),
110+
child: Builder(builder: (context) {
111+
LocaleNotifier localeNotifier = Provider.of<LocaleNotifier>(context, listen: false);
112+
String date = DateFormat.yMMMMd(localeNotifier.locale.languageCode).format(DateTime.parse(image.dateAvailable!));
113+
String time = DateFormat.Hms(localeNotifier.locale.languageCode).format(DateTime.parse(image.dateAvailable!));
114+
return Text(
115+
"$date $time",
116+
maxLines: 2,
117+
overflow: TextOverflow.ellipsis,
118+
style: Theme.of(context).textTheme.bodySmall,
119+
);
120+
}),
121+
),
122+
],
123+
),
124+
);
125+
}
127126

128127
Widget _removeButton(context) => Positioned(
129128
bottom: 0.0,

lib/components/modals/move_or_copy_modal.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class _MoveOrCopyModalState extends State<MoveOrCopyModal> {
5252
@override
5353
Widget build(BuildContext context) {
5454
return BottomSheet(
55-
backgroundColor: Theme.of(context).backgroundColor,
55+
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
5656
enableDrag: false,
5757
onClosing: () {},
5858
shape: const RoundedRectangleBorder(

lib/utils/image_actions.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,9 @@ Future<dynamic> onMovePhotos(BuildContext context, List<ImageModel> images, [Alb
111111
break;
112112
}
113113
if (results > 0) {
114-
return choice;
114+
return true;
115115
}
116-
return -1;
116+
return false;
117117
},
118118
),
119119
),

lib/views/image/edit_image_page.dart

Lines changed: 32 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -115,34 +115,7 @@ class _EditImagePageState extends State<EditImagePage> {
115115
body: ListView(
116116
padding: const EdgeInsets.symmetric(vertical: 8.0),
117117
children: [
118-
SizedBox(
119-
height: carouselHeight,
120-
child: OrientationBuilder(builder: (context, orientation) {
121-
return PageView.builder(
122-
controller: PageController(
123-
viewportFraction: min(
124-
maxCarouselElementWidth / MediaQuery.of(context).size.width,
125-
0.9,
126-
),
127-
),
128-
padEnds: false,
129-
itemCount: _imageList.length,
130-
itemBuilder: (context, index) {
131-
ImageModel image = _imageList[index];
132-
return Padding(
133-
padding: EdgeInsets.only(
134-
left: index == 0 ? 8.0 : 0.0,
135-
right: index == _imageList.length - 1 ? 8.0 : 0.0,
136-
),
137-
child: ImageDetailsCard(
138-
image: image,
139-
onRemove: () => _onRemoveImage(image),
140-
),
141-
);
142-
},
143-
);
144-
}),
145-
),
118+
_carousel,
146119
FormSection(
147120
margin: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0),
148121
title: appStrings.editImageDetails_title,
@@ -240,4 +213,35 @@ class _EditImagePageState extends State<EditImagePage> {
240213
),
241214
);
242215
}
216+
217+
Widget get _carousel {
218+
return SizedBox(
219+
height: carouselHeight,
220+
child: OrientationBuilder(builder: (context, orientation) {
221+
return PageView.builder(
222+
controller: PageController(
223+
viewportFraction: min(
224+
maxCarouselElementWidth / MediaQuery.of(context).size.width,
225+
0.9,
226+
),
227+
),
228+
padEnds: false,
229+
itemCount: _imageList.length,
230+
itemBuilder: (context, index) {
231+
ImageModel image = _imageList[index];
232+
return Padding(
233+
padding: EdgeInsets.only(
234+
left: index == 0 ? 8.0 : 0.0,
235+
right: index == _imageList.length - 1 ? 8.0 : 0.0,
236+
),
237+
child: ImageDetailsCard(
238+
image: image,
239+
onRemove: () => _onRemoveImage(image),
240+
),
241+
);
242+
},
243+
);
244+
}),
245+
);
246+
}
243247
}

0 commit comments

Comments
 (0)