Skip to content

Commit c41a059

Browse files
position the message banner as the top of the column rather than stack (#411)
1 parent 52d3f56 commit c41a059

File tree

1 file changed

+18
-26
lines changed

1 file changed

+18
-26
lines changed

lib/samples/display_content_of_utility_network_container/display_content_of_utility_network_container.dart

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,30 @@ class _DisplayContentOfUtilityNetworkContainerState
9494
Widget build(BuildContext context) {
9595
return Scaffold(
9696
body: SafeArea(
97-
top: false,
9897
left: false,
9998
right: false,
10099
child: Stack(
101100
children: [
102101
Column(
103102
children: [
103+
// Add a banner to show the results of the identify operation.
104+
Visibility(
105+
visible: _message.isNotEmpty,
106+
child: Container(
107+
padding: const EdgeInsets.all(5),
108+
color: Colors.grey[400],
109+
child: Row(
110+
mainAxisAlignment: MainAxisAlignment.center,
111+
children: [
112+
Text(
113+
_message,
114+
textAlign: TextAlign.center,
115+
style: Theme.of(context).textTheme.labelMedium,
116+
),
117+
],
118+
),
119+
),
120+
),
104121
Expanded(
105122
// Add a map view to the widget tree and set a controller.
106123
child: ArcGISMapView(
@@ -126,31 +143,6 @@ class _DisplayContentOfUtilityNetworkContainerState
126143
),
127144
],
128145
),
129-
// Add a banner to show the results of the identify operation.
130-
SafeArea(
131-
child: IgnorePointer(
132-
child: Visibility(
133-
visible: _message.isNotEmpty,
134-
child: Container(
135-
padding: const EdgeInsets.all(5),
136-
color: Colors.white.withValues(alpha: 0.7),
137-
child: Row(
138-
mainAxisAlignment: MainAxisAlignment.center,
139-
children: [
140-
FittedBox(
141-
fit: BoxFit.scaleDown,
142-
child: Text(
143-
_message,
144-
textAlign: TextAlign.center,
145-
style: Theme.of(context).textTheme.labelMedium,
146-
),
147-
),
148-
],
149-
),
150-
),
151-
),
152-
),
153-
),
154146
// Display a progress indicator and prevent interaction until state is ready.
155147
LoadingIndicator(visible: !_ready),
156148
],

0 commit comments

Comments
 (0)