{"id":5347,"date":"2020-12-02T06:14:26","date_gmt":"2020-12-02T06:14:26","guid":{"rendered":"https:\/\/www.folio3.com\/mobile\/?p=5347"},"modified":"2020-12-03T12:15:53","modified_gmt":"2020-12-03T12:15:53","slug":"sharing-code-in-mobile-web-apps-using-flutter","status":"publish","type":"post","link":"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-in-mobile-web-apps-using-flutter\/","title":{"rendered":"One codebase to rule them all \u2013 Sharing code in mobile &#038; web apps using Flutter"},"content":{"rendered":"\n<p>All developers at some point get into the debate of which framework to choose for making a cross-platform app for a given use case as businesses are continuously trying to cut down on development time. And with the ever-increasing innovations in technology, it\u2019s getting harder and harder to reach a verdict of this debate as there are so many good contenders like React Native, Ionic and Xamarin to name a few. Flutter, which is relatively a new addition to the cross-platform dev frameworks list, claims to provide the same cross-platform development capabilities, but it\u2019s got a characteristic which gives Flutter an edge over other platforms. A truly single codebase for native mobile and web apps.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\"><br><strong>Flutter Internals<\/strong><\/h1>\n\n\n\n<p>Let\u2019s take React and Ionic as examples. They both have their own set of processes to render UI onto the screen of any specific platform.<\/p>\n\n\n\n<p>As we know in the React world. We have different frameworks for web and mobile, ReactJs &amp; React Native. Though when making a web &amp; mobile app we can reuse a lot of the code such as business logic, by implementing certain patterns, but when it comes to the UI elements, we would have to manage two different versions of the component for web and mobile.<\/p>\n\n\n\n<p>On the other hand, Ionic creates the UI elements using web standard (Js, Html &amp; CSS). Ionic styles the components in such a way that it mimics the platform specific style, so we get native look and feel of the components on each platform. And then the app is rendered in a WebView. So basically, Ionic apps are not native apps.<\/p>\n\n\n\n<p>Now flutter takes a completely different approach. It does not translate the components into native components or render it in any WebView container, it works more like a gaming engine where it takes complete control of the screen and by using its own high-performance rendering engine, draws every pixel of the UI onto the screen using Skia canvas.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/LMzxL-WIBvNxFnds3UotlLnU1wfm-5peGQ1Cl9rTBjYGj32YFd-JTtn6YqV6TbXoBHupd5yZmZaPnlJ64nWLd_2lm5C8-KMwLhKCYmwX1vUzxTgNis_ztItRQ93LWLPdbq9nuOYM\" alt=\"\"\/><\/figure>\n\n\n\n<p>Some might argue that it might be more performance costly to redraw each component, but Flutter has a very optimized process of traversing its widget tree and rendering only the part of UI (widget) which needs to be redrawn.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/d-qcjRJzkPPLoNjoTX_tyik3pa86PEDwZSA24L551hTehqv28vdyiuRDX1a_xPxAnHU7C_CHQYna3pNshdqIMC_THeU5PAjtGYXuxCEhZmlJ-R7hZFUiuAOWU0G7eBsw1P5vt8gb\" alt=\"\"\/><\/figure>\n\n\n\n<h1 class=\"wp-block-heading\"><br><strong>Native UI\/UX<\/strong><\/h1>\n\n\n\n<p>Since flutter is painting every pixel, one would think that it would be more time consuming to develop individual styles for every component &amp; platform, but that is not the case. Flutter provides its extensive set of pre-defined adaptive widgets right out of the box. Including a set of Material and Cupertino styled widgets for Android and iOS respectively. Same widgets can be rendered on the web as well. As many developers would already be familiar with using material design in web apps, if a Flutter app is built using Material widgets, they would have consistent look and feel in both of their mobile and web apps.<\/p>\n\n\n\n<p>Base components like switches can be used in an adaptive way so that a single line of code gets rendered according to the platform it&#8217;s running on.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/IIoXS72juQt0qgJs2RsdHaORao2pmJ5mCRdGnI5sNgFtaO-YF4s0P---IgLHyj6og4-Ua3f3nqmyNh_SD7kWmh0Zj6FnyI72SmwjYGXskg_cJ_YtEmLKTtVXlHg53Cx0IZOjziR2\" alt=\"\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/KTZVM-B0wZaDvp6bit0tXci8A09Pz183i6y8jCK0vZ7GgDF6IelIaxDzPbO9ZWw7C6OAifBi9aD9-izwmhStE0c_KSvoq2dP6FkYAjqfkEBfFG-ahm0m4Vy3nOM5abzYZ5s_UqGI\" alt=\"\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/MoA5hMZIRA0heR4QTFN-jO7T32v6X2FWytOnPztLA9K6F87jjqj-m-eCg77xXMngUhSzSgGJPF5LbAfNORoQ7LxjXiE1ZUchIZHTKWqqXR5S7Pkbc-wY6e4OlRAQu4oFSXOPZrQE\" alt=\"\"\/><\/figure>\n\n\n\n<p>Flutter also provides device specific information which a developer might need to make some decisions for widget styling or making responsive layouts such as:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Platform.isAndroid<\/li><li>Platform.isIos<\/li><li>kIsWeb<\/li><li>MediaQuery.of(context).orientation<\/li><li>MediaQuery.of(context).size.height<\/li><\/ul>\n\n\n\n<h1 class=\"wp-block-heading\"><br><strong>Flutter Web<\/strong><\/h1>\n\n\n\n<p>Introduction of web support in Flutter has made it truly unique. With this support, existing codebase written for mobile apps in Dart language can be compiled for the web as well using web-standards (Js, Html &amp; CSS).<\/p>\n\n\n\n<p>As we know, the flutter dart framework layer itself is platform agnostic as it sits above a Rendering layer, which is written for each specific platform. To enable web support, Flutter team just had to implement its core drawing layer which uses standard browser\u2019s APIs to access DOM and Canvas to draw the app onto the screen. And in addition, had to enable compiling dart code into JavaScript instead of ARM machine code which is done for mobile apps.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/XFq6VvBgT7BduezvpCkd0b2BQSVxjn8OTAGfMlmQOLtnvCoHhkzuaqZQvVdDl1KywYIStPl50gVPixw9h56Yg2PK8bx0ZZTPS6PFaC1HIJpleE97ANqnEzqdyBvo1rRfLdZm0uJO\" alt=\"\"\/><\/figure>\n\n\n\n<h1 class=\"wp-block-heading\"><br><strong>Demo app for web &amp; mobile<\/strong><\/h1>\n\n\n\n<p>In order to demonstrate how one codebase can be used for both web and mobile apps, We\u2019ve pulled together a demo flutter app which showcases all the building blocks of Flutter and we can see how they render on different devices. This app has implemented Material Design and we\u2019ll be testing on Android mobile, Android Tab and Web (Chrome). See the demo videos of each device for reference. Link to the source code of the app is mentioned in the References section.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><br><strong>MaterialApp, Scaffold, AppBar &amp; AppDrawer<\/strong><\/h2>\n\n\n\n<p>These 4 widgets together define the overall layout of the app. The top bar, a togglable side menu and the body for the app. By adding them without any platform specific tweaking, we get the result shown in the app.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><br><strong>Layout<\/strong><\/h2>\n\n\n\n<p>Now this will be the most important aspect when developing an app for both mobile and web. The theory behind responsive layout that we are familiar with in the web dev world, are applied here as well. Flutter provides many ways to lay out our content. But we have to configure them in a way that the content stays responsive across different devices and screen sizes. Following are some of the widgets Flutter provides for layouts:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><br><strong>Container, Rows &amp; Columns<\/strong><\/h3>\n\n\n\n<p>These are the widgets that you will find that are used most. They are normally used in conjunction to make up our entire content. In this app, all screens in our demo are wrapped in a container, whose width is set dynamically with the help of media query.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/zBkfoR6COxU_Jfhp8AIE5ipEcrup8bI29RvFtOtUYqRb4usIBPs953I3XfS9Me13fT7sBkkJiUS4INXluMAjPzjYM9G6G1zZxMmDCb2-tSitFfskhGbjBmWPx9vEUxmgQynN5a33\" alt=\"\"\/><\/figure>\n\n\n\n<p>Based on the standard media query breakpoints for medium, large and xl devices, we set the container width dynamically so that in smaller screen, we use the whole width of the screen, and as we go towards bigger screens, we take smaller percentage of the whole screen so that our components are not stretched all the way across on computer monitors for example. A red border has been added around the main container so you can estimate how big the container is on the screen.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><br><strong>Flex, Wrap &amp; Grid<\/strong><\/h3>\n\n\n\n<p>These are some other ways to layout the content. Flex follows a similar pattern of flexbox from the web world where we can tell flutter how the content should be sized comparatively to the others. Wrap, as the name suggests, wraps the content in the next row\/column if the content overflows. Grid also is very common. It\u2019s used a lot with showing let\u2019s say a picture collection or multiple cards. In this app, as there\u2019s no content within the grid, it is automatically sized according to the space available.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><br><strong>Form Controls<\/strong><\/h2>\n\n\n\n<p>Some commonly used form controls have been added in the app to show how they look on different screens. Note that \u201cWrap\u201d has been used in this screen so that\u2019s why we see small containers move to the next rows in smaller screens.<\/p>\n\n\n\n<p>With the help of these controls, we\u2019ve pulled together a sample form. The width of these controls is set dynamically by using the width of the main container (deviceParams.containerWidth) that we defined at the beginning. So, for one text field, we take 45% of the width of the main container minus some padding, so that in one row, we get maximum of two fields (45*2 i.e. 90%) along with an icon (10%).<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/VF_l7MX4Oc1mlD9fHSsWSDgUu8v2IX7BDvFyEGrVc-RZVfTChnS222tGprUnIGeoVdvlR8ySIqLn9zu3Pusn90bWaM7Osn1IV5fi0j21wAc7QMFM-N9efUHGzbWCvodl3hGEi9ee\" alt=\"\"\/><\/figure>\n\n\n\n<p>Also based on the device, we can set either we want to show some content in a single or multi line. This example is of the checkboxes and radio button on the contact form.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/LJ6KniW084NZw0Ang02D2_fMS9esdLlXBa0wI-bR_PzdHFjhTEKKm__2oGDtOFGxtGDUvLe2Sv6CWsy_CuCRSq-Qys5LSHlC7AFmqekRJwgzpzT_QdVTNFIGXVmvQ1pb_taR8sGs\" alt=\"\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><br><strong>Tabs, Lists &amp; Tables<\/strong><\/h2>\n\n\n\n<p>Tabs are normally used with the Scaffold widget in Flutter so that it takes the same size as our top AppBar which is what followed in mobile material layouts. But as we were planning to use the same Tab Widget on the web, we added them in our body container instead of the scaffold.<\/p>\n\n\n\n<p>ListView widget helps with creating dynamic list content which is scrollable by default. Inside we\u2019ve used List items which gives us a nice layout of the items including avatars, title, subtitle and trailing info. Similarly, Material also provides a DataTable widget which is highly customizable. In this example, we have used a very basic \u201ccars\u201d data to visualize both ListView and DataTable.<\/p>\n\n\n\n<p>Generally, displaying data in a table would make sense on a web app, but as we already have limited screen real estate on mobile, showing a table would either make it squished and unreadable or would be horizontally scrollable which is really painful to use. We can fix this very easily in Flutter by rendering our desired widget based on platform or screen size as it is done in the \u201cadaptive\u201d tab in our demo app.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/lXFAAJxDxgEqrDL9SUmtqRTiDmeKIccXEfIYQ3rGttFGMZXtED-jZd_6v52lGPCb342X_HsHSs--VkG0oNjhGfAfM51MlefDp7TDEkuRMRklcEJqpjb5DhihA5BtP-Hxd4M3ZBU5\" alt=\"\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><br><strong>Alerts, Panels &amp; Stepper<\/strong><\/h2>\n\n\n\n<p>Alerts, Dialog popups, notifications etc. can also be used in a similar manner.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\"><br><strong>Considerations<\/strong><\/h1>\n\n\n\n<p>Now that we\u2019ve seen basics and how Flutter can be used for web apps, there\u2019s still some factors about Flutter web that should be considered:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Flutter web was initially managed in a separate repo. Though it is merged into the main Flutter codebase, it&#8217;s still in beta and Flutter team is still trying to improve upon its quality and performance. So, you may run into some issues and bugs as it&#8217;s not yet completely stable.<\/li><li>As for the performance, there are primarily two factors that we see when measuring performance of a web app. One is handling large data and second, effects &amp; animations. Dart handles large lists reasonably well but the Flutter web is still trying to improve the performance when it comes to animations, so you might not get the buttery smooth transitions or animations like you get from other frameworks yet.<\/li><li>Since it&#8217;s not stable, a good amount of time would be spent on testing the apps.<\/li><li>There are plenty of 3<sup>rd<\/sup> party libraries that you can use for Flutter mobile, but for web there are comparatively less. So, e.g. if you are planning to use features such as getting location of your user, you will find a lot of options of libraries to choose from for iOS and Android but you might not find any one package which supports web as well.<\/li><\/ul>\n\n\n\n<h1 class=\"wp-block-heading\"><br><strong>Final Thoughts<\/strong><\/h1>\n\n\n\n<p>We\u2019ve got some idea now on how powerful Flutter is when it comes to cross platform development even when the web is still in beta. Though we might not want to use Flutter web for let\u2019s say a full-fledged e-commerce store at the moment, but as rapidly its development is being done, I believe we are not that far from the first stable version of Flutter web and start enabling web support for our existing Flutter codebases. With its ever-growing popularity and how more &amp; more developers are leaning towards Flutter now, it&#8217;s giving a hard time to its competitors.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Demo:<\/h1>\n\n\n\n<h4 class=\"wp-block-heading\">Web Application<\/h4>\n\n\n\n<figure class=\"wp-block-embed-youtube wp-block-embed is-type-video is-provider-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe title=\"Flutter Web App Demo | One codebase to rule them all\" width=\"840\" height=\"473\" src=\"https:\/\/www.youtube.com\/embed\/QoMTAcG3sRI?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\"><br>Tab Application<\/h4>\n\n\n\n<figure class=\"wp-block-embed-youtube wp-block-embed is-type-video is-provider-youtube wp-embed-aspect-4-3 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe title=\"Flutter Tab App Demo | One codebase to rule them all\" width=\"840\" height=\"630\" src=\"https:\/\/www.youtube.com\/embed\/kr1eJhRgxX4?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\"><br>Mobile Application<\/h4>\n\n\n\n<figure class=\"wp-block-embed-youtube wp-block-embed is-type-video is-provider-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe title=\"Flutter Mobile App Demo | One codebase to rule them all\" width=\"840\" height=\"473\" src=\"https:\/\/www.youtube.com\/embed\/cJLchXMvclc?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<h1 class=\"wp-block-heading\"><br><strong>References<\/strong><\/h1>\n\n\n\n<ul class=\"wp-block-list\"><li>Code for our demo app can be found at:<a href=\"https:\/\/github.com\/abdulraheemabid\/flutter_demo\"> https:\/\/github.com\/abdulraheemabid\/flutter_demo<\/a><\/li><li><a href=\"https:\/\/flutter.dev\/web\">https:\/\/flutter.dev\/web<\/a><\/li><li><a href=\"https:\/\/flutter.dev\/docs\/get-started\/web\">https:\/\/flutter.dev\/docs\/get-started\/web<\/a><\/li><li><a href=\"https:\/\/flutter.dev\/docs\/development\/ui\/layout\/responsive\">https:\/\/flutter.dev\/docs\/development\/ui\/layout\/responsive<\/a><\/li><li><a href=\"https:\/\/flutter.dev\/docs\/development\/platform-integration\/web\">https:\/\/flutter.dev\/docs\/development\/platform-integration\/web<\/a><\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>All developers at some point get into the debate of which framework to choose for making a cross-platform app for a given use case as businesses are continuously trying to cut down on development time. And with the ever-increasing innovations in technology, it\u2019s getting harder and harder to reach a verdict of this debate as &hellip; <a href=\"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-in-mobile-web-apps-using-flutter\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;One codebase to rule them all \u2013 Sharing code in mobile &#038; web apps using Flutter&#8221;<\/span><\/a><\/p>\n","protected":false},"author":37,"featured_media":5361,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[53],"tags":[],"class_list":["post-5347","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-flutter-app-development"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Share Code in Mobile and Web Apps by using Flutter<\/title>\n<meta name=\"description\" content=\"A comprehensive guide about how to Share the code for the development of both mobile and web apps by using Flutter technology.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-in-mobile-web-apps-using-flutter\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Share Code in Mobile and Web Apps by using Flutter\" \/>\n<meta property=\"og:description\" content=\"A comprehensive guide about how to Share the code for the development of both mobile and web apps by using Flutter technology.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-in-mobile-web-apps-using-flutter\/\" \/>\n<meta property=\"og:site_name\" content=\"Mobile App Development Services\" \/>\n<meta property=\"article:published_time\" content=\"2020-12-02T06:14:26+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-12-03T12:15:53+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.folio3.com\/mobile\/wp-content\/uploads\/2020\/12\/Sharing-code-in-mobile-web-apps-using-Flutter.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"920\" \/>\n\t<meta property=\"og:image:height\" content=\"539\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Noc Folio3\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Noc Folio3\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-in-mobile-web-apps-using-flutter\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-in-mobile-web-apps-using-flutter\/\"},\"author\":{\"name\":\"Noc Folio3\",\"@id\":\"https:\/\/www.folio3.com\/mobile\/#\/schema\/person\/0b6e4f68efbd12d222ac9422766c61eb\"},\"headline\":\"One codebase to rule them all \u2013 Sharing code in mobile &#038; web apps using Flutter\",\"datePublished\":\"2020-12-02T06:14:26+00:00\",\"dateModified\":\"2020-12-03T12:15:53+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-in-mobile-web-apps-using-flutter\/\"},\"wordCount\":1898,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.folio3.com\/mobile\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-in-mobile-web-apps-using-flutter\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.folio3.com\/mobile\/wp-content\/uploads\/2020\/12\/Sharing-code-in-mobile-web-apps-using-Flutter.jpg\",\"articleSection\":[\"flutter-app-development\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-in-mobile-web-apps-using-flutter\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-in-mobile-web-apps-using-flutter\/\",\"url\":\"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-in-mobile-web-apps-using-flutter\/\",\"name\":\"How to Share Code in Mobile and Web Apps by using Flutter\",\"isPartOf\":{\"@id\":\"https:\/\/www.folio3.com\/mobile\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-in-mobile-web-apps-using-flutter\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-in-mobile-web-apps-using-flutter\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.folio3.com\/mobile\/wp-content\/uploads\/2020\/12\/Sharing-code-in-mobile-web-apps-using-Flutter.jpg\",\"datePublished\":\"2020-12-02T06:14:26+00:00\",\"dateModified\":\"2020-12-03T12:15:53+00:00\",\"description\":\"A comprehensive guide about how to Share the code for the development of both mobile and web apps by using Flutter technology.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-in-mobile-web-apps-using-flutter\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-in-mobile-web-apps-using-flutter\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-in-mobile-web-apps-using-flutter\/#primaryimage\",\"url\":\"https:\/\/www.folio3.com\/mobile\/wp-content\/uploads\/2020\/12\/Sharing-code-in-mobile-web-apps-using-Flutter.jpg\",\"contentUrl\":\"https:\/\/www.folio3.com\/mobile\/wp-content\/uploads\/2020\/12\/Sharing-code-in-mobile-web-apps-using-Flutter.jpg\",\"width\":920,\"height\":539,\"caption\":\"Sharing code in mobile & web apps using Flutter\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-in-mobile-web-apps-using-flutter\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.folio3.com\/mobile\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"One codebase to rule them all \u2013 Sharing code in mobile &#038; web apps using Flutter\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.folio3.com\/mobile\/#website\",\"url\":\"https:\/\/www.folio3.com\/mobile\/\",\"name\":\"Mobile App Development Services\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/www.folio3.com\/mobile\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.folio3.com\/mobile\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.folio3.com\/mobile\/#organization\",\"name\":\"Mobile App Development Services\",\"url\":\"https:\/\/www.folio3.com\/mobile\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.folio3.com\/mobile\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.folio3.com\/mobile\/wp-content\/uploads\/2020\/12\/folio3-mobile.png\",\"contentUrl\":\"https:\/\/www.folio3.com\/mobile\/wp-content\/uploads\/2020\/12\/folio3-mobile.png\",\"width\":210,\"height\":50,\"caption\":\"Mobile App Development Services\"},\"image\":{\"@id\":\"https:\/\/www.folio3.com\/mobile\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.folio3.com\/mobile\/#\/schema\/person\/0b6e4f68efbd12d222ac9422766c61eb\",\"name\":\"Noc Folio3\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.folio3.com\/mobile\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/29f05a21b8db20048e7717694b024bbd?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/29f05a21b8db20048e7717694b024bbd?s=96&d=mm&r=g\",\"caption\":\"Noc Folio3\"},\"url\":\"https:\/\/www.folio3.com\/mobile\/blog\/author\/noc\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Share Code in Mobile and Web Apps by using Flutter","description":"A comprehensive guide about how to Share the code for the development of both mobile and web apps by using Flutter technology.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-in-mobile-web-apps-using-flutter\/","og_locale":"en_US","og_type":"article","og_title":"How to Share Code in Mobile and Web Apps by using Flutter","og_description":"A comprehensive guide about how to Share the code for the development of both mobile and web apps by using Flutter technology.","og_url":"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-in-mobile-web-apps-using-flutter\/","og_site_name":"Mobile App Development Services","article_published_time":"2020-12-02T06:14:26+00:00","article_modified_time":"2020-12-03T12:15:53+00:00","og_image":[{"width":920,"height":539,"url":"https:\/\/www.folio3.com\/mobile\/wp-content\/uploads\/2020\/12\/Sharing-code-in-mobile-web-apps-using-Flutter.jpg","type":"image\/jpeg"}],"author":"Noc Folio3","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Noc Folio3","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-in-mobile-web-apps-using-flutter\/#article","isPartOf":{"@id":"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-in-mobile-web-apps-using-flutter\/"},"author":{"name":"Noc Folio3","@id":"https:\/\/www.folio3.com\/mobile\/#\/schema\/person\/0b6e4f68efbd12d222ac9422766c61eb"},"headline":"One codebase to rule them all \u2013 Sharing code in mobile &#038; web apps using Flutter","datePublished":"2020-12-02T06:14:26+00:00","dateModified":"2020-12-03T12:15:53+00:00","mainEntityOfPage":{"@id":"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-in-mobile-web-apps-using-flutter\/"},"wordCount":1898,"commentCount":0,"publisher":{"@id":"https:\/\/www.folio3.com\/mobile\/#organization"},"image":{"@id":"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-in-mobile-web-apps-using-flutter\/#primaryimage"},"thumbnailUrl":"https:\/\/www.folio3.com\/mobile\/wp-content\/uploads\/2020\/12\/Sharing-code-in-mobile-web-apps-using-Flutter.jpg","articleSection":["flutter-app-development"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-in-mobile-web-apps-using-flutter\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-in-mobile-web-apps-using-flutter\/","url":"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-in-mobile-web-apps-using-flutter\/","name":"How to Share Code in Mobile and Web Apps by using Flutter","isPartOf":{"@id":"https:\/\/www.folio3.com\/mobile\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-in-mobile-web-apps-using-flutter\/#primaryimage"},"image":{"@id":"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-in-mobile-web-apps-using-flutter\/#primaryimage"},"thumbnailUrl":"https:\/\/www.folio3.com\/mobile\/wp-content\/uploads\/2020\/12\/Sharing-code-in-mobile-web-apps-using-Flutter.jpg","datePublished":"2020-12-02T06:14:26+00:00","dateModified":"2020-12-03T12:15:53+00:00","description":"A comprehensive guide about how to Share the code for the development of both mobile and web apps by using Flutter technology.","breadcrumb":{"@id":"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-in-mobile-web-apps-using-flutter\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-in-mobile-web-apps-using-flutter\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-in-mobile-web-apps-using-flutter\/#primaryimage","url":"https:\/\/www.folio3.com\/mobile\/wp-content\/uploads\/2020\/12\/Sharing-code-in-mobile-web-apps-using-Flutter.jpg","contentUrl":"https:\/\/www.folio3.com\/mobile\/wp-content\/uploads\/2020\/12\/Sharing-code-in-mobile-web-apps-using-Flutter.jpg","width":920,"height":539,"caption":"Sharing code in mobile & web apps using Flutter"},{"@type":"BreadcrumbList","@id":"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-in-mobile-web-apps-using-flutter\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.folio3.com\/mobile\/"},{"@type":"ListItem","position":2,"name":"One codebase to rule them all \u2013 Sharing code in mobile &#038; web apps using Flutter"}]},{"@type":"WebSite","@id":"https:\/\/www.folio3.com\/mobile\/#website","url":"https:\/\/www.folio3.com\/mobile\/","name":"Mobile App Development Services","description":"","publisher":{"@id":"https:\/\/www.folio3.com\/mobile\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.folio3.com\/mobile\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.folio3.com\/mobile\/#organization","name":"Mobile App Development Services","url":"https:\/\/www.folio3.com\/mobile\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.folio3.com\/mobile\/#\/schema\/logo\/image\/","url":"https:\/\/www.folio3.com\/mobile\/wp-content\/uploads\/2020\/12\/folio3-mobile.png","contentUrl":"https:\/\/www.folio3.com\/mobile\/wp-content\/uploads\/2020\/12\/folio3-mobile.png","width":210,"height":50,"caption":"Mobile App Development Services"},"image":{"@id":"https:\/\/www.folio3.com\/mobile\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.folio3.com\/mobile\/#\/schema\/person\/0b6e4f68efbd12d222ac9422766c61eb","name":"Noc Folio3","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.folio3.com\/mobile\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/29f05a21b8db20048e7717694b024bbd?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/29f05a21b8db20048e7717694b024bbd?s=96&d=mm&r=g","caption":"Noc Folio3"},"url":"https:\/\/www.folio3.com\/mobile\/blog\/author\/noc\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.folio3.com\/mobile\/wp-json\/wp\/v2\/posts\/5347"}],"collection":[{"href":"https:\/\/www.folio3.com\/mobile\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.folio3.com\/mobile\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.folio3.com\/mobile\/wp-json\/wp\/v2\/users\/37"}],"replies":[{"embeddable":true,"href":"https:\/\/www.folio3.com\/mobile\/wp-json\/wp\/v2\/comments?post=5347"}],"version-history":[{"count":4,"href":"https:\/\/www.folio3.com\/mobile\/wp-json\/wp\/v2\/posts\/5347\/revisions"}],"predecessor-version":[{"id":5351,"href":"https:\/\/www.folio3.com\/mobile\/wp-json\/wp\/v2\/posts\/5347\/revisions\/5351"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.folio3.com\/mobile\/wp-json\/wp\/v2\/media\/5361"}],"wp:attachment":[{"href":"https:\/\/www.folio3.com\/mobile\/wp-json\/wp\/v2\/media?parent=5347"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.folio3.com\/mobile\/wp-json\/wp\/v2\/categories?post=5347"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.folio3.com\/mobile\/wp-json\/wp\/v2\/tags?post=5347"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}