₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,325,049 members, 8,420,060 topics. Date: Thursday, 04 June 2026 at 10:28 AM

Toggle theme

Need Help In Small Flutter Task - Programming - Nairaland

Nairaland ForumScience/TechnologyProgrammingNeed Help In Small Flutter Task (514 Views)

1 Reply (Go Down)

Need Help In Small Flutter Task by leastpaycom(op):
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.
Re: Need Help In Small Flutter Task by leastpaycom(op): 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
Re: Need Help In Small Flutter Task by leastpaycom(op): 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
Re: Need Help In Small Flutter Task by leastpaycom(op): 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

I Made A Simple/beautiful Task Manager App With Flutter..reviews NeededPlease I Need Help In DecidingFlutter Vs React Native Vs Xamarin For Cross Platform Development234

Flexispy App - Who Can Help Me Install It?Which Camera Do You Use?The “male Loneliness Epidemic” Does Not Exist