<?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 Sravan on Medium]]></title>
        <description><![CDATA[Stories by Sravan on Medium]]></description>
        <link>https://medium.com/@sravanpabolu?source=rss-288510c83907------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*kl1DZZTAuAqzHcX-</url>
            <title>Stories by Sravan on Medium</title>
            <link>https://medium.com/@sravanpabolu?source=rss-288510c83907------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 12:44:47 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sravanpabolu/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[Flutter — Using Multiple Futures in single widget]]></title>
            <link>https://sravanpabolu.medium.com/flutter-using-multiple-futures-in-single-widget-9c623206dce3?source=rss-288510c83907------2</link>
            <guid isPermaLink="false">https://medium.com/p/9c623206dce3</guid>
            <category><![CDATA[futurebuilder]]></category>
            <category><![CDATA[future]]></category>
            <category><![CDATA[flutter-app-development]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[Sravan]]></dc:creator>
            <pubDate>Sun, 14 Mar 2021 10:18:17 GMT</pubDate>
            <atom:updated>2021-03-14T10:18:17.011Z</atom:updated>
            <content:encoded><![CDATA[<h3>Flutter — Using Multiple Futures in single widget</h3><p>Welcome to <strong><em>How do I</em></strong> series…</p><p><em>In this blog post, we’ll learn, how to create a build a widget, with multiple Futures in Flutter</em></p><p>Imagine a scenario where we need to depend more than one condition. Let’s consider the following scenario.</p><figure><img alt="Flowchart" src="https://cdn-images-1.medium.com/max/830/1*2jXFkGcZHF_9577aXpAf-Q.png" /><figcaption>Flow chart</figcaption></figure><p>To achieve this, we will use</p><ol><li>a function that returns aFuture to determine if the app is opened for first time.</li><li>a function that returns a Future to determine if the user session is active.</li></ol><p>Let’s see using multiple futures in flutter within single widget. For this, we will use Future.wait(), that waits for multiple futures to complete and collects their results. The value of the returned future will be a list of all the values that were produced in the order that the futures are provided by iterating [futures].</p><p>In our example, we will useFuture.wait([_checkFirstTimeInstall(), _getAuthSession()])</p><p>Future.wait([_checkFirstTimeInstall(), _getAuthSession()])</p><p>Now, the complete widget code would be like this</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dc56071ff7d182d2954e34de808617bf/href">https://medium.com/media/dc56071ff7d182d2954e34de808617bf/href</a></iframe><p>That’s it. You are done.</p><p>Please Clap and Share if you like it. Follow, to receive occasional updates.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9c623206dce3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Create a TabBar without DefaultTabController in Flutter]]></title>
            <link>https://sravanpabolu.medium.com/create-a-tabbar-without-defaulttabcontroller-in-flutter-831b680335e2?source=rss-288510c83907------2</link>
            <guid isPermaLink="false">https://medium.com/p/831b680335e2</guid>
            <category><![CDATA[segmentcontrol]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[segment]]></category>
            <category><![CDATA[tab-bar]]></category>
            <dc:creator><![CDATA[Sravan]]></dc:creator>
            <pubDate>Sun, 17 Jan 2021 18:36:25 GMT</pubDate>
            <atom:updated>2021-01-19T10:49:03.181Z</atom:updated>
            <content:encoded><![CDATA[<p>Welcome to <strong><em>How do I</em></strong> series…</p><p><em>In this blog post, we’ll learn, how to create a Tab bar without DefaultTabBarController, in Flutter.</em></p><p>In this Example, we will be using Cupertino package for using <em>CupertinoSegmentedControl</em>. So create a new class named <em>tab_screen.dart </em>and import</p><blockquote>import ‘package:flutter/cupertino.dart’;</blockquote><p>Create a Stateful widget by name TabScreen, your code should look like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/990/1*yER3iK064GJNEOnIluOiLA.png" /></figure><p>Now, in the <em>main.dart</em> file, modify <em>body</em> parameter as</p><blockquote>body: TabScreen()</blockquote><p>Save and check your device. it should show 3 tabs. We are now ready to configure this segment control or tab bar control.</p><p>Add a variable to store the index of tab, configure Segment control with variety of colors and implement method definition for _tabChanged. Your code should look like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/676/1*Ka-Ig81b-W5LhgjsMEyUsA.png" /></figure><p>Now start playing with Tabs. It’s time to implement the Tab view, for the selected tab.</p><p>Create 3 new classes Bike, Car, Plane.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/1*FAexxC4SwZhBAgLlEYZOWA.png" /></figure><p>Wrap CupertinoSegmentedControl in Column, so that our view can be second child in the column. Add implementation for our selected view like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/668/1*RfX-6N-iw5fjriP8vNamkQ.png" /></figure><p>Now run on your device. You should get this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*LZ8JcbAqkbRQMJ1UVtuiHA.gif" /></figure><p>That’s it. You are done.</p><p><strong>Add-ons:</strong></p><p><strong>Tip 1:</strong> Use Expanded to occupy the remaining space of column. So, the code would be</p><blockquote>Expanded(child: _showSelectedView()),</blockquote><p><strong>Tip 2:</strong> As segment takes Tab as input, you can use icons like this.</p><blockquote>Tab(child: Icon(Icons.bike_scooter)),</blockquote><p>You can find the source code for the project <a href="https://github.com/sravanpabolu/FlutterTabBar">here</a></p><p>Please share if you like it. Follow, to receive occasional updates.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=831b680335e2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using DateTime picker in React Native — an example]]></title>
            <link>https://sravanpabolu.medium.com/using-datetime-picker-in-react-native-an-example-5f2d75bac9c7?source=rss-288510c83907------2</link>
            <guid isPermaLink="false">https://medium.com/p/5f2d75bac9c7</guid>
            <category><![CDATA[datepicker]]></category>
            <category><![CDATA[example]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[beginner]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Sravan]]></dc:creator>
            <pubDate>Fri, 23 Oct 2020 02:36:10 GMT</pubDate>
            <atom:updated>2020-10-23T02:37:32.057Z</atom:updated>
            <content:encoded><![CDATA[<h3>Using DateTime picker in React Native — an example</h3><p><em>In this blog post, We’ll learn, how to develop a simple react native app, where user can click a button to open date picker, select a date and come back to previous screen, with the selected date displayed to a label</em></p><p>In this Example, we will be using</p><ol><li>React hooks - inside DatePicker component</li><li>Call backs — For getting the selected date from DatePicker to App</li></ol><h3>Prerequisite</h3><p>I am going to use react-native-modal-datetime-picker npmjs module in this example. I am using version 8.7.1 and the github link for the repo is <a href="https://github.com/mmazzarolo/react-native-modal-datetime-picker">here</a></p><h3>Getting Started</h3><p>Assuming that you have already created react native project, install the following package in terminal using the following command</p><p>npm i react-native-modal-datetime-picker @react-native-community/datetimepicker</p><p>Create a new file named DatePicker.jsx and paste the following code</p><pre>import React, { useState } from &quot;react&quot;;<br>import { View, Button } from &quot;react-native&quot;;<br>import DateTimePickerModal from &quot;react-native-modal-datetime-picker&quot;;<br><br>const DatePicker = ({ selectedDateCallback }) =&gt; {<br>    const [isDatePickerVisible, setDatePickerVisibility] = useState(false);<br><br>    const showDatePicker = () =&gt; {<br>        setDatePickerVisibility(true);<br>    };<br><br>    const hideDatePicker = () =&gt; {<br>        setDatePickerVisibility(false);<br>    };<br><br>    const handleConfirm = (date) =&gt; {<br>        console.log(&quot;A date has been picked: &quot;, date);<br>        hideDatePicker();<br><br>        //send back to parent component<br>        selectedDateCallback(date);<br>    };<br><br>    return (<br>        &lt;View&gt;<br>            &lt;Button onPress={showDatePicker} title=&quot;Show Date Picker &quot;&gt;&lt;/Button&gt;<br>            &lt;DateTimePickerModal<br>                isVisible={isDatePickerVisible}<br>                mode=&quot;date&quot;<br>                onConfirm={handleConfirm}<br>                onCancel={hideDatePicker}<br>            /&gt;<br>        &lt;/View&gt;<br>    );<br>};<br><br>export default DatePicker;</pre><p>Now, Lets come back to App.js<br>First, Add Import</p><p>import DatePicker from &#39;./DatePicker&#39;</p><p>Next, Add the following code above return() method</p><pre>const [aDate, setDate] = useState(new Date());<br><br>dateCallback = (selectedDate) =&gt; {<br>        const currentDate = selectedDate || aDate;<br>        this.state.date = currentDate ;<br>        console.log(&quot;Selected date =&gt; &quot; + currentDate)<br>}</pre><p>Atlast, Add the following code in return() method</p><p>&lt;DatePicker selectedDateCallback={this.dateCallback} /&gt;</p><p>Now, Save all the changes run the app in iOS Simulator or Android emulator or your own device to see the output. You can find the source code for the project <a href="https://github.com/sravanpabolu/DatePickerExampleReactNative">here</a></p><p>Find the screenshots below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*uGrZP5jdSy7PmSi75ZKAOQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*Cs2eJx1mumQ5KmWsRfRdDQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5f2d75bac9c7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>