Learn Flutter in 30 Days

Overview
Comments
  • The non-nullable variable 'items' must be initialized. Try adding an initializer expression.

    The non-nullable variable 'items' must be initialized. Try adding an initializer expression.

    I removed the first item which is added on catalog.dart . Logically if we see, it can be null so that we fetch data from network or json files. But after removing that first item. It shows an error. class CatalogModel { static List<Item> items; } Please review it once.

    opened by codersangam 5
  • Issues with VxBuilder

    Issues with VxBuilder

    VxBuilder(
                mutations: {RemoveMutation},
                builder: (context) {
                  return "\$${_cart.totalPrice}"
                      .text
                      .xl5
                      .color(context.theme.accentColor)
                      .make();
                },
    )
    

    Screenshot 2022-05-24 083155 )

    error messege: The argument type 'Widget Function(BuildContext)' can't be assigned to the parameter type 'Widget Function(BuildContext, dynamic, VxStatus?)'.dartargument_type_not_assignable

    opened by xanyl 3
  • Unable to connect to AVD and My phone when trying to run using F5

    Unable to connect to AVD and My phone when trying to run using F5

    I have already opened the original issues here on Flutter's official Github Issues page, but as I'm doing 30 Days of Flutter , I thought that I should share my issue here to.

    Anyone can please check the original issue here - https://github.com/flutter/flutter/issues/82411

    @iampawan @arps18

    opened by SubhanRaj 2
  • Question

    Question

    Hi, I wanna ask can we do like that the items which get added to the cart should still be visible in the cart after reopening the app with shared preferences ?

    opened by AssassinAguilar 0
  • Encountered some issues

    Encountered some issues

    Encountered following bugs and applied undermentioned fixes

    items were not initialized -> initialized as empty list static List<Item> items = List.empty(); required field missing in Item() constructor -> added required keyword Item({required this.id, ....}); Null safety found missing in copyWith() Item copyWith({ String? id ... In factory fromMap() the line which checks map nullability throwing error -> commented //if (map == null) return null; In home.dart list was not mapping to model -> distributed into two assignments List<Item> list = List.from(productsData) .map<Item>((item) => Item.fromMap(item)) .toList(); CatalogModel.items = list;

    opened by noumi92 1
  • Form Validation Error

    Form Validation Error

    After clicking Login button the screen is changing even if the text and password fields are empty

    
    import 'package:first_app/utils/approutes.dart';
    import 'package:flutter/material.dart';
    
    class Login extends StatefulWidget {
      @override
      _LoginState createState() => _LoginState();
    }
    
    class _LoginState extends State<Login> {
      String name = "";
      bool changebtn = false;
      final _formkey = GlobalKey<FormState>();
    
      movetohome(BuildContext context) async {
        if (_formkey.currentState!.validate()) {
          setState(() {
            changebtn = true;
          });
        }
        // push to move to next route
    
        await Future.delayed(Duration(seconds: 1));
        await Navigator.pushNamed(context, Approutes.homeRoute);
        setState(() {
          changebtn = false;
        });
      }
    
      @override
      Widget build(BuildContext context) {
        return Material(
            color: Colors.white,
            child: SingleChildScrollView(
              child: Form(
                key: _formkey,
                child: Column(
                  children: [
                    Image.asset(
                      "assets/images/top.png",
                      fit: BoxFit.cover,
                    ),
                    SizedBox(
                      height: 80.0,
                    ),
                    Text(
                      "Welcome $name",
                      style: TextStyle(fontWeight: FontWeight.bold, fontSize: 28),
                    ),
                    Padding(
                      padding: const EdgeInsets.symmetric(
                          vertical: 30.0, horizontal: 40.0),
                      child: Column(
                        children: [
                          TextFormField(
                            onChanged: (value) {
                              name = value;
                              setState(() {});
                            },
                            style: TextStyle(fontSize: 20),
                            decoration: InputDecoration(
                                hintText: "Enter username", labelText: "username"),
                            validator: (value) {
                              if (value!.isEmpty) {
                                return "Username cannot be empty";
                              }
                              return null;
                            },
                          ),
                          TextFormField(
                            style: TextStyle(fontSize: 20),
                            obscureText: true,
                            decoration: InputDecoration(
                                hintText: "Enter password", labelText: "password"),
                            validator: (value) {
                              if (value!.isEmpty) {
                                return "Password cannot be empty";
                              } else if (value.length < 6) {
                                return "Password length should be atleast 6";
                              }
                              return null;
                            },
                          ),
                          SizedBox(
                            height: 50.0,
                          ),
                          Material(
                            color: Colors.pinkAccent,
                            borderRadius: BorderRadius.circular(changebtn ? 60 : 8),
                            child: InkWell(
                              splashColor: Colors.yellow,
                              onTap: () => movetohome(context),
                              child: AnimatedContainer(
                                duration: Duration(seconds: 1),
                                width: changebtn ? 60 : 160,
                                height: 60,
                                // styling
    
                                alignment: Alignment.center,
                                child: changebtn
                                    ? Icon(Icons.done)
                                    : Text(
                                        "Login",
                                        style: TextStyle(
                                            fontSize: 25,
                                            color: Colors.white,
                                            fontWeight: FontWeight.bold),
                                      ),
                              ),
                            ),
                          ),
                        ],
                      ),
                    ),
                  ],
                ),
              ),
            ));
      }
    }
    
    
    opened by sid86-dev 3
Owner
Pawan Kumar
GoogleDevExpert for Flutter, Firebase, Dart & Web Tech. Public Speaker, Blogger, Entrepreneur & YouTuber. Founder of MTechViral & Let's Flutter with Dart.
Pawan Kumar
Learn Dart with this cheat sheet

Learn Dart with this cheat sheet This project starts from Hello World untill the end of the Dart :) Simple example Hello World in Dart void main() {

null 28 Nov 11, 2022
Learn Dart with this cheat sheet

Learn Dart with this cheat sheet This project starts from Hello World untill the end of the Dart :) Simple example Hello World in Dart void main() {

AmirHossein Mohammadi 8 Jan 16, 2022
❤️Flutter ❤️ tips and tricks ❤️ Awesome Flutter ❤️ tips and tricks ❤️

❤️ Awesome Flutter ❤️ tips and tricks ❤️ Tip 1 : stless & stful We can type stless and stful and we get Autocomplete Suggestion to generate Stateless

Laxman Bhattarai 2.8k Dec 28, 2022
It says it all. Not In Flutter Docs, a sort of underground guide to flutter app development and design.

Not In Flutter Docs It says it all. Not In Flutter Docs, a sort of underground guide to flutter app development and design. Licenses Code is under BSD

Fred Grott 56 Dec 27, 2022
🎓Flutter TodoList tutorial

Todo List built with Flutter Built with Git Tutor This tutorial will walk you through the process of building of a simple todo-list with Flutter Getti

Andrei Lesnitsky 294 Dec 29, 2022
Highly Subjective Roadmap to Flutter Development

Flutter Roadmap Dev Environment https://learngitbranching.js.org Language https://dart.dev/guides/language/language-tour https://dart.dev/guides/langu

Oleksandr Leuschenko 4.3k Jan 2, 2023
Based on Microsoft Fluent Design System and made using the help of Flutter VelocityX.

Vx Fluent UI for Flutter Based on Microsoft Fluent Design System and made using the help of Flutter VelocityX. VxFluentUI is a Flutter component libra

Pawan Kumar 14 Jan 28, 2022
Personal Knowledge Base (PKB). Flutter Responsive Web, Desktop, Android, iOS app. MobX as state management.

PKB - Responsive Flutter Web / Desktop / Android / iOS "Personal Knowledge Base" app written on Flutter. >> View DEMO Video About project This project

Vladimir 21 Oct 10, 2022
Flutter Portfolio App Concept - Day 33

Flutter Portfolio App Concept - Day 33

Mohammad Rahmani 29 Nov 10, 2022
Flutter tips and tricks to make the development smoother and easier

Table of Contents Custom Clippers in Flutter Check if Website is Up or Down in Dart Section Titles on ListView in Flutter Circular Progress in Flutter

Praharsh Bhatt 17 Oct 11, 2022
An awesome Flutter 3d project by Flutter_Cube package

flutter3d A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if thi

Azamatjan 1 Oct 26, 2021
Flutter Tutorial - Speech To Text & Voice Recognition

Flutter Tutorial - Speech To Text & Voice Recognition Let's build a Speech To Text Flutter app which recognizes & analyzes your words to execute comma

null 0 Nov 3, 2021
A Collection of Flutter and Dart Tips and Tricks

A Collection of Flutter and Dart Tips and Tricks

Vandad Nahavandipoor 5.7k Dec 27, 2022
A Flutter implementation of an expandable and animated floating search bar, also known as persistent search.

Material Floating Search Bar A Flutter implementation of an expandable floating search bar, also known as persistent search, similar to the ones used

null 390 Mar 3, 2022
A curated list of awesome cheats needed to quickly get started with flutter development.

dart-cheat-sheet A curated list of awesome stuff needed to get started with your flutter development journey Table of Contents String interpolation Fu

Temidayo Adefioye 137 Jan 2, 2023
A flexible multi select package for Flutter. Make multi select widgets the way you want.

Multi Select Flutter Multi Select Flutter is a package for creating multi-select widgets in a variety of ways. Dialog BottomSheet ChoiceChip Features

null 177 Dec 20, 2022
Animal Sounds App written in flutter for the #100daysOfCode

animalsounds A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if

Antonio Giordano 0 Jan 9, 2022
Amazon Bookshelf Interface Design made in Flutter

amazon_ui_clone A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started

Emanoel Santana 0 Nov 25, 2021
A Flutter widget that scrolls text widget and other widget

marquee_widget A Flutter widget that scrolls Widget Text and other Widget with supported RTL. Provides many customizationsincluding custom scroll dire

Yousif Khalid 23 Nov 21, 2022