Skip to content

Commit 814bd40

Browse files
committed
Added Documentation for Classes
1 parent 6f3556b commit 814bd40

File tree

6 files changed

+56
-4
lines changed

6 files changed

+56
-4
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
## 1.0.3
4+
- Added Documentation for Classes
5+
36
## 1.0.2
47
- `isBreakPointEnabled` parameter of `Sdpify` constructor is now `true` by default.
58

lib/src/builder.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ part of '../sdpify.dart';
55
///
66
typedef SdpifyBuilder = Widget Function(BuildContext);
77

8+
/// [Sdpify] is the main entrypoint of this package
9+
/// [Sdpify] takes [SdpifyBuilder] method in constructor parameter
10+
/// which returns a [Widget] also takes [isBreakPointEnabled] bool value
11+
///
812
class Sdpify extends StatelessWidget {
913
/// [screenType] is static variable for global access
1014
/// It can Access like [Sdpify.screenType] this

lib/src/device_constant.dart

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,56 @@
11
part of '../sdpify.dart';
22

3+
/// [DeviceConstant] is a static class that defines popular screen widths
4+
/// and their respective scale ratios for adaptive UI scaling.
5+
///
36
class DeviceConstant {
47
DeviceConstant._();
58

9+
/// [smallMobileWidth] The width of small mobile devices (e.g., older phones).
10+
///
611
static const double smallMobileWidth = 320.0;
12+
13+
/// [mobileWidth] The width of standard mobile devices.
14+
///
715
static const double mobileWidth = 375.0;
16+
17+
/// [largeMobileWidth] The width of large mobile devices.
18+
///
819
static const double largeMobileWidth = 480.0;
20+
21+
/// [extraLargeMobileWidth] The width of extra-large mobile devices or small tablets.
22+
///
923
static const double extraLargeMobileWidth = 600.0;
24+
25+
/// [tabletWidth] The width of tablets.
26+
///
1027
static const double tabletWidth = 768.0;
11-
static const double desktopWidth = 1024;
1228

29+
/// [desktopWidth] The width of desktop devices.
30+
///
31+
static const double desktopWidth = 1024.0;
32+
33+
/// [smallMobileScale] Scale ratio for small mobile devices.
34+
///
1335
static const double smallMobileScale = 0.90;
36+
37+
/// [mobileScale] Scale ratio for standard mobile devices.
38+
///
1439
static const double mobileScale = 0.95;
15-
static const double largeMobileScale = 1;
40+
41+
/// [largeMobileScale] Scale ratio for large mobile devices.
42+
///
43+
static const double largeMobileScale = 1.0;
44+
45+
/// [extraLargeMobileScale] Scale ratio for extra-large mobile devices.
46+
///
1647
static const double extraLargeMobileScale = 1.05;
48+
49+
/// [tabletScale] Scale ratio for tablets.
50+
///
1751
static const double tabletScale = 1.15;
52+
53+
/// [desktopScale] Scale ratio for desktop devices.
54+
///
1855
static const double desktopScale = 1.2;
1956
}

lib/src/extension.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
part of '../sdpify.dart';
22

33
extension SdpifyExtension on num {
4+
/// [sdp] is the main extension [Sdpify]
5+
/// provides it takes normal logical pixel or any num units and scale them as dp
6+
///
47
double get sdp {
58
return this * Config().scaleFactor;
69
}

lib/src/screen_type.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
part of '../sdpify.dart';
22

3+
/// [ScreenType] is an enum class which contains type of the device screens
4+
///
35
enum ScreenType {
6+
/// [undefined] Defines
7+
/// when [Config] struggles to retrieve device [ScreenType]
8+
///
49
undefined,
510

611
/// [small] Defines for

pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: sdpify
2-
description: "Sdpify is a lightweight package that provides Scalable Density Pixels (SDP) to ensure a consistent UI across different screen sizes and densities. It dynamically converts pixel-based values (px) into scalable dp (sdp), making your app adaptive and responsive on all devices."
3-
version: 1.0.2
2+
description: "Sdpify is a lightweight package that converts pixels to scalable dp (sdp), ensuring a responsive and consistent UI across all screen sizes and densities"
3+
version: 1.0.3
44

55
repository: https://github.com/shariarunix/Sdpify
66
homepage: https://github.com/shariarunix/Sdpify

0 commit comments

Comments
 (0)