@@ -118,14 +118,15 @@ class LogPanelVisibilityNotifier extends StateNotifier<bool> {
118118 }
119119}
120120
121- class LoggingPanel extends ConsumerStatefulWidget {
122- const LoggingPanel ({super .key});
121+ class _LoggingPanel extends ConsumerStatefulWidget {
122+ final bool safeArea;
123+ const _LoggingPanel ({this .safeArea = false });
123124
124125 @override
125- ConsumerState <LoggingPanel > createState () => _LoggingPanelState ();
126+ ConsumerState <_LoggingPanel > createState () => _LoggingPanelState ();
126127}
127128
128- class _LoggingPanelState extends ConsumerState <LoggingPanel > {
129+ class _LoggingPanelState extends ConsumerState <_LoggingPanel > {
129130 bool _runningDiagnostics = false ;
130131
131132 List <Widget > _buildChipsList (Level logLevel) {
@@ -217,14 +218,10 @@ class _LoggingPanelState extends ConsumerState<LoggingPanel> {
217218 final logLevel = ref.watch (logLevelProvider);
218219 final sensitiveLogs = ref.watch (
219220 logLevelProvider.select ((level) => level.value <= Level .CONFIG .value));
220- final visible = ref.watch (logPanelVisibilityProvider);
221-
222- if (! visible) {
223- return const SizedBox ();
224- }
225221
226222 return _Panel (
227223 sensitive: sensitiveLogs,
224+ safeArea: widget.safeArea,
228225 child: Wrap (
229226 alignment: WrapAlignment .spaceBetween,
230227 runSpacing: 4.0 ,
@@ -269,43 +266,40 @@ class _LoggingPanelState extends ConsumerState<LoggingPanel> {
269266 }
270267}
271268
272- class WarningPanel extends ConsumerWidget {
273- const WarningPanel ({super .key});
269+ class _WarningPanel extends StatelessWidget {
270+ final bool safeArea;
271+ const _WarningPanel ({this .safeArea = false });
274272
275273 @override
276- Widget build (BuildContext context, WidgetRef ref ) {
274+ Widget build (BuildContext context) {
277275 final l10n = AppLocalizations .of (context);
278- final allowScreenshots =
279- isAndroid ? ref.watch (androidAllowScreenshotsProvider) : false ;
280-
281- if (! allowScreenshots) {
282- return SizedBox ();
283- }
284276
285277 return _Panel (
286- sensitive: allowScreenshots,
287- child: Row (
288- mainAxisSize: MainAxisSize .min,
289- children: [
290- Padding (
291- padding: const EdgeInsets .only (left: 12.0 , top: 8.0 , bottom: 8.0 ),
292- child: Icon (
293- Symbols .warning_amber,
294- size: 24 ,
278+ sensitive: true ,
279+ safeArea: safeArea,
280+ child: Row (
281+ mainAxisSize: MainAxisSize .min,
282+ children: [
283+ Padding (
284+ padding: const EdgeInsets .only (left: 12.0 , top: 8.0 , bottom: 8.0 ),
285+ child: Icon (
286+ Symbols .warning_amber,
287+ size: 24 ,
288+ ),
295289 ),
296- ),
297- const SizedBox (width: 8.0 ),
298- Flexible (child: Text (l10n.l_warning_allow_screenshots))
299- ],
300- ),
301- );
290+ const SizedBox (width: 8.0 ),
291+ Flexible (child: Text (l10n.l_warning_allow_screenshots))
292+ ],
293+ ));
302294 }
303295}
304296
305297class _Panel extends StatelessWidget {
306298 final Widget child;
307299 final bool sensitive;
308- const _Panel ({required this .child, required this .sensitive});
300+ final bool safeArea;
301+ const _Panel (
302+ {required this .child, required this .sensitive, this .safeArea = true });
309303
310304 @override
311305 Widget build (BuildContext context) {
@@ -346,18 +340,48 @@ class _Panel extends StatelessWidget {
346340 ? sensitiveColor.withValues (alpha: 0.3 )
347341 : colorScheme.secondaryContainer.withValues (alpha: 0.3 );
348342
343+ final content = Padding (
344+ padding: const EdgeInsets .all (4.0 ),
345+ child: child,
346+ );
347+
349348 return ColoredBox (
350349 color: colorScheme.surface,
351350 child: Theme (
352351 data: localThemeData,
353352 child: ColoredBox (
354353 color: panelBackgroundColor,
355- child: Padding (
356- padding: const EdgeInsets .all (4.0 ),
357- child: child,
358- ),
354+ child: safeArea ? SafeArea (child: content) : content,
359355 ),
360356 ),
361357 );
362358 }
363359}
360+
361+ class PanelList extends ConsumerWidget {
362+ const PanelList ({super .key});
363+
364+ @override
365+ Widget build (BuildContext context, WidgetRef ref) {
366+ final logPanelVisible = ref.watch (logPanelVisibilityProvider);
367+ final allowScreenshots =
368+ isAndroid ? ref.watch (androidAllowScreenshotsProvider) : false ;
369+ return Column (
370+ mainAxisSize: MainAxisSize .min,
371+ crossAxisAlignment: CrossAxisAlignment .stretch,
372+ children: [
373+ if (allowScreenshots)
374+ Flexible (
375+ child: _WarningPanel (
376+ safeArea: ! logPanelVisible,
377+ ),
378+ ),
379+ if (allowScreenshots && logPanelVisible) const SizedBox (height: 4.0 ),
380+ if (logPanelVisible)
381+ Flexible (
382+ child: _LoggingPanel (safeArea: true ),
383+ )
384+ ],
385+ );
386+ }
387+ }
0 commit comments