Jul 17, 2024
How to Read Google Sheet Data in a Flutter App
Meta description: Learn to integrate Google Sheets data in your Flutter app using the googleapis package, enabling dynamic content management and enhanced user interaction.
Author


Book a call
Table of Contents
googleapis package to read data from Google Sheets in your Flutter app.Additionally, we'll cover how to handle nested Google Sheets by extracting the GID from the Google Sheets URL.
Prerequisites
- A Google account.
- Flutter is installed on your machine.
Step 1: Set Up Google Cloud Project
- Create a Google Cloud Project
- Go to the Google Cloud Console.
- Click on the project drop-down and select "New Project."
- Enter a project name and click "Create."




Step 2: Create Service Account
- Create Service Account
- Go to the Service Accounts page.
- Click "Create Service Account."
- Enter a name and ID for your service account, then click "Create."


- Grant Permissions
- To grant permission, assign "Editor" to your service account and click "Continue."
- Create Key
- Click "Create Key" and select "JSON" as the key type.
- A JSON file will be downloaded. Save this file securely as it contains your service account credentials.

Step 3: Share Google Sheet with Service Account
- Open your Google Sheet.
- Click "Share" and enter the email address of your service account (found in the JSON key file).
- Grant "Viewer" or "Editor" access as needed.



Step 4: Integrate Google Sheets API in Flutter
pubspec.yaml file:Step5: Calling the Method to Fetch Data
GoogleSheetsApiData with the necessary parameters and then calls accessGoogleSheetData to retrieve the data. Here’s how you can do it:clientEmail,clientId, andprivateKeyare obtained from the service account JSON file.google_sheet_urlis the URL of the Google Sheet you want to read.GoogleSheetsApiDatais a class that encapsulates the logic for accessing the Google Sheets API.
Conclusion
You have now set up your Flutter app to read data from Google Sheets using the googleapis package, including handling nested Google Sheets by extracting the GID from the Google Sheets URL. This setup allows your app to dynamically fetch and display data from Google Sheets, providing flexibility and easy management of content. For more advanced use cases, explore the extensive capabilities of the Google Sheets API.
Subscribe to Our Newsletter
Subscribe to RSS
Press & Media Hub RSS FeedRelated Articles.
More from the engineering frontline.
Dive deep into our research and insights on design, development, and the impact of various trends to businesses.

Jun 27, 2026
Building a Resilient Hybrid-Cloud Network with WireGuard HA, Route-Based Failover, and Deep Observability

Jun 19, 2026
We Built a 114-Second AWS-to-Azure Failover. Here’s What We Learned

Jun 12, 2026
Cloud-Native and Cloud-Agnostic Are Not Ideologies; They Are Business-Stage Decisions

Jun 8, 2026
Geeklego: The Open-Source Design System Built to Work With AI

May 18, 2026
Your Vibe Code Has No Memory. DESIGN.md Fixes That.

May 14, 2026