Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated documentation explaining how to run the AppStandalone project #80

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
125 changes: 122 additions & 3 deletions apps/AppStandalone/README.md
Expand Up @@ -5,39 +5,158 @@ A new Flutter project.
## Getting Started

FlutterFlow projects are built to run on the Flutter _stable_ release.

---

This guide walks you through the steps required to run the app locally on your machine. Please
follow the instructions carefully to ensure a smooth setup.

### Prerequisites

Before starting, make sure you have the following installed:

- Flutter SDK
- Dart SDK
- Xcode (for iOS)
- Android Studio (for Android)
- CocoaPods (for iOS dependencies)
- Firebase account and [Firebase CLI](https://firebase.google.com/docs/cli#install_the_firebase_cli)

### Setup Instructions

1. **Get Flutter Dependencies**:
josancamon19 marked this conversation as resolved.
Show resolved Hide resolved
From within `apps/AppStandalone`, install flutter packages:
```
flutter pub get
```

2. **Install iOS Pods**:
Navigate to the iOS directory and install the CocoaPods dependencies:
```
cd ios
pod install
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probably won't work out of the box for new clones since the ios project hasn't been built yet. Here is the error I got:

pod install                                                                                                     
Ignoring msgpack-1.7.1 because its extensions are not built. Try: gem pristine msgpack --version 1.7.1   

...

Generating Pods project                                                                                                      
[!] An error occurred while processing the post-install hook of the Podfile.
                                                                                                                                                                                                                                                          
/Users/jkjensen/dev/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework must exist. If you're running pod install manually, make sure "flutter precache --ios" is executed first      

If the user runs flutter precache --ios first then the pod install should succeed.

Suggested change
pod install
flutter precache --ios
pod install

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird, @after-ephemera I personally don't remember ever having to do that in a flutter project, I don't know if I would add it as part of the steps, can someone else try to replicate this guide, and double check if they need flutter precache --ios, thanks.

pod repo update
```

3. **Environment Configuration**:
Rename the environment configuration file:
```
cd ..
mv .env.template .env
josancamon19 marked this conversation as resolved.
Show resolved Hide resolved
```

4. **Firebase Project**:
- Create a new project in [Firebase Console](https://console.firebase.google.com/).
- Activate the FlutterFire CLI tool:
```
dart pub global activate flutterfire_cli
```
- Configure FlutterFire with your Firebase project:
```
flutterfire configure
josancamon19 marked this conversation as resolved.
Show resolved Hide resolved
```
Follow the prompts to select your project and target platforms (Android, iOS, Web).

5. **API Keys**:
Add your Firebase and other necessary API keys to the `.env` file.

6. **Run Build Runner**:
Generate necessary files with Build Runner:
```
dart run build_runner build
josancamon19 marked this conversation as resolved.
Show resolved Hide resolved
```

7. **Configure Xcode**:
- Open your iOS project in Xcode:
```
open ios/Runner.xcworkspace
```
- Set up the imageNotification and main app:
- For imageNotification:
- Select a team in Xcode.
- Set the identifier to `com.$your-username.friend-app-standalone.ImageNotification`.
- For the main app:
- Select a team in Xcode.
- Set the identifier to `com.$your-username.friend-app-standalone`.
- If you do not have a paid Apple Developer account, perform the following
modifications:
- Remove Notifications and Sign In with Apple capabilities.
- Create an Entitlements file as shown below:
![Removing Capabilities](assets/docs/xcode-capabilities-to-remove.png)
- Ensure the project builds without errors in Xcode:
```
Product > Build
```
- Modify the routing on nav.dart (line 82) code to bypass login checks:
```
FFRoute(
name: '_initialize',
path: '/',
builder: (context, _) => appStateNotifier.loggedIn
? entryPage ?? const HomePageWidget()
: const Onboarding1Widget(),
)
```
to
```
FFRoute(
name: '_initialize',
path: '/',
builder: (context, _) => const HomePageWidget(),
),
```

8. **Run the App**:
- Select your target device in Xcode or Android Studio.
- Run the app.

By following these steps, you should be able to run the app on your local machine. If you encounter
any issues, please refer to the official Flutter and Firebase documentation, or check the community
forums for similar problems and solutions.

## Integration Tests

To test on a real iOS / Android device, first connect the device and run the following command from the root of the project:
To test on a real iOS / Android device, first connect the device and run the following command from
the root of the project:

```bash
flutter test integration_test/test.dart
```

To test on a web browser, first launch `chromedriver` as follows:

```bash
chromedriver --port=4444
```

You may need to run this if you get the following error

Error

```
lib/env/env.dart:2:6: Error: Error when reading 'lib/env/env.g.dart': No such file or directory
part 'env.g.dart';
```

Command

```
flutter pub run build_runner build
```

Then from the root of the project, run the following command:

```bash
flutter drive \
--driver=test_driver/integration_test.dart \
--target=integration_test/test.dart \
-d chrome
```

Find more information about running Flutter integration tests [here](https://docs.flutter.dev/cookbook/testing/integration/introduction#5-run-the-integration-test).
Find more information about running Flutter integration
tests [here](https://docs.flutter.dev/cookbook/testing/integration/introduction#5-run-the-integration-test)
.

Refer to this guide for instructions on running the tests on [Firebase Test Lab](https://github.com/flutter/flutter/tree/main/packages/integration_test#firebase-test-lab).
Refer to this guide for instructions on running the tests
on [Firebase Test Lab](https://github.com/flutter/flutter/tree/main/packages/integration_test#firebase-test-lab)
.
Binary file added apps/AppStandalone/assets/docs/team-selection.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.