title: How to properly save data in text field flutter using SharedPreferences?
body: <p>I'm trying to get the data from the text field via 'Save Data' button then show that data in Text Widget when I click the 'Show Data' button. I'm using SharedPreferences dependency. I'm already done with the code but there's one problem, whenever I click the 'Show Data' button, it only shows the data from the second Text Field like this: LastName null</p>
  <p>The result should be: FirstName LastName</p>
  <blockquote>
  <p>Here's the Save Data</p>
  </blockquote>
  <pre><code>saveData(String firstName, String lastName) async {
  final prefs = await SharedPreferences.getInstance();
  prefs.setString(firstName, lastName);
  }
  </code></pre>
  <blockquote>
  <p>Here's the Show Data</p>
  </blockquote>
  <pre><code>showData(String firstName, String lastName) async {
  final prefs = await SharedPreferences.getInstance();
  setState(() {
    fName = prefs.getString(firstName);
    lName = prefs.getString(lastName);
  });
  }
  </code></pre>