Flutter

List.generate The getter 'length' was called on null. Receiver: null Tried calling: length

╄→尐↘猪︶ㄣ 提交于 2021-02-11 12:48:57
问题 both files have same problem **The getter 'length' was called on null. Receiver: null Tried calling: length ** file name product.dart import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:http/http.dart' as http; import './product_list.dart'; import '../../../api/api_conf.dart' as ApiBase; import '../../../size_config.dart'; import './section_title.dart'; class PopularProducts extends StatefulWidget { @override _PopularProductsState createState() =>

Flutter Map markers not displaying

前提是你 提交于 2021-02-11 12:47:39
问题 import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:flutter/material.dart'; import 'package:geolocator/geolocator.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; class NewMap extends StatefulWidget { @override _NewMapState createState() => _NewMapState(); } class _NewMapState extends State<NewMap> { GoogleMapController _controller; Position position; Widget _child; Map<MarkerId, Marker> markers =

How do I catch an error in Flutter (`beacon_broadcast` library)? Conventional methods don't work for this library

两盒软妹~` 提交于 2021-02-11 12:41:21
问题 I am using a library called beacon_broadcast when I start the beacon broadcast, it outputs an error in the console, but I'm not able to catch it ( try , .catchError , and using .then doesn't work). Console Output: D/BeaconParser( 7318): Parsing beacon layout: blah_blah_blah D/BluetoothAdapter( 7318): isLeEnabled(): ON D/BluetoothAdapter( 7318): isLeEnabled(): ON E/BeaconTransmitter( 7318): Advertisement start failed, code: 2 Error code 2 means advertising slot not available. I do not think

Listview shows overflow issue on right side

允我心安 提交于 2021-02-11 12:40:51
问题 I have below code to display 2 cards and trying to have horizontal movement. Listview is already in place. Axis direction is horizontal. Still there is overflow issue in right side. Also tried shrink wrap but did not work. Issue can be easily replicated on dart pad: https://dartpad.dartlang.org/dart? just copy the below code. void main() { runApp(MyApp()); } class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( theme: ThemeData.dark()

Flutter. Elements in the row overlaps each other [closed]

寵の児 提交于 2021-02-11 12:40:35
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 8 days ago . Improve this question I need to set "Inactive" zones on Slider. So i did it with Row, Expanded and Container widgets, but there is still one issue... Elements in the row overlaps each other How can i force my Slider to overlap containers? Code(Slider in the middle section) Slider 回答1: So, i did as

Flutter. Elements in the row overlaps each other [closed]

别等时光非礼了梦想. 提交于 2021-02-11 12:40:22
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 8 days ago . Improve this question I need to set "Inactive" zones on Slider. So i did it with Row, Expanded and Container widgets, but there is still one issue... Elements in the row overlaps each other How can i force my Slider to overlap containers? Code(Slider in the middle section) Slider 回答1: So, i did as

Listview shows overflow issue on right side

走远了吗. 提交于 2021-02-11 12:39:48
问题 I have below code to display 2 cards and trying to have horizontal movement. Listview is already in place. Axis direction is horizontal. Still there is overflow issue in right side. Also tried shrink wrap but did not work. Issue can be easily replicated on dart pad: https://dartpad.dartlang.org/dart? just copy the below code. void main() { runApp(MyApp()); } class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( theme: ThemeData.dark()

Not Able to Fetch JSON values to field in flutter

半城伤御伤魂 提交于 2021-02-11 12:39:45
问题 I am able to fetch the JSON data successfully, but not able to fetch the fields of JSON data and build a list in flutter. This is the code I am using to fetch the field data OrderModel.fromJson(Map<String, dynamic> json) { error = json['error']; if (json['content'] != null) { content = new List<OrderContent>(); json['content'].forEach((v) { content.add(new OrderContent.fromJson(v)); }); } } The json['content'] is Map<String, dynamic> . In .forEach((v) what should I write to get the data? I am

How do I catch an error in Flutter (`beacon_broadcast` library)? Conventional methods don't work for this library

杀马特。学长 韩版系。学妹 提交于 2021-02-11 12:39:11
问题 I am using a library called beacon_broadcast when I start the beacon broadcast, it outputs an error in the console, but I'm not able to catch it ( try , .catchError , and using .then doesn't work). Console Output: D/BeaconParser( 7318): Parsing beacon layout: blah_blah_blah D/BluetoothAdapter( 7318): isLeEnabled(): ON D/BluetoothAdapter( 7318): isLeEnabled(): ON E/BeaconTransmitter( 7318): Advertisement start failed, code: 2 Error code 2 means advertising slot not available. I do not think

How to hide AppBar in the application created in Flutter

假如想象 提交于 2021-02-11 12:37:56
问题 I have this code below, I want to hide the bar app, is it possible? I've tried straight through the Android Theme but I did not get Success. :( @override Widget build(BuildContext context) { return WebviewScaffold( appBar: AppBar( title: TextField( autofocus: false, controller: controller, textInputAction: TextInputAction.go, onSubmitted: (url) => launchUrl(), style: TextStyle(color: Colors.white), decoration: InputDecoration( border: InputBorder.none, hintText: "Digite a URL", hintStyle: