bdlukaa / fluent_ui

Implements Microsoft's WinUI3 in Flutter.
https://bdlukaa.github.io/fluent_ui/
BSD 3-Clause "New" or "Revised" License
2.91k stars 453 forks source link

Add debug rending to highlight UI features during development. #1062

Closed Andrious closed 4 months ago

Andrious commented 4 months ago

Supplying Flutter's rendering library will further assist developers when working on an app's interface:

import 'package:flutter/rendering.dart' as debug
    show
        debugPaintSizeEnabled,
        debugPaintBaselinesEnabled,
        debugPaintPointersEnabled,
        debugPaintLayerBordersEnabled,
        debugRepaintRainbowEnabled,
        debugRepaintTextRainbowEnabled;

Assigning true to any of the following will highlight particular features of the interface:

/// Causes each RenderBox to paint a box around its bounds debugPaintSizeEnabled

/// Causes each RenderBox to paint a line at each of its baselines. bool debugPaintBaselinesEnabled

/// Causes each Layer to paint a box around its bounds. bool debugPaintLayerBordersEnabled

/// Causes objects like [RenderPointerListener] to flash while they are being tapped. bool debugPaintPointersEnabled

/// Overlay a rotating set of colors when repainting layers in debug mode. bool debugRepaintRainbowEnabled

/// Overlay a rotating set of colors when repainting text in debug mode. bool debugRepaintTextRainbowEnabled

For example, with it now implemented, the debugPaintSizeEnabled parameter set true will visually indicate the size and boundaries of the separate widgets that make up a particular screen:

debugPaintSizeEnabled

Pre-launch Checklist

bdlukaa commented 4 months ago

I am not sure this change should be proposed to fluent_ui. Flutter's WidgetsApp doesn't have this built-in, why would FluentApp do? Also, these can be easily toggled using the command line or Dart DevTools.

Andrious commented 4 months ago

Very well. Excellent work, D'Luka. I wish you continued success.