1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-08 13:58:47 +00:00
Files
samples/add_to_app/books/flutter_module_books
dependabot[bot] eed9db1b2e Bump pigeon from 24.2.2 to 25.0.0 in /add_to_app/books/flutter_module_books (#2594)
Bumps [pigeon](https://github.com/flutter/packages/tree/main/packages) from 24.2.2 to 25.0.0.
<details>
<summary>Commits</summary>
<ul>
<li><a href="f65d7a73ba"><code>f65d7a7</code></a> [pigeon] adds Internal options (<a href="https://github.com/flutter/packages/tree/main/packages/issues/8709">#8709</a>)</li>
<li><a href="ff7724c18a"><code>ff7724c</code></a> [camera_avfoundation] Tests backfilling - part 3 (<a href="https://github.com/flutter/packages/tree/main/packages/issues/8853">#8853</a>)</li>
<li><a href="9cc6f370ef"><code>9cc6f37</code></a> [video_player_android] Provide the current surface to the new ExoPlayer in Te...</li>
<li><a href="464cea5300"><code>464cea5</code></a> [camera_avfoundation] Tests backfilling - part 2 (<a href="https://github.com/flutter/packages/tree/main/packages/issues/8796">#8796</a>)</li>
<li><a href="2d3b24ebd9"><code>2d3b24e</code></a> [google_sign_in] Add Android account name field as optional (<a href="https://github.com/flutter/packages/tree/main/packages/issues/8573">#8573</a>)</li>
<li><a href="e037d19ca0"><code>e037d19</code></a> [google_maps_flutter_web] set icon anchor for markers  (<a href="https://github.com/flutter/packages/tree/main/packages/issues/8077">#8077</a>)</li>
<li><a href="f5f9113bbe"><code>f5f9113</code></a> [google_sign_in] Add Android account name field as optional (implementation p...</li>
<li>See full diff in <a href="https://github.com/flutter/packages/commits/pigeon-v25.0.0/packages">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=pigeon&package-manager=pub&previous-version=24.2.2&new-version=25.0.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

</details>
2025-03-18 07:16:38 +00:00
..
2025-02-12 18:08:01 -05:00
2025-02-12 18:08:01 -05:00

Books add-to-app sample

This application simulates a mock scenario in which an existing app with business logic and middleware already exists. It demonstrates how to add Flutter to an app that has established patterns for these domains. For more information on how to use it, see the README.md parent directory.

This application also utilizes the Pigeon plugin to avoid manual platform channel wiring. Pigeon autogenerates the platform channel code in Dart/Java/Objective-C to allow interop using higher order functions and data classes instead of string-encoded methods and serialized primitives.

The Pigeon autogenerated code is checked-in and ready to use. If the schema in pigeon/schema.dart is updated, the generated classes can also be re- generated using:

flutter pub run pigeon --input pigeon/schema.dart \
  --dart_out lib/api.dart \
  --objc_header_out ../ios_books/IosBooks/api.h \
  --objc_source_out ../ios_books/IosBooks/api.m \
  --objc_prefix BK \
  --java_out ../android_books/app/src/main/java/dev/flutter/example/books/Api.java \
  --java_package "dev.flutter.example.books"

Demonstrated concepts

  • An existing books catalog app is already implemented in Kotlin and Swift.
  • The platform-side app has existing middleware constraints that should also be the middleware foundation for the additional Flutter screen.
    • On Android, the Kotlin app already uses GSON and OkHttp for networking and references the Google Books API as a data source. These same libraries also underpin the data fetched and shown in the Flutter screen.
  • The platform application interfaces with the Flutter book details page using idiomatic platform API conventions rather than Flutter conventions.
    • On Android, the Flutter activity receives the book to show via activity intent and returns the edited book by setting the result intent on the activity. No Flutter concepts are leaked into the consumer activity.
  • The pigeon plugin is used to generate interop APIs and data classes. The same Book model class is used within the Kotlin/Swift program, the Dart program and in the interop between Kotlin/Swift and Dart.

More info

For more information about Flutter, check out flutter.dev.

For instructions on how to integrate Flutter modules into your existing applications, see Flutter's add-to-app documentation.