{"id":32271634,"url":"https://github.com/medeity/lib_mvp","last_synced_at":"2025-10-22T22:56:06.846Z","repository":{"id":56833864,"uuid":"203949281","full_name":"MeDeity/lib_mvp","owner":"MeDeity","description":"An mvp pattern implementation of flutter","archived":false,"fork":false,"pushed_at":"2020-01-13T08:57:54.000Z","size":56,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-22T22:55:59.707Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MeDeity.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}},"created_at":"2019-08-23T07:40:33.000Z","updated_at":"2020-01-13T08:57:56.000Z","dependencies_parsed_at":"2022-09-08T07:42:13.339Z","dependency_job_id":null,"html_url":"https://github.com/MeDeity/lib_mvp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MeDeity/lib_mvp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MeDeity%2Flib_mvp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MeDeity%2Flib_mvp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MeDeity%2Flib_mvp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MeDeity%2Flib_mvp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MeDeity","download_url":"https://codeload.github.com/MeDeity/lib_mvp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MeDeity%2Flib_mvp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280528609,"owners_count":26345643,"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","status":"online","status_checked_at":"2025-10-22T02:00:06.515Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-10-22T22:56:04.811Z","updated_at":"2025-10-22T22:56:06.840Z","avatar_url":"https://github.com/MeDeity.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lib_mvp\n\nan achieve of mvp framework,\n\n\n## Thanks\nThanks to the [simplezhli -\u003e flutter deer](https://github.com/simplezhli/flutter_deer) project,\nthis library is an MVP implementation separated from this project.\n\nThis is a strongly coupled tool library with the following open source libraries built in:\n1. [dio](https://github.com/flutterchina/dio): ^2.1.13\n2. [sprintf](https://github.com/Naddiseo/dart-sprintf): ^4.0.0\n3. [rxdart](https://github.com/ReactiveX/rxdart): ^0.21.0\n4. [oktoast](https://github.com/OpenFlutter/flutter_oktoast): ^2.1.8\n\n## Getting Started\n#### Use this package as a library\n1. Depend on it\nAdd this to your package's pubspec.yaml file:\n```\ndependencies:\n  lib_mvp: ^1.0.0\n```\n\n2.Install it\nYou can install packages from the command line:\n\nwith Flutter:\n```\n$ flutter pub get\n```\n\n\nNow in your Dart code, you can use:\n\n```\nimport 'package:lib_mvp/lib_mvp.dart';\n```\n\n#### 一、 init OKToast:\n```\n  @override\n  Widget build(BuildContext context) {\n    return OKToast(//init OKToast\n      child: MaterialApp(\n        title: 'MVP Framework Test',\n        theme: ThemeData(\n          primarySwatch: Colors.blue,\n        ),\n        home: IndexPage(),\n      ),\n    );\n  }\n```\n#### 二、xxxPageState extends BasePageState ,Take IndexPage as an example\n```\nclass IndexPage extends StatefulWidget {\n  @override\n  State\u003cStatefulWidget\u003e createState() {\n    return IndexPageState();\n  }\n}\n\nclass IndexPageState extends BasePageState\u003cIndexPage, IndexPagePresenter\u003e {\n\n  @override\n  IndexPagePresenter createPresenter() {\n    return IndexPagePresenter();\n  }\n\n}\n\n```\n\n#### 三、Create xxxPagePresenter,Take IndexPagePresenter as an example\n```\nclass IndexPagePresenter extends BasePagePresenter\u003cIndexPageState\u003e{\n\n  void requestUserInfo(){\n    requestNetwork(Method.get,\n      url: Api.users,\n      baseUrl: Api.baseUrl,\n      onSuccess: (response){\n        Map\u003cString,dynamic\u003e _map = json.decode(response?.data.toString());\n        String result = json.encode(_map);\n        ResponseUserInfoEntity entity = EntityFactory.generateOBJ(_map[\"data\"]);\n        view.updateResponseView(entity);\n      },\n    );\n  }\n}\n```\nHope you enjoy it!!!!\n\nHere is a [sample demo](https://github.com/MeDeity/flutter_mvp) show how to use this mvp framework,scan this qrcode to download android demo.\n\n![android demo apk](screenshot/demo_download_url.png)\n\nOr It is especially recommended that you check out this open source project =\u003e[simplezhli -\u003e flutter deer](https://github.com/simplezhli/flutter_deer)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmedeity%2Flib_mvp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmedeity%2Flib_mvp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmedeity%2Flib_mvp/lists"}