pparth602

Untitled

Sep 30th, 2020
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 1.37 KB | None | 0 0
  1. Future<Widget> _buildMusicTile(
  2.     List<String> listofAudioFilesPath, List<String> listofAudioNames) async {
  3.   List<String> listOfFilesPath = await listofAudioFilesPath;
  4.   List<String> listOfFilesNames = await listofAudioNames;
  5.   if (listofAudioFilesPath != null && listOfFilesNames != null) {
  6.     return ListView.separated(
  7.       itemCount: listofAudioNames.length,
  8.       separatorBuilder: (BuildContext context, int index) {
  9.         return Container(
  10.           height: 10,
  11.           color: Colors.white,
  12.         );
  13.       },
  14.       itemBuilder: (BuildContext context, int index) {
  15.         return ListTile(
  16.           leading: Icon(Icons.play_circle_filled),
  17.           title: Text(
  18.             '$listofAudioNames[$index]',
  19.             style: TextStyle(color: Colors.black, fontSize: 25),
  20.           ),
  21.           subtitle: Text(
  22.             '$listOfFilesPath',
  23.             style: TextStyle(color: Colors.black, fontSize: 25),
  24.           ),
  25.         );
  26.       },
  27.     );
  28.   } else {
  29.     return Center(
  30.       child: Column(
  31.         children: [
  32.           Text(
  33.             '$listofAudioNames',
  34.             style: TextStyle(color: Colors.black, fontSize: 25),
  35.           ),
  36.           Text(
  37.             '$listOfFilesPath',
  38.             style: TextStyle(color: Colors.black, fontSize: 25),
  39.           ),
  40.           CircularProgressIndicator(),
  41.         ],
  42.       ),
  43.     );
  44.   }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment