Skip to content

Commit

Permalink
docs: add documents app bar widgets according to mark down standards #42
Browse files Browse the repository at this point in the history
  • Loading branch information
PouriaMoradi021 committed Jan 2, 2025
1 parent 36eda0a commit a120586
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 2 deletions.
27 changes: 26 additions & 1 deletion lib/src/core/common/widgets/app_bar_button.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,31 @@
import 'package:fluent_ui/fluent_ui.dart';
import 'package:flutter_svg/svg.dart';

/// ## [FluentAppBarButton] Class Documentation
///
/// The `FluentAppBarButton` class represents a custom button widget with an icon
/// that is used in the AppBar. It supports hover effects and is designed to work
/// with the `fluent_ui` and `flutter_svg` packages for a smooth UI experience.
///
/// ### Usage:
///
/// This widget creates a button with an SVG icon and provides a hover effect.
/// The button color changes when hovered over. The button also allows you to
/// define the action that occurs when the button is pressed via the `onPressed` callback.
///
/// ### Properties:
///
/// - **[icon]** (String):
/// - A string representing the path to the SVG icon used in the button.
/// - This path is passed to the `SvgPicture.asset()` constructor.
///
/// - **[onPressed]** (VoidCallback):
/// - A callback function that is triggered when the button is pressed.
///
/// ### Methods:
///
/// - **[build(BuildContext context)]**:
/// - Builds the widget's UI, including the hover button with the SVG icon and hover effect.
///
class FluentAppBarButton extends StatelessWidget {
const FluentAppBarButton({
super.key,
Expand Down
30 changes: 29 additions & 1 deletion lib/src/core/common/widgets/customized_appbar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,33 @@ import 'package:gui/src/core/utils/gen/assets/assets.gen.dart';
import 'package:window_manager/window_manager.dart';

import 'app_bar_button.dart';

/// ## [CustomAppBar] Class Documentation
///
/// The `CustomAppBar` class represents a custom application bar (AppBar)
/// that provides
/// window management controls (minimize, maximize, and close) along with
/// an optional theme toggle.
/// It is designed to be used with the `fluent_ui` and `flutter_svg` packages
/// and includes custom buttons
/// for window operations, integrated with the `window_manager` package.
///
/// ### Usage:
///
/// This widget provides a custom AppBar for an application, including:
/// - An SVG logo on the left.
/// - A toggle switch for changing themes (currently commented out).
/// - Window control buttons for minimizing, maximizing, and closing the window.
///
/// ### Properties:
///
/// - **[preferredSize]**:
/// - Returns a fixed size for the AppBar, specifically `48` pixels in height.
///
/// ### Methods:
///
/// - **[build(BuildContext context)]**:
/// - Builds the UI of the custom AppBar, including window controls and layout
/// management.
class CustomAppBar extends StatelessWidget implements PreferredSizeWidget {
const CustomAppBar({super.key});

Expand Down Expand Up @@ -38,6 +64,8 @@ class CustomAppBar extends StatelessWidget implements PreferredSizeWidget {
ToggleSwitch(
checked: true,
onChanged: (bool value) {
/// to-do #42 : uncomment this part after resolving confilcts
/// between theme & Fluent UI by Pouria
// context.read<ThemeBloc>().add(
// ThemeChanged(
// theme: isLightTheme ? ThemeModes.dark : ThemeModes.light,
Expand Down

0 comments on commit a120586

Please sign in to comment.