They're trying to get the fix and their positions from flutter but what I get is a string with all the data and not with their positions, i'm using BLoC
Firebase:
As you can see in firebase I have a data array

cloud_firestore_api.dart:
Future<QuerySnapshot> getCites() async {
return await _db
.collection('type_cites').getDocuments();
}
cloud_firestore_repository.dart:
Future<QuerySnapshot>getCites() => _cloudfireStoreAPI.getCites();
user_bloc.dart:
Future<QuerySnapshot>getCites()=> _cloudFirestoreRepository.getCites();
and here's where I send to call my function and what I get instead of an array is a string:
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:flutter/material.dart';
import 'package:generic_bloc_provider/generic_bloc_provider.dart';
import 'package:/User/bloc/userbloc.dart';
class DatePickerScreen extends StatefulWidget {
UserBloc userBloc;
QuerySnapshot snapshot;
@override
State<StatefulWidget> createState() {
return _DatePickerScreen();
}
}
class _DatePickerScreen extends State<DatePickerScreen> {
@override
Widget build(BuildContext context) {
widget.userBloc = BlocProvider.of<UserBloc>(context);
widget.userBloc.getCites().then((result) {
widget.snapshot = result;
});
return RaisedButton(
onPressed: () {
print( widget.snapshot.documents[0].data);
},
);
}
}
output:
and if I print the size of what it brings:
when I actually have it in an arrangement that has 3 positions and its size devernial of being 3 and not 1, Any way to get the fix right from firebase?

