File tree 4 files changed +13
-9
lines changed
4 files changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -12,10 +12,14 @@ class AudioList extends StatefulWidget {
12
12
}
13
13
14
14
class _AudioListState extends State <AudioList > {
15
+ List <FileSystemEntity > data = [];
16
+
15
17
@override
16
18
Widget build (BuildContext context) {
17
19
return FutureBuilder <List <FileSystemEntity >>(
20
+ key: const ValueKey ("futureBuilder" ),
18
21
future: fetchAudioFiles (),
22
+ initialData: data,
19
23
builder: (context, AsyncSnapshot <List <FileSystemEntity >> snapshot) {
20
24
if (snapshot.connectionState == ConnectionState .active ||
21
25
snapshot.connectionState == ConnectionState .waiting) {
@@ -24,12 +28,17 @@ class _AudioListState extends State<AudioList> {
24
28
);
25
29
}
26
30
if (snapshot.hasData) {
31
+ data = snapshot.data! ;
27
32
return ListView .builder (
33
+ key: const ValueKey ("ListBuilder" ),
28
34
reverse: true ,
29
35
padding: const EdgeInsets .symmetric (vertical: 15 ),
30
36
itemCount: snapshot.data? .length,
31
37
itemBuilder: (BuildContext context, int index) {
32
- return AudioBubble (filepath: snapshot.data! [index].path);
38
+ return AudioBubble (
39
+ filepath: snapshot.data! [index].path,
40
+ key: ValueKey (snapshot.data! [index].path),
41
+ );
33
42
},
34
43
);
35
44
} else {
Original file line number Diff line number Diff line change @@ -35,6 +35,9 @@ class _HomePageState extends State<HomePage>
35
35
@override
36
36
Widget build (BuildContext context) {
37
37
return Scaffold (
38
+ appBar: AppBar (
39
+ title: const Text ("Audio Chat" ),
40
+ ),
38
41
body: Padding (
39
42
padding: const EdgeInsets .all (Globals .defaultPadding),
40
43
child: Column (
Original file line number Diff line number Diff line change @@ -15,13 +15,6 @@ packages:
15
15
url: "https://pub.dartlang.org"
16
16
source: hosted
17
17
version: "0.1.6+1"
18
- audio_wave:
19
- dependency: "direct main"
20
- description:
21
- name: audio_wave
22
- url: "https://pub.dartlang.org"
23
- source: hosted
24
- version: "0.1.2"
25
18
boolean_selector:
26
19
dependency: transitive
27
20
description:
Original file line number Diff line number Diff line change @@ -34,7 +34,6 @@ dependencies:
34
34
permission_handler : ^8.1.6
35
35
path_provider : ^2.0.5
36
36
record : ^3.0.0
37
- audio_wave : ^0.1.2
38
37
39
38
# The following adds the Cupertino Icons font to your application.
40
39
# Use with the CupertinoIcons class for iOS style icons.
You can’t perform that action at this time.
0 commit comments