@@ -15,7 +15,7 @@ class MoverViewModel extends BaseViewModel {
1515 String ? targetFolderPath;
1616 String ? logFilePath;
1717
18- bool startButtonActive = true ;
18+ bool startButtonActive = false ;
1919
2020 final List <String > _extensions = [
2121 '.dds' ,
@@ -37,6 +37,10 @@ class MoverViewModel extends BaseViewModel {
3737
3838 String currentTexture = '' ;
3939 int amountTextures = 0 ;
40+ double value = 0.0 ;
41+ int i = 0 ;
42+
43+ String message = '' ;
4044
4145 void onReady () async {
4246 Directory appDocument = await getApplicationDocumentsDirectory ();
@@ -90,9 +94,7 @@ class MoverViewModel extends BaseViewModel {
9094
9195 List <String > list = _getTexturesFromLog (platformLogFile.path! );
9296 BotToast .showText (text: 'Extracted ${list .length } textures' );
93- list.forEach ((element) {
94- print (element);
95- });
97+ amountTextures = list.length;
9698 logFilePath = platformLogFile.path! ;
9799 logFilePathController.text = platformLogFile.path! ;
98100 if (_textures.isNotEmpty) {
@@ -101,9 +103,12 @@ class MoverViewModel extends BaseViewModel {
101103 _textures.addAll (list);
102104 list.clear ();
103105 }
106+ startButtonActive = true ;
107+ notifyListeners ();
104108 }
105109
106- void startCopy () {
110+ void startCopy (BuildContext context) async {
111+ message = 'Copying $amountTextures textures...' ;
107112 _checkExistence (_textures, sourceFolderPath! );
108113 }
109114
@@ -126,6 +131,13 @@ class MoverViewModel extends BaseViewModel {
126131
127132 void _checkExistence (List <String > textures, String sourceFolder) async {
128133 for (String texture in textures) {
134+ value = (i / textures.length);
135+ i = i + 1 ;
136+ currentTexture = texture;
137+ notifyListeners ();
138+ /* Future.delayed(Duration(milliseconds: 1000))
139+ .then((value) => notifyListeners()); */
140+
129141 File textureFile = File (_context.join (sourceFolder, texture) + '.dds' );
130142 bool exist = await textureFile.exists ();
131143 if (exist) {
@@ -134,6 +146,11 @@ class MoverViewModel extends BaseViewModel {
134146 _notFound.writeAsStringSync (texture + '\n ' , mode: FileMode .append);
135147 }
136148 }
149+ BotToast .showText (
150+ text: 'All textures was copied success!' ,
151+ duration: Duration (seconds: 5 ));
152+ message = 'Copied!' ;
153+ notifyListeners ();
137154 }
138155
139156 /// This method finds and copies the other files with required extensions
0 commit comments