Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8746815
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:15:14+00:00 2026-06-13T12:15:14+00:00

How do I parse query strings safely in Dart ? Let’s assume I have

  • 0

How do I parse query strings safely in Dart?

Let’s assume I have q string with the value of:

?page=main&action=front&sid=h985jg9034gj498g859gh495

Ideally the code should work both in the server and client, but for now I’ll settle for a working client-side code.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T12:15:15+00:00Added an answer on June 13, 2026 at 12:15 pm

    I have made a simple package for that purpose exactly: https://github.com/kaisellgren/QueryString

    Example:

    import 'package:query_string/query_string.dart');
    
    void main() {
      var q = '?page=main&action=front&sid=h985jg9034gj498g859gh495&enc=+Hello%20&empty';
    
      var r = QueryString.parse(q);
    
      print(r['page']); // "main"
      print(r['asdasd']); // null
    }
    

    The result is a Map. Accessing parameters is just a simple r['action'] and accessing a non-existant query parameter is null.

    Now, to install, add to your pubspec.yaml as a dependency:

    dependencies:
      query_string: any
    

    And run pub install.

    The library also handles decoding of things like %20 and +, and works even for empty parameters.

    It does not support "array style parameters", because they are not part of the RFC 3986 specification.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following .ashx page that takes some query string parameters and returns
I have written a python script to parse an HTML page, get some strings
I have startdate in QueryString with value: 3/1/2012 DateTime.Parse(Request.QueryString[startdate]).Month return month number: 1 but
I have to parse the following data {ResultSet:{Query:microsec fin,Result: [{symbol:MICROSE_a.NS,name: MICROSEC FIN SERV LTD
Possible Duplicate: jQuery won't parse my JSON from AJAX query So I have parsed
Using Python2.4.5 (don't ask!) I want to parse a query string and get a
Cursor smCursor = getContentResolver().query( Uri.parse(content://contact), new String[] { _id, address, body }, address like?,
I have a small interrogation concerning my grammar. I want to parse strings, like
I have this code List<string> IDs = new List<string>(); XDocument doc = XDocument.Parse(xmlFile); var
I am very new to node.js and mongodb. I have a page getting query

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.