workblogprojects

My Journey of Learning Flutter

·4 min read

My journey with Flutter started at the beginning of 2024. It wasn't because I wanted to learn a new technology for the sake of it, but because I had a real problem to solve. I wanted to build a mobile app for my university, VIT-AP, to make life easier for students. The idea of creating something that my friends and I could use every day was incredibly exciting, but there was one small problem: I had absolutely no idea how to build mobile apps.

So, I did what any excited and slightly impatient person would do — I jumped right in. I didn't follow any tutorials or read any documentation. Instead, I opened up ChatGPT and started asking it to write code for me. My "development" process was simple: ask the AI, copy the code, and paste it into my project.

For a little while, it felt like magic. I was building screens and adding buttons without knowing what I was doing. But the magic quickly wore off. Most of the time, the code didn't work. I would spend hours trying to fix errors that I didn't understand. My project, the VITAP Student App, became a tangled mess of files and code that was impossible to manage. Adding a new feature felt like performing surgery in the dark. I knew I had to change my approach.

That's when I discovered Rivaan Ranawat's YouTube channel, and it was a complete game-changer. His videos were exactly what I needed. He explained complex topics like "Clean Architecture" and "MVVM" in a way that finally made sense to me. He had tutorials on everything from state management with BLoC and Riverpod to testing. His channel became my go-to resource, and I honestly believe it saved my project. If you're starting with Flutter, I can't recommend his channel enough.

Inspired, I decided to start over, but this time, I would do it the right way. I created a structured learning path for myself.

First, I focused on learning Dart, the programming language that Flutter is built on. Since I already knew object-oriented programming from Java, Dart felt quite familiar. I just had to get used to a few new concepts like null safety, mixins, and how it handles asynchronous programming.

Once I had a decent grasp of Dart, I moved on to Flutter basics. I learned about "widgets," which are like the building blocks of a Flutter app. You combine them to create your UI, from a simple button to a complex screen layout. I spent time understanding how to arrange these widgets to build beautiful and responsive layouts.

Next, I tackled the big one: state management. In simple terms, "state" is just any data in your app that can change over time. State management is how you handle those changes. In the Flutter world, the two most popular choices are BLoC and Riverpod. I decided to try both. BLoC felt very structured and a bit formal, making you separate your business logic from your UI very strictly. This is great for large, complex apps where you need things to be predictable. Riverpod, on the other hand, felt more modern and flexible, with less boilerplate code. My advice is to try both and see which one clicks for you.

After getting comfortable with state management, I dove into architectural patterns like MVVM (Model-View-ViewModel) and Clean Architecture. This is when my app started to feel like a real, professional project. These patterns are like blueprints for your code, helping you keep everything organized, testable, and easy to maintain.

Finally, I learned about testing in Flutter. I learned how to write unit tests for my logic, widget tests for my UI components, and integration tests to ensure the entire app worked as expected. This gave me the confidence to add new features without worrying about breaking something else.

Looking back, my path to learning Flutter was a bit chaotic, but it was also a lot of fun. I learned that it's okay to make a mess as long as you're willing to clean it up and learn from your mistakes. Building a real project from day one was a powerful motivator, and it made the late-night debugging sessions feel worthwhile.

So, if you're thinking about learning Flutter, my advice is to just start. Build something you're passionate about, don't be afraid to break things, and lean on the amazing community and creators out there. It's a rewarding journey, and seeing your app come to life is one of the best feelings in the world.