Skip to content

Commit fb58fb9

Browse files
committed
Fix pub.dev warnings
1 parent 46a29eb commit fb58fb9

File tree

5 files changed

+24
-9
lines changed

5 files changed

+24
-9
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
## [0.0.1] - 04/01/2020
22

33
* Initial release
4+
5+
## [0.0.2] - 05/01/2020
6+
7+
* Fix pub.dev warnings

lib/src/flutter_rename_app.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ renameApp() async {
8282
Logger.error(error.message);
8383
return;
8484
}
85+
86+
Logger.error("Getting error : $error");
8587
}
8688
}
8789

@@ -125,7 +127,8 @@ _applyContentChanges(List<RequiredChange> requiredChanges) async {
125127
final Directory directory = Directory(path);
126128
await Future.forEach(directory.listSync(recursive: true),
127129
(FileSystemEntity entity) async {
128-
await _changeContentInFile(entity.path, change.regexp, change.replacement);
130+
await _changeContentInFile(
131+
entity.path, change.regexp, change.replacement);
129132
});
130133
} else {
131134
await _changeContentInFile(path, change.regexp, change.replacement);

lib/src/utils/change_android_package_name.dart

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,21 @@ changeAndroidPackageName(Config config) async {
1717
final String oldPackagePath = oldPackageNameParts.join("/");
1818
final String newPackagePath = newPackageNameParts.join("/");
1919

20-
final Directory oldAndroidDirectory = Directory("${workingDirectory.path}/$oldPackagePath");
21-
final Directory newAndroidDirectory = Directory("${workingDirectory.path}/$newPackagePath");
20+
final Directory oldAndroidDirectory =
21+
Directory("${workingDirectory.path}/$oldPackagePath");
22+
final Directory newAndroidDirectory =
23+
Directory("${workingDirectory.path}/$newPackagePath");
2224

2325
newAndroidDirectory.createSync(recursive: true);
24-
final List<FileSystemEntity> files = oldAndroidDirectory.listSync(recursive: true);
26+
final List<FileSystemEntity> files =
27+
oldAndroidDirectory.listSync(recursive: true);
2528

2629
await Future.forEach(files, (FileSystemEntity fileSystemEntity) async {
2730
if (fileSystemEntity is File) {
2831
try {
2932
final String fileName = fileSystemEntity.path.split("/").last;
30-
final File file = await fileSystemEntity.copy("${newAndroidDirectory.path}/$fileName");
33+
final File file = await fileSystemEntity
34+
.copy("${newAndroidDirectory.path}/$fileName");
3135
file.createSync(recursive: true);
3236
} catch (error) {
3337
Logger.error(error);
@@ -42,14 +46,15 @@ changeAndroidPackageName(Config config) async {
4246
newPackageNameParts,
4347
);
4448

45-
directoryToDelete.deleteSync(recursive: true);
49+
directoryToDelete?.deleteSync(recursive: true);
4650
}
4751

4852
/// Get the directory for the Android files
4953
/// Either it is a Kotlin or Java project
5054
Future<Directory> _getDirectory(List<String> oldPackageNameParts) async {
5155
final String packagePath = oldPackageNameParts.join("/");
52-
final Directory javaDirectory = Directory("android/app/src/main/java/$packagePath");
56+
final Directory javaDirectory =
57+
Directory("android/app/src/main/java/$packagePath");
5358
if (javaDirectory.existsSync()) {
5459
return Directory("android/app/src/main/java");
5560
}
@@ -79,4 +84,6 @@ Directory _getFirstDifferentDirectory(
7984
if (foundADifference) {
8085
return Directory("$workingDirectoryPath/$path");
8186
}
87+
88+
return null;
8289
}

lib/src/utils/utils.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ class Utils {
1616
static String fromIdentifierToName(String identifier) {
1717
return identifier
1818
.split("_")
19-
.map((word) => "${word[0].toUpperCase()}${word.substring(1, word.length)}")
19+
.map((word) =>
20+
"${word[0].toUpperCase()}${word.substring(1, word.length)}")
2021
.toList()
2122
.join(" ");
2223
}

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: flutter_rename_app
22
description: A package that enable to rename an entire app and ids in one command.
3-
version: 0.0.1
3+
version: 0.0.2
44
homepage: https://github.com/ThomasEcalle/flutter_rename_app
55

66
environment:

0 commit comments

Comments
 (0)