Reset flutter views when leaving flutter module inside native app
After some experiments the solution was to natively react to the state and send a custom 'reset'
through a methodchannel
How can I push a UIViewController from FlutterViewController
You need to embed FlutterViewController in container UINavigationController programmatically or in storyboard, then you will be able to push your next controller.
Here is example how to embed programmatically:
@interface AppDelegate()
@property (nonatomic, strong) UINavigationController *navigationController;
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[GeneratedPluginRegistrant registerWithRegistry:self];
UIViewController *flutterViewController = [[FlutterViewController alloc] init];
self.navigationController = [[UINavigationController alloc] initWithRootViewController:flutterViewController];
[self.navigationController setNavigationBarHidden:YES];
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.rootViewController = self.navigationController;
[self.window makeKeyAndVisible];
return true;
}
- (void)pushExample {
UIViewController *viewController = [[UIViewController alloc] init];
[self.navigationController pushViewController:viewController animated:true];
}
@end
When needed(e.g. button tapped) invoke pushExample
.
Also you can check "storyboard" way in this video
Playing audio in the background
You can use flutter_sound package from the link.
https://pub.dev/packages/flutter_sound
On the class where you need to play the audio, import the flutter sound package. After that inside the initState method play the audio like below
@override
void initState() {
FlutterSound flutterSound = FlutterSound();
flutterSound.startPlayer(url); // here give the mp3 url like "audio1.mp3"
}
Flutter app opens, but is stuck on splash-screen
Solution for me:
1) updated my iOS toolchain with flutter doctor
2) flutter clean
3) flutter build ios --release
in the terminal
4) Archive in Xcode
Related Topics
Avoid Equatable and Hashable Boilerplate, Swift 4.2
Validatemenuitem or Menuwillopen Not Called for Nsmenu
Customize Mglpolyline Using Mapbox
Bleed Through from Nsbutton Checkbox on Non-Transparent Nspopover
How to Name File Stored to Files App via Uactivityviewcontroller
Auto Height Does Not Work in UIview in Swift 3
Collision Detection Leading to Color Detection
Nevpnmanager with L2Tp Protocol
Trying to Display Location Data from Firebase to Mapkit
How to Run Terminal Command in Swift from Any Directory
Access Safari Bookmarks in Macos Mojave Programmatically
Open Attachment from Mail Using iOS 8 App [Swift]
How to Add Skspritenode in a Loop
Generating a Simple Algebraic Expression in Swift
Connecting Avaudiosourcenode to Avaudiosinknode Does Not Work