Skip to content

MysteryRan/RanMall_flutter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RanMall_flutter

商城flutter版


    dependencies:
      flutter:
        sdk: flutter
      cupertino_icons: ^1.0.0
      dio: ^3.0.9
      flutter_swiper: ^1.1.6
      crypto: ^2.0.6
      

Getting Started

详情 购物车 双十一 购物车

创建flutter项目

  1. flutter create myapp
  2. cd myapp
  3. flutter run

原生项目添加flutter模块

添加flutter模块

  1. flutter create -t module flutter_module
  2. flutter attach

原生项目修改podfile


      flutter_application_path = '../my_flutter'
  
      load File.join(flutter_application_path, '.ios', 'Flutter', 'podhelper.rb')

      target 'targetName' 
        use_frameworks!
        install_all_flutter_pods(flutter_application_path)

      end

添加代码


    #import <FlutterPluginRegistrant/GeneratedPluginRegistrant.h>

    @interface AppDelegate ()

    @end

    @implementation AppDelegate

  
  - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  
        self.flutterEngine = [[FlutterEngine alloc] initWithName:@"my flutter engine"];
        [self.flutterEngine run];
        [GeneratedPluginRegistrant registerWithRegistry:self.flutterEngine];
        return YES;
        
        }

加载部分界面


    FlutterEngine *flutterEngine =
            ((AppDelegate *)UIApplication.sharedApplication.delegate).flutterEngine;
            
    self.flutterViewController =
            [[FlutterViewController alloc] initWithEngine:flutterEngine nibName:nil bundle:nil];
            
    self.flutterViewController.view.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);
    
    [self addChildViewController:self.flutterViewController];
    
    [self.view addSubview:self.flutterViewController.view];
    

安卓打包

安卓 安卓

About

商城Flutter版

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages