{"id":15498023,"url":"https://github.com/rodydavis/flutter_everywhere","last_synced_at":"2025-04-06T03:10:28.870Z","repository":{"id":49637196,"uuid":"183069062","full_name":"rodydavis/flutter_everywhere","owner":"rodydavis","description":"Template Flutter Project for iOS, Android, Fuschica, MacOS, Windows, Linux, Web, Command Line, Chrome Extension","archived":false,"fork":false,"pushed_at":"2021-10-12T22:39:19.000Z","size":249872,"stargazers_count":401,"open_issues_count":8,"forks_count":55,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-04-01T15:09:17.338Z","etag":null,"topics":["android","desktop","flutter","fuschia","ios","linux","macos","web","windows"],"latest_commit_sha":null,"homepage":"https://rodydavis.github.io/flutter_everywhere/#/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rodydavis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-23T18:01:11.000Z","updated_at":"2025-03-17T02:43:00.000Z","dependencies_parsed_at":"2022-09-19T19:01:33.132Z","dependency_job_id":null,"html_url":"https://github.com/rodydavis/flutter_everywhere","commit_stats":null,"previous_names":[],"tags_count":5,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodydavis%2Fflutter_everywhere","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodydavis%2Fflutter_everywhere/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodydavis%2Fflutter_everywhere/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodydavis%2Fflutter_everywhere/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rodydavis","download_url":"https://codeload.github.com/rodydavis/flutter_everywhere/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247427006,"owners_count":20937201,"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","desktop","flutter","fuschia","ios","linux","macos","web","windows"],"created_at":"2024-10-02T08:41:41.292Z","updated_at":"2025-04-06T03:10:28.846Z","avatar_url":"https://github.com/rodydavis.png","language":"C++","readme":"# Flutter Everywhere\n\nWeb Demo (PWA): https://rodydavis.github.io/flutter_everywhere/#/\n\n## Targets\n\n- Web\n- Desktop (MacOS, Windows, Linux)\n- Android\n- iOS\n- Electron (MacOS, Windows, Linux)\n- CLI and dart2Native\n- Rest API\n- Chrome Extension\n\n## Overview\n\n- Flutter Client Project: iOS, Android, Web, MacOS, Windows, Linux..\n- Flutter Server Project: REST API to `lib/data/models` directory..\n- Flutter Command Line Project: CLI to `lib/data/models` directory..\n\nOne project, multiple implementations.\n\n### Usage (REST API)\n\nrun the project from VsCode with the server config selected.\n\nthen you can make post or get requests too `http:0.0.0.0/8080`\n\n`http://0.0.0.0/8080/counter?count=22` yields:\n\n```json\n{\n    \"status\": \"success\",\n    \"message\": \"Info\",\n    \"body\": {\n        \"counter\": 22\n    }\n}\n```\n\n### Usage (CLI)\n\n`dart bin/main.dart counter --add 1` yields:\n\n```auto\nCounter Value.. 0\nAdding..1\nRemoving..0\nCounter Value.. 1\n```\n\n### Usage (dart2Native)\n\nBuild Executable:\n\n- `dart2native bin/main.dart  -o counter`\n\nRun Executable:\n\n- `./counter counter --add 1`\n\n```auto\nCounter Value.. 0\nAdding..1\nRemoving..0\nCounter Value.. 1\n```\n\n### Usage (Client)\n\nRun Flutter Project Like Normal\n\n`flutter run`\n\n- For Electron:\n\nRun: `npm install`\nRun: `npm run dev` or `npm run dev_skia`\n\n```dart\nimport 'package:flutter/material.dart';\n\nimport 'data/models/index.dart';\nimport 'plugins/desktop/desktop.dart';\n\nvoid main() {\n  setTargetPlatformForDesktop();\n  runApp(MyApp());\n}\n\nclass MyApp extends StatelessWidget {\n  // This widget is the root of your application.\n  @override\n  Widget build(BuildContext context) {\n    return MaterialApp(\n      title: 'Flutter Demo',\n      theme: ThemeData(\n        // This is the theme of your application.\n        //\n        // Try running your application with \"flutter run\". You'll see the\n        // application has a blue toolbar. Then, without quitting the app, try\n        // changing the primarySwatch below to Colors.green and then invoke\n        // \"hot reload\" (press \"r\" in the console where you ran \"flutter run\",\n        // or simply save your changes to \"hot reload\" in a Flutter IDE).\n        // Notice that the counter didn't reset back to zero; the application\n        // is not restarted.\n        primarySwatch: Colors.blue,\n      ),\n      home: MyHomePage(title: 'Flutter Demo Home Page'),\n    );\n  }\n}\n\nclass MyHomePage extends StatefulWidget {\n  MyHomePage({Key key, this.title}) : super(key: key);\n\n  // This widget is the home page of your application. It is stateful, meaning\n  // that it has a State object (defined below) that contains fields that affect\n  // how it looks.\n\n  // This class is the configuration for the state. It holds the values (in this\n  // case the title) provided by the parent (in this case the App widget) and\n  // used by the build method of the State. Fields in a Widget subclass are\n  // always marked \"final\".\n\n  final String title;\n\n  @override\n  _MyHomePageState createState() =\u003e _MyHomePageState();\n}\n\nclass _MyHomePageState extends State\u003cMyHomePage\u003e {\n  CounterModel _counter = CounterModel();\n\n  void _incrementCounter() {\n    setState(() {\n      // This call to setState tells the Flutter framework that something has\n      // changed in this State, which causes it to rerun the build method below\n      // so that the display can reflect the updated values. If we changed\n      // _counter without calling setState(), then the build method would not be\n      // called again, and so nothing would appear to happen.\n      _counter.add(1);\n    });\n  }\n\n  @override\n  Widget build(BuildContext context) {\n    // This method is rerun every time setState is called, for instance as done\n    // by the _incrementCounter method above.\n    //\n    // The Flutter framework has been optimized to make rerunning build methods\n    // fast, so that you can just rebuild anything that needs updating rather\n    // than having to individually change instances of widgets.\n    return Scaffold(\n      appBar: AppBar(\n        // Here we take the value from the MyHomePage object that was created by\n        // the App.build method, and use it to set our appbar title.\n        title: Text(widget.title),\n      ),\n      body: Center(\n        // Center is a layout widget. It takes a single child and positions it\n        // in the middle of the parent.\n        child: Column(\n          // Column is also a layout widget. It takes a list of children and\n          // arranges them vertically. By default, it sizes itself to fit its\n          // children horizontally, and tries to be as tall as its parent.\n          //\n          // Invoke \"debug painting\" (press \"p\" in the console, choose the\n          // \"Toggle Debug Paint\" action from the Flutter Inspector in Android\n          // Studio, or the \"Toggle Debug Paint\" command in Visual Studio Code)\n          // to see the wireframe for each widget.\n          //\n          // Column has various properties to control how it sizes itself and\n          // how it positions its children. Here we use mainAxisAlignment to\n          // center the children vertically; the main axis here is the vertical\n          // axis because Columns are vertical (the cross axis would be\n          // horizontal).\n          mainAxisAlignment: MainAxisAlignment.center,\n          children: \u003cWidget\u003e[\n            Text(\n              'You have pushed the button this many times:',\n            ),\n            Text(\n              '$_counter',\n              style: Theme.of(context).textTheme.display1,\n            ),\n          ],\n        ),\n      ),\n      floatingActionButton: FloatingActionButton(\n        onPressed: _incrementCounter,\n        tooltip: 'Increment',\n        child: Icon(Icons.add),\n      ), // This trailing comma makes auto-formatting nicer for build methods.\n    );\n  }\n}\n\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frodydavis%2Fflutter_everywhere","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frodydavis%2Fflutter_everywhere","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frodydavis%2Fflutter_everywhere/lists"}