@@ -82,11 +82,9 @@ class _ImagePageState extends State<ImagePage> {
8282 void initState () {
8383 _imageList = widget.images.sublist (0 );
8484 _album = widget.album;
85- _imagePage =
86- ((_imageList.length - 1 ) / Settings .defaultElementPerPage).floor ();
85+ _imagePage = ((_imageList.length - 1 ) / Settings .defaultElementPerPage).floor ();
8786
88- final ImageModel ? startImage =
89- _imageList.firstWhere ((image) => image.id == widget.startId);
87+ final ImageModel ? startImage = _imageList.firstWhere ((image) => image.id == widget.startId);
9088 if (startImage != null ) {
9189 _page = _imageList.indexOf (startImage);
9290 if (_imageList.last == startImage) {
@@ -117,9 +115,7 @@ class _ImagePageState extends State<ImagePage> {
117115 systemNavigationBarColor: Colors .black.withOpacity (0.001 ),
118116 statusBarColor: Colors .black.withOpacity (0.001 ),
119117 statusBarIconBrightness:
120- App .appKey.currentContext? .read <ThemeNotifier >().isDark ?? false
121- ? Brightness .light
122- : Brightness .dark,
118+ App .appKey.currentContext? .read <ThemeNotifier >().isDark ?? false ? Brightness .light : Brightness .dark,
123119 ));
124120 super .dispose ();
125121 }
@@ -129,8 +125,7 @@ class _ImagePageState extends State<ImagePage> {
129125 Future <void > _loadMoreImages () async {
130126 if (_album.id == - 1 ) return ;
131127 if (_album.nbImages <= _imageList.length) return ;
132- ApiResponse <List <ImageModel >> result =
133- await fetchImages (_album.id, _imagePage + 1 );
128+ ApiResponse <List <ImageModel >> result = await fetchImages (_album.id, _imagePage + 1 );
134129 if (result.hasError || ! result.hasData) return ;
135130 setState (() {
136131 _imagePage += 1 ;
@@ -145,10 +140,8 @@ class _ImagePageState extends State<ImagePage> {
145140 if (serverUrl == null ) return {};
146141
147142 // Get server cookies
148- List <Cookie > cookies =
149- await ApiClient .cookieJar.loadForRequest (Uri .parse (serverUrl));
150- String cookiesStr =
151- cookies.map ((cookie) => '${cookie .name }=${cookie .value }' ).join ('; ' );
143+ List <Cookie > cookies = await ApiClient .cookieJar.loadForRequest (Uri .parse (serverUrl));
144+ String cookiesStr = cookies.map ((cookie) => '${cookie .name }=${cookie .value }' ).join ('; ' );
152145
153146 // Get HTTP Basic id
154147 SharedPreferences prefs = await SharedPreferences .getInstance ();
@@ -354,9 +347,7 @@ class _ImagePageState extends State<ImagePage> {
354347 style: TextStyle (fontSize: 16.0 , color: Colors .white),
355348 ),
356349 ),
357- if (MediaQuery .of (context).orientation ==
358- Orientation .landscape)
359- ..._actions,
350+ if (MediaQuery .of (context).orientation == Orientation .landscape) ..._actions,
360351 if (widget.isAdmin)
361352 PopupMenuButton (
362353 position: PopupMenuPosition .under,
@@ -385,9 +376,7 @@ class _ImagePageState extends State<ImagePage> {
385376 _onLike,
386377 ),
387378 child: PopupListItem (
388- icon: ! _currentImage.favorite
389- ? Icons .favorite_border
390- : Icons .favorite,
379+ icon: ! _currentImage.favorite ? Icons .favorite_border : Icons .favorite,
391380 text: ! _currentImage.favorite
392381 ? appStrings.imageOptions_addFavorites
393382 : appStrings.imageOptions_removeFavorites,
@@ -495,10 +484,7 @@ class _ImagePageState extends State<ImagePage> {
495484 imageUrl = image.elementUrl;
496485 imageUrl = HtmlUnescape ().convert (imageUrl);
497486 } else {
498- imageUrl = image
499- .getDerivativeFromString (Preferences .getImageFullScreenSize)
500- ? .url ??
501- '' ;
487+ imageUrl = image.getDerivativeFromString (Preferences .getImageFullScreenSize)? .url ?? '' ;
502488 }
503489
504490 // ApiClient.cookieJar.loadForRequest(Uri.parse(imageUrl));
@@ -520,10 +506,8 @@ class _ImagePageState extends State<ImagePage> {
520506 child: IconButton (
521507 color: Colors .white,
522508 style: ButtonStyle (
523- backgroundColor: MaterialStateProperty .resolveWith (
524- (states) => Colors .black.withOpacity (0.5 )),
525- shape: MaterialStateProperty .resolveWith (
526- (states) => CircleBorder ()),
509+ backgroundColor: MaterialStateProperty .resolveWith ((states) => Colors .black.withOpacity (0.5 )),
510+ shape: MaterialStateProperty .resolveWith ((states) => CircleBorder ()),
527511 ),
528512 onPressed: () {
529513 Navigator .of (context).pushNamed (
@@ -562,6 +546,7 @@ class _ImagePageState extends State<ImagePage> {
562546 debugPrint ("$o \n $s " );
563547 return const Icon (Icons .broken_image_outlined);
564548 },
549+ filterQuality: FilterQuality .medium,
565550 );
566551 },
567552 );
@@ -601,14 +586,11 @@ class _ImagePageState extends State<ImagePage> {
601586 crossAxisAlignment: CrossAxisAlignment .stretch,
602587 children: [
603588 _pagination,
604- if (MediaQuery .of (context).orientation ==
605- Orientation .portrait)
589+ if (MediaQuery .of (context).orientation == Orientation .portrait)
606590 SizedBox (
607591 height: 56.0 ,
608592 child: Row (
609- children: _actions
610- .map ((action) => Expanded (child: action))
611- .toList (),
593+ children: _actions.map ((action) => Expanded (child: action)).toList (),
612594 ),
613595 ),
614596 ],
@@ -667,8 +649,7 @@ class _ImagePageState extends State<ImagePage> {
667649 duration: _overlayAnimationDuration,
668650 curve: _overlayAnimationCurve,
669651 child: Builder (builder: (context) {
670- if (_currentImage.comment == null || _currentImage.comment! .isEmpty)
671- return const SizedBox ();
652+ if (_currentImage.comment == null || _currentImage.comment! .isEmpty) return const SizedBox ();
672653 return GestureDetector (
673654 behavior: HitTestBehavior .opaque,
674655 onTap: _showImageDetails,
0 commit comments