<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: maheenriaz</title>
    <description>The latest articles on DEV Community by maheenriaz (@maheenriaz).</description>
    <link>https://dev.to/maheenriaz</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F786432%2Fc10f28f2-580a-4d5f-ab76-8fd79ef988a0.jpeg</url>
      <title>DEV Community: maheenriaz</title>
      <link>https://dev.to/maheenriaz</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/maheenriaz"/>
    <language>en</language>
    <item>
      <title>What is a Flatlist? How we use Flatlist in react-native:</title>
      <dc:creator>maheenriaz</dc:creator>
      <pubDate>Mon, 10 Jan 2022 12:36:58 +0000</pubDate>
      <link>https://dev.to/zenkoders/what-is-a-flatlist-how-we-use-flatlist-in-react-native-1561</link>
      <guid>https://dev.to/zenkoders/what-is-a-flatlist-how-we-use-flatlist-in-react-native-1561</guid>
      <description>&lt;p&gt;Rather than showing the list of items using the map function on an array and returning some JSX for each item in that array and then embedding that inside a scrollview so we can scroll up and down in that list.&lt;br&gt;
Another way of showing a list that is better to use in any condition is Flatlist. In Flatlist, we don’t need to use scrollview because Flatlist comes with the ability to scroll up and down the list so we will get rid of that instead of importing.&lt;/p&gt;
&lt;h2&gt;
  
  
  How to use:
&lt;/h2&gt;

&lt;p&gt;First of all, we need our Flatlist components. We don’t have an opening and a closing tag. Flatlist is a self-closing component. And here we have different numbers of props that control how our list works. So first props are:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Data:&lt;/strong&gt;&lt;br&gt;
 Data props specify the data that we want to show. We have to pass data as an array. e.g. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Render Item:&lt;/strong&gt;&lt;br&gt;
 This prop is going to be a function. Now this function return some jsx with some item in the array that we are iterating we have to destructure it because it is not just the item &lt;br&gt;
&lt;code&gt;e.g. &amp;lt;Flatlist. renderItem={({item})=&amp;gt;(&lt;br&gt;
return(&amp;lt;Text&amp;gt;{people.name}&amp;lt;/Text&amp;gt;)&lt;br&gt;
       )} /&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. numColumns:&lt;/strong&gt;&lt;br&gt;
 numColumns props are used to show data in multiple columns.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Horizontal:&lt;/strong&gt;&lt;br&gt;
 If this prop is true, then data will be displayed horizontally.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. KeyExtractor:&lt;/strong&gt;&lt;br&gt;
 It is used to specify the unique value in the given lists of items.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. ListHeaderComponent:&lt;/strong&gt;&lt;br&gt;
 This prop render at the top of the item&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. ListFooterComponent:&lt;/strong&gt;&lt;br&gt;
 This prop render at the end of the item&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8. Refreshing:&lt;/strong&gt;&lt;br&gt;
 Set true while waiting for new data to refresh&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Implementation:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React from "react";
import { StyleSheet, Text, View, FlatList } from "react-native";
const Person = [
  {
    id: "1",
    name: "Alex"
  },
  {
    id: "2",
    name: "Michel"
  },
  {
    id: "3",
    name: "Robert"
  },
  {
    id: "4",
    name: "William"
  },
  {
    id: "5",
    name: "James"
  }
];

const Item = ({ title }) =&amp;gt; {
  return (
    &amp;lt;View style={styles.item}&amp;gt;
      &amp;lt;Text&amp;gt;{title}&amp;lt;/Text&amp;gt;
    &amp;lt;/View&amp;gt;
  );
};

export default function App() {
  const renderItem = ({ item }) =&amp;gt; (
    &amp;lt;Item style={styles.text} title={item.name} /&amp;gt;
  );
  return (
    &amp;lt;View style={styles.container}&amp;gt;
      &amp;lt;FlatList
        data={Person}
        renderItem={renderItem}
        keyExtractor={(item) =&amp;gt; item.id}
      /&amp;gt;
    &amp;lt;/View&amp;gt;
  );
}

const styles = StyleSheet.create({
  container: {
    marginTop: 30,
    padding: 2
  },
  item: {
    backgroundColor: "green",
    padding: 20,
    marginVertical: 8,
    marginHorizontal: 16
  },
  text: {
    color: "red"
  }
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Code Output:
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bI3yia1r--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/otwhn2r21jd6o230p6dz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bI3yia1r--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/otwhn2r21jd6o230p6dz.png" alt="code" width="512" height="437"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to change the app name in react-native(in android and IOS):
</title>
      <dc:creator>maheenriaz</dc:creator>
      <pubDate>Thu, 06 Jan 2022 07:36:40 +0000</pubDate>
      <link>https://dev.to/zenkoders/how-to-change-the-app-name-in-react-nativein-android-and-ios-573i</link>
      <guid>https://dev.to/zenkoders/how-to-change-the-app-name-in-react-nativein-android-and-ios-573i</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;In Android:&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;To change the app name in react native first go to your project folder and open this path in VScode,&lt;br&gt;
android/app/src/main/res/values/string.xml&lt;br&gt;
Now you can easily change the app name in the string tag.&lt;br&gt;
For example:&lt;br&gt;
&lt;code&gt;&amp;lt;string name="app_name"&amp;gt;YOUR_APP_NAME&amp;lt;/string&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;After changing the app name, uninstall the previous app from your device and run these commands:&lt;br&gt;
&lt;code&gt;$ cd android &lt;br&gt;
 $ ./gradlew clean &lt;br&gt;
 $ cd ..&lt;br&gt;
 $ react-native run-android&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;For IOS:&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Open info.plist, change the value after the key to your app name. Eg.&lt;br&gt;
&lt;code&gt;&amp;lt;key&amp;gt;CFBundleDisplayName&amp;lt;/key&amp;gt;&lt;br&gt;
 &amp;lt;string&amp;gt;My New App Name&amp;lt;/string&amp;gt;&lt;/code&gt;&lt;br&gt;
Now uninstall the previous app from your device. Run &lt;br&gt;
&lt;code&gt;$ npm install&lt;br&gt;
 $ pod install&lt;/code&gt;&lt;br&gt;
Now simply, you can install the new app on your device.&lt;br&gt;
Or you can also change the app name from Xcode. &lt;br&gt;
Go to Xcode, open your project in Xcode, and find the targets tab. Select your project and change the hostname with your app name.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsuae19gqu40dzunv2l4q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsuae19gqu40dzunv2l4q.png" alt="IOS"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ios</category>
      <category>android</category>
      <category>react</category>
      <category>javascript</category>
    </item>
    <item>
      <title>What way should I choose React Native or Flutter</title>
      <dc:creator>maheenriaz</dc:creator>
      <pubDate>Wed, 05 Jan 2022 10:55:36 +0000</pubDate>
      <link>https://dev.to/zenkoders/what-way-should-i-choose-react-native-or-flutter-4h5e</link>
      <guid>https://dev.to/zenkoders/what-way-should-i-choose-react-native-or-flutter-4h5e</guid>
      <description>&lt;p&gt;In this blog, we will discuss two top-rank frameworks i.e. React Native and Flutter. Earlier we needed time, money, and skills to develop cross-platform applications. But nowadays companies need the fastest way to develop native apps. To develop native apps, we must know JAVA for android and SWIFT for ios which waste our time. React native and flutter give us the advantage to write a single code and deploy it to various platforms.&lt;/p&gt;

&lt;h2&gt;
  
  
  Flutter:
&lt;/h2&gt;

&lt;p&gt;From a single codebase in a flutter, we create natively-compiled apps for mobile and desktop. Google has recently developed cross-platform mobile app development. Dart is the programming language used by flutter. It enables the creation of expressive and flexible user interfaces with native performance.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F00jdn2x0vol1t7juxexy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F00jdn2x0vol1t7juxexy.png" alt="flutter"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  React Native:
&lt;/h2&gt;

&lt;p&gt;React Native is an open-source framework developed by Facebook and it runs on javascript. The main focus of this framework is the native application rendering that is primarily compatible with Android and iOS. React native is based upon React JS which is a factor of native code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fybgcvg98b26whcm6iyz6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fybgcvg98b26whcm6iyz6.png" alt="reactnative"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Programming Language Difference:
&lt;/h2&gt;

&lt;h2&gt;
  
  
  React Native:
&lt;/h2&gt;

&lt;p&gt;React native uses javascript. It is easier for developers to move on to react-native because of javascript as compared to dart.&lt;/p&gt;

&lt;h2&gt;
  
  
  Flutter:
&lt;/h2&gt;

&lt;p&gt;Flutter uses dart language. It is just like the C language/JAVA. Dart is not used much nowadays. It supports object-oriented programming like abstraction, encapsulation, polymorphism, and inheritance. Dart bridge is larger but it runs faster as compared to javascript bridge.&lt;/p&gt;

&lt;h2&gt;
  
  
  Advantages of React Native:
&lt;/h2&gt;

&lt;h2&gt;
  
  
  1. Changes Are Visible Immediately:
&lt;/h2&gt;

&lt;p&gt;React native uses hot reloading or live reloading. When a user makes any changes in the code, changes will be visible to the developer immediately which is the main advantage to seeing the real-time changes in the application.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Adding to an Existing App:
&lt;/h2&gt;

&lt;p&gt;If we already have an app and we want to improve that app. We don't need to re-create that app. By using React Native, we can add components that we had to create in our app. It saves our time and money.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Flexibility:
&lt;/h2&gt;

&lt;p&gt;React-native makes it easy for developers to pick up where someone left the work and start coding. It increases the flexibility of developers and improves the performance of mobile applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Support 3rd Party libraries:
&lt;/h2&gt;

&lt;p&gt;React native allows using 3rd party libraries using a native module and javascript module. If you want to add dynamic charts in react native apps, you can easily add them in your application using 3rd party libraries.&lt;/p&gt;

&lt;h2&gt;
  
  
  Disadvantages of React Native:
&lt;/h2&gt;

&lt;h2&gt;
  
  
  1. Takes longer time to get started:
&lt;/h2&gt;

&lt;p&gt;React native takes a long time to initialize the app because of the javascript thread. Any kind of user interaction like events, API response. The longer the API response, it will block the user thread and slow the performance of mobile applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. It is insecure in terms of security:
&lt;/h2&gt;

&lt;p&gt;React native creates a vulnerability in the security of the system. If you are creating finance and banking apps you don't need to choose to react-native because for the banking app the data is confidential and we need security for confidential data.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. It's a Difficult Task to Learn the React Native:
&lt;/h2&gt;

&lt;p&gt;If you are a newcomer in the field of development then it will be hard to learn to react-native because of JSX. JSX contains Html with javascript. In comparison to other cross-platform apps, it will be difficult for the ordinary student to learn to react-native.&lt;/p&gt;

&lt;h2&gt;
  
  
  Advantages of flutter:
&lt;/h2&gt;

&lt;h2&gt;
  
  
  1. Fast Reloading:
&lt;/h2&gt;

&lt;p&gt;Flutter provides fast reloading after changes are made in the application. &lt;/p&gt;

&lt;h2&gt;
  
  
  2. Open source:
&lt;/h2&gt;

&lt;p&gt;Flutter is open-source and free to use. They provide substantial documentation and a large community that helps you to solve any problem you might run into.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Productivity is high:
&lt;/h2&gt;

&lt;p&gt;You may utilize the same code base for your iOS and Android apps because Flutter is cross-platform. This will undoubtedly save you time and money.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Compatibility:
&lt;/h2&gt;

&lt;p&gt;Since widgets are the part of flutter app. That's why we will experience fewer compatibility issues on different operating systems which saves time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Disadvantages of Flutter:
&lt;/h2&gt;

&lt;h2&gt;
  
  
  1. Not suitable for web apps:
&lt;/h2&gt;

&lt;p&gt;Browsers do not currently support Flutter-based applications. This implies you won't be able to use any web applications. It also does not support watchOS and tvOS.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. It's a Difficult Task to Learn the Dart:
&lt;/h2&gt;

&lt;p&gt;Dart is a lesser-known programming language, yet it is necessary to master it to work with Flutter.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Does Not support 3rd party libraries:
&lt;/h2&gt;

&lt;p&gt;It does not support 3rd party libraries which increases the programming tasks.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Large App size:
&lt;/h2&gt;

&lt;p&gt;flutter app size is larger than 5MB.&lt;/p&gt;

&lt;h2&gt;
  
  
  Apps that are built on React Native:
&lt;/h2&gt;

&lt;p&gt;Facebook&lt;br&gt;
Instagram&lt;br&gt;
Skype&lt;br&gt;
Uber Eats&lt;br&gt;
Wix&lt;br&gt;
Tesla&lt;/p&gt;

&lt;h2&gt;
  
  
  Apps that are built on Flutter:
&lt;/h2&gt;

&lt;p&gt;Hamilton&lt;br&gt;
Lunching&lt;br&gt;
Reflectly&lt;br&gt;
Google Ads&lt;br&gt;
Xianyu by Alibaba&lt;/p&gt;

&lt;h2&gt;
  
  
  How we create a Flutter app:
&lt;/h2&gt;

&lt;p&gt;Firstly, open a terminal and run these commands:&lt;br&gt;
$ flutter create my_app&lt;br&gt;
$ flutter analyze&lt;br&gt;
$ flutter test&lt;br&gt;
$ flutter run lib/main.dart&lt;/p&gt;

&lt;h2&gt;
  
  
  How we create react native app:
&lt;/h2&gt;

&lt;p&gt;Firstly, open terminal and run these commands:&lt;br&gt;
$ npx react-native init new_project&lt;br&gt;
$ cd new_project&lt;br&gt;
$ react-native run-android&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>flutter</category>
      <category>mobiledev</category>
    </item>
  </channel>
</rss>
