AppDelegate.m 1.13 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#import "AppDelegate.h"

#import <Flutter/Flutter.h>
#import "LocationProvider.h"

@implementation AppDelegate {
    LocationProvider* _locationProvider;
}

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    FlutterDartProject* project = [[FlutterDartProject alloc] initFromDefaultSourceForConfiguration];
    self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
17 18 19
    FlutterViewController* flutterController = [[FlutterViewController alloc] initWithProject:project
                                                                                      nibName:nil
                                                                                       bundle:nil];
20
    _locationProvider = [[LocationProvider alloc] init];
21
    [flutterController addMessageListener:_locationProvider];
22

23
    self.window.rootViewController = flutterController;
24 25 26 27 28
    [self.window makeKeyAndVisible];
    return YES;
}

@end