欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

[Flutter]开发记录

程序员文章站 2022-05-25 19:21:44
...

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
 刷新profile
4.Deploy to iOS devices:

 

 

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.
        ),
      ),
    );
  }
}

 

 

 

 

相关标签: flutter