1

I got list.

final services= [
  HizmetModel(title: 'ServiceA', price: 30),
  HizmetModel(title: 'ServiceB', price: 30),
  HizmetModel(title: 'ServiceD', price: 30),
];

I would like to write and read this list to Firebase like below.

enter image description here

1
  • 1
    still not solved. Commented Mar 19, 2022 at 19:33

1 Answer 1

1

Assuming that HizmetModel has a method toMap() that converts HizmetModel(title: 'ServiceA', price: 30) => {'ServiceA': 30}.

List<Map> firebaseData = services.map((e) => e.toMap());

You can upload this List to firebase as usual.

https://firebase.flutter.dev/docs/overview/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.