<?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 Ruwan Sampath on Medium]]></title>
        <description><![CDATA[Stories by Ruwan Sampath on Medium]]></description>
        <link>https://medium.com/@ruwasoft?source=rss-47c75e4461a6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*XlNzmhzAEWiYjMAMq2VdEw.jpeg</url>
            <title>Stories by Ruwan Sampath on Medium</title>
            <link>https://medium.com/@ruwasoft?source=rss-47c75e4461a6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 13:19:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ruwasoft/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[Starlink Standard Kit: Why the Doubters Were Wrong and How It Changed My Daily Life]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://ruwasoft.medium.com/starlink-standard-kit-why-the-doubters-were-wrong-and-how-it-changed-my-daily-life-154792bcd521?source=rss-47c75e4461a6------2"><img src="https://cdn-images-1.medium.com/max/2600/1*AdexEskqviy8riph2uhk9g.jpeg" width="3120"></a></p><p class="medium-feed-snippet">Disclosure: This article contains an official Starlink referral link. If you decide to order your kit using the link below, you will&#x2026;</p><p class="medium-feed-link"><a href="https://ruwasoft.medium.com/starlink-standard-kit-why-the-doubters-were-wrong-and-how-it-changed-my-daily-life-154792bcd521?source=rss-47c75e4461a6------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://ruwasoft.medium.com/starlink-standard-kit-why-the-doubters-were-wrong-and-how-it-changed-my-daily-life-154792bcd521?source=rss-47c75e4461a6------2</link>
            <guid isPermaLink="false">https://medium.com/p/154792bcd521</guid>
            <category><![CDATA[spacex-starlink]]></category>
            <category><![CDATA[starlink-internet]]></category>
            <category><![CDATA[satellite-internet]]></category>
            <category><![CDATA[starlink-satellites]]></category>
            <category><![CDATA[starlink]]></category>
            <dc:creator><![CDATA[Ruwan Sampath]]></dc:creator>
            <pubDate>Sat, 29 Aug 2026 19:29:54 GMT</pubDate>
            <atom:updated>2026-08-29T19:29:54.506Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[How to integrate google mobile ads in flutter app]]></title>
            <link>https://ruwasoft.medium.com/how-to-integrate-google-mobile-ads-in-flutter-app-87083a94a169?source=rss-47c75e4461a6------2</link>
            <guid isPermaLink="false">https://medium.com/p/87083a94a169</guid>
            <category><![CDATA[monetization]]></category>
            <category><![CDATA[google-admob]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[admob]]></category>
            <category><![CDATA[banner-ads]]></category>
            <dc:creator><![CDATA[Ruwan Sampath]]></dc:creator>
            <pubDate>Mon, 28 Jun 2021 07:16:37 GMT</pubDate>
            <atom:updated>2021-06-28T07:18:20.581Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*60zos2JvwKO-yMt1smFQQw.jpeg" /><figcaption>Add Admob to your flutter app</figcaption></figure><p>The Google Mobile Ads SDK for Flutter currently supports loading and displaying banner, interstitial (full-screen), native ads, and rewarded video ads</p><p>To Integrating Google Mobile Ads SDK into a Flutter app, which you will do here.</p><p>click here to <a href="https://pub.dev/packages/google_mobile_ads#prerequisites"><em>Prerequisites</em></a></p><h3><strong>Step 1</strong></h3><p><strong>Adding the Google Mobile Ads plugin as a dependency</strong></p><p>add the <a href="https://pub.dev/packages/google_mobile_ads">Google Mobile Ads</a> plugin as a dependency to the pubspec.yaml file located at the root of the project.</p><pre>dependencies:<br>  google_mobile_ads: ^0.13.1</pre><h3><strong>Step 2</strong></h3><p><strong>Import to in your Dart code, you can use:</strong></p><pre>import &#39;package:google_mobile_ads/google_mobile_ads.dart&#39;;</pre><h3><strong>Step 3</strong></h3><p><strong>Setup for Specific Platform</strong></p><p><strong><em>Android</em></strong></p><p>Update <strong>AndroidManifest.xml</strong></p><ol><li>Open the android/app/src/main/AndroidManifest.xml file in Android Studio.</li><li>Add your AdMob app ID by adding a &lt;meta-data&gt; tag and entering com.google.android.gms.ads.APPLICATION_ID. as shown below. You can find your App ID in the <a href="https://support.google.com/admob/answer/7356431">AdMob UI</a>. For android:value insert your own AdMob App ID in quotes, as shown below.</li></ol><pre>&lt;!-- Sample AdMob App ID: ca-app-pub-3940256099942544~3347511713 --&gt;<br> &lt;meta-data<br>      android:name=&quot;com.google.android.gms.ads.APPLICATION_ID&quot;<br>      android:value=&quot;ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy&quot;/&gt;</pre><p>The AdMob App ID must be included in the AndroidManifest.xml. Failure to do so will result in a crash on the launch of an app.</p><p><strong><em>iOS</em></strong></p><p>Update your <strong>Info.plist</strong></p><ol><li>Open the ios/Runner/Info.plist file in Android Studio.</li><li>add a GADApplicationIdentifier key with a string value of your AdMob app ID (<a href="https://support.google.com/admob/answer/7356431">identified in the AdMob UI</a>) as shown below:</li></ol><pre>&lt;key&gt;GADApplicationIdentifier&lt;/key&gt;<br>&lt;string&gt;ca-app-pub-################~##########&lt;/string&gt;</pre><h3><strong>Step 4</strong></h3><p><strong>Initialize the Mobile Ads SDK</strong></p><p>Before loading ads, have your app initialize the Mobile Ads SDK by calling MobileAds.instance.initialize() which initializes the SDK and returns a Future that finishes once initialization is complete (or after a 30-second timeout). This needs to be done only once, ideally right before running the app.</p><pre>import &#39;package:google_mobile_ads/google_mobile_ads.dart&#39;;<br>import &#39;package:flutter/material.dart&#39;;<br><br>void main() {<br>  WidgetsFlutterBinding.ensureInitialized();<br>  MobileAds.instance.initialize();  //do it as this line<br><br>  runApp(MyApp());<br>}<br><br>class MyApp extends StatefulWidget {<br>  @override<br>  MyAppState createState() =&gt; MyAppState();<br>}<br><br>class MyAppState extends State&lt;MyApp&gt; {<br>  @override<br>  void initState() {<br>    super.initState();<br>    // Load ads.<br>  }<br>}</pre><h3><strong>Step 5</strong></h3><p><strong>Here is an Add a banner ad</strong></p><p>A BannerAd requires an adUnitId, an AdSize, an AdRequest, and an AdListener. An example is shown below as well as more information on each parameter follows.</p><pre>final BannerAd myBanner = BannerAd(<br>  adUnitId: &#39;&lt;ad unit id&gt;&#39;,<br>  size: AdSize.banner,<br>  request: AdRequest(),<br>  listener: AdListener(),<br>);</pre><p>To define a custom banner size, set your desired AdSize, as shown here:</p><pre>final AdSize adSize = AdSize(300, 50);</pre><p><strong>Banner Ad Events</strong></p><p>Through the use of AdListener, you can listen for lifecycle events, such as when an ad is closed or the user leaves the app. This example implements each method and logs a message to the console:</p><pre>final AdListener listener = AdListener(<br> // Called when an ad is successfully received.<br> onAdLoaded: (Ad ad) =&gt; print(&#39;Ad loaded.&#39;),<br> // Called when an ad request failed.<br> onAdFailedToLoad: (Ad ad, LoadAdError error) {<br>   print(&#39;Ad failed to load: $error&#39;);<br> },<br> // Called when an ad opens an overlay that covers the screen.<br> onAdOpened: (Ad ad) =&gt; print(&#39;Ad opened.&#39;),<br> // Called when an ad removes an overlay that covers the screen.<br> onAdClosed: (Ad ad) =&gt; print(&#39;Ad closed.&#39;),<br> // Called when an ad is in the process of leaving the application.<br> onApplicationExit: (Ad ad) =&gt; print(&#39;Left application.&#39;),<br>);</pre><p>After a BannerAd is instantiated, load() must be called before it can be shown on the screen.</p><pre>myBanner.load();</pre><p><strong>To display</strong> a BannerAd as a widget, you must instantiate an AdWidget with a supported ad after calling load(). You can create the widget before calling load(), but load() must be called before adding it to the widget tree.</p><pre>final AdWidget adWidget = AdWidget(ad: myBanner);</pre><p>AdWidget inherits from Flutter&#39;s Widget class and can be used as any other widget. On iOS, make sure you place the widget in a widget with a specified width and height. Otherwise, your Ad may not be displayed. A BannerAd can be placed in a container with a size that matches the ad:</p><pre>final Container adContainer = Container(<br>  alignment: Alignment.center,<br>  child: adWidget,<br>  width: myBanner.size.width.toDouble(),<br>  height: myBanner.size.height.toDouble(),<br>);</pre><p>Finally, release the resource associated with the BannerAd object by calling the BannerAd.dispose() method in the dispose() callback method.</p><pre>@override<br>void dispose() {<br>  // TODO: Dispose BannerAd object<br>  myBanner?.dispose();<br>  super.dispose();<br>}</pre><p>That’s it! Your app is now ready to display banner ads.</p><p><strong>Full Example</strong></p><pre>import &#39;package:flutter/material.dart&#39;;<br>import &#39;package:google_mobile_ads/google_mobile_ads.dart&#39;;<br><br><br>void main() {<br>  runApp(MaterialApp(<br>      debugShowCheckedModeBanner: false,<br>      home: MyApp()));<br>}<br><br>// You can also test with your own ad unit IDs by registering your device as a<br>// test device. Check the logs for your device&#39;s ID value.<br>const String testDevice = &#39;YOUR_DEVICE_ID&#39;;<br><br>class MyApp extends StatefulWidget {<br>  @override<br>  _MyAppState createState() =&gt; _MyAppState();<br>}<br><br>class _MyAppState extends State&lt;MyApp&gt; {<br><br>  BannerAd _bannerAd;<br><br>  @override<br>  void initState() {<br>    super.initState();<br>    _bannerAd = BannerAd(<br>      adUnitId: BannerAd.testAdUnitId,<br>      request: AdRequest(),<br>      size: AdSize.banner,<br>      listener: AdListener(<br>        onAdLoaded: (Ad ad) {<br>          print(&#39;$BannerAd loaded.&#39;);<br>        },<br>        onAdFailedToLoad: (Ad ad, LoadAdError error) {<br>          print(&#39;$BannerAd failedToLoad: $error&#39;);<br>        },<br>        onAdOpened: (Ad ad) =&gt; print(&#39;$BannerAd onAdOpened.&#39;),<br>        onAdClosed: (Ad ad) =&gt; print(&#39;$BannerAd onAdClosed.&#39;),<br>        onApplicationExit: (Ad ad) =&gt; print(&#39;$BannerAd onApplicationExit.&#39;),<br>      ),<br>    );<br><br>    _bannerAd?.load();<br>  }<br><br>  @override<br>  void dispose() {<br>    super.dispose();<br>    _bannerAd?.dispose();<br>    _bannerAd = null;<br>  }<br><br>  @override<br>  Widget build(BuildContext context) {<br>    final AdWidget adWidget = AdWidget(ad: _bannerAd);<br>    return Scaffold(<br>      appBar: AppBar(<br>        title: const Text(&#39;Google Mobile Ads&#39;),<br>        actions: &lt;Widget&gt;[<br>        ],<br>      ),<br>      body: Column(<br>        children: [<br>          Align(<br>            alignment: FractionalOffset.topCenter,<br>            child: Padding(<br>                padding: EdgeInsets.only(top: 10.0),<br>                child: Container(<br>                  alignment: Alignment.center,<br>                  child: adWidget,<br>                  width: _bannerAd.size.width.toDouble(),<br>                  height: _bannerAd.size.height.toDouble(),<br>                )<br>            ),<br>          )<br>        ],<br>      ),<br>    );<br>  }<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=87083a94a169" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to handle users permission with flutter]]></title>
            <link>https://ruwasoft.medium.com/how-to-handle-users-permission-with-flutter-86b216df3c80?source=rss-47c75e4461a6------2</link>
            <guid isPermaLink="false">https://medium.com/p/86b216df3c80</guid>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[android-permissions]]></category>
            <category><![CDATA[permission]]></category>
            <category><![CDATA[app-permissions]]></category>
            <category><![CDATA[flutter-app-development]]></category>
            <dc:creator><![CDATA[Ruwan Sampath]]></dc:creator>
            <pubDate>Sun, 06 Jun 2021 14:45:21 GMT</pubDate>
            <atom:updated>2021-06-06T14:45:21.147Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JCc_XC6pZn0KBEUCB6DBCA.png" /><figcaption>permission_handler package</figcaption></figure><p>Handle users permission with flutter is very simple.</p><p><strong><em>Lest do it</em></strong></p><h3><strong>1. Add this package to your pubspec.yaml file</strong></h3><p>permission_handler: ^4.2.0+hotfix.3</p><p>after adding this you need to run pub get</p><h3><strong>2 . Now in your Dart code, you can use:</strong></h3><pre><strong>import</strong> &#39;package:permission_handler/permission_handler.dart&#39;;</pre><h3><strong>3. Add This function for ask permission</strong></h3><p>_askPermission() async {<br> if (Platform.isIOS) {<br> /*Map&lt;PermissionGroup, PermissionStatus&gt; permissions =<br> */<br> await PermissionHandler().requestPermissions([PermissionGroup.photos]);<br> } else {<br> /* PermissionStatus permission = */ await PermissionHandler()<br> .checkPermissionStatus(PermissionGroup.storage);<br> }<br> }</p><p><strong>hint :</strong> in this case you need to change the PermissionGroup type according to your needs.</p><h3><strong>4. Call to that Function in initstate()</strong></h3><p>_askPermission();</p><h3><strong>5. Setup</strong></h3><p>While the permissions are being requested during runtime, you’ll still need to tell the OS which permissions your app might potentially use. That requires adding permission configuration to Android- and iOS-specific files.</p><p><strong>Android<em>:</em></strong></p><p><strong><em>Add the permissions to Manifest.xml fil</em>e. this need to import after the application closing tag</strong></p><p>&lt;uses-permission android:name=”android.permission.INTERNET” /&gt;<br> &lt;uses-permission android:name=”android.permission.WRITE_EXTERNAL_STORAGE”/&gt;<br> &lt;uses-permission android:name=”android.permission.READ_EXTERNAL_STORAGE” /&gt;<br> &lt;uses-permission android:name=”android.permission.SET_WALLPAPER” /&gt;</p><p>Note: this permission types need to change with your needs</p><p><strong>IOS</strong>:</p><p>Add permission to your Info.plist file</p><p><strong>All are done.. Congratulations…!</strong></p><p><strong>Additional reading</strong></p><p>I am using <a href="https://pub.dev/packages/permission_handler">permission_handler</a> package. But I have faced problem with installing the new version of that.</p><p>so install it like this</p><p>permission_handler: ^4.2.0+hotfix.3</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=86b216df3c80" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Google Play app description]]></title>
            <link>https://ruwasoft.medium.com/google-play-app-description-e1532fa5b069?source=rss-47c75e4461a6------2</link>
            <guid isPermaLink="false">https://medium.com/p/e1532fa5b069</guid>
            <category><![CDATA[google-play]]></category>
            <category><![CDATA[formatting]]></category>
            <category><![CDATA[style]]></category>
            <category><![CDATA[description]]></category>
            <category><![CDATA[play-store]]></category>
            <dc:creator><![CDATA[Ruwan Sampath]]></dc:creator>
            <pubDate>Sun, 06 Jun 2021 05:10:44 GMT</pubDate>
            <atom:updated>2021-06-06T05:10:44.980Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2SMSAjFNtCnoGDbjVhnAJw.png" /><figcaption>style text in play console description</figcaption></figure><p>You have made an Android application that is available on Google Play. Now You want to add some more formatting to your app description</p><p><strong><em>Tet’s do it</em></strong></p><p>Experimentally, I’ve discovered that you can provide:</p><ul><li>Single line breaks are ignored; double line breaks open a new paragraph.</li><li>Single line breaks can be enforced by ending a line with two spaces (similar to Markdown).</li><li>A limited set of HTML tags (optionally nested), specifically:</li><li>&lt;b&gt;…&lt;/b&gt; for boldface,</li><li>&lt;i&gt;…&lt;/i&gt; for italics,</li><li>&lt;u&gt;…&lt;/u&gt; for underline,</li><li>&lt;br /&gt; to enforce a single line break,</li><li>I could <strong>not</strong> find any way to get strikethrough working (neither HTML or Markdown style).</li><li>A fully-formatted URL such as http://google.com; this appears as a hyperlink.<br>(Beware that trying to use an HTML &lt;a&gt; tag for a custom description does <em>not</em> work and breaks the formatting.)</li><li>HTML character entities are supported, such as &amp;rarr; (→), &amp;trade; (™) and &amp;reg; (®); consult <a href="http://www.w3.org/TR/html4/sgml/entities.html">this W3 reference</a> for the exhaustive list.</li><li>UTF-8 encoded characters are supported, such as é, €, £, ‘, ’, ★ and ☆.</li><li>Indentation isn’t strictly possible, but using a bullet and em space character looks reasonable (&amp;#8226;&amp;#8195; yields &quot;• &quot;).</li><li>Emoji are also supported (though on the website depends on the user’s OS &amp; browser).</li></ul><p>Special notes concerning <strong><em>only</em> Google Play app</strong>:</p><ul><li>Some HTML tags only work in the app:</li><li>&lt;blockquote&gt;…&lt;/blockquote&gt; to indent a paragraph of text,</li><li>&lt;small&gt;…&lt;/small&gt; for slightly smaller text,</li><li>&lt;big&gt;…&lt;/big&gt; for slightly larger text,</li><li>&lt;sup&gt;…&lt;/sup&gt; and &lt;sub&gt;…&lt;/sub&gt; for super- and subscripts.</li><li>&lt;font color=&quot;#a32345&quot;&gt;…&lt;/font&gt; for setting font colors in HEX code.</li><li>Some symbols do not appear correctly, such as ‣.</li><li>All these notes also apply to the app’s “What’s New” section.</li></ul><p>Special notes concerning <strong><em>only</em> Google Play website</strong>:</p><ul><li>All HTML formatting appears as plain text in the website’s “What’s New” section (i.e. users will see the HTML source).</li></ul><p><a href="https://stackoverflow.com/questions/11071127/google-play-app-description-formatting">source</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e1532fa5b069" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Drop down menu - Flutter]]></title>
            <link>https://ruwasoft.medium.com/drop-down-menu-flutter-c620ca7589e9?source=rss-47c75e4461a6------2</link>
            <guid isPermaLink="false">https://medium.com/p/c620ca7589e9</guid>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[dropdown]]></category>
            <category><![CDATA[flutter-ui]]></category>
            <category><![CDATA[lists]]></category>
            <category><![CDATA[flutter-app-development]]></category>
            <dc:creator><![CDATA[Ruwan Sampath]]></dc:creator>
            <pubDate>Tue, 18 May 2021 06:03:15 GMT</pubDate>
            <atom:updated>2021-05-18T06:03:15.585Z</atom:updated>
            <content:encoded><![CDATA[<p>Today we are going to develop simple number list as drop down menu</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nqYyibGjpF3QVC2ShRKl1Q.jpeg" /></figure><h3><strong>Step 1 - Create new flutter Application — Give it a any name you like</strong></h3><h3><strong>Step 2 - Now we want to remove all the existing codes of the default application (don’t remove following codes)</strong></h3><pre>import &#39;package:flutter/material.dart&#39;;<br><br>void main() {<br>  runApp(MyApp());<br>}<br><br>class MyApp extends StatelessWidget {<br>  // This widget is the root of your application.<br>  @override<br>  Widget build(BuildContext context) {<br>    return MaterialApp(<br>      title: &#39;Drop down menu&#39;,<br>      theme: ThemeData(<br><br>        primarySwatch: Colors.<em>blue</em>,<br>      ),<br>      home: MyDropDown()<br>    );<br>  }<br>}</pre><h3><strong>Step 3 - Make a own brand new StatefulWidget</strong></h3><p>You can give any name. i am going to name it as MyDropDown. After creating this you need to give it name as home in MyApp class.</p><pre>home: MyDropDown()</pre><h3>Step 4 - Make a List in that created state class. in my case it name is _MyDropDownState</h3><pre>final List&lt;String&gt; numbers=[&quot;1&quot;,&quot;2&quot;,&quot;3&quot;,&quot;4&quot;,&quot;5&quot;,&quot;6&quot;,&quot;7&quot;,&quot;8&quot;,&quot;9&quot;,&quot;10&quot;];</pre><h3><strong>Step 5 - Make a variable for hold selected value</strong></h3><p>this is use to give initial value for the drop down list and also it can hold selected value from the drop down</p><pre>String _selectedValue=&quot;1&quot;;</pre><h3><strong>Step 6 - Return Scaffold widget in created State class</strong></h3><p>And inside the scaffold I would like to have a container. so that I can apply some padding to all the content that inside it. You can apply the padding by EdgeInsets.All. and on the child i will make a column widget.</p><pre>@override<br>Widget build(BuildContext context) {<br>  return Scaffold(<br>    body: Container(<br>      padding: EdgeInsets.all(32),<br>      child: Column(<br>        children: [</pre><pre>        ],<br>      ),<br>    ),<br>  );<br>}</pre><h3><strong>Step 7 - Make a Drop Down</strong></h3><p>Inside the column widget I would like to have drop down.</p><pre>DropdownButton &lt;String&gt;(<br>      value: _selectedValue,<br>      onChanged: (value){<br>        setState(() {<br>          _selectedValue=value;<br>        });<br>      },<br>      <br>      items: numbers.map&lt;DropdownMenuItem&lt;String&gt;&gt;((value){<br>        return DropdownMenuItem(<br>            child: Text(value),<br>            value: value,<br><br>        );<br>      }).toList(),<br><br>),</pre><p>ok. lest developed it. run it and test.. !</p><h3><strong>Our fianl code is like this</strong></h3><pre>import &#39;package:flutter/material.dart&#39;;<br><br>void main() {<br>  runApp(MyApp());<br>}<br><br>class MyApp extends StatelessWidget {<br>  // This widget is the root of your application.<br>  @override<br>  Widget build(BuildContext context) {<br>    return MaterialApp(<br>      title: &#39;Drop down menu&#39;,<br>      theme: ThemeData(<br><br>        primarySwatch: Colors.<em>blue</em>,<br>      ),<br>      home: MyDropDown()<br>    );<br>  }<br>}<br><br>class MyDropDown extends StatefulWidget {<br>  const MyDropDown({Key key}) : super(key: key);<br><br>  @override<br>  _MyDropDownState createState() =&gt; _MyDropDownState();<br>}<br><br>class _MyDropDownState extends State&lt;MyDropDown&gt; {<br><br>  final List&lt;String&gt; numbers=[&quot;1&quot;,&quot;2&quot;,&quot;3&quot;,&quot;4&quot;,&quot;5&quot;,&quot;6&quot;,&quot;7&quot;,&quot;8&quot;,&quot;9&quot;,&quot;10&quot;];<br><br>  String _selectedValue=&quot;1&quot;;<br><br>  @override<br>  Widget build(BuildContext context) {<br>    return Scaffold(<br>      body: Container(<br>        padding: EdgeInsets.all(32),<br>        child: Column(<br>          children: [<br>            DropdownButton &lt;String&gt;(<br>              value: _selectedValue,<br>              onChanged: (value){<br>                setState(() {<br>                  _selectedValue=value;<br>                });<br>              },<br>              <br>              items: numbers.map&lt;DropdownMenuItem&lt;String&gt;&gt;((value){<br>                return DropdownMenuItem(<br>                    child: Text(value),<br>                    value: value,<br><br>                );<br>              }).toList(),<br><br>        ),<br>          ],<br>        ),<br>      ),<br>    );<br>  }<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c620ca7589e9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to View Firebase real time database value in ListView in Flutter]]></title>
            <link>https://ruwasoft.medium.com/1-configure-firebase-flutter-f4f555960009?source=rss-47c75e4461a6------2</link>
            <guid isPermaLink="false">https://medium.com/p/f4f555960009</guid>
            <category><![CDATA[firebaserealtimedatabase]]></category>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[flutter-app-development]]></category>
            <category><![CDATA[listview]]></category>
            <dc:creator><![CDATA[Ruwan Sampath]]></dc:creator>
            <pubDate>Mon, 03 May 2021 18:09:48 GMT</pubDate>
            <atom:updated>2021-05-03T18:26:06.334Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JXHtV38ss9aNM4bYKM9U3g.jpeg" /><figcaption>I ‘m going to show you how to build listview using backend as firebase</figcaption></figure><h3>How to View Firebase Real Time Database Value from ListView in Flutter</h3><p>Today I’m going to show you example for view firebase data in Flutter Listview</p><h3>1. Connect Your Project with firebase</h3><p>I assume that you have already know to connect the application with firebase. if not just search in youtube and come to next part.</p><h3>2: Adding Dependencies</h3><p>You should add the dependency in pubspec.yaml file for working with firebase.</p><p>dependencies:<br> flutter:<br> sdk: flutter<br> cupertino_icons: ^0.1.2<br> firebase_core: ^0.4.0+6<br> firebase_database: ^3.0.4<br> intl: ^0.15.8</p><h3>3. Create Db Reference</h3><p>final ref= FirebaseDatabase.instance.reference().child(“OrderHistory”);</p><h3>4. Create Db Model</h3><p>Now we have to create database model to store reading value from firebase. and this model use to create object of an model for store reading data.</p><p>Create new dart file as OrderHistoryModel.dart</p><p>class OrderHistoryModel<br>{<br> String name;<br> String picture;<br> String price;<br> String quantity;<br> String date;</p><p>OrderHistoryModel({<br> this.name,<br> this.picture,<br> this.price,<br> this.quantity,<br> this.date,<br> });<br>}</p><h3>5. Create List using Created Db Model</h3><p>This list use to store collections objects of a db model</p><p>List&lt;OrderHistoryModel&gt; Products_on_the_order_history=List();</p><h3>6. Read data from the firebase</h3><p>you can add new function with this code and call it from initstate()</p><p>try{<br> await ref.once().then((DataSnapshot snapshot) {<br> var data = snapshot.value;</p><p>Products_on_the_order_history.clear();</p><p>data.forEach((key,value)<br> {<br> OrderHistoryModel model = new OrderHistoryModel(<br> name: value[“ptitle”],<br> picture: value[“img”],<br> price: value[“price”],<br> quantity: value[“qty”],<br> date: value[“date”],</p><p>);<br> setState(() {<br> Products_on_the_order_history.add(model);<br> });</p><p>print(model.name);<br> print(model.picture);</p><p>}<br> );</p><p>});<br> }<br> catch(e)<br> {<br> print(e);<br> }</p><h3>7 Use widget to return single item from the list</h3><p><a href="http://twitter.com/override">@override</a><br> Widget build(BuildContext context) {<br> return new ListView.builder(<br> itemCount: Products_on_the_order_history.length,<br> itemBuilder: (context, index){<br> return Single_order_history_product(<br> order_history_product_name: Products_on_the_order_history[index].name,<br> order_history_prod_picture: Products_on_the_order_history[index].picture,<br> order_history_prod_price: Products_on_the_order_history[index].price,<br> order_history_prod_qty: Products_on_the_order_history[index].quantity,<br> order_history_product_date: Products_on_the_order_history[index].date,</p><p>);<br> });<br> }</p><h3>8 Create class to Build List of items one by one</h3><p>class Single_order_history_product extends StatelessWidget {</p><p>final order_history_product_name;<br> final order_history_prod_picture;<br> final order_history_prod_price;<br> final order_history_prod_qty;<br> final order_history_product_date;</p><p>Single_order_history_product({<br> this.order_history_product_name,<br> this.order_history_prod_picture,<br> this.order_history_prod_price,<br> this.order_history_prod_qty,<br> this.order_history_product_date,<br> });</p><p><a href="http://twitter.com/override">@override</a><br> Widget build(BuildContext context) {</p><p>String PImg = order_history_prod_picture;</p><p>print(“PImg”);<br> print(PImg);</p><p>return Card(</p><p>child: ListTile(</p><p>//=============== LEADING SECTION ===============================<br> leading: FadeInImage.assetNetwork(<br> placeholder: ‘assets/open_box.png’,<br> image:PImg,<br> height: 80.0,<br> width: 80.0,<br> fit: BoxFit.contain,<br> ),</p><p>// =========== TITLE SECTION ==============================<br> title: new Text(order_history_product_name),</p><p>////end of title===========================================</p><p>// ========== SUBTITLE SECTION ==================================<br> subtitle: new Column(<br> children:&lt;Widget&gt; [</p><p>//======for product price==========================<br> new Row(<br> children: [<br> // =============this section is for the Product price =========================<br> Padding(<br> padding: const EdgeInsets.only(top:5.0),<br> child: new Text(“\Rs.${order_history_prod_price}”,style: TextStyle(color: Colors.black87),),<br> ),</p><p>//end of product price=================================<br> ],</p><p>),<br> //end of price container ==================================</p><p>//Row inside the column<br> new Row(<br> children: &lt;Widget&gt; [</p><p>//==========this section is for the qty of the product=========<br> Padding(<br> padding: const EdgeInsets.all(0.0),<br> child: new Text(“Qty :”),<br> ),</p><p>Padding(<br> padding: const EdgeInsets.all(4.0),<br> child: new Text(order_history_prod_qty,style: TextStyle(color: Colors.orangeAccent),),<br> ),<br> //end of qty of the product</p><p>//==============this section is for oder received date ==========================<br> new Padding(padding: const EdgeInsets.fromLTRB(15.0, 8.0, 8.0,8.0),<br> child: new Text(“Date :”),<br> ),<br> Padding(<br> padding: const EdgeInsets.all(4.0),<br> child: new Text(order_history_product_date,style: TextStyle(color: Colors.orangeAccent)),<br> ),</p><p>//=======================end of received date</p><p>],<br> ),</p><p>],<br> ),</p><p>//========================================================================<br> ),<br> );<br> }</p><p>}</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f4f555960009" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flutter & Firebase Realtime Database- Tutorial]]></title>
            <link>https://ruwasoft.medium.com/flutter-firebase-realtime-database-tutorial-980c2b965a21?source=rss-47c75e4461a6------2</link>
            <guid isPermaLink="false">https://medium.com/p/980c2b965a21</guid>
            <category><![CDATA[push]]></category>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[realtime-database]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[save]]></category>
            <dc:creator><![CDATA[Ruwan Sampath]]></dc:creator>
            <pubDate>Sun, 02 May 2021 16:20:23 GMT</pubDate>
            <atom:updated>2021-05-02T16:20:23.005Z</atom:updated>
            <content:encoded><![CDATA[<p>Let’s explore firebase realtime database by creating a simple chat app. where anyone can post message publically</p><h3>1: Configure Firebase &amp; Flutter</h3><p>I assume that you have already know to connect flutter application with firebase. First you have to connect with firebase</p><h3>2: Adding Dependencies</h3><pre>dependencies:<br>  flutter:<br>    sdk: flutter<br>  cupertino_icons: ^0.1.2<br>  firebase_core: ^0.4.0+6<br>  firebase_database: ^3.0.4<br>  intl: ^0.15.8</pre><h3>3: Working with Code</h3><p>Now we can start writing code with our main.dart</p><p>Let’s create a db reference chat to store our messages. &amp; _txtCtrl for handling user inputs</p><pre>var _firebaseRef = FirebaseDatabase().reference().child(&#39;chats&#39;);<br>TextEditingController _txtCtrl = TextEditingController();</pre><p>Now using _firebaseRef we can add, read, update, delete data with chat</p><h4>Insert Data to Firebase Realtime Database</h4><pre>sendMessage() {<br>    _firebaseRef.push().set({<br>        &quot;message&quot;: _txtCtrl.text,<br>        &quot;timestamp&quot;: DateTime.now().millisecondsSinceEpoch<br>    });<br>}</pre><p>this code can insert(push) data into firebase</p><h4>Delete Data to Firebase Realtime Database</h4><pre>deleteMessage(key) {<br>    _firebaseRef.child(key).remove();<br>}</pre><p>Using this code, we delete child with key</p><h4>Update Data to Firebase Realtime Database</h4><pre>updateTimeStamp(key) {<br>    _firebaseRef<br>        .child(key)<br>        .update({&quot;timestamp&quot;: DateTime.now().millisecondsSinceEpoch});<br>}</pre><p>Using this code, we’re updating the timestamp of particular message based on key</p><h4>Read data from firebase Realtime Database</h4><p>To display firebase data into our app, we need StreamBuilder.</p><pre>StreamBuilder(<br>    stream: _firebaseRef.onValue,<br>    builder: (context, snap) {<br><br>        if (snap.hasData &amp;&amp; !snap.hasError &amp;&amp; snap.data.snapshot.value != null) {<br><br>            Map data = snap.data.snapshot.value;<br>            List item = [];<br><br>            data.forEach((index, data) =&gt; item.add({&quot;key&quot;: index, ...data}));<br><br>            return ListView.builder(<br>                    itemCount: item.length,<br>                    itemBuilder: (context, index) {<br>                    return ListTile(<br>                        title: Text(item[index][&#39;message&#39;]),<br>                        trailing: Text(DateFormat(&quot;hh:mm:ss&quot;)<br>                            .format(DateTime.fromMicrosecondsSinceEpoch(<br>                                item[index][&#39;timestamp&#39;] * 1000))<br>                            .toString()),<br>                        onTap: () =&gt;<br>                            updateTimeStamp(item[index][&#39;key&#39;]),<br>                        onLongPress: () =&gt;<br>                            deleteMessage(item[index][&#39;key&#39;]),<br>                    );<br>                    },<br>                );<br>        }<br>        else<br>            return Text(&quot;No data&quot;);<br>    },<br>)</pre><p><strong>Explanation:</strong></p><ul><li>We created StreamBuilder based on _firebaseRef.onValue, which means, we update stream builder whenever data changes on firebase (CRUD)</li><li>If there is an error with data or null, we display Text Widget with “No data”</li><li>If there is no error, we’re storing all messages (snap.data.snapshot.value) into Map data</li><li>Since firebase key are unpredictable, we have used forEach to push data into item</li></ul><p>Before</p><pre>{-Lk30mSI-ObTUuy730c4: {message: gbrjv dl, timestamp: 1563435680036}, -Lk30mXd97oFihH_5MVR: {message: gbrjv dl, timestamp: 1563435679414}, -Lk30izl-cQ7IdtKeo4i: {message: ghrhr, timestamp: 1563435678204}}</pre><p>After</p><pre>[{key: -Lk30mSI-ObTUuy730c4, message: gbrjv dl, timestamp: 1563435680036}, {key: -Lk30mXd97oFihH_5MVR, message: gbrjv dl, timestamp: 1563435679414}, {key: -Lk30izl-cQ7IdtKeo4i, message: ghrhr, timestamp: 1563435678204}]</pre><ul><li>Once everything is fine, we use ListView.builder() &amp; ListTile for displaying data</li><li>When user Tap, we update timestamp &amp; with longpress, we delete data</li></ul><p>This code we display a TextField with Buttons</p><pre>Container( child: Row(children: &lt;Widget&gt;[<br>        Expanded(child: TextField(controller: _txtCtrl)),<br>        SizedBox(<br>            width: 80,<br>            child: OutlineButton(child: Text(&quot;Add&quot;), onPressed: () =&gt; sendMessage()))<br>    ])<br>);</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=980c2b965a21" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to display a toast message in flutter ?]]></title>
            <link>https://ruwasoft.medium.com/how-to-display-a-toast-message-in-flutter-1560f8acbb06?source=rss-47c75e4461a6------2</link>
            <guid isPermaLink="false">https://medium.com/p/1560f8acbb06</guid>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[message]]></category>
            <category><![CDATA[toast]]></category>
            <category><![CDATA[alerts]]></category>
            <category><![CDATA[flutter-app-development]]></category>
            <dc:creator><![CDATA[Ruwan Sampath]]></dc:creator>
            <pubDate>Sat, 01 May 2021 18:06:31 GMT</pubDate>
            <atom:updated>2021-05-01T18:06:31.538Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to display a toast message in flutter ?</h3><ol><li>First you need to import the package</li></ol><pre>import &#39;package:fluttertoast/fluttertoast.dart&#39;;</pre><p>2. Then show your toast like this.</p><pre>Fluttertoast.<em>showToast</em>(<br>    msg: &quot;Your Message here!&quot;,<br>    toastLength: Toast.LENGTH_SHORT,<br>    gravity: ToastGravity.CENTER,<br>    timeInSecForIosWeb: 1,<br>    backgroundColor: Colors.<em>green</em>,<br>    textColor: Colors.<em>white</em>,<br>    fontSize: 16.0);</pre><p>NOTE : if you need to show the toast in bottom change gravity as BOTTOM</p><pre>gravity: ToastGravity.BOTTOM,</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1560f8acbb06" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to get user inputs with flutter]]></title>
            <link>https://ruwasoft.medium.com/how-to-get-user-inputs-with-flutter-2ec42b56a14?source=rss-47c75e4461a6------2</link>
            <guid isPermaLink="false">https://medium.com/p/2ec42b56a14</guid>
            <category><![CDATA[save]]></category>
            <category><![CDATA[input-field]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[textfield]]></category>
            <category><![CDATA[button-click]]></category>
            <dc:creator><![CDATA[Ruwan Sampath]]></dc:creator>
            <pubDate>Tue, 27 Apr 2021 21:14:57 GMT</pubDate>
            <atom:updated>2021-04-28T14:19:50.101Z</atom:updated>
            <content:encoded><![CDATA[<p>How to get user inputs with flutter</p><ol><li>First you need to Create object of TextEditingController as a global variable in your State class</li></ol><p>final emailController = new TextEditingController();</p><p>2. Then set it into your TextField widget</p><p>TextField(<br> controller: emailController, //as this line<br> obscureText: true,<br> textAlign: TextAlign.left,<br> decoration: InputDecoration(<br> border: InputBorder.none,<br> hintText: ‘PLEASE ENTER YOUR EMAIL’,<br> hintStyle: TextStyle(color: Colors.grey),<br> ),<br>)</p><p>3. Now you can get the value from anywhere using,</p><p>emailController.text;</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2ec42b56a14" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How To Solve Automatically Pin Dragon Center And Xbox To the taskbar when restart the MSI Laptop ?]]></title>
            <link>https://ruwasoft.medium.com/how-to-solve-automatically-pin-dragon-center-and-xbox-to-the-taskbar-when-restart-the-msi-laptop-737ac3d02144?source=rss-47c75e4461a6------2</link>
            <guid isPermaLink="false">https://medium.com/p/737ac3d02144</guid>
            <category><![CDATA[windows-10]]></category>
            <category><![CDATA[pin]]></category>
            <category><![CDATA[msi-laptop]]></category>
            <category><![CDATA[taskbar-issues-support]]></category>
            <category><![CDATA[automatically]]></category>
            <dc:creator><![CDATA[Ruwan Sampath]]></dc:creator>
            <pubDate>Sat, 24 Apr 2021 09:21:49 GMT</pubDate>
            <atom:updated>2021-04-24T14:20:27.523Z</atom:updated>
            <content:encoded><![CDATA[<p>How to solve automatically pin dragon center and Xbox yo the taskbar when restart the MSI laptop ? Read This…</p><p>Many MSI users have the problem about this. When they unpin dragon center and Xbox from the taskbar, its automatically pin again after restart the laptop. Today I am going to show you how to solve this problem.</p><p>go to this file path</p><p>C:\Users\&lt;Your_User_Name&gt;\AppData\Local\Microsoft\Windows\Shell</p><p>You can see LayoutModification.xml file in this folder and open it with any of your text editor. Look for CustomTaskbarLayoutCollection tag and find the lines for Dragon center and Xbox. Remove that lines and save your Xml.</p><p>Reboot and test. they don’t show again !</p><p>Thank You</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=737ac3d02144" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>