A modern Customer Club App built with Flutter that allows users to register customer information including full name, phone number, gender, and description.
All data is automatically stored online in Google Sheets and can also be exported to Excel.
-
🧾 Customer Information Registration
- Full Name
- Phone Number
- Gender
- Description / Notes
-
☁️ Online Google Sheets Sync
- Automatically sends customer data to your linked Google Sheet
- Works in real-time over the internet
-
📤 Excel Export Support
- Export all registered customers as an Excel file
-
⚙️ State Management using
Provider -
🎨 Modern Material Design UI
-
🔒 Secure Google Sheets Integration
- The file
google_sheet_services.darthas been removed from the repository for security reasons
- The file
- Flutter (latest stable version)
http– For API communication with Google Sheetsprovider– For state managementexcel– For local Excel exportflutter_form_builder– For form validation and input handling
---
To connect this app to your own Google Sheet:
- Create a new Google Sheet and open it.
- Go to Extensions → Apps Script.
- Paste the following code inside the script editor:
function doPost(e) { var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); var data = JSON.parse(e.postData.contents); sheet.appendRow([data.name, data.phone, data.gender, data.description, new Date()]); return ContentService.createTextOutput("Success"); }
- Click Deploy → New Deployment
- Set the deployment type to Web App
- Set access to Anyone
- Click Deploy, then copy the Web App URL
The file google_sheet_services.dart is not included in the repository due to security reasons.
You must create it manually and include your Google Web App URL inside it.
class GoogleSheetService {
static const String scriptUrl = "YOUR_DEPLOYED_SCRIPT_URL_HERE";
static Future<void> insertData({
required String name,
required String phone,
required String gender,
required String description,
}) async {
// Example: Send a POST request to your Google Apps Script endpoint
}
}You can also connect securely to Google Sheets using a Service Account.
This method allows direct API access without publishing a Web App.
import 'dart:convert';
import 'package:googleapis/sheets/v4.dart' as sheets;
import 'package:googleapis_auth/auth_io.dart';
import 'user_model.dart';
class GoogleSheetService {
final _scopes = [sheets.SheetsApi.spreadsheetsScope];
final String _spreadsheetId = "YOUR_SPREADSHEET_ID";
final String _sheetName = "Sheet1";
final Map<String, dynamic> _credentials = jsonDecode(r'''
{
"type": "service_account",
"project_id": "YOUR_PROJECT_ID",
"private_key_id": "YOUR_PRIVATE_KEY_ID",
"private_key": "YOUR_PRIVATE_KEY",
"client_email": "YOUR_CLIENT_EMAIL",
"client_id": "YOUR_CLIENT_ID",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "YOUR_CERT_URL"
}
''');
Future<void> sendUserInfo(UserModel user) async {
final accountCredentials = ServiceAccountCredentials.fromJson(_credentials);
final authClient = await clientViaServiceAccount(accountCredentials, _scopes);
final sheetsApi = sheets.SheetsApi(authClient);
final values = [
[
user.name ?? "",
user.phone,
user.gender,
user.description ?? "",
DateTime.now().toIso8601String()
]
];
final valueRange = sheets.ValueRange.fromJson({"values": values});
final range = "$_sheetName!A:E";
await sheetsApi.spreadsheets.values.append(
valueRange,
_spreadsheetId,
range,
valueInputOption: "RAW",
);
authClient.close();
}
}- Never commit your private key JSON to a public repository.
- Keep
google_sheet_services.dartlocal and private. - Replace
_spreadsheetIdand_sheetNamewith your own Google Sheet values.
git clone https://github.com/your-username/flutter-customer-club.git
cd flutter-customer-clubflutter pub getflutter run✅ Make sure you have configured your Google Sheet Web App URL before running.
| Name | Phone | Gender | Description | Date |
|---|---|---|---|---|
| John Doe | +123456789 | Male | Loyal Customer | 2025-10-17 |
| Mary Smith | +987654321 | Female | Interested in offers | 2025-10-17 |
- Ensure your device has an active internet connection
- Always deploy your Google Apps Script before testing the app
- Data sync will fail if the Web App URL is invalid or permission settings are incorrect
- Use the Excel export feature to back up your data locally
Developed by: Amirhossein Jahangiri
📧 Email: [email protected]
🌐 Website: iamjahangiri.ir
This project is licensed under the MIT License.
You are free to use, modify, and distribute this software with attribution.