Thanks to visit codestin.com
Credit goes to github.com

Skip to content

A simple Flutter application designed for mosque communities to register and manage members' phone numbers directly through Google Sheets — no backend required. This lightweight app is ideal for small mosques or community centers that need a quick and reliable way to collect and store member contact information online.

Notifications You must be signed in to change notification settings

amirhossein-jahangiri/Club_Number

Repository files navigation

🏆 Flutter Customer Club App

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.


📱 Features

  • 🧾 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.dart has been removed from the repository for security reasons

🛠️ Tech Stack

  • Flutter (latest stable version)
  • http – For API communication with Google Sheets
  • provider – For state management
  • excel – For local Excel export
  • flutter_form_builder – For form validation and input handling

📷 Screenshots

Light

---

⚙️ Google Sheets Configuration

To connect this app to your own Google Sheet:

  1. Create a new Google Sheet and open it.
  2. Go to Extensions → Apps Script.
  3. 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");
    }

🔧 Deploy Your Google Apps Script

  1. Click Deploy → New Deployment
  2. Set the deployment type to Web App
  3. Set access to Anyone
  4. Click Deploy, then copy the Web App URL

⚠️ Important

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.

Example Implementation:

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
  }
}

🔒 Google Sheets Service (Secure Method using Service Account)

You can also connect securely to Google Sheets using a Service Account.
This method allows direct API access without publishing a Web App.

Example Implementation:

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();
  }
}

✅ Security Notes

  • Never commit your private key JSON to a public repository.
  • Keep google_sheet_services.dart local and private.
  • Replace _spreadsheetId and _sheetName with your own Google Sheet values.

🚀 Getting Started

1. Clone the Repository

git clone https://github.com/your-username/flutter-customer-club.git
cd flutter-customer-club

2. Install Dependencies

flutter pub get

3. Run the App

flutter run

✅ Make sure you have configured your Google Sheet Web App URL before running.

📊 Example Google Sheet Structure

Name Phone Gender Description Date
John Doe +123456789 Male Loyal Customer 2025-10-17
Mary Smith +987654321 Female Interested in offers 2025-10-17

🧠 Usage Tips

  • 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

👨‍💻 Developer Contact

Developed by: Amirhossein Jahangiri

📧 Email: [email protected]
🌐 Website: iamjahangiri.ir


📄 License

This project is licensed under the MIT License.
You are free to use, modify, and distribute this software with attribution.

About

A simple Flutter application designed for mosque communities to register and manage members' phone numbers directly through Google Sheets — no backend required. This lightweight app is ideal for small mosques or community centers that need a quick and reliable way to collect and store member contact information online.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published