mirror of
https://github.com/flutter/samples.git
synced 2026-05-04 05:46:39 +00:00
Add content resizing sample (#2756)
Add a content resizing sample for iOS to support https://github.com/flutter/flutter/pull/177410 ## Pre-launch Checklist - [x] I read the [Flutter Style Guide] _recently_, and have followed its advice. - [x] I signed the [CLA]. - [x] I read the [Contributors Guide]. - [x] I have added sample code updates to the [changelog]. - [x] I updated/added relevant documentation (doc comments with `///`). If you need help, consider asking for advice on the #hackers-devrel channel on [Discord]. <!-- Links --> [Flutter Style Guide]: https://github.com/flutter/flutter/blob/master/docs/contributing/Style-guide-for-Flutter-repo.md [CLA]: https://cla.developers.google.com/ [Discord]: https://github.com/flutter/flutter/blob/master/docs/contributing/Chat.md [Contributors Guide]: https://github.com/flutter/samples/blob/main/CONTRIBUTING.md [changelog]: ../CHANGELOG.md --------- Co-authored-by: Eric Windmill <eric@ericwindmill.com>
This commit is contained in:
38
add_to_app/ios_content_resizing/README.md
Normal file
38
add_to_app/ios_content_resizing/README.md
Normal file
@@ -0,0 +1,38 @@
|
||||
# ios_content_resizing
|
||||
|
||||
Embeds an instance of Flutter into an existing iOS app that will dynamically resize itself based off of it's content.
|
||||
|
||||
## Description
|
||||
|
||||
This sample showcases the integration of a self-resizing Flutter view within a native UIKit environment. The Flutter module features an expanding column of widgets. As items are added, the hosting UIView will automatically adjusts its [intrinsicContentSize](https://developer.apple.com/documentation/uikit/uiview/intrinsiccontentsize) to accommodate the new content size.
|
||||
|
||||
## tl;dr
|
||||
|
||||
If you're just looking to get up and running quickly, these bash commands will
|
||||
fetch packages and set up dependencies (note that the above commands assume
|
||||
you're building for both iOS and Android, with both toolchains installed):
|
||||
|
||||
```bash
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
cd flutter_module/
|
||||
flutter pub get
|
||||
|
||||
# For iOS builds:
|
||||
cd ../ios_content_resizing
|
||||
pod install
|
||||
open ios_content_resizing.xcworkspace
|
||||
# Then, click "Run" in Xcode to launch the app into your Simulator or device
|
||||
```
|
||||
|
||||
## Requirements
|
||||
|
||||
* Flutter
|
||||
* iOS
|
||||
* Xcode
|
||||
* Cocoapods
|
||||
|
||||
## Questions/issues
|
||||
|
||||
See [add_to_app/README.md](../README.md) for further help.
|
||||
Reference in New Issue
Block a user