{"id":22881216,"url":"https://github.com/hey24sheep/uiblock","last_synced_at":"2025-05-07T03:08:36.884Z","repository":{"id":56841555,"uuid":"264513710","full_name":"hey24sheep/uiblock","owner":"hey24sheep","description":"Easiest and simplest method to block/unblock ui for your flutter apps","archived":false,"fork":false,"pushed_at":"2023-10-12T06:42:42.000Z","size":1202,"stargazers_count":15,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-07T03:08:29.956Z","etag":null,"topics":["android","blockui","dart","flutter","flutter-package","flutter-plugin","ios","loader"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/uiblock","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/hey24sheep.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"hey24sheep","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":["https://ko-fi.com/hey24sheep","https://paypal.me/hey24sheep"]}},"created_at":"2020-05-16T19:42:33.000Z","updated_at":"2025-04-22T21:18:14.000Z","dependencies_parsed_at":"2024-12-13T17:32:37.369Z","dependency_job_id":"308903a8-0a12-4314-a83c-1a6f2db053c3","html_url":"https://github.com/hey24sheep/uiblock","commit_stats":{"total_commits":18,"total_committers":2,"mean_commits":9.0,"dds":"0.11111111111111116","last_synced_commit":"5834d680011ac111c13f42dc9a61705cebd56754"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hey24sheep%2Fuiblock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hey24sheep%2Fuiblock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hey24sheep%2Fuiblock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hey24sheep%2Fuiblock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hey24sheep","download_url":"https://codeload.github.com/hey24sheep/uiblock/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252804217,"owners_count":21806770,"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":["android","blockui","dart","flutter","flutter-package","flutter-plugin","ios","loader"],"created_at":"2024-12-13T17:31:59.200Z","updated_at":"2025-05-07T03:08:36.865Z","avatar_url":"https://github.com/hey24sheep.png","language":"Dart","funding_links":["https://github.com/sponsors/hey24sheep","https://ko-fi.com/hey24sheep","https://paypal.me/hey24sheep","https://ko-fi.com/J3J6Q1QXE"],"categories":[],"sub_categories":[],"readme":"# uiblock\n[![pub package publisher](https://img.shields.io/badge/pub.dev-01579b.svg?style=flat-square\u0026logo=dart\u0026logoColor=white)](https://pub.dev/publishers/hey24sheep.com/packages)\n[![pub package](https://img.shields.io/pub/v/uiblock.svg?style=flat-square)](https://pub.dartlang.org/packages/uiblock)\n[![GitHub Stars](https://img.shields.io/github/stars/hey24sheep/uiblock.svg?style=flat-square\u0026?logo=github)](https://github.com/hey24sheep/uiblock)\n[![Platform](https://img.shields.io/badge/platform-android%20|%20ios-green.svg?style=flat-square\u0026color=9cf)](https://img.shields.io/badge/platform-Android%20%7C%20iOS-green.svg)\n\n\u003ca href=\"https://ko-fi.com/J3J6Q1QXE\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\u003cimg src=\"https://img.shields.io/badge/buymeacoffee-F5E800.svg?style=for-the-badge\u0026logoColor=white\u0026logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAQAAAAAYLlVAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QA/4ePzL8AAAAJcEhZcwABOvYAATr2ATqxVzoAAAAHdElNRQfnAhALDBqwztzyAAADc0lEQVRo3u2YW0hUQRjHf3tRu5FmNytKSO2qkGKmFWRBURFdBIsgepEi6NGHeowg6K2XqCfBfPHFBH3oihaKRiVKiaHlRnbVzPJSu+u6u6cH181zzuzZOVurPZz/sMvOzP+b73++OTPzzYIFCxYsWJhl2EimmJVx9hLgPT18wC/qvIQHJe5lHBeVHCNVL+DVDLj/I+Mxx5mvFvB2BgUoKHioImu6gL4ZFqCg8IyCPwI+zoIAhU62Tgn4MisCFFpYDWDHHuclGAnbuYATbAyyJE4uJqjChR1wsIG9Oj/fKaURhgwD5cONX9AexIsbL0EDWze7ws6c7KFZx67E4Yw4BR6e0EobI6yggG3kMifUM85zGmjFSxKFHCCfhKjR8NPIG25wSNVazCYYEarv5TQLplFTOEU7CgqvKCN5Wk8q5QxEjcAkNtOjYkxQDmMC08/sFTxFBnXcI1vXbuOkcCL1AqBcw6kHt8D0SoRALmGZsN3OVUkBBfxQcbrs2HSkIWojCPjGV2F7kBq+RX0PAFy8U9VTRAJ6eSM12HR081qK52ZEVV8sEuBlwrQAP+NSvCTmqeoOkYAEHKYF2ATjiJDGKlV9RLQLpGtIMkhhqRQvU7MffhdFYDn5pgXkkiHBsrOPRFXLO5EAJ0dJMuU+kdLwPmmEHZxQ1YM0QUCwgoc5YkpACaMS+0A2LRpGH1uIcJy0sc5E+LuibsXJnOCFjlGBw0Yw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\u0026logoColor=white\" alt=\"Buy Me A Coffee\" height=\"41\" width=\"174\"\u003e\n\u003c/a\u003e\n\n**Easiest and simplest method to block/unblock ui for your flutter apps.**\n\n**One line of code** to **block/unblock ui** and stop user from navigating during loading or processing in your flutter apps. You could use it as a widget or directly as a global service/util.\n\n- **Fully customizable**\n- **Android and IOS**\n- **Easy and Simple**\n- **No other dependencies**\n- **Well documented**\n- **Production ready**\n\n\n\u003cp\u003e\n\u003cimg src=\"https://github.com/hey24sheep/uiblock/raw/master/screenshots/example5.gif\" width=\"220\" height=\"440\" /\u003e\n\u003cimg src=\"https://github.com/hey24sheep/uiblock/raw/master/screenshots/example1.gif\" width=\"220\" height=\"440\" /\u003e\n\u003cimg src=\"https://github.com/hey24sheep/uiblock/raw/master/screenshots/example2.gif\" width=\"220\" height=\"440\" /\u003e\n\u003cimg src=\"https://github.com/hey24sheep/uiblock/raw/master/screenshots/example3.gif\" width=\"220\" height=\"440\" /\u003e\n\u003cimg src=\"https://github.com/hey24sheep/uiblock/raw/master/screenshots/example4.gif\" width=\"220\" height=\"440\" /\u003e\n\u003c/p\u003e\n\n## Installation\n\nWith `null-safety`\n\n```dart\n      dependencies:\n        uiblock: ^2.0.1\n```\n\nWithout `null-safety`\n      \n```dart\n      dependencies:\n        uiblock: 1.2.0\n```\n \n## Getting Started\n\nAdd the dependency to your project and start using **uiblock** everywhere:\n\nImport the package.\n\n```dart\nimport 'package:uiblock/uiblock.dart';\n```\n\nTo block ui\n\n```dart\n // default\n UIBlock.block(context);\n \n //OR\n\n // if using globalKey\n UIBlock.block(_scaffoldGlobalKey.currentContext);\n```\n\nTo unblock ui\n\n```dart\n // call unblock after blockui to dissmiss\n UIBlock.unblock(context);\n\n //OR\n\n // if using globalKey\n UIBlock.unblock(_scaffoldGlobalKey.currentContext);\n```\n#\n\n## Using as a widget\n\n```dart\n//toggle showLoader to block/unblock\nFlatButton(\n    child: Text('Load Async'),\n    onPressed: () {\n        setState(() {\n            showLoader = !showLoader;\n        });\n    },\n),\n\n // easily create custom block ui body\n Container(\n    height: _height,\n    child: UIBlock(\n        loadingStateFromFuture: () async {\n        if (showLoader) {\n            // return null, to block ui\n            return null;\n        }\n        // unblocks ui on hasData or hasError\n        return Future.value(Random().nextInt(200));\n        },\n        barrierColor: Colors.blueGrey,\n        barrierOpacity: 0.2,\n        loadingTextWidget: Text('Loading data...'),\n        hideBuilderOnNullData: true,\n        builder: (BuildContext context, AsyncSnapshot\u003cdynamic\u003e snapshot) {\n            return Center(child: Text('Async Data ${snapshot.data}'));\n        },\n    ),\n );\n```\n\n#\n\n### Blocking with text\n```dart\nUIBlock.block(\n    _scaffoldGlobalKey.currentContext,\n    canDissmissOnBack: true,\n    loadingTextWidget: Padding(\n        padding: const EdgeInsets.all(8.0),\n        child: Text(\n        'Press back to dissmiss',\n        textAlign: TextAlign.center,\n        style: TextStyle(\n            color: Colors.white,\n            fontSize: 18.0,\n            fontWeight: FontWeight.w600,\n        ),\n        ),\n    ),\n);\n```\n\n\n### Creating using child builder\n\n```dart\n // easily create custom block ui body\n UIBlock.block(\n     _scaffoldGlobalKey.currentContext,\n    backgroundColor: Colors.green.withOpacity(0.5),\n    imageFilter: ImageFilter.blur(sigmaX: 5.0, sigmaY: 5.0),\n    childBuilder: (BuildContext context) {\n        // return your widget here\n    },\n );\n\n // Don't forget to call unblock after block :)\n```\n\n### Creating custom block modal transitions (*only applicable on static UIBlock.block*)\n\n```dart\n// NOTE : only for on UIBlock.block as this uses Modal Barrier\n// widget block is inline widget replacement with loader widget\n\nUIBlock.block(\n    //...\n    // more code\n    customBuildBlockModalTransitions:\n        (context, animation, secondaryAnimation, child) {\n        return RotationTransition(\n            turns: animation,\n            child: child,\n        );\n    },\n    // ...\n);\n```\n\n ## Using with data return\n\n ``` dart\n // NOTE : canDissmissOnBack is alaways true\n  var result = await UIBlock.blockWithData(\n            _scaffoldGlobalKey.currentContext,\n            loadingTextWidget: Padding(\n                padding: const EdgeInsets.all(8.0),\n                child: FlatButton(\n                onPressed: () {\n                    // unblock and return data\n                    UIBlock.unblockWithData(context, \"hello world\");\n                },\n                child: Text(\n                        'Press here to dissmiss with data. Back for null',\n                        textAlign: TextAlign.center,\n                        style: TextStyle(\n                        color: Colors.white,\n                        fontSize: 18.0,\n                        fontWeight: FontWeight.w600,\n                        ),\n                    ),\n                ),\n            ),\n        );\n\n    print(result);\n```\n\nFor more details have a look at the other [examples](https://github.com/hey24sheep/uiblock/tree/master/example).\n\n#\n\n## Properties\n| Property                          |     Type     |         Default |                                                           Note |\n| --------------------------------- | :----------: | --------------: | -------------------------------------------------------------: |\n| context (**required**)            | BuildContext |               - |                                                                |\n| childBuilder                      |   Function   |               - |                                                                |\n| customLoaderChild                 |    Widget    |               - |                                                                |\n| loadingTextWidget                 |    Widget    |               - |                                                                |\n| imageFilter                       | ImageFilter  |               - |                                                                |\n| backgroundColor                   |    Color     |     Transparent |                                                                |\n| canDissmissOnBack                 |     bool     |           false |                                                                |\n| safeAreaLeft                      |     bool     |            true |                     Set as 'false' to disable 'Left' Safe Area |\n| safeAreaTop                       |     bool     |            true | Set as 'false' to disable 'Top' (usually status bar) Safe Area |\n| safeAreaRight                     |     bool     |            true |                    Set as 'false' to disable 'Right' Safe Area |\n| safeAreaBottom                    |     bool     |            true |                   Set as 'false' to disable 'Bottom' Safe Area |\n| safeAreaMinimumPadding            |  EdgeInsets  | EdgeInsets.zero |                                                                |\n| safeAreaMaintainBottomViewPadding |     bool     |           false |                                                                |\n| isSlideTransitionDefault          |     bool     |            true |                        Toggle between slide or fade transition |\n| buildBlockModalTransitions        |   Function   |               - |     Use this to create custom transition other than fade/slide |\n\n## Widget Properties\n| Property               |            Type            |                         Default |\n| ---------------------- | :------------------------: | ------------------------------: |\n| builder                |          Function          |                you implement it |\n| loadingStateFromFuture | Future\u003cdynamic\u003e Function() | your future function (APIs,etc) |\n| loaderBuilder          |          Function          |                               - |\n| customLoaderChild      |           Widget           |                               - |\n| loadingTextWidget      |           Widget           |                               - |\n| offset                 |           offset           |                               - |\n| barrierOpacity         |           double           |                             0.4 |\n| barrierColor           |           Color            |                         black45 |\n| canDismiss             |            bool            |                           false |\n| hideBuilderOnNullData  |            bool            |                           false |\n\n#\n\n## Improve\n\nHelp me by reporting bugs, **submit new ideas** for features or anything else that you want to share.\n\n- Just [write an issue](https://github.com/hey24sheep/uiblock/issues) on GitHub. ✏️\n- And don't forget to hit the **like button** for this package ✌️\n\n## More\n\nCheck out my other useful packages on [pub.dev](https://pub.dev/publishers/hey24sheep.com/packages)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhey24sheep%2Fuiblock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhey24sheep%2Fuiblock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhey24sheep%2Fuiblock/lists"}