<?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 Mattia Crovero on Medium]]></title>
        <description><![CDATA[Stories by Mattia Crovero on Medium]]></description>
        <link>https://medium.com/@mattia_crovero?source=rss-4dfd585485fd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*JwFqI5r_Kb8Ae0EDPr37UQ.jpeg</url>
            <title>Stories by Mattia Crovero on Medium</title>
            <link>https://medium.com/@mattia_crovero?source=rss-4dfd585485fd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 21:13:46 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mattia_crovero/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 SQLite.. a little more friendly]]></title>
            <link>https://medium.com/shipkaro/flutter-sqlite-a-little-more-friendly-c5b1bb737045?source=rss-4dfd585485fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/c5b1bb737045</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[database-administration]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[plugins]]></category>
            <dc:creator><![CDATA[Mattia Crovero]]></dc:creator>
            <pubDate>Sun, 01 Sep 2019 14:44:14 GMT</pubDate>
            <atom:updated>2019-09-01T17:27:26.395Z</atom:updated>
            <content:encoded><![CDATA[<p>After several projects using SQLite in Flutter (with the amazing <a href="https://pub.dev/packages/sqflite">sqflite</a> plugin), I’ve started missing a key feature that has been part of my web development workflow for years: a dashboard to see at a glance the state of my database and all its tables. <br>That’s why I’ve decided to share with you my new plugin: <strong>Flutter Sqflite Manager</strong>.</p><p><a href="https://pub.dev/packages/flutter_sqflite_manager">flutter_sqflite_manager | Flutter Package</a></p><blockquote>This is still an early preview, some behaviors can change or being removed. Every feedback, bug report or feature request is welcome, please send it at the <a href="https://github.com/mcrovero/flutter_sqflite_manager/issues">issue tracker</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*sWLy47awbLgaaN9CN8DF6w.jpeg" /></figure><p>The goal of the plugin is to create a comprehensive suite of tools to visually manage our SQLite database in the easiest way possible and possibly reach the capabilities of the more advanced software available for web (e.g. PHPMyAdmin).</p><p>Currently, the plugin allows you to browse the database’s tables, see the rows inside them, empty tables and delete the entire database. <br>For every table, it is possible to get the structure with all the columns and the corresponding column type.</p><p>In the future, I’d like to add more options for single rows and also the capability to create and delete tables dynamically to fasten the development workflow even more.</p><p>Now that the library is finally public to test if it can be useful for some of the developers out there, new and interesting ideas will surely come up from the amazing Flutter community. <br>Contribute to the project if you’d like to (really appreciated) and let me know if you find any issues.</p><p>Follow me on <a href="https://twitter.com/mattia_crovero">Twitter</a> for quick updates.</p><p><a href="https://github.com/mcrovero/flutter_sqflite_manager">mcrovero/flutter_sqflite_manager</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LoFbvexGMt5vsothjfohuw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c5b1bb737045" width="1" height="1" alt=""><hr><p><a href="https://medium.com/shipkaro/flutter-sqlite-a-little-more-friendly-c5b1bb737045">Flutter SQLite.. a little more friendly</a> was originally published in <a href="https://medium.com/shipkaro">shipkaro — my journey to $10k</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Interactive keyboard in Flutter]]></title>
            <link>https://medium.com/@mattia_crovero/interactive-keyboard-in-flutter-5d7ac6ee096b?source=rss-4dfd585485fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/5d7ac6ee096b</guid>
            <category><![CDATA[native]]></category>
            <category><![CDATA[keyboard]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[Mattia Crovero]]></dc:creator>
            <pubDate>Fri, 24 May 2019 19:55:15 GMT</pubDate>
            <atom:updated>2019-05-24T19:55:57.501Z</atom:updated>
            <content:encoded><![CDATA[<p>One of the main goals of flutter is to provide a fully native experience on any platform and it’s particularly great on Android and iOS with all the Material and Cupertino widgets and the different behaviors when interacting with our apps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*v4eWhje5mrsxgpw7" /></figure><p>It is really difficult to distinguish if the app is native or not, but there are some small details that an experienced user would notice. For example, when I started using Flutter it was impossible to use force touch on TextFields to move the cursor around and that was an action that an iOS user pretends to do and that could’ve ruined the experience. Luckily Flutter is always improving and features like this one are constantly added.</p><p>A key feature that is still missing because of some iOS limitations is a way to interactively dismiss the keyboard. On Android, the back button is great to quickly close the keyboard and the users are used to it but on iOS, gestures are required even though aren’t as straightforward as a button.</p><p>To bypass the limitations, I found <a href="https://medium.com/@superpeteblaze/ios-custom-keyboard-dismissal-with-swift-9b6df2d9cc49">this article</a> from <a href="https://medium.com/u/d0ff76ca6320">Pete Smith</a> that has the perfect solution for my specific problem and I’ve implemented his idea in a Flutter plugin.</p><p><a href="https://pub.dev/packages/flutter_interactive_keyboard">flutter_interactive_keyboard | Flutter Package</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*TuZv_2IQTtW1fTA6RVDDDA.gif" /></figure><h3>The Trick</h3><p>The solution to bypass the iOS limitations is very simple: disable the keyboard animations, take a screenshot (in our case its a view) and put the fake keyboard instead of the real one. Whenever the keyboard is dragged the animation is not performed by the real keyboard but programmatically by moving the fake view.</p><p>With this approach, there are obviously some downsides. The most evident ones are the absence of the blur effect underneath the keyboard (maybe there’s a workaround for that too) and the impossibility to tap any key when dragging the keyboard.</p><h3>The Android side</h3><p>On Android, the drag isn’t reproducible because the keyboard can’t dismiss without animation on every device. However, trying to mimic the effect has resulted in a quicker interaction than with a button.</p><p>In conclusion, even though the first goal of this plugin is giving a native feel on the iOS side, I believe that porting this kind of features on every platform can enable Flutter developers to focus on the convenience of interactions more than on platform specific requirements. Without any limitation and the power of Flutter, we’ll hopefully see more dynamicity and new interactions.</p><p><a href="https://github.com/mcrovero/flutter_interactive_keyboard">mcrovero/flutter_interactive_keyboard</a></p><p>The library is still in development and PRs are welcomed.</p><p>Follow me on <a href="https://twitter.com/mattia_crovero">Twitter</a> for quick updates or <a href="http://www.linkedin.com/in/mattia-crovero">LinkedIn</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5d7ac6ee096b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Rubber — A material bottom sheet in Flutter]]></title>
            <link>https://medium.com/@mattia_crovero/rubber-a-material-bottom-sheet-in-flutter-9f1bf519cc9a?source=rss-4dfd585485fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/9f1bf519cc9a</guid>
            <category><![CDATA[spring]]></category>
            <category><![CDATA[animation]]></category>
            <category><![CDATA[bottomsheet]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[material-design]]></category>
            <dc:creator><![CDATA[Mattia Crovero]]></dc:creator>
            <pubDate>Mon, 17 Dec 2018 17:28:33 GMT</pubDate>
            <atom:updated>2018-12-17T22:57:03.069Z</atom:updated>
            <content:encoded><![CDATA[<h3>Rubber — A material bottom sheet in Flutter</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b7nfkXW_LBLFsiBZiJKucQ.jpeg" /></figure><p>I’m currently working on a Flutter project that requires a <a href="https://material.io/design/components/sheets-bottom.html#">material bottom sheet</a>. Usually, on Android projects, the material library is enough but for Flutter I haven’t found any library or tutorial that compares to the Android one. So I’ve decided to build it by myself and I came up with <a href="https://github.com/mcrovero/rubber"><strong>Rubber</strong></a>, a material bottom sheet implementation for Flutter.</p><p><a href="https://pub.dartlang.org/packages/rubber">rubber | Flutter Package</a></p><blockquote>This is still an early preview, some behaviors can change or being removed. Every feedback, bug report or feature request is welcome, please send it at the <a href="https://github.com/mcrovero/rubber/issues">issue tracker</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WqVEhJvOcf_Nke_ywa3qZw.gif" /></figure><h3>Why bottom sheets?</h3><p>Apps are becoming more complex but at the same time need to be as simple as possible and easy to navigate.</p><p>It is difficult to fit a lot of information in the limited screens of our smartphones and the classic layout solutions (es. listview) are not always enough.</p><p>With bottom sheets we can show two different pages with related contents at the same time and let the user decide to which of the two give his attention. This way the page switching will be smoother and faster.</p><p>From the material guidelines, bottom sheets must be:</p><ul><li><strong>Supporting</strong>: Bottom sheets contain content that supplements the screen’s primary UI region.</li><li><strong>Flexible</strong>: Bottom sheets can display a wide variety of content and layouts.</li><li><strong>Ergonomic</strong>: Bottom sheets are easy to reach on a mobile device.</li></ul><p>I’ve tried to keep these three principles in mind while developing rubber trying to make it user friendly and lightweight.</p><h3>Spring Animation explained</h3><p>When we swipe up the bottom sheet, the animation controller starts a spring animation. Behind runs the <a href="https://docs.flutter.io/flutter/physics/SpringSimulation-class.html">SpringSimulation</a> that requires, among the other parameters, the springDescription.</p><p>This variable can be passed to the <em>RubberAnimationController</em> in the constructor and is in the form of:</p><pre>springDescription = SpringDescription.withDampingRatio(<br>  mass: 1.5,<br>  stiffness: 300.0,<br>  ratio: 0.4,<br>);</pre><p>The <strong>stiffness </strong>defines the elastic constant and the lower it is, the wider the bottom sheet will stretch.</p><p>The <strong>ratio</strong> is the damping value and the higher it is, the fastest the bottom sheet stops to the final state.</p><p>In the near future I’m going to add some predefined constants to make it easier customize the feel of your bottom sheet and further explanations on the subject.</p><h3>Next steps</h3><p>Even though this library is still in his early phase, feedbacks are really appreciated. If you’d like to contribute or add the library to your project, you can find the <a href="https://github.com/mcrovero/rubber/wiki/Quick-start">complete documentation</a> on the Wiki(still in progress..).</p><p>This is just the introduction to the library, I’m going to write more as the project evolves, so stay tuned!</p><p>You can also follow me on <a href="https://twitter.com/mattia_crovero">Twitter</a> for quick updates or <a href="http://www.linkedin.com/in/mattia-crovero">LinkedIn</a>.</p><p><a href="https://github.com/mcrovero/rubber">mcrovero/rubber</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9f1bf519cc9a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Earth coordinate system]]></title>
            <link>https://medium.com/@mattia_crovero/earth-coordinate-system-b9d309bda35e?source=rss-4dfd585485fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/b9d309bda35e</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[sensors]]></category>
            <category><![CDATA[algebra]]></category>
            <dc:creator><![CDATA[Mattia Crovero]]></dc:creator>
            <pubDate>Wed, 05 Dec 2018 17:32:43 GMT</pubDate>
            <atom:updated>2018-12-05T17:49:37.912Z</atom:updated>
            <content:encoded><![CDATA[<p>Have you ever thought of how our devices can interact with the world? How AR apps understand the device motion and position? Or even how to empower your app with physical actions and triggers?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MwaZup4Zjs57a6XoUVua3g.png" /></figure><p>Well, I haven’t.. until few weeks ago when a client asked for an app that required the device to understand where it goes and how it rotates compared to a fixed movement direction. Now I can share with you the little I learned and how to implement it in an Android project (obviously in Kotlin).</p><p>I’ve created a Github repository with the minimum to follow this article, it requires a device with gyroscope (I’ve left all the sensor management in the same activity for clarity and ease of reading).</p><p><a href="https://github.com/Matt2397/EarthCoordinates">Matt2397/EarthCoordinates</a></p><h4>Relative coordinates to absolute coordinates</h4><p>Let’s use as reference the accelerometer sensor, as the example in the repository, but you can apply this logic to every vector that is relative to the device coordinates (gravity, geomagnetic field, linear acceleration..). To understand how to visualize the data we get from the device sensors, look at the image below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/225/1*m6_2rfIf0dsUk9LmRXgK-A.png" /><figcaption>Form <a href="https://developer.android.com/guide/topics/sensors/">Android Developers</a></figcaption></figure><blockquote>When a device is held in its default orientation, the X axis is horizontal and <strong>points to the right</strong>, the Y axis is vertical and <strong>points up</strong>, and the Z axis <strong>points toward the outside of the screen face</strong>.</blockquote><p><a href="https://github.com/Matt2397/EarthCoordinates/blob/master/app/src/main/java/app/mattiacrovero/earthcoordinates/MainActivity.kt">In our case</a> the accelerometer gives us the value relative to this coordinate system and it will be difficult to understand how the action happened in the real world. Let’s say we need to understand if the acceleration happened parallel to our sight direction (given that we’re looking towards the magnetic north) and not relative to the current device rotation.</p><p>With just the accelerometer would be impossible but in conjunction with the gyroscope we can achieve that. (Unfortunately not every smartphone has the gyroscope sensor.. I’m posting an alternative that requires just the accelerometer and the magnetometer sensors in the next weeks.. hopefully)</p><p>The value we get from the gyroscope is the rotation around each axis of the <strong>earth coordinate system </strong>well described with the image below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/246/1*WpbZnP_hJPRhK5p2OSjw6w.png" /><figcaption>Form <a href="https://developer.android.com/guide/topics/sensors/">Android Developers</a></figcaption></figure><p>The sphere represent the earth and citing the Android developer website:</p><blockquote><strong>X</strong> is defined as the vector product Y x Z. It is tangential to the ground at the device’s current location and <strong>points approximately East</strong>. <strong>Y</strong> is tangential to the ground at the device’s current location and <strong>points toward the geomagnetic North Pole</strong>. <strong>Z</strong> <strong>points toward the sky</strong> and is perpendicular to the ground plane.</blockquote><p>The gyroscope gives us the rotation from this coordinate system in the form of a <a href="https://en.wikipedia.org/wiki/Quaternion">quaternion</a>. The explanation of this complex number system is beyond the focus of this article but if you’d like to deepen the subject I’ve linked at the end some useful resources.</p><p>Quaternions can be replaced by an equivalent <a href="https://en.wikipedia.org/wiki/Rotation_matrix">rotation matrix</a> that for our goal are faster to execute and easier to understand (<a href="https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation#Performance_comparisons">source</a>). We can easily achieve that with this method provided by the SensorManager class.</p><pre>SensorManager.getRotationMatrixFromVector(rotationMatrix, quaternion)</pre><p>Finally, to transform our data from the relative coordinate system to the earth absolute coordinate system is pretty straightforward: we just need to rotate the vector (in our case the accelerometer values) by the rotation matrix and this is it.</p><pre>vector = LinearAlgebraHelper.rotateVector3(vector, rotationMatrix)</pre><blockquote>In <a href="https://en.wikipedia.org/wiki/Linear_algebra">linear algebra</a>, a <strong>rotation matrix</strong> is a <a href="https://en.wikipedia.org/wiki/Matrix_(mathematics)">matrix</a> that is used to perform a <a href="https://en.wikipedia.org/wiki/Rotation_(mathematics)">rotation</a> in <a href="https://en.wikipedia.org/wiki/Euclidean_space">Euclidean space</a>.</blockquote><p>Lets’ jump to the implementation of the <em>rotateVector3</em> method with the rotation matrix (a simple matrix-vector multiplication):</p><pre>// v: vector we want to rotate, r: rotation matrix<br>fun rotateVector3(v : FloatArray, r: FloatArray): FloatArray {<br>    val newVector = FloatArray(3)<br>    for(i in 0..2) {                <br>        var s = 0f                <br>        for(j in 0..2) {                    <br>            s += vector[j] * rotationMatrix[j+i*3]                <br>        }<br>        newVector[i] = s            <br>    }            <br>    return newVector        <br>}</pre><p>Now everything is setup and ready to be tested, feel free to experiment with the git repository and leave your feedback.</p><p>Here are some links I found useful during my studies:</p><ul><li><a href="https://developer.android.com/guide/topics/sensors/">Android Developers — Sensors</a></li><li><a href="https://stackoverflow.com/questions/14607640/rotating-a-vector-in-3d-space">Rotate vector — rotation matrix</a></li><li><a href="https://en.wikipedia.org/wiki/Rotation_matrix">Rotation Matrix — Wikipedia</a></li></ul><h4>Quaternions</h4><ul><li><a href="https://www.youtube.com/watch?v=d4EgbgTm0Bg&amp;feature=youtu.be">Quaternion — 3 blue 1 brown</a></li><li><a href="https://math.stackexchange.com/questions/40164/how-do-you-rotate-a-vector-by-a-unit-quaternion">Rotate vector3 by quaternion</a></li><li><a href="https://en.wikipedia.org/wiki/Quaternion">Quaternions - Wikipedia</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b9d309bda35e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>