Class Doc-Comment zu Konstruktor verschieben #157

Open
opened 2026-01-12 16:09:29 +00:00 by flixcoo · 0 comments
Owner

Class Doc-Comment zu Konstruktor verschieben

Die Doc-Strings für die Klassen sind aktuell falsch gesetzt. Damit die Dokumentation auch richtig angezeigt wird, muss diese direkt über dem Konstruktor stehen.

Umsetzung

Ist Soll

Aktueller Code

/// A custom button widget that is designed to have a width relative to the screen size.
/// It supports three types of buttons: primary, secondary, and text buttons.
/// - [text]: The text to display on the button.
/// - [buttonType]: The type of button to display. Defaults to [ButtonType.primary].
/// - [sizeRelativeToWidth]: The size of the button relative to the width of the screen.
/// - [onPressed]: The callback to be invoked when the button is pressed.
class CustomWidthButton extends StatelessWidget {
  const CustomWidthButton({
    super.key,
    required this.text,
    this.buttonType = ButtonType.primary,
    required this.sizeRelativeToWidth,
    this.onPressed,
  });

Wie es aussehen muss

class CustomWidthButton extends StatelessWidget {
  /// A custom button widget that is designed to have a width relative to the screen size.
  /// It supports three types of buttons: primary, secondary, and text buttons.
  /// - [text]: The text to display on the button.
  /// - [buttonType]: The type of button to display. Defaults to [ButtonType.primary].
  /// - [sizeRelativeToWidth]: The size of the button relative to the width of the screen.
  /// - [onPressed]: The callback to be invoked when the button is pressed.
  const CustomWidthButton({
    super.key,
    required this.text,
    this.buttonType = ButtonType.primary,
    required this.sizeRelativeToWidth,
    this.onPressed,
  });
# Class Doc-Comment zu Konstruktor verschieben Die Doc-Strings für die Klassen sind aktuell falsch gesetzt. Damit die Dokumentation auch richtig angezeigt wird, muss diese direkt über dem Konstruktor stehen. ## Umsetzung <table> <thead> <tr> <th>Ist</th> <th>Soll</th> </tr> </thead> <tbody> <tr> <td><img width="90%" src="/attachments/8fe02566-a127-4730-9140-d4efa5e2c2c8"></td> <td><img width="76%" src="/attachments/517e15e0-b5fe-4bde-9633-96c20b5f0441"></td> </tr> <table> ### Aktueller Code ```dart /// A custom button widget that is designed to have a width relative to the screen size. /// It supports three types of buttons: primary, secondary, and text buttons. /// - [text]: The text to display on the button. /// - [buttonType]: The type of button to display. Defaults to [ButtonType.primary]. /// - [sizeRelativeToWidth]: The size of the button relative to the width of the screen. /// - [onPressed]: The callback to be invoked when the button is pressed. class CustomWidthButton extends StatelessWidget { const CustomWidthButton({ super.key, required this.text, this.buttonType = ButtonType.primary, required this.sizeRelativeToWidth, this.onPressed, }); ``` ### Wie es aussehen muss ```dart class CustomWidthButton extends StatelessWidget { /// A custom button widget that is designed to have a width relative to the screen size. /// It supports three types of buttons: primary, secondary, and text buttons. /// - [text]: The text to display on the button. /// - [buttonType]: The type of button to display. Defaults to [ButtonType.primary]. /// - [sizeRelativeToWidth]: The size of the button relative to the width of the screen. /// - [onPressed]: The callback to be invoked when the button is pressed. const CustomWidthButton({ super.key, required this.text, this.buttonType = ButtonType.primary, required this.sizeRelativeToWidth, this.onPressed, }); ```
flixcoo added this to the Alpha milestone 2026-01-12 16:09:29 +00:00
flixcoo added the
Priority
Low
4
Task
Refactoring
labels 2026-01-12 16:09:29 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: liquid-development/game-tracker#157