<?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 Jay Naik on Medium]]></title>
        <description><![CDATA[Stories by Jay Naik on Medium]]></description>
        <link>https://medium.com/@NaikJay?source=rss-6b6c54daa585------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*Wc4jnqI2e-2xup5U_Jig5Q.jpeg</url>
            <title>Stories by Jay Naik on Medium</title>
            <link>https://medium.com/@NaikJay?source=rss-6b6c54daa585------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 18 May 2026 03:00:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@NaikJay/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[Creating a note-taking app in Flutter/Dart]]></title>
            <link>https://medium.com/aubergine-solutions/creating-a-note-taking-app-in-flutter-dart-f50852993cd0?source=rss-6b6c54daa585------2</link>
            <guid isPermaLink="false">https://medium.com/p/f50852993cd0</guid>
            <category><![CDATA[mobile-development]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[dart]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Jay Naik]]></dc:creator>
            <pubDate>Fri, 03 May 2019 07:06:08 GMT</pubDate>
            <atom:updated>2021-08-27T03:37:16.130Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/371/1*0dQNpR0DrpaZfMM8mXsvig.png" /></figure><p>Flutter is an open source cross-platform mobile development framework developed by Google. Apps for which are written in <a href="https://www.dartlang.org/">Dart</a>. <a href="https://flutter.dev/">Flutter</a> comes pre-equipped with <a href="https://material.io/design/">Material Design</a> components which makes it very easy to create apps with good look and feel. In Flutter everything is a Widget- either stateless or stateful in kind. A note-taking app with usable design and functionalities is a good learning exercise one can start with.</p><p>If you haven’t installed flutter and a supported IDE, you can find the instructions <a href="https://flutter.dev/docs/get-started/install">here</a>.</p><p>First, let’s set up the project:</p><ol><li>Create a flutter project from Android Studio or enter the command in terminal/cmd “<strong>flutter create notes</strong>”.</li><li>In <strong><em>main.dart</em></strong> remove the homePage class and create a new file with our own HomePage class extending Stateful Widget. This class will contain our Scaffold.</li><li>Create another Stateful Widget class. This will Build body containing Staggered View for HomePage. We’ll call it “<strong>StaggeredGridPage</strong>”.</li></ol><p>Let’s be creative and try to present the notes in a cool staggered view.</p><p>We’ll use this dart package to create a staggered grid view. <a href="https://pub.dartlang.org/packages/flutter_staggered_grid_view">https://pub.dartlang.org/packages/flutter_staggered_grid_view</a> and SQLite to store the notes data on the device.</p><p>Following is a code snippet from <strong><em>pubspec.yaml</em></strong><em> </em>with the required dependencies listed. Add them, save the file and use flutter command “<strong>flutter packages get</strong>” to resolve the newly added dependencies.</p><pre>dependencies:<br>  flutter:<br>    sdk: flutter</pre><pre><br>  cupertino_icons: ^0.1.2<br>  flutter_staggered_grid_view: ^0.2.7<br>  auto_size_text: ^1.1.2<br>  sqflite:<br>  path:<br>  intl: ^0.15.7<br>  share: ^0.6.1</pre><p>Create a class for the notes. We’ll need the <strong>toMap </strong>function for database queries.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7af71b132a229d986aefcc33e75c2043/href">https://medium.com/media/7af71b132a229d986aefcc33e75c2043/href</a></iframe><p><strong>Grab the code of SQLite database queries for note class and table from </strong><a href="https://gitlab.com/jaynaik/notes_app_flutter/blob/development/lib/Models/SqliteHandler.dart"><strong>here</strong></a><strong>.</strong></p><p>Now your Material App’s home should have a <a href="https://docs.flutter.io/flutter/material/Scaffold-class.html">Scaffold</a> from HomePage.dart which should have StaggeredGridView as the body. In the <a href="https://docs.flutter.io/flutter/material/AppBar-class.html">AppBar</a> of the scaffold place an action button to enable the user to toggle between list view and staggered view. Don’t forget to wrap the body in <a href="https://docs.flutter.io/flutter/widgets/SafeArea-class.html">SafeArea</a>, we want the app to be notch friendly on latest phones.</p><p>The Staggered View library requires a cross-axis count for the view which we’ll provide dynamically based on width of the display size. This is required to tell the view number of notes we want to show side by side. In landscape mode on a phone or a tablet screen, we’ll make it arrange 3 notes horizontally and 2 for a phone in portrait mode.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/96f151a71be4e3ac1836e7f60453777f/href">https://medium.com/media/96f151a71be4e3ac1836e7f60453777f/href</a></iframe><p>This view needs tiles for notes to display. The tile we design for the view must preview the title and the content of the note. To handle the text of different length in the tile we’ll use a <a href="https://pub.dartlang.org/packages/auto_size_text">library</a> to create auto-expanding text view. We only have to define line limit and the widget will auto-expand to accommodate the content till that limit.</p><p>Like segue in iOS and Intent in Android, to navigate between pages in Flutter we use <a href="https://api.flutter.dev/flutter/widgets/Navigator-class.html">Navigator</a>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dbef876a049473b05f38da943675057e/href">https://medium.com/media/dbef876a049473b05f38da943675057e/href</a></iframe><p>The tile in the view will look something like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/256/1*DmQVyV8AALXsLUUsSe5r7Q.png" /><figcaption>Note tiles in staggered view on HomePage</figcaption></figure><p>Now we need a view to edit/create a note, which will also possess various useful actions in AppBar to undo, archive and more. The more action will bring up a bottom sheet with options like share, duplicate, delete permanently and a horizontally scrollable colour picker with which we’ll be able to change the background colour of that particular note.</p><p>We’ll segregate NotePage, BottomSheet and ColorSlider widgets in different classes and files to keep the code clean and manageable. To change the colour on all of them when the user picks a new one from the ColorSlider we need to update the state. We can connect these three widgets via callback functions to respond to the changes so they can update themselves.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4WayNHC2_UGxin7uRGJV2A.png" /><figcaption>CallBack flow. You’ll see it in action below.</figcaption></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/08f16300806e2d343a7b21055000a7de/href">https://medium.com/media/08f16300806e2d343a7b21055000a7de/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/1*W_PmxxJyFkpl3ktHrqpMHg.gif" /><figcaption>This is how it’ll look and work</figcaption></figure><p>I’ve added some handy features as well to undo changes, archive, share, duplicate and permanently delete the note.</p><p>The entire codebase for the app can be found at my repository <a href="https://github.com/jayjonas1996/flutter_notes">Github</a>. Feel free to drop by and give it a go yourself.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f50852993cd0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/aubergine-solutions/creating-a-note-taking-app-in-flutter-dart-f50852993cd0">Creating a note-taking app in Flutter/Dart</a> was originally published in <a href="https://medium.com/aubergine-solutions">Aubergine Solutions</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>