File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -136,6 +136,7 @@ class ReceiveFile {
136136
137137 // 全体の進捗をstreamで送信
138138 final totalReceiveProgress = ReceiveProgress (
139+ currentFileIndex: i,
139140 totalProgress: totalProgress,
140141 singleProgress: progress.singleProgress,
141142 receiveSpeed: progress.receiveSpeed,
@@ -258,6 +259,9 @@ class ReceiveFile {
258259
259260/// 受信の進捗情報のクラス
260261class ReceiveProgress {
262+ /// 現在受信しているファイルのIndex番号
263+ final int ? currentFileIndex;
264+
261265 /// 全体の進捗 (割合)
262266 final double ? totalProgress;
263267
@@ -274,7 +278,8 @@ class ReceiveProgress {
274278 final int ? currentTotalSize;
275279
276280 ReceiveProgress (
277- {this .totalProgress,
281+ {this .currentFileIndex,
282+ this .totalProgress,
278283 required this .singleProgress,
279284 required this .receiveSpeed,
280285 required this .currentFileSize,
Original file line number Diff line number Diff line change @@ -186,6 +186,7 @@ class _ReceivePageState extends State<ReceivePage>
186186 bool receiveReady = false ;
187187 final setStateCompleter = Completer <Function >();
188188 ReceiveProgress progress = ReceiveProgress (
189+ currentFileIndex: 0 ,
189190 totalProgress: 0 ,
190191 singleProgress: 0 ,
191192 receiveSpeed: 0 ,
@@ -229,7 +230,7 @@ class _ReceivePageState extends State<ReceivePage>
229230 children: [
230231 Text (
231232 receiveReady
232- ? "${currentIndex + 1 }個目のファイルを受信中 ${(progress .totalProgress ! * 100 ).toStringAsFixed (1 )}%完了"
233+ ? "${progress . currentFileIndex ! + 1 }個目のファイルを受信中 ${(progress .totalProgress ! * 100 ).toStringAsFixed (1 )}%完了"
233234 : "" ,
234235 textAlign: TextAlign .center,
235236 ),
@@ -238,7 +239,7 @@ class _ReceivePageState extends State<ReceivePage>
238239 ),
239240 Text (
240241 receiveReady
241- ? "${fileInfo .names [currentIndex ]} ${(progress .singleProgress * 100 ).toStringAsFixed (1 )}%完了"
242+ ? "${fileInfo .names [progress . currentFileIndex ! ]} ${(progress .singleProgress * 100 ).toStringAsFixed (1 )}%完了"
242243 : "" ,
243244 textAlign: TextAlign .center,
244245 ),
You can’t perform that action at this time.
0 commit comments