0
点赞
收藏
分享

微信扫一扫

[Flutter]开发记录

山竹山竹px 2022-08-04 阅读 96


1.官网:https://flutter.io/setup-macos/#system-requirements

2.准备SDK:https://flutter.io/setup-macos/

3.Add the ​​flutter​​ tool to your path:[macOS]设置全局命令

 

open ~/.bash_profile

export PATH=[PATH_TO_FLUTTER_GIT_DIRECTORY]/flutter/bin:$PATH

source ~/.bash_profile

brew update
$ brew install --HEAD libimobiledevice
$ brew install ideviceinstaller ios-deploy cocoapods
$ pod setup

 brew doctor可以看到错误和建议


 

5.Android studio 安装dart & flutter插件.先安装dart,要不可能报错

 

5.flutter doctor检查

补充完插件\IDE等等

 

6.Android studio new file->new flutter project

 

7.Use an external package

 In pubspec.yaml, add english_words (3.1.0 or higher) to the dependencies list. Add the highlighted line below:

 

dependencies:
flutter:
sdk: flutter

cupertino_icons: ^0.1.0
english_words: ^3.1.0

 While viewing the pubspec in Android Studio’s editor view, click 

Packages get.


 

 

In lib/main.dart, import the new package:

 

import 'package:flutter/material.dart';
import 'package:english_words/english_words.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
final wordPair = WordPair.random();
return MaterialApp(
title: 'Welcome to Flutter',
home: Scaffold(
appBar: AppBar(
title: Text('Welcome to Flutter'),
),
body: Center(
//child: Text('Hello World'), // Replace the highlighted text...
child: Text(wordPair.asPascalCase), // With this highlighted text.
),
),
);
}
}

 

 

 

 

举报

相关推荐

0 条评论