<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by chetan koppal on Medium]]></title>
        <description><![CDATA[Stories by chetan koppal on Medium]]></description>
        <link>https://medium.com/@koppalc?source=rss-87bdf9e03232------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*PXvGzzLsZDmBsDg4</url>
            <title>Stories by chetan koppal on Medium</title>
            <link>https://medium.com/@koppalc?source=rss-87bdf9e03232------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 24 May 2026 02:29:32 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@koppalc/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[Create a data table using flutter]]></title>
            <link>https://medium.com/@koppalc/create-a-data-table-using-flutter-49ff8c0a3058?source=rss-87bdf9e03232------2</link>
            <guid isPermaLink="false">https://medium.com/p/49ff8c0a3058</guid>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[flutter-widget]]></category>
            <category><![CDATA[flutter-app-development]]></category>
            <category><![CDATA[datatables]]></category>
            <dc:creator><![CDATA[chetan koppal]]></dc:creator>
            <pubDate>Tue, 19 Jul 2022 14:45:03 GMT</pubDate>
            <atom:updated>2022-07-19T14:45:03.512Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Data table image" src="https://cdn-images-1.medium.com/max/1024/1*mf9nZPRnRuHmtiAg_h5aJQ.png" /></figure><p>Hi, Devs it’s been a long time since I back with a new concept of the data table. Let’s learn how to create the custom data table in a flutter by using flutter widgets. In this story, we will create the very basic data table as shown in the above picture. For devs it’s so common feature to show their data in table format now it’s very easy to create your own, customized, complex, responsive, and nicely designed data table using a flutter build widget called D<strong>ataTable</strong>.</p><p>Now Let’s head into the story of the widget and how exactly the widgets are used to create the data table in a flutter. Here below listed are the few widgets we need to build the data table.</p><ul><li>Datatable.</li><li>Datacolumn.</li><li>Datarow.</li><li>Datacell.</li></ul><p>These are the few widgets we need to build your data table. Let me explain each widget in deep.</p><ol><li><strong>DataTable</strong></li></ol><p>DataTable widget allows you to build a table that automatically sizes its columns according to what’s actually in the cells. if you need to give spacing in between columns and rows you can provide your own sizes using <em>dataRowHeight: </em>and <em>columnSpacing: </em>properties and you can add borders as like in the above picture, use <em>border: </em>also it will provide the default divider between each row.</p><blockquote>Note: in this datatable to give the color we need use the material state color to provide color to datarow and dataheadingrow like below example</blockquote><pre>dataRowColor: MaterialStateColor.resolveWith((states) {<br>if (states == MaterialState.selected) {<br>return Colors.amber;<br>} else {<br>return Colors.brown;<br>}<br>}),</pre><p>DataTable contains <em>columns:</em> and <em>rows:</em> property. The column takes an array of DataColumn and the rows take an array of DataRow. Each DataRow has a cells property that takes an array of DataCell.</p><p><strong>2. DataColumn</strong></p><p>This widget is used to provide the heading for each column that accepts the <em>label: </em>property we can provide any widget to that label property as you need like image, icons, etc.</p><p><strong>3. DataRow</strong></p><p>This widget is used to provide each row in the data table which accepts the <em>cells: </em>property takes an array of datacell widgets.</p><p><strong>4. DataCell</strong></p><p>DataCell takes the widget as a value. You can provide Text, Image, Icon, or any other widget. Even this widget accepts the function for tap, longpress, and many more.</p><h3>Let’s Strat…….</h3><p>Before starting, If you have a problem with creating a flutter project visit <a href="https://docs.flutter.dev/get-started/test-drive">site</a>. Once successfully created the new project create a file inside your project lib folder, datatable.dart in your project directory then, create the class with extended as a widget as you need like stateless or stateful. Use the DataTable widget as your root widget for your data table as same as below.</p><pre>@override<br>Widget build(BuildContext context) {<br>return Padding(<br>padding: const EdgeInsets.all(10.0),<br>child: DataTable(),<br>);<br>}</pre><p>Next, add a list of DataColumn for the <em>column: </em>property to provide a heading for the data table.</p><pre>columns: const [<br>DataColumn(<br>label: Text(&quot;S/NO&quot;),<br>),<br>DataColumn(<br>label: Text(&quot;First Name&quot;),<br>),<br>DataColumn(<br>label: Text(&quot;Last Name&quot;),<br>),<br>DataColumn(<br>label: Text(&quot;Salary&quot;),<br>)<br>],</pre><p>In the last, add the list of DataRow to <em>rows:</em> property and add the list of DataCell widgets to the DataRow property called <em>cells:.</em></p><pre>rows: [<br>DataRow( <br>cells: [<br>DataCell(Text(&#39;1&#39;)),<br>DataCell(Text(‘fname’)),<br>DataCell(Text(‘lname’)),<br>DataCell(Text(‘sal’)),<br>],<br>);<br>]</pre><p><strong>NOTE:</strong> If your data table is large do not forget to wrap it with SingleChildScrollView To Avoid any horizontal space overflow in UI.</p><p>Hurrey, That’s it now you created your data table using flutter.</p><blockquote>GitHub link: <a href="https://github.com/chetu-ko/flutter_example/tree/main/lib/data_table">Click Here…</a></blockquote><p><strong>Thank you…</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=49ff8c0a3058" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Custom IntroScreen Using Flutter]]></title>
            <link>https://medium.com/@koppalc/custom-introscreen-using-flutter-8badbdf82a04?source=rss-87bdf9e03232------2</link>
            <guid isPermaLink="false">https://medium.com/p/8badbdf82a04</guid>
            <category><![CDATA[flutter-development]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[flutter-app-development]]></category>
            <category><![CDATA[intro-screen]]></category>
            <category><![CDATA[onboarding-screen]]></category>
            <dc:creator><![CDATA[chetan koppal]]></dc:creator>
            <pubDate>Sun, 13 Mar 2022 10:01:48 GMT</pubDate>
            <atom:updated>2022-07-19T09:58:46.945Z</atom:updated>
            <content:encoded><![CDATA[<p>Here we will learn how to code the custom intro screen without using any package, using flutter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5rseNWobC7VtFoh9ZukUog.png" /></figure><p>Hello Devs, let’s learn how to code your own custom intro screens without using any of the packages. In this introscreen story, we will use the page view widget, which is an inbuilt widget provided by the flutter team. It has many properties that help you to add customization as you needed for your flutter apps. This <strong>pageview </strong>can be used for most of the problems like image sliding, intro screen, showing steps, etc. Here you can add your own sliding effects, animations, your sliding indicators. I think this is the easiest and best way to implement the sliding problems with the best customization.</p><p>So, are you ready to make use of this Pageview widget for IntroScreen and how it can be used to make user-friendly apps?</p><h3>Let’s Strat…….</h3><p>Before starting, If you have a problem with creating a flutter project visit <a href="https://docs.flutter.dev/get-started/test-drive">site</a>. Once successfully created the new project create a file inside your project lib folder, youpagename.dart file. After creating a dart file create a stateful widget in your dart file and add the below variables.</p><pre>late PageController _pageController;</pre><pre>int currentIndex = 0;</pre><pre>static const _kDuration = Duration(milliseconds: 300);</pre><pre>static const _kCurve = Curves.ease;</pre><p>A page controller lets you manipulate which page is visible in a <a href="https://api.flutter.dev/flutter/widgets/PageView-class.html">PageView</a>.also lets you control the offset in terms of pages, which are increments of the viewport size. Continue to add the below code in youpagename.drat file.</p><pre>@override</pre><pre>void initState() {</pre><pre>super.initState();</pre><pre>_pageController = PageController();</pre><pre>}</pre><pre>@override</pre><pre>void dispose() {</pre><pre>_pageController.dispose();</pre><pre>super.dispose();</pre><pre>}</pre><pre>onChangedFunction(int index) {</pre><pre>setState(() {</pre><pre>currentIndex = index;</pre><pre>});</pre><pre>}</pre><pre>nextFunction() {</pre><pre>_pageController.nextPage(duration: _kDuration, curve: _kCurve);</pre><pre>}</pre><pre>previousFunction() {</pre><pre>_pageController.previousPage(duration: _kDuration, curve: _kCurve);</pre><pre>}</pre><p>Above code init function will initialize the pagecontroller, dispose function dispose the controller to improvise your memory consumption, Onchanged function is used to set the state of your current page index, Next and previous function are used to change the current page to next page and previous page.</p><pre>class Indicator extends StatelessWidget {</pre><pre>final int? positionIndex, currentIndex;</pre><pre>const Indicator({Key? key, this.currentIndex, this.positionIndex})</pre><pre>: super(key: key);</pre><pre>@override</pre><pre>Widget build(BuildContext context) {</pre><pre>return Container(</pre><pre>height: 7,</pre><pre>width: 7,</pre><pre>decoration: BoxDecoration(</pre><pre>border: Border.all(color: Colors.transparent),</pre><pre>color: positionIndex == currentIndex ? Colors.black : Colors.grey,</pre><pre>borderRadius: BorderRadius.circular(100.r)),</pre><pre>);</pre><pre>}</pre><pre>}</pre><p>The above widget is an indicator widget that shows the indicator for your pages. You customize the indicator as you needed by changing the properties.</p><pre>Stack(</pre><pre>children: &lt;Widget&gt;[</pre><pre>PageView(</pre><pre>onPageChanged: onChangedFunction,</pre><pre>controller: _pageController,</pre><pre>children: [</pre><pre>//Here you can add you own customized pageview widgets as you //needed. If you didn&#39;t get how to use it i will add the code in //github please refer.</pre><pre>],</pre><pre>),</pre><pre>currentIndex != 2</pre><pre>? Positioned(</pre><pre>bottom: 80,</pre><pre>left: 168,</pre><pre>child: Container(</pre><pre>child: Row(</pre><pre>mainAxisSize: MainAxisSize.max,</pre><pre>mainAxisAlignment: MainAxisAlignment.spaceBetween,</pre><pre>children: &lt;Widget&gt;[</pre><pre>InkWell(</pre><pre>onTap: () =&gt; nextFunction(),</pre><pre>child: Text(</pre><pre>&quot;Next&quot;,</pre><pre>style: TextStyle(</pre><pre>fontSize: 17,</pre><pre>fontWeight: FontWeight.w600,</pre><pre>color: AppColor.primary1),</pre><pre>),</pre><pre>)</pre><pre>],</pre><pre>),</pre><pre>),</pre><pre>)</pre><pre>: Container(),</pre><pre>Positioned(</pre><pre>bottom: 36,</pre><pre>left: 165,</pre><pre>child: Row(</pre><pre>mainAxisSize: MainAxisSize.max,</pre><pre>mainAxisAlignment: MainAxisAlignment.center,</pre><pre>crossAxisAlignment: CrossAxisAlignment.center,</pre><pre>children: &lt;Widget&gt;[</pre><pre>Indicator(</pre><pre>positionIndex: 0,</pre><pre>currentIndex: currentIndex,</pre><pre>),</pre><pre>SizedBox(</pre><pre>width: 10,</pre><pre>),</pre><pre>Indicator(</pre><pre>positionIndex: 1,</pre><pre>currentIndex: currentIndex,</pre><pre>),</pre><pre>SizedBox(</pre><pre>width: 10,</pre><pre>),</pre><pre>Indicator(</pre><pre>positionIndex: 2,</pre><pre>currentIndex: currentIndex,</pre><pre>),</pre><pre>],</pre><pre>),</pre><pre>),</pre><pre>]),</pre><p>Use the stack widget as your parent widget for a better experience of movements and page transition view, even you can use any of the widgets as you needed, but the stack gives a better experience. Now you have your own customized introscreen for your application. If anything you know something better, feel free to add a comment.</p><blockquote>Here is github project for you reference :<a href="https://github.com/chetu-ko/flutter_example/tree/main/lib/costum_intro_screen"> Github link</a></blockquote><p><strong>Thank you…</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8badbdf82a04" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to build dated tabs with flutter…]]></title>
            <link>https://medium.com/@koppalc/how-to-build-dated-tabs-with-flutter-b90d40b79482?source=rss-87bdf9e03232------2</link>
            <guid isPermaLink="false">https://medium.com/p/b90d40b79482</guid>
            <category><![CDATA[flutter-ui]]></category>
            <category><![CDATA[flutter-app-development]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[chetan koppal]]></dc:creator>
            <pubDate>Thu, 18 Nov 2021 15:34:40 GMT</pubDate>
            <atom:updated>2022-07-19T10:00:18.094Z</atom:updated>
            <content:encoded><![CDATA[<h4>The story will explain how to build dated tabs Like displaying Month, date, or week on tabs.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RyGNRa_L08IM76OfJLj9fQ.jpeg" /></figure><p>Hello everyone, In this story will explain how to build the dated tabs with DefaultTabController. Best and easy customization can be done by changing your own data like month or week or day as you needed.</p><p>Example view:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*NspA6AGj-eoM6WNXw13MrQ.png" /><figcaption>Home</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/481/1*C4kgrvIvuQfySAYWWtqN7Q.png" /><figcaption>Date-pick</figcaption></figure><p>Let’s start building dated tabs from scratch.</p><p>First, add the Intl package to your flutter project inside the pubspec.yml file under the dependencies.</p><blockquote>intl package: <a href="https://pub.dev/packages/intl">click here</a></blockquote><p>This package is used to customize the calendar parameter which is week, date, and year.</p><p>Now, create the page yourpagename.dart file inside your project create the stateful widget. Add the<strong> SingleTickerProviderStateMixin</strong> to your class, this mixin is used to control the tab controller and then add the below parameters to your class.</p><pre>DateTime selectedDate = DateTime.now(); // current selected date</pre><pre>List&lt;Widget&gt; myTabs; // this is the list of dated tabs</pre><pre>List&lt;Widget&gt; tabView = List&lt;Widget&gt;(); // this is the tab view</pre><pre>List&lt;DateTime&gt; tabDate = []; // this is to add the dates for future</pre><pre>TabController tabController; // tab controller</pre><p>The below-added function is to select the current date from the calendar.</p><pre>Future&lt;void&gt; _selectDate(BuildContext context) async {</pre><pre>final DateTime picked = await showDatePicker(</pre><pre>context: context,</pre><pre>initialDate: selectedDate,</pre><pre>firstDate: DateTime(2015, 1), // previous limited date</pre><pre>lastDate: DateTime(2101)// End of your calender<br>);</pre><pre>if (picked != null &amp;&amp; picked != selectedDate)</pre><pre>setState(() {</pre><pre>selectedDate = picked;</pre><pre>});</pre><pre>}</pre><p>Next, add the tab controller function, call that function inside the initstate().</p><pre>TabController getTabController() {</pre><pre>return TabController(length: 0, vsync: this);</pre><pre>}</pre><pre>void initState() {</pre><pre>tabController = getTabController();</pre><pre>super.initState();</pre><pre>}</pre><p>After adding the controller you need to add the two widgets to generate the tab view, one is for the tabview and another is for generating the number of tabview.</p><pre>Widget getWidget(DateTime date) {</pre><pre>return Center(</pre><pre>child: Text(“Date: $date”),</pre><pre>);</pre><pre>}</pre><pre>List&lt;Widget&gt; getWidgets() {</pre><pre>tabView.clear();</pre><pre>tabView = List.generate(tabDate.length, (index) {</pre><pre>return getWidget(tabDate[index]);</pre><pre>});</pre><pre>tabDate.clear();</pre><pre>return tabView;</pre><pre>}</pre><p>Now, came into the main part of this story, generating the tabs and its’s data. List.generate function will generate the number of tabs and tab data view as needed. Add the below function inside the widget build.</p><pre>final myTabs = List.generate(7, (index) {</pre><pre>var now = selectedDate; // current selected date</pre><pre>var date = DateTime(now.year, now.month, now.day + index); //get the //next date </pre><pre>var day = DateFormat(‘d’).format(date); // this will get date          </pre><pre>var week = DateFormat(‘EEEE’).format(date);// this will get week</pre><pre>var weekname = week.substring(0, 3);// get the week string as three</pre><pre>var month = DateFormat(‘MMMM’).format(date).substring(0, 3);// month //string as three</pre><pre>tabDate.add(date);</pre><pre>//the below widget you can customize your own tab....</pre><pre>return Column(</pre><pre>children: [</pre><pre>Text(weekname),</pre><pre>Text(</pre><pre>day.toString() + ‘ ‘ + month,</pre><pre>style: TextStyle(fontSize: 10),</pre><pre>),</pre><pre>],</pre><pre>);</pre><pre>});</pre><p>Here you are done with generating the tab view, tabs, and customizing the tab data. if want to format your own date, month and week you can visit the below-added link there you will find more examples on how to format the date in a flutter. Below you will find the complete code of dated tabs.</p><blockquote>formating the date in a flutter: <a href="https://stackoverflow.com/questions/16126579/how-do-i-format-a-date-with-dart">click here</a></blockquote><pre>import ‘package:flutter/material.dart’;</pre><pre>import ‘package:intl/intl.dart’;</pre><pre>class YourClass extends StatefulWidget {</pre><pre>@override</pre><pre>_YourClassState createState() =&gt; _YourClassState();</pre><pre>}</pre><pre>class _YourClassState extends State&lt;YourClass&gt;</pre><pre>with SingleTickerProviderStateMixin {</pre><pre>DateTime selectedDate = DateTime.now();</pre><pre>List&lt;Widget&gt; myTabs;</pre><pre>List&lt;Widget&gt; tabView = List&lt;Widget&gt;();</pre><pre>List&lt;DateTime&gt; tabDate = [];</pre><pre>TabController tabController;</pre><pre>Future&lt;void&gt; _selectDate(BuildContext context) async {</pre><pre>final DateTime picked = await showDatePicker(</pre><pre>context: context,</pre><pre>initialDate: selectedDate,</pre><pre>firstDate: DateTime(2015, 1),</pre><pre>lastDate: DateTime(2101));</pre><pre>if (picked != null &amp;&amp; picked != selectedDate)</pre><pre>setState(() {</pre><pre>selectedDate = picked;</pre><pre>});</pre><pre>}</pre><pre>TabController getTabController() {</pre><pre>return TabController(length: 0, vsync: this);</pre><pre>}</pre><pre>void initState() {</pre><pre>tabController = getTabController();</pre><pre>super.initState();</pre><pre>}</pre><pre>Widget getWidget(DateTime date) {</pre><pre>return Center(</pre><pre>child: Text(“Date: $date”),</pre><pre>);</pre><pre>}</pre><pre>List&lt;Widget&gt; getWidgets() {</pre><pre>tabView.clear();</pre><pre>tabView = List.generate(tabDate.length, (index) {</pre><pre>return getWidget(tabDate[index]);</pre><pre>});</pre><pre>tabDate.clear();</pre><pre>return tabView;</pre><pre>}</pre><pre>@override</pre><pre>Widget build(BuildContext context) {</pre><pre>final myTabs = List.generate(7, (index) {</pre><pre>var now = selectedDate;</pre><pre>var date = DateTime(now.year, now.month, now.day + index);</pre><pre>var day = DateFormat(‘d’).format(date);</pre><pre>var week = DateFormat(‘EEEE’).format(date);</pre><pre>var weekname = week.substring(0, 3);</pre><pre>var month = DateFormat(‘MMMM’).format(date).substring(0, 3);</pre><pre>tabDate.add(date);</pre><pre>return Column(</pre><pre>children: [</pre><pre>Text(weekname),</pre><pre>Text(</pre><pre>day.toString() + ‘ ‘ + month,</pre><pre>style: TextStyle(fontSize: 10),</pre><pre>),</pre><pre>],</pre><pre>);</pre><pre>});</pre><pre>return DefaultTabController(</pre><pre>length: myTabs.length,</pre><pre>child: Scaffold(</pre><pre>appBar: AppBar(</pre><pre>bottom: TabBar(</pre><pre>tabs: myTabs,</pre><pre>),</pre><pre>actions: [</pre><pre>IconButton(</pre><pre>icon: Icon(Icons.date_range),</pre><pre>onPressed: () =&gt; _selectDate(context),</pre><pre>)</pre><pre>],</pre><pre>title: Text(“Matches”),</pre><pre>),</pre><pre>body: TabBarView(</pre><pre>children: getWidgets(),</pre><pre>),</pre><pre>),</pre><pre>);</pre><pre>}</pre><pre>}</pre><p>Now you have your own customized dated tabs in your application. If anything you know something better, feel free to add a comment.</p><blockquote>Complete project, Github link : <a href="https://github.com/chetu-ko/flutter_example/tree/main/lib/dated_tabs">click Here</a></blockquote><h3><strong>Thank you…</strong></h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b90d40b79482" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Obfuscating with Flutter]]></title>
            <link>https://medium.com/@koppalc/obfuscating-with-flutter-207431ffb17a?source=rss-87bdf9e03232------2</link>
            <guid isPermaLink="false">https://medium.com/p/207431ffb17a</guid>
            <category><![CDATA[obfuscating]]></category>
            <category><![CDATA[obfuscating-flutter-code]]></category>
            <dc:creator><![CDATA[chetan koppal]]></dc:creator>
            <pubDate>Fri, 29 Oct 2021 06:54:27 GMT</pubDate>
            <atom:updated>2021-10-29T06:54:27.257Z</atom:updated>
            <content:encoded><![CDATA[<p>How rendering, performance and UI is important for application, also Making your code secure is important in development. Here is the flutter feature <a href="https://en.wikipedia.org/wiki/Obfuscation_(software)"><strong>Obfuscating </strong></a>that make your application code obfuscate and secure. Before moving to the implementation let’s Learn about the obfuscate.</p><h3><strong>What is obfuscate?</strong></h3><p>In general, <strong>obfuscate </strong>is making it difficult for humans to understand. Code obfuscation is the process of modifying an application binary code to make it harder for humans to understand. Obfuscation hides function and class names in your compiled code, this makes difficult for an attacker to reverse engineer your proprietary app.</p><p>Example of obfuscated code from a <a href="https://en.wikipedia.org/wiki/Just_another_Perl_hacker">JAPH</a>:</p><pre>@P=split//,&quot;.URRUU\c8R&quot;;@d=split//,&quot;\nrekcah xinU / lreP rehtona tsuJ&quot;;<strong>sub</strong> p{<br>@p{&quot;r$p&quot;,&quot;u$p&quot;}=(P,P);pipe&quot;r$p&quot;,&quot;u$p&quot;;++$p;($q*=2)+=$f=!fork;map{$P=$P[$f^ord<br>($p{$_})&amp;6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&amp;&amp;<br>close$_}%p;wait <strong>until</strong>$?;map{/^r/&amp;&amp;&lt;$_&gt;}%p;$_=$d[$q];sleep rand(2)<strong>if</strong>/\S/;<strong>print</strong></pre><p>For More example: <a href="https://en.wikipedia.org/wiki/Just_another_Perl_hacker">https://en.wikipedia.org/wiki/Just_another_Perl_hacker</a></p><blockquote>Before implementation of something, it is important know the advantages and disadvantages.</blockquote><h3><strong>Pros and Cons of Obfuscate</strong></h3><p><strong>Advantage</strong></p><ul><li>Faster loading time</li><li>Reduced memory usage</li><li>Protection for trade secrets</li><li>Prevention of circumvention</li><li>Prevention of virus detection</li></ul><p><strong>Disadvantage</strong></p><ul><li>obfuscation can make reading, writing, and reverse-engineering a program difficult and time-consuming,</li><li>It adds time and complexity to the build process for the developers.</li><li>Certain kinds of obfuscation can degrade performance and/or require Internet.</li></ul><h3><strong>Implementation…</strong></h3><p><strong>intro:</strong></p><p>The following list describes which platforms support the obfuscation process described in this page:</p><p><strong>Android</strong>/<strong>iOS : </strong>Supported as of Flutter 1.16.2. To obfuscate an app built against an earlier version of Flutter. <a href="https://github.com/flutter/flutter/wiki/Obfuscating-Dart-Code"><strong>Click here</strong></a></p><p><strong>macOS: </strong>macOS (<a href="https://flutter.dev/desktop">in alpha</a> as of Flutter 1.13), supports obfuscation as of Flutter 1.16.2</p><p><strong>Linux</strong>/<strong>Windows: </strong>Not yet supported.</p><p><strong>web: </strong>Obfuscation is not supported for web apps, but a web app can be <a href="https://en.wikipedia.org/wiki/Minification_(programming)">minified</a>, which is similar.</p><p><strong>Flutter’s code obfuscation, when supported, works only on a </strong><a href="https://flutter.dev/docs/testing/build-modes"><strong>release build</strong></a><strong>.</strong></p><p><strong>For App Bundle:</strong></p><p><em>Without</em> splitting:</p><pre>flutter build appbundle --obfuscate --split-debug-info=/&lt;directory&gt;</pre><p><em>With</em> Splitting:</p><pre>flutter build appbundle --target-platform android-arm,android-arm64,android-x64 --obfuscate --split-debug-info=/&lt;directory&gt;</pre><p><strong>For APK:</strong></p><p><em>Without</em> splitting:</p><pre>flutter build apk --obfuscate --split-debug-info=/&lt;directory&gt;</pre><p><em>With</em> Splitting:</p><pre>flutter build apk --target-platform android-arm,android-arm64,android-x64 --split-per-abi --obfuscate --split-debug-info=/&lt;directory&gt;</pre><p><em>Works only for Flutter version v1.16.2 or higher.</em></p><blockquote>To Know about &lt;directory&gt; see relative and folder path example</blockquote><p><strong>PS: About Splitting:</strong><br>By default, fat apk contains arm v7, arm v8 and x64 which increases apk size, which you don’t want to. So, when you split it, you have separate binaries which you can upload on the store and thus reducing the size of the apk that a user would need to download.</p><p>These Below example is about the <strong>&lt;directory&gt;</strong> mentioned in above command.</p><p><strong>Example using Relative Path:</strong></p><pre>flutter build apk --obfuscate --split-debug-info=./ProjectFolderName/debug</pre><p><strong>Example using Folder Path:</strong></p><pre>flutter build apk --obfuscate --split-debug-info=/Users/apple/Desktop/items/</pre><blockquote>If you still stuck on things see here :<strong><em> </em></strong><a href="https://stackoverflow.com/questions/50542764/how-to-obfuscate-flutter-apps"><strong><em>Click here</em></strong></a></blockquote><blockquote>More Info about the obfuscate: <a href="https://en.wikipedia.org/wiki/Obfuscation_(software)"><strong>Click here</strong></a></blockquote><h3><strong>Thank you…</strong></h3><p><strong>If this article helped you a bit, learnt new thing please clap!</strong></p><p><strong>if you find anything that could be improved please let me know, I would love to improve.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=207431ffb17a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PWA Support on Desktop and Mobile Using Flutter apps]]></title>
            <link>https://medium.com/@koppalc/pwa-support-on-desktop-and-mobile-using-flutter-apps-120f3a8b9c53?source=rss-87bdf9e03232------2</link>
            <guid isPermaLink="false">https://medium.com/p/120f3a8b9c53</guid>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[flutter-web]]></category>
            <category><![CDATA[pwa]]></category>
            <category><![CDATA[flutter-app-development]]></category>
            <dc:creator><![CDATA[chetan koppal]]></dc:creator>
            <pubDate>Tue, 14 Sep 2021 12:05:29 GMT</pubDate>
            <atom:updated>2021-09-28T16:45:45.628Z</atom:updated>
            <content:encoded><![CDATA[<h3>Intro:</h3><p>In this article you will learn. How to setup the flutter apps as<strong> PWA for both Desktop and Mobile using flutter</strong>. Before Moving into the setup let’s learn about <strong>what is PWA? </strong>in a brief.</p><h3>What is PWA (Progressive Web App)?</h3><p>Progressive web apps is combination of application and web. It is intended to work on all the platform that uses the a standards-compliant browser, including both desktop and mobile devices. PWA look as standalone application but works on browser.</p><p>If you think about the native application and progressive web apps in terms of the capabilities and performance, Native applications are the best capabilities, whereas web apps represent the best of reach.</p><h3>Why PWA?</h3><p>A lot of companies are on progressive web apps to modernize there website and reach the user expectation. <strong>How?</strong></p><p><em>There are some interesting facts user will be not satisfied with native application.</em></p><blockquote>Users of native application hate the delay and unreliability on mobile. fifty percent of smartphone users are using company’s website for there day to day shopping because of the storage, they don’t want to install and also the updating apps for every time when its trigger update message.</blockquote><p>When it’s come to the above facts PWA reach the user expectations. When user installs the PWA from website, whereas an installed PWA usually takes less than 1MB. According to those observations, we found out that users prefer experiences that are fast, installable, reliable, and engaging.</p><h3>Flutter PWA benefits:</h3><ul><li>Offline access — enables offline access to pages, since we can save the pages as apps</li><li>Faster loading time — if done correctly, it provides us with 3x time performance</li><li>App Like feel — with UI abilities and control provided by the flutter</li><li>No App store submission required — users can add these apps from any website through their browsers</li><li>Single code base — software developers can use the same code to ship a PWA, due to its cross-platform ability.</li></ul><h3>Let’s Setup PWA on flutter…..</h3><p>There are many ways to develop PWA but Flutter delivers high-quality PWAs that are integrated with a user’s environment, including installation, offline support, and tailored UX. Here you can deploy your flutter app on multiple platforms like Android, iOS, web.</p><h3>Implementation</h3><blockquote><strong>requirements </strong>: <strong>Flutter SDK and chrome</strong> must be installed in your local machine.</blockquote><p><strong>Setp1:</strong></p><p>Before moving to creation of new flutter project make sure to run the below command. To get PWA support for flutter apps, you have to be on <strong>stable </strong>channel.</p><pre>flutter channel stable<br>flutter upgrade<br>flutter doctor -v</pre><blockquote><strong>Warning: </strong>Running <em>flutter channel stable</em> replaces your current version of Flutter with the stable version and can take time if your connection is slow. After this, running <em>flutter upgrade</em> upgrades your install to the latest <em>stable</em>. Returning to another channel (beta, dev, or master) requires calling <em>flutter channel &lt;channel&gt;</em> explicitly.</blockquote><p>Confirm the chrome installation by running the below command. It will shown up the connected devices.</p><pre>flutter devices</pre><p><strong>Step2:</strong></p><p>Next step is to create the flutter project with web support. Don’t know how to create Flutter project see here, <a href="https://flutter.dev/docs/get-started/test-drive"><strong>https://flutter.dev/docs/get-started/test-drive</strong></a><strong>.</strong></p><p>Create the flutter project with CLI run the below commands.</p><pre>flutter create your_project_name<br>cd your_project_name</pre><p>Run the below command to enable the web support for flutter apps.</p><pre>flutter config --enable-web</pre><blockquote><strong><em>If you want to enable the web for existing flutter project run the below command. if web is already exist skip this.</em></strong></blockquote><blockquote>flutter create .</blockquote><blockquote><strong><em>Note :</em></strong><em> Please don’t forget to run it with that dot(.) either you will get some errors</em></blockquote><p>To serve your app from localhost in Chrome, enter the following from the top of the package:</p><pre>flutter run -d chrome</pre><p>The above command launches your flutter app on web. Once the app launches. web support is successful.</p><p><strong>Step3:</strong></p><p>This is the step where you do the exact PWA process in flutter. Here you will get one <strong>interesting fact</strong>, you need not do any changes in the code of flutter to make PWA. When you enable the web configuration in flutter apps it will already add the service workers to the app for run as PWA.</p><p>After that You need to run the command in your terminal to create a build folder, which is necessary to host your app on the web.</p><pre>flutter build web</pre><blockquote>Note: You not able test your PWA on localhost. You have to deploy your web on server.</blockquote><p>The above command will build the application and creates a directory called <strong>web inside the build folder</strong>. This will be the root folder for our project. Now we can make the necessary configuration changes in the manifest. Images, icons, themes can be changed as per required in the manifest file found in the <strong>web</strong> folder. After the above process, make sure that you are ready to deploy your application as PWA.</p><p><strong>Step4: Deploy the app on Surge for test</strong></p><h3>What is Surge?</h3><p>Surge is a static web publishing tool. It is widely used among Front-End Developers. Using surge is the best way for front end developers to publish static web applications into production. We can use surge to publish our PWA.</p><p><strong>REQUIREMENTS:</strong></p><ul><li>Install the latest version of <strong>node.js</strong></li></ul><blockquote>Node.js Link to download CLI <a href="https://nodejs.org/en/">https://nodejs.org/en/</a></blockquote><ul><li>Install surge using npm (node package manager)</li></ul><pre>on Windows — <strong>npm i -g surge<br></strong>on Mac — <strong>sudo npm i -g surge</strong></pre><p>The above command installs surge globally on your system. Then after the installation move to web directory inside the build folder to deploy the web.</p><pre>cd build<br>cd web</pre><p>Run the below command inside the web directory to deploy your web on surge server.</p><pre>surge</pre><p>This will give us a live link deployed on surge. The link will be denoted as <strong>domain</strong> and will have a file extension <strong>.sh</strong>. Open this file in your browser to view the application.</p><p>To remove an app from surge, run <strong>surge teardown </strong>followed by the URL name.</p><pre>surge teardown &lt;the_url given by the surge with .sh extension&gt;</pre><blockquote><strong>Note: after all the process you will not appear the install button on URL bar that because of the URL given by surge. The url is in the form of http, PWA install button will not appear on the http url. Make sure to make the url as </strong><a href="https://yourURL.sh"><strong>https://yourURL.sh</strong></a></blockquote><p>Now, you can run the URL on the web browser with <a href="https://yourURL.sh"><strong>https://yourURL.sh</strong></a><strong> </strong>and it will take while to load wait for few second. Once the website is loaded the install button will appear on the right side of the URL bar <strong>on desktops and in mobile phones </strong>it will appear in the bottom of the browser<strong> as add to home screen.</strong></p><p>For More info about the PWA Visit: <a href="https://web.dev/progressive-web-apps/"><strong>https://web.dev/progressive-web-apps/</strong></a></p><h3>You did it.. Thank You…</h3><p><strong>If this article helped you a bit, found interesting and learnt new thing please clap!👏</strong></p><p><strong>Thanks for reading this article if you find anything that could be improved please let me know, I would love to improve.💙</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=120f3a8b9c53" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>