{"id":27002934,"url":"https://github.com/octmon/flutter_easy","last_synced_at":"2025-04-04T05:14:26.855Z","repository":{"id":49317726,"uuid":"201950454","full_name":"OctMon/flutter_easy","owner":"OctMon","description":"A common Flutter package.","archived":false,"fork":false,"pushed_at":"2024-05-02T13:32:49.000Z","size":8733,"stargazers_count":7,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-05-03T03:29:15.010Z","etag":null,"topics":["app","common","fast","flutter"],"latest_commit_sha":null,"homepage":"","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/OctMon.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":"2019-08-12T14:48:53.000Z","updated_at":"2024-06-03T09:54:48.065Z","dependencies_parsed_at":"2024-04-22T12:31:37.724Z","dependency_job_id":"ed95970d-5573-446e-b132-c13e44298414","html_url":"https://github.com/OctMon/flutter_easy","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OctMon%2Fflutter_easy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OctMon%2Fflutter_easy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OctMon%2Fflutter_easy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OctMon%2Fflutter_easy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OctMon","download_url":"https://codeload.github.com/OctMon/flutter_easy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247123087,"owners_count":20887261,"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":["app","common","fast","flutter"],"created_at":"2025-04-04T05:14:25.965Z","updated_at":"2025-04-04T05:14:26.840Z","avatar_url":"https://github.com/OctMon.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![flutter_easy](https://socialify.git.ci/OctMon/flutter_easy/image?description=1\u0026descriptionEditable=A%20common%20Flutter%20package.\u0026font=Inter\u0026forks=1\u0026issues=1\u0026logo=https%3A%2F%2Fraw.githubusercontent.com%2Fflutter%2Fwebsite%2Fmaster%2Fsrc%2F_assets%2Fimage%2Fflutter-lockup.png\u0026owner=1\u0026pattern=Floating%20Cogs\u0026pulls=1\u0026stargazers=1\u0026theme=Dark)](https://octmon.github.io/)\n\n# flutter_easy\n\n[![pub](https://img.shields.io/pub/v/flutter_easy.svg)](https://pub.dev/packages/flutter_easy)\n[![flutter](https://img.shields.io/badge/flutter-Android%7CiOS%7CWeb%7CWindows%7CMac-blue.svg)](https://flutter.dev)\n[![license](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/OctMon/flutter_easy/blob/main/LICENSE)\n[![build](https://github.com/OctMon/flutter_easy/workflows/build/badge.svg)](https://github.com/OctMon/flutter_easy/actions)\n\nA common Flutter package.\n[Example](https://octmon.github.io/flutter_easy/)\n\n## Getting Started\n\nAdditional arguments:\n```\n--dart-define=app-debug-flag=true\n```\n\nRun:\n```bash\nflutter run --release --dart-define=app-debug-flag=true\n```\n\n[Example:](https://www.octmon.com/example)\n\nmain.dart\n\n```dart\nvoid main() async {\n  await initEasyApp(\n    appBaseURLChangedCallback: () {\n      // Reload API\n      configAPI(null);\n    },\n  );\n  await initApp();\n  runApp(const MyApp());\n  if (isAndroid) {\n    SystemChrome.setPreferredOrientations([\n      DeviceOrientation.portraitUp,\n      DeviceOrientation.portraitDown,\n    ]);\n    // Set overlay style status bar. It must run after MyApp(), because MaterialApp may override it.\n    SystemUiOverlayStyle systemUiOverlayStyle =\n        const SystemUiOverlayStyle(statusBarColor: Colors.transparent);\n    SystemChrome.setSystemUIOverlayStyle(systemUiOverlayStyle);\n  }\n}\n```\n\napp.dart\n\n```dart\nFuture\u003cvoid\u003e initApp() async {\n  // Encrypt password\n  StorageUtil.setEncrypt(\"XxXxXxXxXxXxXxXxX\");\n  // Load user info\n  await Get.putAsync(() =\u003e UserService().load());\n  // Load API\n  configAPI(null);\n}\n\nclass MyApp extends StatelessWidget {\n  const MyApp({Key? key}) : super(key: key);\n\n  @override\n  Widget build(BuildContext context) {\n    return BaseApp(\n      initialRoute: Routes.splash,\n      getPages: Routes.routes,\n      localizationsDelegates: const [\n        S.delegate,\n        GlobalMaterialLocalizations.delegate,\n        GlobalWidgetsLocalizations.delegate,\n        GlobalCupertinoLocalizations.delegate,\n        LocaleNamesLocalizationsDelegate(),\n      ],\n      supportedLocales: S.delegate.supportedLocales,\n      locale: Get.deviceLocale,\n      localeResolutionCallback:\n          (Locale? locale, Iterable\u003cLocale\u003e supportedLocales) {\n        logDebug(\"localeResolutionCallback: $locale\");\n        if (locale == null || !S.delegate.isSupported(locale)) {\n          return null;\n        }\n        if (locale.languageCode == \"zh\") {\n          return const Locale(\"zh\", \"CN\");\n        }\n        return locale;\n      },\n    );\n  }\n}\n```\n\nroutes.dart\n\n```dart\nclass Routes {\n  static final String root = '/';\n  static final String splash = '/splash';\n\n  Routes._();\n\n  static final List\u003cGetPage\u003e routes = [\n    GetPage(\n      name: Routes.root,\n      page: () =\u003e RootPage(),\n    ),\n    GetPage(\n      name: Routes.splash,\n      page: () =\u003e SplashPage(),\n    ),\n    GetPage(\n      name: routesLoginNamed,\n      page: () =\u003e LoginPage(),\n    ),\n}\n```\n\n\n\n# Installing\n\nAdd flutter_easy to your pubspec.yaml file:\n\n```yaml\ndependencies:\n  flutter_easy:\n```\n\nImport flutter_easy in files that it will be used:\n\n```dart\nimport 'package:flutter_easy/flutter_easy.dart';\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foctmon%2Fflutter_easy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foctmon%2Fflutter_easy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foctmon%2Fflutter_easy/lists"}