skip to Main Content

What is the difference between the two classes you see in the photo? Can you explain in all aspects (ram, readability etc.)?

why is there a 220 character requirement? why is there a 220 character requirement? why is there a 220 character requirement?

code

2

Answers


  1. In my simple opinion because when you declare a variable a memory area is allocated and in the second class you have 2 variables declared, namely:

    final TextEditingController controller;
    final String text;
    
    Login or Signup to reply.
  2. Differences worth mentioning are that in the 2nd example the object NewTextField inherits from StatelessWidget which on the one hand extends NewTextField with the members and functionalities of StatelessWidget (object is larger). Furthermore, it makes your widget stateless, while CustomTextField remains statefull because TextField is statefull.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search