Questions tagged [flutter]

Seeking answers regarding the versatile Flutter cross-platform UI toolkit? Feel free to employ this tag! For queries confined to a specific platform, remember to include relevant tags like [android], [ios], and more. Furthermore, consider adding the [dart] tag for coding-related questions.

Extract only the values from a JSON string using Regular Expressions

Need help cutting out specific values from a JSON String in Flutter/Dart. Here's an example of the JSON String: [{"insert":"Test12 "},{"insert":"Test1","attributes":{"b":true}},{"insert&q ...

What is the best way to manage an unused parameter received from an API in a Flutter

In order to avoid Gson errors when parsing objects, I only need the name and id parameters for Dropdown. How can I handle unwanted parameters from the API response in a Flutter object? import 'package:meta/meta.dart'; import 'dart:convert'; c ...

What is the best way to eliminate excess space within a TextFormField in Flutter?

When I added the suffixIcon, a slight extra space between the hint text and underline became noticeable. However, when the suffixIcon was not included, the layout looked perfect. In the examples of "New Password" and "Confirm Password," the issue with the ...

The onChanged attribute of TextField disappears when the done button is pressed on the keyboard after typing in Flutter

class AddTaskScreen extends StatelessWidget { const AddTaskScreen({Key? key}) : super(key: key); @override Widget build(BuildContext context) { String newTask = ''; return Container( color: const Color.fromARGB(255, 117, 117, 117), ...

Linked to various listviews, numerous flat buttons can be found. But how can we make the unselected buttons appear greyed out and unfocused

I am currently working on an app design that includes 3 flat buttons placed in a row. The first button is selected by default and displays a listView widget. The other two buttons should be greyed out until clicked, at which point they will show another ...

Error encountered while establishing connection with Flutter, Node.js, and Socket.io

I'm in the process of building a multiplayer TicTacToe game using Flutter and Node.js with Socket.io integration. Here is the code: Flutter late io.Socket socket; final String url = 'http://localhost:5000'; @override void initState() { super ...

Exploring ways to send data to WebView in Flutter

How can I pass the location obtained in my Flutter app to a WebView for further processing within the opened site? var userLocation = Provider.of<UserLocation>(context); Here is my WebView setup: WebView( initialUrl: widget.url, javasc ...

Is there a hashing algorithm that produces identical results in both Dart and TypeScript?

I am looking to create a unique identifier for my chat application. (Chat between my Flutter app and Angular web) Below is the code snippet written in Dart... String peerId = widget.peerid; //string ID value String currentUserId = widget.currentId ...

The Flutter error message states that a 'String' type is incompatible with an 'int' type when trying to access an 'index'

Seeking assistance for an app I am developing to fetch data from a URL post in JSON format. The data includes information about a person, such as their client details and address. However, when attempting to use this address information to send it to anoth ...

At times, certain HTTP (fetch-XHR) requests tend to get terminated. In my case, I am utilizing Flutter Web (get: ^4.6.6) alongside Xampp (Laravel

https://i.stack.imgur.com/MJUOH.png https://i.stack.imgur.com/fDhJe.png A request sent via Http (fetch-XHR) enters a state of cancellation, but it occasionally functions properly. It appears that the initial attempt after loading the page is usually uns ...

Converting a lengthy string of coordinates into latitude and longitude in Flutter

From a Json API call, I am receiving a group of latitude and longitude coordinates formatted as a long string in the "lineStrings" block. Typically, I would expect individual latitudes and longitudes that I could iterate through, but instead, I have this ...

Each sub-array must be assigned a unique parent array name in the JSON structure

Flutter / Dart Discussion I have an array with an "Accessories" list that includes a brand name ("samsung"). I need to add the brand name to all subarrays. In the subarray of the "Brand" key, you can see the second code space which contains the parent ke ...

What is the best way to send nested model objects to the parent widget in Flutter?

While attempting to populate my different models with values, I encountered an issue when using the toJson() function of the parent model. This function is supposed to call other models with their objects and create a JSON format that can be sent to Fireba ...

Progressive UI elements, designed to adjust seamlessly across various screen dimensions

I have a Flutter app with a form, and I want the initial page of the form to display an overview of the steps similar to a stepper: https://i.stack.imgur.com/cCdB9.png Since my app needs to work on both mobile and web platforms, it must be responsive to d ...

Tips for presenting Nested JSON information?

I am having trouble figuring out the correct syntax to display DietName from Data{}, PartnerName from PartnerData[], and DayName from DayList[]. These data are inside another ArrayList, and I need help displaying them. { "Status": "1", "Message": " ...

Json model lacks a getter for instances in the class

I'm facing a problem that I couldn't find the solution to through Google or here, so here's my issue. I'm trying to retrieve JSON data from my own JSON test server at: The JSON data is nested and I'm attempting to GET the "r ...

What is the best way to conceal the keyboard in a Flutter dropdown menu?

I'm currently working on a project using Flutter and experiencing issues with the keyboard opening when a user clicks on the DropDownMenu. I am looking for a solution to prevent the keyboard from popping up when the user interacts with the dropdown list. ...

Having trouble extracting JSON data from an API in a Flutter application

My goal is to retrieve and parse JSON data from a REST API in node.js using express and MongoDB, and then present it as userdata. However, no matter what I attempt, I am unable to successfully parse the data. It either throws an exception like "Unhandled E ...

What is the process of transforming a list of arrays, which is in JSON format, into Dart?

Having trouble with the JSON_ANNOTATION feature when dealing with a json that contains nested arrays. Uncertain about how to convert the paths in the array into a single Paths object. Maybe something like this, but it doesn't seem to handle multiple level ...

FirebaseCloudMessaging : PlatformException (PlatformException(null-error, The host platform unexpectedly returned a null value for a non-null return value., null, null))

I am currently facing a challenge in sending notifications from a Node.js API to a Flutter application. Initially, my goal is to enable my application to receive notifications from Firebase. However, I encountered an issue when initializing the app: Pla ...

The Flutter image blurs into a striking combination of red and black as the screen dimensions are altered

https://i.stack.imgur.com/YeZa6.png Hello everyone, we are facing an issue with Flutter web. Here's what's happening: When we use flutter run -d chrome --web-renderer canvaskit and flutter run -d chrome --web-renderer html, nothing changes. If we open th ...

What is the optimal ranking system for learning in Mongodb using Node.js and Express? How can we best utilize these

1 - What is the recommended order for learning (Mongo db,Node.js,Express)? 2 - Is this platform compatible with both web and mobile devices? 3 - Can you explain the functionalities of the programs? 4 - I'm planning to integrate it into my Flutter mobile ...

Sketch a perfect circle effortlessly morphing into a straight line

I encountered an issue with my Flutter app where I was unable to create a shape like the one shown in this image for my Slider: https://i.stack.imgur.com/wlXG2.png Here is what I currently have: final paint = Paint() ..color = Colors.black ..s ...

Storing and Retrieving Cookies for User Authentication in a Flutter Application

I am currently working on developing a platform where, upon logging in, a token is created and stored in the cookie. While I have successfully implemented a route that stores the cookie using Node.js (verified in Postman), I encounter issues when attemptin ...

Scrolling effect on images for carousel display

Can the lateral animation feature from material3 documentation be implemented in Flutter, such as with a PageView? I am particularly intrigued by the way the image adjusts to the size of the page when swiping horizontally. Check out material3's lateral an ...

Assertion failure at line 4429, position 12: The condition '!_debugLocked' is not satisfied

Below is the code I have created for a ListView.builder to display 4 elevated buttons in a container with axis.horizontal. When clicking on the container, it should navigate to another page. Additionally, I have set up a list to retrieve data from each c ...

Encountered a type mismatch in Flutter where an 'int' was expected but a 'String' was provided instead

Recently, I've been diving into creating a quotes app that utilizes a rest API to fetch data and display random quotes at the center of the screen with just a tap. However, I seem to be encountering some hurdles in getting everything to function as in ...

The class `MappedListIterable<dynamic, dynamic>` cannot be assigned to the type `List<Weather>`

I have created three classes to handle JSON parsing from an API call. Here are the classes: class CurrentWeatherInfo { double temperature; double feelsLike; double minTemperature; double maxTemperature; int pressure; int humidity; CurrentWea ...

Require a standardized query parameter format within the URL

In my flutter app, I have a method that performs a get request by passing parameters into the URL. Future<Map<String, dynamic>> getData( {String path, String token, Map<String, String> params}) async { try { Uri uri = Uri ...

The parameter of the Card widget in Flutter is not properly defined

Need help with creating a reusable Card widget in my Dart app. Keep encountering a named parameter is not defined error. Any ideas on what could be causing this issue? Here's what I've attempted so far: Reinstalling the flutter SDK. No issues fo ...

What is the method to achieve a perfectly round shape for the FAB in Flutter's Material Design 3, similar to that of Material Design

I attempted to implement the following code: FloatingActionButton( onPressed: () {}, backgroundColor: Colors.transparent, elevation: 0, child: Container( decoration: const BoxDecoration( shape: BoxShape ...

In an attempt to transform a List<T> into a JsonString for storage in sharedPreferences, there arises the challenge of dealing with a data structure that includes both a Contact object and a boolean value within &

Struggling with saving a list to sharedpreferences by converting it to JsonString. Facing the issue of 'encodable object failed: Instance of 'CustonContact''. Looking for assistance. class CustomContact extends Contact{ Contact contact; b ...

Retrieving information from intricate JSON structures using Flutter

I am trying to extract the "title" from this json response Although I can access other data like kind or etag over items, the items array is shown as null. How can I retrieve the title from it? var data = await http.get("https://www.googleapis.com/youtub ...

Transform the JSON data into a collection of unique objects in a Flutter application

Currently, I am working on saving and retrieving a list of custom objects to and from shared preferences. Below is the code for my save function: save(String key, value) async { final prefs = await SharedPreferences.getInstance(); prefs.setString(key, j ...

Navigate through the pages by simply clicking a button on my navigation bar

I currently have a NavigationBar on my app that consists of 3 tabs. I am looking for a way to switch the active tab or destination when a button is pressed. The Navigation Bar setup in the Home class: body:IndexedStack( index: currentPageIndex, ...

Utilizing dynamic JSON values in Flutter for efficient parsing

Within my Flutter application, I am receiving a JSON response and able to parse it with ease. However, there is a key named "data" in the JSON response that provides me with dynamic values as follows: Sometimes it appears like this (1): "da ...

Dealing with dynamic JSON in Flutter: A concise guide

{ "status": "error", "msg": "Please ensure all fields are filled out properly", "error": { "device_token": [ "The device token field is ...

ExpressJS exhibits unique behavior based on whether the API is requested with or without the specified PORT number

I have encountered an issue with my 2 flutter web apps. One of them is functioning flawlessly when I request the URL, but the other one only works when I include the port xxxxx:4000/nexus-vote. However, when I remove the port, I receive a status code of 20 ...

Creating a flutter app that features a vertical line separating the first letter of each text widget's children within a ListView.builder

I am trying to design a user interface similar to the example below, where the initial character of each Text widget within a ListView's children is linked by a vertical line. If any of the items in that ListView have sub-children, the vertical lines ...

Unable to process: ' (dynamic) =>Meta' as it is not compatible with type '(String, dynamic) => MapEntry<dynamic, dynamic>' for 'transform'

Examining my json data: { "data": { "id": 1, "title": "Test-1", "description": "Description of test-1.", "category_id": "1", "product_sizes": [ ...

Tips for resolving the error message "The getter 'length' was called on null"

I uploaded a PHP file on my college server, and it works fine when accessed directly from the server. The JSON data can be retrieved by running the PHP file at this link . However, when trying to access the same data in a Flutter app, I encountered an erro ...

Creating a ripple effect on Tab items in Flutter

Hey there! I recently set up a Flutter TabBar with tabs and was wondering if there is a way to incorporate a button-like ripple effect when the user clicks on the tab buttons. Any suggestions or tips would be greatly appreciated! TabBar( isScro ...

Guide for configuring Supabase authentication details in a NodeJS environment

I've decided to separate my Supabase database interactions from my client Flutter app and create a dedicated NodeJS express app for that purpose. Currently, I have included the credentials of the logged-in user in the header of my API requests as show ...

What is the best way to apply multiple conditions to filter JSON data in Flutter?

Hey there, I am looking to enhance the filtering of a JSON list in Flutter by adding an additional condition. Here is a snippet of my JSON structure: { "product": "butox 50 ml", "agencies": [ { ...

Utilizing a FutureBuilder for fetching JSON data in a Flutter DropDownButton

I have been developing an app using Flutter and I am currently working on implementing a Dropdown Button that will display values received from a JSON response via an API built with Django. Here is the JSON response: [{"name": "FC1", "username": "admin"} ...

The type '_InternalLinkedHashMap<String, dynamic>' is incompatible with the type 'BanarModel'

There seems to be an issue with the code. I believe it is because I stored an object in a list, so how can I solve this? The error message says '_InternalLinkedHashMap' is not a subtype of type 'BanarModel'. class Home ...

Tips for processing JSON data in a Flutter application when the response consists of an array of objects

I received an API response structured like this: [ {"name":"lakshay","id":"1217","type":"Staff","temperature":56.6,"date":"12-06-2020"}, {"name":"lakshay","id":"1217","type":"Staff","temperature":56.6,"date":"12-06-2020"}, ..... ] I want to ...

I am encountering an error where the type `'_Map<String, dynamic>'` is not being recognized as a subtype of type `'FutureOr<List<dynamic>>'`

I have developed an app that utilizes an API to retrieve data. However, I am currently encountering an error when trying to retrieve the data from the API. Here is the code for my User (Character) model class: class Character { late int id; late String ...

Showing all columns in a table using Flutter

I'm currently developing a test application using Dart, which is designed to display and insert data into a database hosted on 000webhost.com. In my app, I'm trying to display JSON data in a table where all the columns are contained within a sin ...

I'm looking to create a redirect feature using a QR code that will direct users to a specific page within my Flutter app. How

When the user scans the QR code, they will be taken to a secret internal page that can only be accessed through this specific link. I attempted to use various libraries such as , but it did not achieve the desired outcome. ...

The slider remains stationary, yet its value fluctuates

Below is the code snippet I have: class _ReadingBookPage extends State<ReadingBookPage> { double _sizeFont = 14; ... @override Widget build(BuildContext context) { return Scaffold( body: ... ...

I am experiencing difficulties with socket.io and my Flutter app is unable to establish a connection with the server or backend component

For the backend of my flutter app, I utilized socket.io and node.js. I created an index.json file and implemented a function on a page to establish a connection between my app and the backend. However, I am facing issues with it not working as expected. Be ...

Guide on transitioning a token authenticated user from an API to session-based authentication within a Flutter app through a Flutter web view

My goal is to achieve the following: imagine I have an authenticated user with an API token. When this user clicks a button, I want to open a web view and authenticate them using session-based authentication. https://i.stack.imgur.com/CsZ57.png This is wh ...

Tips for fetching data from a Django REST API endpoint and displaying it in a Flutter Dropdown widget

I am currently working on a project that involves using Django REST for the backend with Flutter dropdown widget to display a list of Country states. However, I am facing challenges in getting the list of states to appear in the dropdown menu. Can anyone p ...

What is the process to manually trigger hot reload in Flutter?

I am currently developing a Node.js application to make changes to Flutter code by inserting lines of code into it. My goal is to view these updates in real-time. Is there a way to implement hot reload so that every time I finish writing a line in the file ...

Instructions for displaying emotes and UTF-8 characters in a Flutter/Java app

In my efforts to display text in Flutter, I am facing the challenge of ensuring that the text is encoded in UTF-8 and can also show emojis. Unfortunately, I have not been successful in achieving both simultaneously. When attempting to decode an input with ...

Cracking the Code: Unleashing the Art of Parsing JSON with Dart's Dynamic Object

Can anyone help me with mapping this JSON in Dart? I received this JSON as the response.data from a get request made using the Dio library in Flutter. [ { "getPlayersFilterResult": { "Players": [{p1},{p2},..] } }, ...

Incorporate chat functionality into a Flutter app without relying on Firebase

Looking to add chat functionality to my app as a feature request. The backend is built in nodejs, so I'm exploring different ways to achieve this. Tried using socket.io but ran into compatibility issues between socket.io and flutter. My preference is not ...

What is the best way to handle a JSON map containing a list of maps retrieved from an API for an HTTP GET request

I'm encountering a persistent error that I can't seem to resolve: NoSuchMethodError (NoSuchMethodError: The method 'map' was called on null. Receiver: null Tried calling: map(Closure: (dynamic) => Name1Name2)) Despite my best effo ...

Error occurred while retrieving JSON data due to utilizing null check operator on a null value

I'm having trouble understanding this code. builder: (context, snapshot) { if (snapshot.data != null && widget.stored!.b) { return new GridView.count( children: List.generate(snapshot.data!.length, (index) { return ...

Fetch the Future<list<DATA>> array from an API in Flutter and parse the JSON response

I recently dove into Flutter and decided to start using FlutKit packages. I've encountered a challenge with an array LIST while working on this project. FlutKit utilizes a list with static Json data to cache initial data, including Products, Categories, an ...

Easily create clickable words in Flutter by extracting specific words from a JSON String

In my JSON response, I receive a set of questions. My goal is to split these questions into words and compare them with another JSON response. When there's a match, I want to highlight the matching words and make them clickable to display a pop-up showing ...

Tips for unraveling intricate JSON data structures in Dart/Flutter

Following my server request, I received the following JSON data: [ { "id": 56012, "name": "The name", "description": "<p>description</p>\n", "regula ...

Retrieving JSON data in Flutter based on category

I am in the process of creating an e-commerce application. I am using a ListView.builder to show the data but I'm struggling with fetching products based on the selected category. Below is the model for the list of categories: class Category { final ...

Style for Selected Avatar Chips in Flutter FilterChip

I'm using a `FilterChip` along with a `CircleAvatar` for the avatar, but when it's selected, there's an unwanted rectangle that I can't seem to locate any information about. How can I get rid of it? Here is the code snippet: child: FilterChip( av ...

Tips on how to effectively sort JSON data within the itemBuilder function

I am facing an issue with filtering JSON data that contains objects with name, latitude, and longitude. I only want to display the names of objects that have both latitude and longitude values. Example object in JSON with lat and lng: dynamicDataUrl: ...

Creating a customized background color for an Elevated Button styling

I'm currently working on customizing a Flutter ElevatedButton within the context of an app that adheres to a specific color scheme created by myself. Is there a way to apply styles to this button using a particular hexadecimal color value (for example, u ...

Ways to ensure your drawer remains constantly open

I'm interested in incorporating a drawer similar to the one shown in this image into my Flutter app: View Image Currently, I am using NavigationRail and have read that it is possible to add a menu button to open a navigation drawer. Can anyone provid ...

Error encountered during build: The specified resource value for <color> is invalid

Whenever I attempt to launch my Flutter App on a Pixel 5 Device, I encounter this error message: /Users/username/.gradle/caches/transforms-3/0ace7b4637c402760ef38d3581a65ee0/transformed/appcompat-1.4.2/res/values/values.xml:37:4: Invalid <color> for ...

When utilizing a rest API in Flutter, information seems to vanish unexpectedly

After implementing a future builder to fetch data from the backend on the first tab of the bottom navigation bar, I noticed that the data disappears when I switch to the second tab. Why does this occur and how can it be resolved? https://i.stack.imgur.com ...

Incorporate JSON data into a Flutter list view in a dynamic way without the need to first load it into

I am completely new to working with flutter and I have been wondering if there is a way to directly load a JSON string into a listview widget without the need to create a specific model for it. The JSON data consists of an array called "fields", and each e ...

Obtaining Local JSON data in a standard Flutter class

In the Services-> math_logic.dart file, I have a page dedicated to mathematical calculations where I did not use StateFul Widget. However, I encountered an error indicating that 'Future is not a subtype of String'. It seems that there was also an issue ...

What ways can we implement identification features in Flutter Web applications, such as adding an ID or name property?

While developing a Flutter Web application, I am exploring a Web-UI-Testing framework that is Selenium-based. Unfortunately, I am struggling to locate an HTML element that represents a specific flutter widget by its id or name attribute. The widget key doe ...

Exporting the flutter PATH can cause conflicts with the functionality of docker cli and npm

Hello, I've encountered an issue that is puzzling me. After installing Flutter and adding its path to my .zshrc file as shown below: export PATH={$PATH}:/Users/matteo/Documents/flutter/bin I started experiencing difficulties with Docker and/or Npm ( ...