Skip to content

Commit fca897d

Browse files
committed
feat: rebase
1 parent 6d25412 commit fca897d

5 files changed

Lines changed: 52 additions & 70 deletions

File tree

android/app/build.gradle

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
plugins {
2+
id "com.android.application"
3+
id "kotlin-android"
4+
id "dev.flutter.flutter-gradle-plugin"
5+
}
6+
17
def localProperties = new Properties()
28
def localPropertiesFile = rootProject.file('local.properties')
39
if (localPropertiesFile.exists()) {
@@ -6,11 +12,6 @@ if (localPropertiesFile.exists()) {
612
}
713
}
814

9-
def flutterRoot = localProperties.getProperty('flutter.sdk')
10-
if (flutterRoot == null) {
11-
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12-
}
13-
1415
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
1516
if (flutterVersionCode == null) {
1617
flutterVersionCode = '1'
@@ -21,10 +22,6 @@ if (flutterVersionName == null) {
2122
flutterVersionName = '1.0'
2223
}
2324

24-
apply plugin: 'com.android.application'
25-
apply plugin: 'kotlin-android'
26-
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27-
2825
def keystoreProperties = new Properties()
2926
def keystorePropertiesFile = rootProject.file('key.properties')
3027
if (keystorePropertiesFile.exists()) {
@@ -81,7 +78,6 @@ flutter {
8178
}
8279

8380
dependencies {
84-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
8581
implementation "androidx.window:window:1.0.0"
8682
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
8783
}

android/build.gradle

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,3 @@
1-
buildscript {
2-
ext.kotlin_version = '1.7.10'
3-
repositories {
4-
google()
5-
mavenCentral()
6-
}
7-
8-
dependencies {
9-
classpath 'com.android.tools.build:gradle:7.1.3'
10-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11-
}
12-
}
13-
141
allprojects {
152
repositories {
163
google()

android/settings.gradle

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,25 @@
1-
include ':app'
1+
pluginManagement {
2+
def flutterSdkPath = {
3+
def properties = new Properties()
4+
file("local.properties").withInputStream { properties.load(it) }
5+
def flutterSdkPath = properties.getProperty("flutter.sdk")
6+
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
7+
return flutterSdkPath
8+
}()
29

3-
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
4-
def properties = new Properties()
10+
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
511

6-
assert localPropertiesFile.exists()
7-
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
12+
repositories {
13+
google()
14+
mavenCentral()
15+
gradlePluginPortal()
16+
}
17+
}
818

9-
def flutterSdkPath = properties.getProperty("flutter.sdk")
10-
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
11-
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
19+
plugins {
20+
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
21+
id "com.android.application" version "7.1.3" apply false
22+
id "org.jetbrains.kotlin.android" version "1.7.10" apply false
23+
}
24+
25+
include ":app"

lib/views/image/image_page.dart

Lines changed: 15 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -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,

pubspec.yaml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
66
version: 2.2.3+223
77

88
environment:
9-
sdk: ">=2.17.6 <3.0.0"
9+
sdk: ">=3.0.0 <4.0.0"
10+
flutter: 3.22.2
1011

1112
dependencies:
1213
flutter:
@@ -24,15 +25,18 @@ dependencies:
2425
auto_size_text: ^3.0.0 # Text that auto-sizes (image thumbnail title)
2526
cupertino_icons: ^1.0.2 # iOS style icons (might be useless)
2627
font_awesome_flutter: ^10.1.0 # Font awesome icons (might be useless)
27-
flutter_slidable: ^2.0.0 # Album card's sliding cations
28+
flutter_slidable: ^3.0.1 # Album card's sliding cations
2829
drag_select_grid_view: ^0.6.1 # Drag to select image grid
29-
rounded_loading_button: ^2.1.0 # Loading button animation
30+
rounded_loading_button: # Loading button animation
31+
git:
32+
url: https://github.com/scopendo/flutter_rounded_loading_button # A custom fork that can work with the latest flutter SDK
33+
ref: dd4b76a
3034
modal_bottom_sheet: ^3.0.0-pre # Custom modals (might be useless)
3135
cached_network_image: ^3.2.2 # Better cache for images (used for album's thumbnail)
3236
flutter_speed_dial: ^6.1.0+1 # Speed dial
3337
pull_to_refresh: ^2.0.0 # Top and bottom refresh gestures
3438
photo_view: ^0.14.0 # Zoom on fullscreen photos
35-
extended_text: ^11.0.0 # Text overflow on left side
39+
extended_text: ^13.0.0 # Text overflow on left side
3640
flutter_easyloading: ^3.0.5 # Show loading dialog
3741

3842
# Storage
@@ -64,7 +68,7 @@ dependencies:
6468
# Translations
6569
flutter_localizations:
6670
sdk: flutter
67-
intl: ^0.18.0 # Used for translations
71+
intl: ^0.19.0 # Used for translations
6872
html_unescape: ^2.0.0
6973

7074
dev_dependencies:

0 commit comments

Comments
 (0)