{"id":27144212,"url":"https://github.com/vb10/kartal","last_synced_at":"2025-04-08T08:58:29.261Z","repository":{"id":40333336,"uuid":"321453659","full_name":"VB10/kartal","owner":"VB10","description":" extension library for helping while coding application for dart \u0026 flutter ","archived":false,"fork":false,"pushed_at":"2025-03-09T00:20:56.000Z","size":3073,"stargazers_count":103,"open_issues_count":5,"forks_count":41,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-02T23:34:38.126Z","etag":null,"topics":["extension","flutter"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/kartal","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/VB10.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-14T19:37:55.000Z","updated_at":"2025-03-09T00:21:01.000Z","dependencies_parsed_at":"2023-10-01T23:36:29.735Z","dependency_job_id":"1e74f539-01bb-490d-9ee5-83922bfe2597","html_url":"https://github.com/VB10/kartal","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VB10%2Fkartal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VB10%2Fkartal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VB10%2Fkartal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VB10%2Fkartal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VB10","download_url":"https://codeload.github.com/VB10/kartal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247809990,"owners_count":20999816,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["extension","flutter"],"created_at":"2025-04-08T08:58:28.630Z","updated_at":"2025-04-08T08:58:29.246Z","avatar_url":"https://github.com/VB10.png","language":"Dart","funding_links":["https://www.buymeacoffee.com/vb10"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\u003ca href=\"https://pub.dev/packages/kartal\"\u003e\u003cimg src=\"https://img.shields.io/pub/v/kartal.svg\" alt=\"Pub\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/vb10/kartal\"\u003e\u003cimg src=\"https://img.shields.io/github/stars/vb10/kartal.svg?style=flat\u0026logo=github\u0026colorB=deeppink\u0026label=stars\" alt=\"Star on Github\"\u003e\u003c/a\u003e \n\u003ca href=\"https://opensource.org/licenses/MIT\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-MIT-purple.svg\" alt=\"License: MIT\"\u003e\u003c/a\u003e   \n\u003ca href=\"https://www.youtube.com/hardwareandro\"\u003e\u003cimg src=\"https://img.shields.io/youtube/channel/subscribers/UCdUaAKTLJrPZFStzEJnpQAg\" alt=\"Youtube: HardwareAndro\"\u003e\u003c/a\u003e\n\u003ca href=\"https://medium.com/@vbacik-10\"\u003e \u003cimg src=\"https://img.shields.io/badge/Medium-12100E?style=for-the-badge\u0026logo=medium\u0026logoColor=white\" alt=\"Medium: Vbacik\"\u003e  \u003c/a\u003e \n \n\n[![](https://dcbadge.vercel.app/api/server/Bzn8WtuZD2?style=flat)](https://discord.gg/Bzn8WtuZD2) \n\n\u003c/p\u003e\n\n# kartal\n\nMy birth country is Kartal, so I created an extension to give born more power.\n\nYou should look at the example folder if you want to see an example using these extensions.\n\n[![\"Buy Me A Coffee\"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png?raw=true)](https://www.buymeacoffee.com/vb10)\n\n## Context extension\n\n\u003cimg src=\"https://github.com/VB10/kartal/blob/master/github/context_extension.png?raw=true\" alt=\"Context Extension\" width=\"400\"/\u003e\n\n\nYou can use context.border to all.\n\n### Border\n\nYou can use this extension for border properties with context.border.\nFor example\n\n`context.border.lowRadius // it equals to device width divided by 0.02`\n\n\u003cdetails open\u003e \n\n\u003csummary\u003eUsages:\u003c/summary\u003e \n\n- `context.border.lowRadius` // it equals to device width divided by 0.02\n- `context.border.normalRadius` // it equals to device width divided by 0.05\n- `context.border.highRadius` // it equals to device width divided by 0.1\n- `context.border.normalBorderRadius` // it equals to device width divided by 0.05\n- `context.border.lowBorderRadius` // it equals to device width divided by 0.02\n- `context.border.highBorderRadius` // it equals to device width divided by 0.1\n- `context.border.roundedRectangleBorderLow` // it equals to device width divided by 0.02\n- `context.border.roundedRectangleAllBorderNormal` // it equals to device width divided by 0.05\n- `context.border.roundedRectangleBorderNormal` // it equals to device width divided by 0.02\n- `context.border.roundedRectangleBorderMedium` // it equals to device width divided by 0.04\n- `context.border.roundedRectangleBorderHigh` // it equals to device width divided by 0.1\n\n\u003c/details\u003e\n\n\n### Device\n\nYou can use for device properties with context.device. For example: `context.device.isSmallScreen`\n\n\u003cdetails\u003e\n\u003csummary\u003e Usages: \u003c/summary\u003e\n\n- `context.device.isSmallScreen` // The range is defined as `0 \u003c= width \u003c 300`.\n- `context.device.isMediumScreen` // The range is defined as `300 \u003c= width \u003c 600`.\n- `context.device.isLargeScreen` // The range is defined as `600 \u003c= width \u003c 900`.\n- `context.device.isAndroidDevice` // Returns true if the device is an Android device.\n- `context.device.isIOSDevice`  // Returns true if the device is an iOS device.\n- `context.device.isWindowsDevice` // Returns true if the device is a Windows device.\n- `context.device.isLinuxDevice` // Returns true if the device is a Linux device.\n- `context.device.isMacOSDevice` // Returns true if the device is a macOS device.\n \u003c/details\u003e\n\n\n### General\n\nYou can use for general properties with context.general. For example: `context.general.appTheme`\n\n\u003cdetails\u003e\n\u003csummary\u003e Usages: \u003c/summary\u003e\n\n- `context.general.mediaQuery` (MediaQueryData)\n- `context.general.appTheme` (ThemeData)\n- `context.general.textTheme` (TextTheme)\n- `context.general.primaryTextTheme` (TextTheme)\n- `context.general.colorScheme` (ColorScheme)\n- `context.general.randomColor` (MaterialColor)\n- `context.general.isKeyBoardOpen` // Returns true if the keyboard is open.\n- `context.general.keyboardPadding` // When the keyboard is open, it returns the padding value of the keyboard.\n- `context.general.appBrightness` (Brightness)\n- `context.general.focusNode` (FocusNode)\n- `context.general.unfocus` // Removes focus from the currently focused input field or widget.\n \u003c/details\u003e\n\n### Navigation\n\n\u003cimg src=\"https://github.com/VB10/kartal/blob/master/github/navigation_extension.png?raw=true\" alt=\"Navigation Extension\" width=\"300\"/\u003e\n\n\nYou can use for default navigation properties with context.navigation. For example: `context.navigation.pop()`\n\n\u003cdetails\u003e\n\u003csummary\u003e Usages: \u003c/summary\u003e\n\n- `context.navigation.pop` // Pops the current route off the navigator.\n- `popWithRoot` /// Pops the current route off the navigator and returns to the root route.\n- `navigateName\u003cT extends Object?\u003e` // Pushes a named route onto the navigator.\n- `navigateToReset\u003cT extends Object?\u003e` // Pushes a named route onto the navigator and removes all previous routes.\n- `navigateToPage\u003cT extends Object?\u003e` // Pushes a new route onto the navigator.\n  \u003c/details\u003e\n\n\n### Padding\n\nYou can use for padding properties with context.padding. For example: `context.padding.low`\n\n\u003cdetails\u003e\n\u003csummary\u003e Usages: \u003c/summary\u003e\n\n\u003e  low is 0.01, normal is 0.02, medium is 0.04, high is 0.1 of the device height. (Basically, it is a percentage of the device height.)\n\n- `context.padding.low` // Add [0.01 percentage of device height ] padding to all sides\n- `context.padding.normal`// Add [0.02 percentage of device height ] padding to all sides\n- `context.padding.medium` //  Add [0.04 percentage of device height ] padding to all sides\n- `context.padding.high` // Add [0.1 percentage of device height ] padding to all sides\n- `context.padding.horizontalLow` // Add [0.01 percentage of device height ] padding to horizontal sides\n- `context.padding.horizontalNormal` // Add [0.02 percentage of device height ] padding to horizontal sides\n- `context.padding.horizontalMedium` // Add [0.04 percentage of device height ] padding to horizontal sides\n- `context.padding.horizontalHigh` // Add [0.1 percentage of device height ] padding to horizontal sides\n- `context.padding.verticalLow` // Add [0.01 percentage of device height ] padding to vertical sides\n- `context.padding.verticalNormal` // Add [0.02 percentage of device height ] padding to vertical sides\n- `context.padding.verticalMedium` // Add [0.04 percentage of device height ] padding to vertical sides\n- `context.padding.verticalHigh` // Add [0.1 percentage of device height ] padding to vertical sides\n- `context.padding.onlyLeftLow` // Add [0.01 percentage of device height ] padding to left side\n- `context.padding.onlyLeftNormal` // Add [0.02 percentage of device height ] padding to left side\n- `context.padding.onlyLeftMedium` \n- `context.padding.onlyLeftHigh` // Add [0.1 percentage of device height ] padding to left side\n- `context.padding.onlyRightLow` // Add [0.01 percentage of device height ] padding to right side\n- `context.padding.onlyRightNormal` // Add [0.02 percentage of device height ] padding to right side\n- `context.padding.onlyRightMedium` // Add [0.04 percentage of device height ] padding to right side\n- `context.padding.onlyRightHigh`  // Add [0.1 percentage of device height ] padding to right side\n- `context.padding.onlyBottomLow` // Add [0.01 percentage of device height ] padding to bottom side\n- `context.padding.onlyBottomNormal` // Add [0.02 percentage of device height ] padding to bottom side\n- `context.padding.onlyBottomMedium` // Add [0.04 percentage of device height ] padding to bottom side\n- `context.padding.onlyBottomHigh` // Add [0.1 percentage of device height ] padding to bottom side\n- `context.padding.onlyTopLow` // Add [0.01 percentage of device height ] padding to top side\n- `context.padding.onlyTopNormal` // Add [0.02 percentage of device height ] padding to top side\n- `context.padding.onlyTopMedium` // Add [0.04 percentage of device height ] padding to top side\n- `context.padding.onlyTopHigh` // Add [0.1 percentage of device height ] padding to top side\n\n\u003c/details\u003e\n\n### Size\n\nYou can use for size properties with context.sized. For example: `context.sized.low`\n\n\u003cdetails\u003e\n\u003csummary\u003e Usages: \u003c/summary\u003e\n\n\n- `context.sized.height` // Height of the current device.\n- `context.sized.width` // Width of the current device.\n- `context.sized.lowValue` // 0.01 percentage of the current widget's height.\n- `context.sized.normalValue` // 0.02 percentage of the current widget's height.\n- `context.sized.mediumValue` // 0.04 percentage of the current widget's height.\n- `context.sized.highValue` // 0.1 percentage of the current widget's height.\n- `context.sized.dynamicWidth(double val)` // Calculates and returns a dynamic width value based on the provided `val` and the current widget's width.\n- `context.sized.dynamicHeight(double val)` // Calculates and returns a dynamic height value based on the provided `val` and the current widget's height.\n- `context.sized.emptySizedWidthBoxLow` // 0.01 percentage to width empty width box\n- `context.sized.emptySizedWidthBoxLow3x` // 0.03 percentage of width to empty width box\n- `context.sized.emptySizedWidthBoxNormal`// 0.05 percentage to width empty width box\n- `context.sized.emptySizedWidthBoxHigh` // 0.1 percentage to width empty width box\n- `context.sized.emptySizedHeightBoxLow` // 0.01 percentage to height empty height box\n- `context.sized.emptySizedHeightBoxLow3x` // 0.03 percentage of height to empty height box\n- `context.sized.emptySizedHeightBoxNormal` // 0.05 percentage to height empty height box\n- `context.sized.emptySizedHeightBoxHigh` // 0.1 percentage to height empty height box\n\n\u003c/details\u003e\n\n## Popup\n\nYou can use context.popupManager to all\n\n- `showLoader` (Function): A method shows loader indicator by pushing a `DialogRoute`. Takes optional `id`, `barrierDismissible` and `widgetBuilder`.\n- `hideLoader` (Function): A method hides current active loader by removing `DialogRoute`. Takes optional `id`. If `id` is not provided will close latest one.\n\n## String extension\n\n\n\u003cimg src=\"https://github.com/VB10/kartal/blob/master/github/string_extension.png?raw=true\" alt=\"String Extension\" width=\"300\"/\u003e\n\nYou can use for string properties with string.ext. For example: `string.ext.toCapitalized()`\n\n\u003cdetails\u003e\n\u003csummary\u003e Usages: \u003c/summary\u003e\n\n- `'SAMPLE'.lineLength` (int): Returns the number of lines in the string.\n- `'SAMPLE'..color` (Color): Returns a Color object parsed from the string.\n- `'SAMPLE'.toCapitalized()` (String): Converts the first letter of the string to a capital letter.\n- `'SAMPLE'.toTitleCase()` (String): Converts all letters of the string to title case.\n- `'SAMPLE'.colorCode` (int?): Returns the color code parsed from the string.\n- `'SAMPLE'.toColor` (Color): Returns a Color object from the color code.\n- `'SAMPLE'.isNullOrEmpty` (bool): Returns true if the string is null or empty.\n- `'SAMPLE'.isNotNullOrNoEmpty` (bool): Returns true if the string is not null and not empty.\n- `'SAMPLE'.isValidEmail` (bool): Checks if the string is a valid email address.\n- `'SAMPLE'.isValidPassword` (bool): Checks if the string is a valid password.\n- `'SAMPLE'.withoutSpecialCharacters` (String?): Removes all diacritics from the string.\n- `'SAMPLE'.ext.searchable` (String): Returns the searchable version of the string(without special characters with lower case).\n- `'SAMPLE'.phoneFormatValue` (String): Returns the value of the phone number without formatting characters.\n- `'SAMPLE'.timeFormatValue` (String): Formats the value of the string as a time.\n- `'SAMPLE'.timeOverlineFormatValue` (String): Unmasks the text for the time overline format.\n- `'SAMPLE'.randomImage` (String): Returns a URL for a random image.\n- `'SAMPLE'.randomSquareImage` (String): Returns a URL for a random square image.\n- `'SAMPLE'.customProfileImage` (String): Returns a URL for a custom profile image.\n- `'SAMPLE'.customHighProfileImage` (String): Returns a URL for a custom high-resolution profile image.\n- `'SAMPLE'.bearer` (Map\u003cString, dynamic\u003e): Returns a map with a bearer token.\n- `'SAMPLE'.launchEmail` (Future\u003cbool\u003e): Launches the email app with the email address.\n- `'SAMPLE'.launchPhone` (Future\u003cbool\u003e): Launches the phone app with the phone number.\n- `'SAMPLE'.launchWebsite` (Future\u003cbool\u003e): Launches the website with the string as the URL.\n- `'SAMPLE'.launchWebsiteCustom` (Future\u003cbool\u003e): Launches the website with custom configuration.\n- `'SAMPLE'.launchMap` (Future\u003cbool\u003e): Launches the map with any value.\n- `'SAMPLE'.shareWhatsApp()` (Future\u003cvoid\u003e): Shares the string via WhatsApp.\n- `'SAMPLE'.shareMail(String title)` (Future\u003cvoid\u003e): Shares the string via email with a title.\n- `'SAMPLE'.share()` (Future\u003cvoid\u003e): Shares the string.\n- `'SAMPLE'.appName` (String): Returns the name of the app.\n- `'SAMPLE'.packageName` (String): Returns the package name of the app.\n- `'SAMPLE'.version` (String): Returns the version of the app.\n- `'SAMPLE'.buildNumber` (String): Returns the build number of the app.\n- `'SAMPLE'.deviceId` (Future\u003cString\u003e): Returns the unique device ID.\n\n\u003c/details\u003e\n\n## File extension\n\nYou can use for file properties with file.ext. For example: `file.ext.fileType`\n\n\u003cdetails\u003e\n\u003csummary\u003e Usages: \u003c/summary\u003e\n\n- `File().ext.fileType` (FileType): Returns the FileType of the file based on its MIME type.\n- `File().ext.isImageFile` (bool): Returns true if the file is of type FileType.IMAGE.\n- `File().ext.isVideoFile` (bool): Returns true if the file is of type FileType.VIDEO.\n- `File().ext.isAudioFile` (bool): Returns true if the file is of type FileType.AUDIO.\n- `File().ext.isTextFile` (bool): Returns true if the file is of type FileType.TEXT.\n\n\u003c/details\u003e\n\n## Future extension\n\n\u003cimg src=\"https://github.com/VB10/kartal/blob/master/github/future_extension.png?raw=true\" alt=\"Future Extension\" width=\"400\"/\u003e\n\nYou can use for future properties with future.ext. For example: `future.ext.toBuild`\n\n- `toBuild` (Widget): Builds a widget based on the state of a future. It allows specifying different widgets for different states, such as loading, success, not found, and error.\n  - `onSuccess` (required): Widget Function(T? data) - Specifies the widget to display when the future completes successfully. It receives the data from the future as a parameter.\n  - `loadingWidget` (required): Widget - Specifies the widget to display while the future is loading or in an active state.\n  - `notFoundWidget` (required): Widget - Specifies the widget to display when the future has no connection state.\n  - `onError` (required): Widget - Specifies the widget to display when an error occurs during the future's execution.\n  - `data` (optional): T? - The initial data to provide to the future builder.\n\n- `timeoutOrNull` (T or null) When operation complete before the timeout limit it will return data. if any problem accrued it will return null.\n  - `timeOutDuration` (required): Duration - Specifies the timeout duration. Default value is 10 seconds.\n  - `enableLogger`, (optional): It will print your error issues in debug console.\n\n## Image Extension\n\n\n\u003cimg src=\"https://github.com/VB10/kartal/blob/master/github/image_extension.png?raw=true\" alt=\"Future Extension\" width=\"400\"/\u003e\n\n\nYou can use for Image widget properties with Image.ext. For example: `Image.ext.rightRotation`\n\n- `rightRotation` (Widget): Returns a [RotationTransition] widget that applies a right rotation animation to the image.\n- `upRotation` (Widget): Returns a [RotationTransition] widget that applies an up rotation animation to the image.\n- `bottomRotation` (Widget): Returns a [RotationTransition] widget that applies a bottom rotation animation to the image.\n- `leftRotation` (Widget): Returns a [RotationTransition] widget that applies a left rotation animation to the image.\n\n## Key Extension\n\nYou can use for GlobalKey properties with key.ext. For example: `Key().ext.offSet`\n\n- `GlobalKey.rendererBox`\n  - Returns the `RenderBox` associated with the current widget.\n  - Return Type: `RenderBox?`\n\n- `GlobalKey.offset`\n\n  - Returns the global offset of the current widget.\n  - Return Type: `Offset?`\n\n- `GlobalKey.height`\n\n  - Returns the height of the current widget.\n  - Return Type: `double?`\n\n- `GlobalKey.scrollToWidget`\n  - Scrolls to the current widget.\n  - Parameters:\n    - `alignmentPolicy` (optional): The alignment policy during scrolling. Default: `ScrollPositionAlignmentPolicy.explicit`.\n  - Return Type: `void`\n\n## Asset Reader\n\nYou can parse your asset file with generic way.\n\n```dart\n   final posts = await BundleDecoder('assets/placeholder.json')\n        .crackBundle\u003cPost, List\u003cPost\u003e\u003e(model: Post());\n```\n\n## Iterable Extension\n\nYou can use for Iterable properties with iterable.ext. For example: `iterable.ext.makeSafe()`\n\n- `[null,1].makeSafe()` // Returns a list with non-null values.\n- `[null,1].makeSafeCustom(bool Function(T? value) onHandle)` // Returns a list with non-null values based on the custom function.\n\n## List Extension\n\nYou can use for List properties with list.ext. For example: `list.ext.isNotNullOrEmpty`\n\n- `[].isNullOrEmpty` // Returns true if the list is null or empty.\n- `[]?.isNotNullOrEmpty` // Returns true if the list is not null and not empty.\n- `[]?.indexOrNull(bool Function(T) search)` // Returns the index of the first element that satisfies the provided search function.\n\n## Widget extension\n\n\n\u003cimg src=\"https://github.com/VB10/kartal/blob/master/github/widget_extension.png?raw=true\" alt=\"Widget Extension\" width=\"400\"/\u003e\n\nYou can use for Widget properties with widget.ext. For example: `widget.ext.toVisible()`\n\n- `Widget.toVisible({bool value = true})` // Returns a widget with visibility based on the value.\n- `Widget.toDisabled({bool? disable, double? opacity})` // Returns a widget with disabled properties based on the value.\n- `Widget.sliver` // Returns a sliver version of the current widget.\n\n## Utility\n\nYou can use for utility properties with utility. For example: `Utility.openAppleMapsWithQuery`\n\n- `MapsUtility.openAppleMapsWithQuery`, `MapsUtility.openGoogleMapsWithQuery`, `MapsUtility.openGoogleWebMapsWithQuery`, // Opens the map with the query.\n- `CustomLinkPreview.getLinkPreviewData` // Gets the link preview data.\n- `CustomLogger.showError` // Shows an error message in .\n- `BundleDecoder('assetPath').crackBundle` // Decodes the asset file.\n\n## License\n\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](/LICENSE)\n\n2020 created for @VB10\n\n## Youtube Channel\n\n[![Youtube](https://yt3.ggpht.com/a/AATXAJyul3hpzl86GIjF-EZxBzy6T62PJxpvzRwz9AbUOw=s288-c-k-c0xffffffff-no-rj-mo)](https://www.youtube.com/watch?v=UCdUaAKTLJrPZFStzEJnpQAg)\n\n## Contributors\n\n\u003ca href=\"https://github.com/vb10/kartal/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=vb10/kartal\" /\u003e\n\u003c/a\u003e\n\nMade with [contrib.rocks](https://contrib.rocks).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvb10%2Fkartal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvb10%2Fkartal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvb10%2Fkartal/lists"}