Skip to content

Commit 43da5fc

Browse files
committed
#34: Fix the display of the communication link list.
1 parent 099695d commit 43da5fc

File tree

1 file changed

+38
-29
lines changed

1 file changed

+38
-29
lines changed

lib/pages/communication_page.dart

Lines changed: 38 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -16,36 +16,45 @@ class CommunicationPage extends StatelessWidget {
1616
appBar: AppBar(
1717
title: const Text('Communication'),
1818
),
19-
body: SliverToBoxAdapter(
20-
child: Consumer<CommunicationProvider>(
21-
builder: (context, itemProvider, child) {
22-
final itemList = itemProvider.items();
23-
if (itemList.isEmpty) {
24-
return const Center(
25-
child: Text('Loading dynamic content...'),
26-
);
27-
}
28-
return ListView.builder(
29-
shrinkWrap: true,
30-
physics: ClampingScrollPhysics(),
31-
itemCount: itemList.length,
32-
itemBuilder: (context, index) {
33-
CommunicationData item = itemList[index];
34-
if (item.title.isEmpty ||
35-
!item.url.startsWith('https://')) {
36-
return SizedBox.shrink();
37-
}
38-
return Padding(
39-
padding: const EdgeInsets.all(16.0),
40-
child: UrlButton(
41-
title: item.title,
42-
url: item.url,
43-
),
44-
);
45-
},
19+
body: Consumer<CommunicationProvider>(
20+
builder: (context, itemProvider, child) {
21+
final itemList = itemProvider.items();
22+
if (itemList.isEmpty) {
23+
return const Center(
24+
child: Text('Loading dynamic content...'),
4625
);
47-
},
48-
),
26+
}
27+
return ListView.builder(
28+
shrinkWrap: true,
29+
physics: ClampingScrollPhysics(),
30+
itemCount: itemList.length,
31+
itemBuilder: (context, index) {
32+
CommunicationData item = itemList[index];
33+
if (item.title.isEmpty ||
34+
!item.url.startsWith('https://')) {
35+
return SizedBox.shrink();
36+
}
37+
return Column(
38+
children: [
39+
Padding(
40+
padding: const EdgeInsets.all(16.0),
41+
child: UrlButton(
42+
title: item.title,
43+
url: item.url,
44+
),
45+
),
46+
Text(
47+
item.url,
48+
style: Theme
49+
.of(context)
50+
.textTheme
51+
.bodySmall,
52+
),
53+
],
54+
);
55+
},
56+
);
57+
},
4958
),
5059
);
5160
}

0 commit comments

Comments
 (0)