<?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: Abdullah Shahid</title>
    <description>The latest articles on DEV Community by Abdullah Shahid (@abdullah_shahid_1071).</description>
    <link>https://dev.to/abdullah_shahid_1071</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%2F1041422%2F989ffac3-7694-4e02-ba13-26746e787789.jpg</url>
      <title>DEV Community: Abdullah Shahid</title>
      <link>https://dev.to/abdullah_shahid_1071</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/abdullah_shahid_1071"/>
    <language>en</language>
    <item>
      <title>The perfect flutter boiler plate and state management solution does not exi….</title>
      <dc:creator>Abdullah Shahid</dc:creator>
      <pubDate>Wed, 08 Mar 2023 21:25:38 +0000</pubDate>
      <link>https://dev.to/abdullah_shahid_1071/the-perfect-flutter-boiler-plate-and-state-management-solution-does-not-exi-4i52</link>
      <guid>https://dev.to/abdullah_shahid_1071/the-perfect-flutter-boiler-plate-and-state-management-solution-does-not-exi-4i52</guid>
      <description>&lt;p&gt;&lt;strong&gt;Yo, yo, yo, 148–3 to the 3 to the 6 to the 9&lt;/strong&gt;, representing the &lt;strong&gt;FLUTTER&lt;/strong&gt;. What’s up?!&lt;br&gt;
As you may know, &lt;strong&gt;flutter is the new sexy&lt;/strong&gt; in mobile app development.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--39N894Ub--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jep20mwt9buq5e75qfyt.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--39N894Ub--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jep20mwt9buq5e75qfyt.jpg" alt="Just Do it Meme" width="416" height="233"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://flutter.dev"&gt;&lt;strong&gt;Flutter&lt;/strong&gt;&lt;/a&gt; is an open-source mobile application development framework created by &lt;strong&gt;Google&lt;/strong&gt;. It allows developers to build &lt;strong&gt;high-performance&lt;/strong&gt;, &lt;strong&gt;cross-platform apps&lt;/strong&gt; for both &lt;strong&gt;Android&lt;/strong&gt; and &lt;strong&gt;iOS&lt;/strong&gt; platforms using a single codebase. Flutter draws its own canvas using graphics engine called &lt;a href="https://skia.org"&gt;&lt;strong&gt;Skia&lt;/strong&gt;&lt;/a&gt;. Unlike, React Native, which relies on native components to draw the UI.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“The choice of framework ultimately depends on the &lt;strong&gt;requirements&lt;/strong&gt; and &lt;strong&gt;goals&lt;/strong&gt; of the project. There is &lt;strong&gt;no one-size-fits-all&lt;/strong&gt; solution, and developers must consider the &lt;strong&gt;trade-offs&lt;/strong&gt; and &lt;strong&gt;benefits&lt;/strong&gt; of each option before making a decision and going all in.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CDO0884i--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u6z4l77so5m0jr08q3em.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CDO0884i--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u6z4l77so5m0jr08q3em.jpg" alt="Choose Wisely Meme" width="491" height="297"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It’s very true that many &lt;strong&gt;developers&lt;/strong&gt; focus on making sure their code simply works, but writing high-quality &lt;strong&gt;production-level code&lt;/strong&gt; requires attention to a variety of factors beyond basic functionality. This includes considerations such as &lt;strong&gt;scalability&lt;/strong&gt;, &lt;strong&gt;readability&lt;/strong&gt;, &lt;strong&gt;modularity&lt;/strong&gt;, and adherence to good design patterns.&lt;/p&gt;

&lt;p&gt;I have used the &lt;strong&gt;MVVM design pattern&lt;/strong&gt;. I follow a service-oriented architecture, where each view has a view model and view model can call appropriate service method for &lt;strong&gt;API&lt;/strong&gt; calls and to connect to outer world.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---eVjEsjN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4w63mpdj8rmy6x2qa2vb.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---eVjEsjN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4w63mpdj8rmy6x2qa2vb.jpg" alt="Image description" width="544" height="302"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Here is the forgot password view,&lt;br&gt;
&lt;/p&gt;


&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import 'package:boiler_plate/ui/common/ui_helpers.dart';
import 'package:boiler_plate/ui/dumb_widgets/circular_progress_indicator.dart';
import 'package:flutter/material.dart';
import 'package:stacked/stacked.dart';
import 'package:stacked/stacked_annotations.dart';

import 'forgot_view.form.dart';
import 'forgot_viewmodel.dart';

@FormView(
  fields: [
    FormTextField(
      name: 'email',
    ),
  ],
)
class ForgotView extends StackedView&amp;lt;ForgotViewModel&amp;gt; with $ForgotView {
  ForgotView({Key? key}) : super(key: key);

  @override
  Widget builder(
    BuildContext context,
    ForgotViewModel viewModel,
    Widget? child,
  ) {
    return Scaffold(
      body: SafeArea(
        child: Padding(
          padding: const EdgeInsets.symmetric(horizontal: 25.0),
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              Container(
                decoration: BoxDecoration(
                  borderRadius: BorderRadius.circular(10),
                  border: Border.all(
                    color: Theme.of(context).colorScheme.onBackground,
                  ),
                ),
                padding: const EdgeInsets.all(16),
                child: const Icon(Icons.fingerprint),
              ),
              verticalSpaceMedium,
              Text(
                'Forgot Password',
                style: Theme.of(context).textTheme.headlineSmall,
              ),
              verticalSpaceMedium,
              Text(
                'No worries, we got you covered.',
                style: Theme.of(context).textTheme.bodyMedium,
              ),
              verticalSpaceMedium,
              TextFormField(
                decoration: const InputDecoration(
                  hintText: 'Email',
                  prefixIcon: Icon(
                    Icons.email,
                  ),
                ),
                enableSuggestions: false,
                autocorrect: false,
                keyboardType: TextInputType.emailAddress,
                textInputAction: TextInputAction.done,
                controller: emailController,
              ),
              verticalSpaceMedium,
              viewModel.isBusy
                  ? const Center(
                      child: MyCircularProgressIndicator(),
                    )
                  : Center(
                      child: ElevatedButton(
                        style: ElevatedButton.styleFrom(
                          minimumSize: const Size(128, 48),
                        ),
                        onPressed: () {},
                        child: const Text('Reset Password'),
                      ),
                    ),
              verticalSpaceMedium,
              Center(
                child: TextButton(
                  onPressed: viewModel.navigateToLogin,
                  child: Row(
                    mainAxisAlignment: MainAxisAlignment.center,
                    mainAxisSize: MainAxisSize.min,
                    children: const [
                      Icon(
                        Icons.arrow_back_ios,
                      ),
                      horizontalSpaceSmall,
                      Text(
                        'Back to Login',
                      ),
                    ],
                  ),
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }

  @override
  ForgotViewModel viewModelBuilder(
    BuildContext context,
  ) =&amp;gt;
      ForgotViewModel();

  @override
  void onViewModelReady(ForgotViewModel viewModel) {
    syncFormWithViewModel(viewModel);
  }

  @override
  void onDispose(ForgotViewModel viewModel) {
    super.onDispose(viewModel);
    disposeForm();
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;and it’s respective forgot view model&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import 'package:boiler_plate/app/app.locator.dart';
import 'package:stacked/stacked.dart';
import 'package:stacked_services/stacked_services.dart';

class ForgotViewModel extends FormViewModel {
  final _navigationService = locator&amp;lt;NavigationService&amp;gt;();

  void navigateToLogin() {
    _navigationService.back();
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Here is the &lt;strong&gt;&lt;a href="https://www.youtube.com/watch?v=-HWkmymzgtc"&gt;output&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Enough Talk. Let’s share some &lt;strong&gt;resources&lt;/strong&gt; for you to have a look at.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Let me introduce &lt;strong&gt;&lt;a href="https://pub.dev/packages/stacked"&gt;Stacked&lt;/a&gt;&lt;/strong&gt;. It provides a simple and elegant state management solution along with its custom &lt;strong&gt;without build context navigation, dialog, bottom sheet and snackbar&lt;/strong&gt; services.&lt;br&gt;
(read detailed documentation &lt;strong&gt;&lt;a href="https://stacked.filledstacks.com"&gt;here&lt;/a&gt;&lt;/strong&gt;)&lt;br&gt;
Here is the &lt;strong&gt;&lt;a href="https://github.com/Mr-RobotDev/flutter-boilerplate"&gt;repository&lt;/a&gt;&lt;/strong&gt; to better understand and a very good README waiting for you to start. (Please like 👍 the repo).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mHZHfdyN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1ljqb9m7majcw0ocxkrt.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mHZHfdyN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1ljqb9m7majcw0ocxkrt.jpg" alt="We are in the endgame now meme" width="555" height="336"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What’s next? It was all I had to share and it’s time for you guys to do something creative with your next mobile app.&lt;br&gt;
Oh, Also. Don’t forget to hit &lt;strong&gt;like&lt;/strong&gt; 👍 if you find this article useful (It helps me a lot to share &lt;strong&gt;valuable info&lt;/strong&gt; with you) and &lt;strong&gt;comment&lt;/strong&gt; if you have any suggestions.&lt;br&gt;
You can connect with me on &lt;strong&gt;&lt;a href="https://www.linkedin.com/in/abdullah-shahid-b9a594219/"&gt;LinkedIn&lt;/a&gt;&lt;/strong&gt; or follow me on Medium for more.&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>mobile</category>
      <category>ios</category>
      <category>android</category>
    </item>
  </channel>
</rss>
