<?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: FaizanKamal7</title>
    <description>The latest articles on DEV Community by FaizanKamal7 (@faizankamal7).</description>
    <link>https://dev.to/faizankamal7</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%2F476904%2F92d346f3-dd4c-490e-bca1-e05699f75352.png</url>
      <title>DEV Community: FaizanKamal7</title>
      <link>https://dev.to/faizankamal7</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/faizankamal7"/>
    <language>en</language>
    <item>
      <title>Implementing and Seeding Polymorphic Relationships with Laravel</title>
      <dc:creator>FaizanKamal7</dc:creator>
      <pubDate>Mon, 06 Nov 2023 18:02:33 +0000</pubDate>
      <link>https://dev.to/faizankamal7/implementing-and-seeding-polymorphic-relationships-with-laravel-foh</link>
      <guid>https://dev.to/faizankamal7/implementing-and-seeding-polymorphic-relationships-with-laravel-foh</guid>
      <description>&lt;p&gt;Polymorphic relationships in Laravel provide a powerful method for associating models in a relational database through a single association. This allows a model to belong to more than one other model on a single association. For example, imagine a scenario where you have a &lt;code&gt;Comment&lt;/code&gt; model that can be associated with a &lt;code&gt;Post&lt;/code&gt; model as well as a &lt;code&gt;Video&lt;/code&gt; model. Instead of creating two separate associations for each type, polymorphic relationships let you streamline this into one.&lt;/p&gt;

&lt;p&gt;The challenge with polymorphic relationships comes when you need to seed your database for testing or local development. How do you create seed data that accurately reflects the complex nature of polymorphic associations? This is where Laravel's factories and seeders come into play, albeit with a bit of customization.&lt;/p&gt;

&lt;h3&gt;
  
  
  Understanding the Problem
&lt;/h3&gt;

&lt;p&gt;When seeding polymorphic relationships, the main challenge is ensuring that the seed data respects the logic of these associations. For instance, a &lt;code&gt;Comment&lt;/code&gt; factory needs to know whether it should be associated with a &lt;code&gt;Post&lt;/code&gt; or a &lt;code&gt;Video&lt;/code&gt;, and this must be randomized or specified during the seeding process to reflect realistic data patterns.&lt;/p&gt;

&lt;p&gt;Here's a step-by-step guide on how to achieve polymorphic seeding with Laravel's factories and seeders:&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Define Your Models and Their Relationships
&lt;/h3&gt;

&lt;p&gt;Let's start by defining our models and their relationships. In your &lt;code&gt;Comment&lt;/code&gt; model, you would define a polymorphic relationship like so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Comment&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;Model&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;commentable&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;morphTo&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And in your &lt;code&gt;Post&lt;/code&gt; and &lt;code&gt;Video&lt;/code&gt; models, you define the inverse of the relationship:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Post&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;Model&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;comments&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;morphMany&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Comment&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;class&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'commentable'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Video&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;Model&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;comments&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;morphMany&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Comment&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;class&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'commentable'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 2: Set Up Your Factory
&lt;/h3&gt;

&lt;p&gt;In Laravel, factories are used to generate fake data for your models. For polymorphic relationships, you need to define a factory for each type of model involved in the relationship and then specify the logic that handles the polymorphism. Here's how you can define a factory for the &lt;code&gt;Comment&lt;/code&gt; model:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cd"&gt;/** @var \Illuminate\Database\Eloquent\Factory $factory */&lt;/span&gt;

&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Faker\Generator&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nc"&gt;Faker&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;App\Models\Comment&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;App\Models\Post&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;App\Models\Video&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nv"&gt;$factory&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;define&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Comment&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;class&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;Faker&lt;/span&gt; &lt;span class="nv"&gt;$faker&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Randomly choose a commentable type&lt;/span&gt;
    &lt;span class="nv"&gt;$commentableType&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$faker&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;randomElement&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="s1"&gt;'Post'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Video'&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;

    &lt;span class="c1"&gt;// Get the commentable object&lt;/span&gt;
    &lt;span class="nv"&gt;$commentable&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;factory&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"App\Models&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nv"&gt;$commentableType&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="s1"&gt;'body'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$faker&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;sentence&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s1"&gt;'commentable_id'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$commentable&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s1"&gt;'commentable_type'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;"App\Models&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nv"&gt;$commentableType&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 3: Seed the Database
&lt;/h3&gt;

&lt;p&gt;Now that we have our factory set up, we can use seeders to populate our database with data:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Illuminate\Database\Seeder&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;App\Models\Comment&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;DatabaseSeeder&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;Seeder&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;run&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// Create 10 comments with random association to Post or Video&lt;/span&gt;
        &lt;span class="nf"&gt;factory&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Comment&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;class&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;Seeding polymorphic relationships in Laravel requires a careful setup of your factories to ensure that the data generated respects the polymorphism logic of your application. By following the above steps, you can effectively create seed data for your polymorphic associations, allowing for more robust testing and development. Remember, Laravel's eloquent ORM is designed to be flexible and powerful, and with the right approach, you can harness its full potential for complex database operations.&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>webdev</category>
      <category>php</category>
      <category>programming</category>
    </item>
    <item>
      <title>JSON Serialization in Laravel to Access Laravel Relational Data in JavaScript</title>
      <dc:creator>FaizanKamal7</dc:creator>
      <pubDate>Fri, 03 Nov 2023 18:59:56 +0000</pubDate>
      <link>https://dev.to/faizankamal7/json-serialization-in-laravel-to-access-laravel-relational-data-in-javascript-25ab</link>
      <guid>https://dev.to/faizankamal7/json-serialization-in-laravel-to-access-laravel-relational-data-in-javascript-25ab</guid>
      <description>&lt;p&gt;When working with Laravel, you may often encounter scenarios where you need to pass data from your server-side application to the client-side JavaScript. One common challenge is accessing relational data in JavaScript that originates from Laravel's eloquent models. In this post, we'll explore how to solve this problem by leveraging JSON serialization and demonstrate how to access related data in JavaScript without making an AJAX call.&lt;/p&gt;

&lt;h2&gt;
  
  
  Problem
&lt;/h2&gt;

&lt;p&gt;Imagine you have a Laravel model called &lt;code&gt;Post&lt;/code&gt; with a one-to-many relationship with another model called &lt;code&gt;Comment&lt;/code&gt;. You want to access both the post and its associated comments in JavaScript. Typically, you might use AJAX to fetch this data from the server, but in this scenario, we will assume that the data is passed from the server to the Blade view via form inputs or select dropdowns.&lt;/p&gt;

&lt;p&gt;Directly passing Laravel model objects from PHP to JavaScript is not straightforward due to the mismatch between PHP and JavaScript. However, we can overcome this challenge by using JSON serialization and a custom &lt;code&gt;toArray&lt;/code&gt; method in our model.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Solution
&lt;/h2&gt;

&lt;p&gt;Let's break down the steps to access the related data in JavaScript:&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Step 1: Model Setup&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;In your &lt;code&gt;Post.php&lt;/code&gt; model, define the &lt;code&gt;comments&lt;/code&gt; relationship and create a custom &lt;code&gt;toArray&lt;/code&gt; method to include the related comments:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Post.php (Model)

class Post extends Model
{
    public function comments()
    {
        return $this-&amp;gt;hasMany(Comment::class);
    }
    public function toArray()
    {
        $data = parent::toArray();
        $data['comments'] = $this-&amp;gt;comments; // Include related comments

        return $data;
    }
}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By overriding the toArray method, we ensure that the related comments are included in the serialized data.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Step 2: Blade View&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;In your Blade view, you can serialize the &lt;code&gt;Post&lt;/code&gt; model to JSON using the &lt;code&gt;@json&lt;/code&gt; directive. This makes the data available for JavaScript:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var postData = @json($post-&amp;amp;gt;toArray());
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Now, the postData variable in JavaScript contains the serialized post data along with its comments.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Step 3: JavaScript Usage&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;You can now work with the post data and its comments in JavaScript without making an AJAX call:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// JavaScript
// Access post data and its comments
var post = postData;
var comments = postData.comments;

// Now, you can work with the post and its comments in JavaScript
console.log('Post Title: ' + post.title);
console.log('Comments:');
comments.forEach(function(comment) {
    console.log('- ' + comment.text);
});

// You can also access elements by their IDs using document.getElementById
var postTitleElement = document.getElementById('post-title');
var commentsListElement = document.getElementById('comments-list');

// Set the post title and comments in your HTML elements
postTitleElement.textContent = post.title;

var commentsHTML = '';
comments.forEach(function(comment) {
    commentsHTML += '&amp;lt;li&amp;gt;' + comment.text + '&amp;lt;/li&amp;gt;';
});

commentsListElement.innerHTML = commentsHTML;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By following these steps, you can seamlessly access and display the related data in your JavaScript code, combining the power of Laravel's Eloquent relationships with client-side scripting. This approach eliminates the need for additional AJAX requests and simplifies your development workflow.&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>webdev</category>
      <category>json</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Is there any way to generate flutter code of Adobe XD shapes</title>
      <dc:creator>FaizanKamal7</dc:creator>
      <pubDate>Wed, 30 Sep 2020 19:12:15 +0000</pubDate>
      <link>https://dev.to/faizankamal7/is-there-any-way-to-generate-flutter-code-of-adobe-xd-shapes-48la</link>
      <guid>https://dev.to/faizankamal7/is-there-any-way-to-generate-flutter-code-of-adobe-xd-shapes-48la</guid>
      <description>&lt;p&gt;Do anyone know here how to generate the code for shapes like this from adobe xd to flutter? Upon generating the code for that shape I get something like below. For every other widget it is generating code well. I know I shouldn't be looking for these kinds of shortcut and should learn how to make shapes like this in flutter . Because of shortage of time I have to do it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="n"&gt;SvgPicture&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;asset&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
                    &lt;span class="s"&gt;'assets/svg/Path 8.svg'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                    &lt;span class="nl"&gt;height:&lt;/span&gt; &lt;span class="mf"&gt;595.6666259765625&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                    &lt;span class="nl"&gt;width:&lt;/span&gt; &lt;span class="mf"&gt;501.8892822265625&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                  &lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2Fi%2F210fg9tlnj8htdefzfht.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%2Fi%2F210fg9tlnj8htdefzfht.PNG" alt="Alt Text" width="800" height="794"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>design</category>
      <category>adobexd</category>
      <category>flutter</category>
    </item>
    <item>
      <title>Answer: Flutter: Create a timeline UI</title>
      <dc:creator>FaizanKamal7</dc:creator>
      <pubDate>Tue, 29 Sep 2020 07:19:23 +0000</pubDate>
      <link>https://dev.to/faizankamal7/answer-flutter-create-a-timeline-ui-1465</link>
      <guid>https://dev.to/faizankamal7/answer-flutter-create-a-timeline-ui-1465</guid>
      <description>&lt;div class="ltag__stackexchange--container"&gt;
  &lt;div class="ltag__stackexchange--title-container"&gt;
    
      &lt;div class="ltag__stackexchange--title"&gt;
        &lt;div class="ltag__stackexchange--header"&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%2Fassets%2Fstackoverflow-logo-b42691ae545e4810b105ee957979a853a696085e67e43ee14c5699cf3e890fb4.svg" alt=""&gt;
          &lt;a href="https://stackoverflow.com/questions/49635381/flutter-create-a-timeline-ui/58701496#58701496" rel="noopener noreferrer"&gt;
            &lt;span class="title-flare"&gt;answer&lt;/span&gt; re: Flutter: Create a timeline UI
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="ltag__stackexchange--post-metadata"&gt;
          &lt;span&gt;Nov  4 '19&lt;/span&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;a class="ltag__stackexchange--score-container" href="https://stackoverflow.com/questions/49635381/flutter-create-a-timeline-ui/58701496#58701496" rel="noopener noreferrer"&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%2Fassets%2Fstackexchange-arrow-up-eff2e2849e67d156181d258e38802c0b57fa011f74164a7f97675ca3b6ab756b.svg" alt=""&gt;
        &lt;div class="ltag__stackexchange--score-number"&gt;
          44
        &lt;/div&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%2Fassets%2Fstackexchange-arrow-down-4349fac0dd932d284fab7e4dd9846f19a3710558efde0d2dfd05897f3eeb9aba.svg" alt=""&gt;
      &lt;/a&gt;
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--body"&gt;
    
&lt;p&gt;I like Osama's answer too but here's my quick custom implementation. It uses a &lt;code&gt;CustomPainter&lt;/code&gt; to draw the lines.&lt;/p&gt;
&lt;pre class="lang-dart prettyprint-override"&gt;&lt;code&gt;import 'package:flutter/material.dart'
class Timeline extends StatelessWidget {
  const Timeline({
    Key? key,
    required this.children,
    this.indicators,
    this.isLeftAligned = true,
    this.itemGap = 12.0,
    this.gutterSpacing = 4.0,
    this.padding = const EdgeInsets.all(8),
    this.controller,
    this.lineColor = Colors.grey,&lt;/code&gt;&lt;/pre&gt;…
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--btn--container"&gt;
    &lt;a href="https://stackoverflow.com/questions/49635381/flutter-create-a-timeline-ui/58701496#58701496" class="ltag__stackexchange--btn" rel="noopener noreferrer"&gt;Open Full Answer&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;


</description>
    </item>
    <item>
      <title>firebase-push-notifications-ios</title>
      <dc:creator>FaizanKamal7</dc:creator>
      <pubDate>Mon, 28 Sep 2020 19:06:43 +0000</pubDate>
      <link>https://dev.to/faizankamal7/firebase-push-notifications-ios-9hg</link>
      <guid>https://dev.to/faizankamal7/firebase-push-notifications-ios-9hg</guid>
      <description>&lt;p&gt;&lt;a href="https://www.appcoda.com/firebase-push-notifications/" rel="noopener noreferrer"&gt;https://www.appcoda.com/firebase-push-notifications/&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Answer: iOS: APN auth Key for free developer account</title>
      <dc:creator>FaizanKamal7</dc:creator>
      <pubDate>Mon, 28 Sep 2020 19:05:25 +0000</pubDate>
      <link>https://dev.to/faizankamal7/answer-ios-apn-auth-key-for-free-developer-account-k9n</link>
      <guid>https://dev.to/faizankamal7/answer-ios-apn-auth-key-for-free-developer-account-k9n</guid>
      <description>&lt;div class="ltag__stackexchange--container"&gt;
  &lt;div class="ltag__stackexchange--title-container"&gt;
    
      &lt;div class="ltag__stackexchange--title"&gt;
        &lt;div class="ltag__stackexchange--header"&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%2Fassets%2Fstackoverflow-logo-b42691ae545e4810b105ee957979a853a696085e67e43ee14c5699cf3e890fb4.svg" alt=""&gt;
          &lt;a href="https://stackoverflow.com/questions/46261372/ios-apn-auth-key-for-free-developer-account/46261665#46261665" rel="noopener noreferrer"&gt;
            &lt;span class="title-flare"&gt;answer&lt;/span&gt; re: iOS: APN auth Key for free developer account
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="ltag__stackexchange--post-metadata"&gt;
          &lt;span&gt;Sep 17 '17&lt;/span&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;a class="ltag__stackexchange--score-container" href="https://stackoverflow.com/questions/46261372/ios-apn-auth-key-for-free-developer-account/46261665#46261665" rel="noopener noreferrer"&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%2Fassets%2Fstackexchange-arrow-up-eff2e2849e67d156181d258e38802c0b57fa011f74164a7f97675ca3b6ab756b.svg" alt=""&gt;
        &lt;div class="ltag__stackexchange--score-number"&gt;
          1
        &lt;/div&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%2Fassets%2Fstackexchange-arrow-down-4349fac0dd932d284fab7e4dd9846f19a3710558efde0d2dfd05897f3eeb9aba.svg" alt=""&gt;
      &lt;/a&gt;
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--body"&gt;
    
&lt;p&gt;To configure Firebase for Push Notifications you need APNs certificate. &lt;/p&gt;

&lt;p&gt;To unlock push notifications capability you need to enroll into the Apple Developer program (after that you will get access to Certificates, IDs &amp;amp; Profiles section of your developer account).&lt;/p&gt;

&lt;p&gt;PS: &lt;a href="https://www.appcoda.com/firebase-push-notifications/" rel="nofollow noreferrer noopener"&gt;AppCoda: Implementing Push Notifications on iOS with Firebase&lt;/a&gt;&lt;/p&gt;

    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--btn--container"&gt;
    &lt;a href="https://stackoverflow.com/questions/46261372/ios-apn-auth-key-for-free-developer-account/46261665#46261665" class="ltag__stackexchange--btn" rel="noopener noreferrer"&gt;Open Full Answer&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;


</description>
    </item>
  </channel>
</rss>
