Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,152,652 members, 7,816,672 topics. Date: Friday, 03 May 2024 at 02:53 PM

Need Help In Small Flutter Task - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Need Help In Small Flutter Task (387 Views)

I Made A Simple/beautiful Task Manager App With Flutter..reviews Needed / Please I Need Help In Deciding / Flutter Vs React Native Vs Xamarin For Cross Platform Development (2) (3) (4)

(1) (Reply) (Go Down)

Need Help In Small Flutter Task by leastpaycom: 10:43pm On Oct 10, 2022
I am a newbie in flutter. I Have problem splitting a string gotten after scanning a qrcode image.
This is how the string generated looks like. [10200,3/02/2022,2,walterjnr1].
i need to split the string so that i can use the four elements to update my database accordingly.

i will add screenshots of qrcode image and my code to show what i have done so far.

please i need someone to re-write my code or explain the logic to use, but i prefer the code.
my whatsapp +234**806**736**1023

Re: Need Help In Small Flutter Task by Nobody: 12:34am On Oct 11, 2022
No time to write anyone's code for them.

How I would approach this is to generate a QR of a Json String instead so instead of splitting the returned string which could break in so many ways. All I have to do get back the data is to serialise the returned string.

some like;

final paymentJson = Json.decode(returnedString)
PaymentDetails.fromJson(paymentJson);

then use the payment details class to access the properties I need to send to the server.

This way it is type-safe and you can check if the serialise failed or any properties is missing and display an appropriate response.

Also, in the event to need to add new properties or remove old ones, you would only need to modify the PaymentDetails model.

1 Like

Re: Need Help In Small Flutter Task by leastpaycom: 10:54am On Oct 11, 2022
Please let me have your WhatsApp number

N/b: The system is made of two versions :
One app(restaurant version) generates the qr code and the other app ( Customers version) scans the code.

If I store d data in json , how will I serialized the return string while scanning?

Thanks for your reply
Re: Need Help In Small Flutter Task by Nobody: 11:06am On Oct 11, 2022
leastpaycom:
Please let me have your WhatsApp number

N/b: The system is made of two versions :
One app(restaurant version) generates the qr code and the other app ( Customers version) scans the code.

If I store d data in json , how will I serialized the return string while scanning?

Thanks for your reply
How are you working with Rest API without any knowledge of serialisation?

Anyway, here is the documentation on getting started with JSON and Serialisation in Flutter https://docs.flutter.dev/development/data-and-backend/json

1 Like

Re: Need Help In Small Flutter Task by leastpaycom: 11:15am On Oct 11, 2022
DrLevi:

How are you working with Rest API without any knowledge of serialisation?

Anyway, here is the documentation on getting started with JSON and Serialisation in Flutter https://docs.flutter.dev/development/data-and-backend/json

lol, your whatsapp number please
Re: Need Help In Small Flutter Task by Nobody: 11:26am On Oct 11, 2022
leastpaycom:


lol, your whatsapp number please
I can't. No need to exchange personal contacts

1 Like

Re: Need Help In Small Flutter Task by leastpaycom: 11:45am On Oct 11, 2022
DrLevi:

I can't. No need to exchange personal contacts

ok
Re: Need Help In Small Flutter Task by inbriggston: 4:00pm On Oct 11, 2022
[center][/center]

(1) (Reply)

Top 10 Web3 Development Companies In California / Nigeria Bloggers Come In Here / Please Help.

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 13
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.