-
Notifications
You must be signed in to change notification settings - Fork 107
Uncategorized: moved articles from the uncategorized folder to various aspect of the document tree. #438
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
Open
mrdavidorok
wants to merge
13
commits into
main
Choose a base branch
from
davidorok/uncategorized
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Uncategorized: moved articles from the uncategorized folder to various aspect of the document tree. #438
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
1761c49
moved articles from the uncategorized folder to various aspect of doc…
mrdavidorok 57b7670
updated content, consolidated and reorganized the articles
mrdavidorok 5fa6aa0
abridged files from new standlone articles and placed them in suitabl…
mrdavidorok 6133e9a
updated assets
mrdavidorok b9380c2
fixed build issues by correcting the internal links
mrdavidorok 6a1cff4
Merge remote-tracking branch 'refs/remotes/origin/main' into davidoro…
PoojaB26 1794577
Update docs/intro/ff-ui/builder.md
mrdavidorok c4b147a
fixed slugs, resolved issues mentioned in the conversation on github.
mrdavidorok e251849
Merge branch 'davidorok/uncategorized' of https://github.com/FlutterF…
mrdavidorok 5e4c3b2
updated content. deleted repeated articles. updated slug.
mrdavidorok bb1c731
updated assets, updated content, repositioned content
mrdavidorok 8271d1d
updated content, updated assets, repositioned content
mrdavidorok 928d310
Merge branch 'davidorok/uncategorized' of https://github.com/FlutterF…
mrdavidorok File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
docs/ff-concepts/navigation-routing/create-a-submenu-using-local-state.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
keywords: ['menu', 'submenu', 'local state'] | ||
slug: /resources/create-a-submenu-using-local-state | ||
title: Create a Submenu Using Local State | ||
--- | ||
|
||
# Create a Submenu Using Local State | ||
|
||
This guide demonstrates how to implement a toggleable submenu in a FlutterFlow project using local state and conditional visibility logic. | ||
|
||
Follow the steps below to create a Submenu using Local State: | ||
|
||
1. **Create a Local State Variable** | ||
- Add a boolean local state variable to your page. | ||
- This variable will control the visibility of the submenu (`true` = open, `false` = closed). | ||
|
||
2. **Place the Submenu Inside a Stack** | ||
- Use a `Stack` widget to layer the submenu on top of the page content. | ||
- Position the submenu where you want it to appear. | ||
|
||
3. **Control Visibility with Local State** | ||
- Apply a visibility condition on the submenu widget using the boolean state variable. | ||
- When the value is `true`, the submenu will be shown; when `false`, it will be hidden. | ||
|
||
4. **Add Toggle Action to Menu Icon** | ||
- On the `onTap` event of the menu icon button, add a conditional action: | ||
- If the state variable is `false`, set it to `true`. | ||
- If it is `true`, set it to `false`. | ||
|
||
5. **Close Menu When Item is Tapped** | ||
- After triggering any submenu action, set the local state variable to `false` to close the menu. | ||
|
||
6. **Dismiss Menu When Tapping Page Background** | ||
- Wrap the main page content in a `GestureDetector`. | ||
- On tap, set the local state variable to `false` to close the menu when the user taps outside it. | ||
|
||
:::tip | ||
The `Stack` widget allows placing widgets on top of each other, which is essential for layering the submenu over other UI elements. | ||
::: | ||
|
||
:::info[Examples] | ||
- [Project Example](https://app.flutterflow.io/project/sub-menu-840l5q) | ||
- [Run Mode Preview](https://app.flutterflow.io/run/LfzBGTaef8WldndHa2x4) | ||
::: | ||
|
||
 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
106 changes: 106 additions & 0 deletions
106
docs/ff-integrations/maps/convert-device-location-to-address.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
--- | ||
keywords: ['device', 'address', 'current'] | ||
slug: /integrations/maps/convert-device-location-to-address | ||
title: Convert Device Location to Address | ||
--- | ||
|
||
# Convert Device Location to Address in FlutterFlow | ||
mrdavidorok marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
This guide is part of the **[Geocoding in FlutterFlow](/geocoding)** series. | ||
It focuses on **reverse geocoding**—turning a device’s latitude and longitude into a readable address (such as city or street name). | ||
|
||
You can achieve this in FlutterFlow using either: | ||
|
||
- **The Google Maps Geocoding API** (via API Calls) | ||
- **The `geocoding` Dart package** (via a Custom Action) | ||
|
||
Explore a live example in this **[FlutterFlow sample project](https://app.flutterflow.io/project/geo-track-rvndye)**. | ||
|
||
**Option 1: Using the Google Maps API** | ||
|
||
1. **Enable the Geocoding API** | ||
|
||
1. Go to the [Google Cloud Console](https://console.cloud.google.com/). | ||
2. Select your project. | ||
3. Search for and enable the **Geocoding API**. | ||
|
||
 | ||
|
||
2. **Add API Key to App State** | ||
|
||
1. Go to **App State > Local State** in FlutterFlow. | ||
2. Add a new variable: | ||
- `apiKey` → Type: `String` | ||
3. Paste your Geocoding API key as the default value. | ||
|
||
 | ||
|
||
3. **Create the API Call** | ||
|
||
1. Navigate to **API Calls** in FlutterFlow. | ||
2. Create a new API call with the following configuration: | ||
|
||
- **Base URL**: | ||
```js | ||
https://maps.googleapis.com/maps/api/geocode/json | ||
``` | ||
- **Method**: `GET` | ||
|
||
3. Under **Variables**, add: | ||
- `latlng` → Type: `String` | ||
- `apiKey` → Type: `String` | ||
|
||
 | ||
|
||
4. Create a Custom Function (LatLng → String) | ||
|
||
Create a custom function that accepts a `LatLng` value (device location) and returns a string in `"latitude,longitude"` format. | ||
|
||
This will be used to populate the `latlng` variable in your API call. | ||
|
||
 | ||
|
||
5. **Run the API and Display the Result** | ||
|
||
1. Add a button or trigger to run the API call. | ||
2. Pass the following: | ||
- `latlng`: From the custom function. | ||
- `apiKey`: From local state. | ||
3. From the API response, extract the address using a **JSON Path**. | ||
|
||
Example JSON Path for city name: | ||
```json | ||
$.results[0].address_components[1].long_name | ||
``` | ||
4. Bind the extracted value to a `Text` widget. | ||
|
||
**Option 2: Using the `geocoding` Dart Package** | ||
|
||
If you prefer to use Flutter's native functionality, you can achieve the same result using the geocoding Dart package in a custom action. | ||
|
||
1. **Add the Package** | ||
Add the dependency to your project’s pubspec.yaml file: | ||
|
||
```js | ||
dependencies: | ||
geocoding: ^2.1.0 | ||
``` | ||
|
||
2. **Create a Custom Action** | ||
- Create a new custom action. | ||
- Add a parameter: LatLng location. | ||
3. Use the geocoding package to convert the coordinates into a readable address. | ||
|
||
Sample code: | ||
|
||
```js | ||
import 'package:geocoding/geocoding.dart'; | ||
|
||
Future<String> getAddressFromLocation(LatLng location) async { | ||
final placemarks = await placemarkFromCoordinates(location.latitude, location.longitude); | ||
final place = placemarks.first; | ||
return '${place.locality}, ${place.country}'; | ||
} | ||
|
||
``` | ||
4. Return the result and bind it to a Text widget. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
--- | ||
mrdavidorok marked this conversation as resolved.
Show resolved
Hide resolved
|
||
slug: /integrations/maps/geocoding | ||
title: Geocoding in FlutterFlow | ||
keywords: ['geocoding', 'reverse geocoding', 'maps', 'location', 'address'] | ||
--- | ||
|
||
# Geocoding in FlutterFlow | ||
|
||
**Geocoding** is the process of converting between human-readable addresses (like “1600 Amphitheatre Parkway, Mountain View, CA”) and geographic coordinates (latitude and longitude). | ||
|
||
FlutterFlow supports geocoding through **custom API calls** and **custom code actions**, giving you flexibility to choose the approach that works best for your app. | ||
|
||
**Types of Geocoding** | ||
|
||
There are two common types of geocoding: | ||
|
||
1. **Forward Geocoding** | ||
Converting an address into geographic coordinates. | ||
*Example:* `"Paris, France"` → `(48.8566, 2.3522)` | ||
|
||
2. **Reverse Geocoding** | ||
Converting geographic coordinates into an address. | ||
*Example:* `(37.4221, -122.0841)` → `"1600 Amphitheatre Parkway, Mountain View, CA"` | ||
|
||
**Approaches in FlutterFlow** | ||
|
||
You can implement geocoding in FlutterFlow in two main ways: | ||
|
||
1. **Google Maps Geocoding API** | ||
|
||
- Uses the official Google Maps API for reliable, global geocoding. | ||
- Requires a Google Cloud project and API key. | ||
- Works via a standard API Call in FlutterFlow. | ||
- Best for: | ||
- Apps with existing Google Maps integrations. | ||
- Large-scale or high-accuracy location services. | ||
|
||
See: **[Google Maps Geocoding API Documentation](https://developers.google.com/maps/documentation/geocoding)** | ||
|
||
Example: Forward Geocoding API Call | ||
|
||
**Endpoint:** | ||
```js | ||
GET https://maps.googleapis.com/maps/api/geocode/json?address=Paris,France&key=YOUR_API_KEY | ||
``` | ||
|
||
**Sample Response** | ||
```json | ||
{ | ||
"results": [ | ||
{ | ||
"formatted_address": "Paris, France", | ||
"geometry": { | ||
"location": { | ||
"lat": 48.856614, | ||
"lng": 2.3522219 | ||
} | ||
} | ||
} | ||
], | ||
"status": "OK" | ||
} | ||
|
||
**FlutterFlow API Call Setup** | ||
|
||
- Method: GET | ||
- URL: `https://maps.googleapis.com/maps/api/geocode/json` | ||
- Query Parameters: | ||
- address → `Paris`,`France` (or variable) | ||
- `key` → your Google Maps API key | ||
|
||
2. **`geocoding` Dart Package (Custom Code)** | ||
|
||
- Uses Flutter’s [`geocoding`](https://pub.dev/packages/geocoding) package for native geocoding. | ||
- Works entirely offline for some lookups (depending on platform and data availability). | ||
- Implemented via a custom action in FlutterFlow. | ||
- Best for: | ||
- Apps that don’t want to rely on external APIs. | ||
- Simpler geocoding needs. | ||
|
||
**Example: Forward Geocoding with geocoding package** | ||
|
||
```dart | ||
import 'package:geocoding/geocoding.dart'; | ||
Future<void> getCoordinatesFromAddress(String address) async { | ||
try { | ||
List<Location> locations = await locationFromAddress(address); | ||
if (locations.isNotEmpty) { | ||
print('Latitude: ${locations.first.latitude}'); | ||
print('Longitude: ${locations.first.longitude}'); | ||
} | ||
} catch (e) { | ||
print('Error: $e'); | ||
} | ||
} | ||
``` | ||
**Example: Reverse Geocoding with geocoding package** | ||
|
||
```dart | ||
import 'package:geocoding/geocoding.dart'; | ||
Future<void> getAddressFromCoordinates(double lat, double lng) async { | ||
try { | ||
List<Placemark> placemarks = await placemarkFromCoordinates(lat, lng); | ||
if (placemarks.isNotEmpty) { | ||
final place = placemarks.first; | ||
print('${place.street}, ${place.locality}, ${place.country}'); | ||
} | ||
} catch (e) { | ||
print('Error: $e'); | ||
} | ||
} | ||
``` | ||
|
||
:::tip[Related Guides] | ||
- [Convert Device Location to Address](/convert-device-location-to-address) — Step-by-step guide for reverse geocoding a device’s coordinates. | ||
- (Coming soon) Forward Geocoding with FlutterFlow — Learn how to convert an address into coordinates. | ||
::: | ||
|
||
|
||
:::tip | ||
If your app already uses Google Maps for displaying locations, the Google API method will be the most seamless. If you want a code-based approach that avoids API calls, the `geocoding` package is a good alternative. | ||
::: |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.