Skip to content

Commit

Permalink
docs: add explanations to extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
BBarisKilic committed Mar 11, 2024
1 parent 979370f commit 7a57095
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/src/core/constants/app_main_color.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Copyright 2024 BBK Development. All rights reserved.
// Use of this source code is governed by a GPL-style license that can be found
// in the LICENSE file.

import 'package:flutter/material.dart';

/// An enum that provides constant main color values to use app-wide.
Expand Down
9 changes: 8 additions & 1 deletion lib/src/core/extensions/app_color_ext.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
// Copyright 2024 BBK Development. All rights reserved.
// Use of this source code is governed by a GPL-style license that can be found
// in the LICENSE file.

import 'package:flutter/material.dart';
import 'package:vmerge/src/core/core.dart';

extension AppColorExt on AppMainColor {
/// An extension that provides additional functionality to the [AppMainColor]
/// enum.
extension AppMainColorExt on AppMainColor {
/// Returns the name of the color based on the enum value.
String name(BuildContext context) {
return switch (this) {
AppMainColor.red => context.l10n.red,
Expand Down
4 changes: 4 additions & 0 deletions lib/src/core/extensions/build_context_ext.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Copyright 2022 BBK Development. All rights reserved.
// Use of this source code is governed by a GPL-style license that can be found
// in the LICENSE file.

import 'package:flutter/material.dart';
import 'package:vmerge/src/core/core.dart';

Expand Down
4 changes: 4 additions & 0 deletions lib/src/core/extensions/extensions.dart
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
// Copyright 2022 BBK Development. All rights reserved.
// Use of this source code is governed by a GPL-style license that can be found
// in the LICENSE file.

export 'app_color_ext.dart';
export 'build_context_ext.dart';

0 comments on commit 7a57095

Please sign in to comment.