Questions tagged [statelesswidget]

121 questions
0
votes
1 answer

For creating common widgets, which one is best Statless, stateFull or simple function with named params?

If a widget has the same style all over the project. We make it common so that we can easily use that with a minimal number of lines. But which one should I use to create a common widget. Let's assume I have a text widget and text form field widget…
0
votes
1 answer

How to call two widgets separately from StatelessWIdget that is in another dart file

So I am new to Flutter and I want to make a simple scoreboard with its timer and everything. The problem is that I got two files screen_result and time. In screen_result I have a screen and buttons to operate the scoreboard, in time I have a…
0
votes
1 answer

Trying to build a future context but my build method has an error

I have this code and the problem is that: 'ProfileView.build' ('Future Function(BuildContext)') isn't a valid override of 'StatelessWidget.build' ('Widget Function(BuildContext)'). I tried to remove future but it doesn't work, any…
arrow
  • 7
  • 4
0
votes
1 answer

Flutter - The non-nullable local variable 'newTaskTitle' must be assigned before it can be used

Hi so I have been getting this error - "The non-nullable local variable 'newTaskTitle' must be assigned before it can be used. (Documentation) Try giving it an initializer expression, or ensure that it's assigned on every execution path." while…
0
votes
1 answer

i have a problem in flutter i dont have any idea i try all methods

vs wrong android studio wrong it is my first wrong i installed flutter but i am getting errors like this i got my error about java installed sdk installed sdk i have no idea i am waiting for your help virtual studio code say Exception: Build process…
Sarx
  • 1
0
votes
1 answer

Flutter - How to put this string code into stateless widget or stateful widget?

Example 1 Can someone show me how to add this Example 1 to stateless or stateful widget in Flutter?
Joe Joe
  • 3
  • 3
0
votes
1 answer

How to create slightly varying widgets from a single base class based on two parameters in Flutter?

Is it possible to create slightly varying instances of a class based on two parameters A and B so that If A and B are present --> create instance variation AB If A and not B are present --> create instance variation A If not A and B are present -->…
zaplec
  • 1,681
  • 4
  • 23
  • 51
0
votes
1 answer

Flutter same constructor parameters for different widgets

I created two buttons but they have common constructor parameters. I don't want to write same parameters again. I want to call all buttons' parameters from mixin or class. My buttons below: Custom text button: class HTextButton extends…
emowise
  • 121
  • 1
  • 14
0
votes
0 answers

How can I make separate color and button stateless and stateful classes for this code in flutter?

I would like to make an extra file 'extra.dart' where I would like to add my top container and the four TextButtonWidgets. 1 ColorWidget, 4 TextButtonWidgets with each one having colorwidget as their child. I would name the top container widget…
giannik28
  • 403
  • 2
  • 6
  • 14
0
votes
1 answer

How to hide a container inside the stateless widgets?

I am building a chatbot using flutter. I have listview of buttons inside a container. If the user presses any button, the container must disappear. I tried with a boolean variable but nothing changes as we cannot alter the state. I cannot change the…
ramya
  • 33
  • 1
  • 8
0
votes
1 answer

Flutter streambuilder does not update a statefulwidget or statelesswidget

I'm trying to build a streambuilder. My problem is that the streambuilder does not update other statefulWidgets inside the streambuilder widget. Here my code: class ChatPage extends StatefulWidget { //pass parm var chat_object; …
user16754196
0
votes
2 answers

By adding the void function it donot calls the build method of the statlessWidget

whenever I create void function the build method of stateless widget is not called due to which further methods are also not called. Kindly guide with the possible solution. import 'package:flutter/material.dart'; class TaskTile extends…
Usama Bin Tahir
  • 143
  • 1
  • 11
0
votes
2 answers

flutter, next page with a variable controller

Excuse me guys, i tryin to build a new page, but with variable "nextcode" in it. so in the new page, it will show nextcode text onTap: () { Navigator.push( context, …
Silent Roar
  • 29
  • 1
  • 4
0
votes
1 answer

How can I pass flutter textediting controller value from one stateless widget to another stateless widget

Here Is the main.dart file: import 'package:flutter/material.dart'; import 'package:untitled/button.dart'; import 'package:untitled/form.dart'; void main() { runApp(MyApp()); } class MyApp extends StatelessWidget { @override Widget…
S.n. Ahad
  • 316
  • 3
  • 6
0
votes
1 answer

Stateful issues with widgets -- update from parent and update from inside

This is going to be way too long but I don't know where the problem is/what to do. Updated: The values track properly if I use a StateLessWidget instead; so... Purpose At its core, I envisioned my TouchPoint to be a button that if tapped and…
ThorMJ
  • 89
  • 1
  • 2
  • 9
1 2 3
8 9