wendux / flutter-comment

Flutter中文网评论
10 stars 0 forks source link

编写您的第一个 Flutter App - Flutter中文网 #5

Open wendux opened 6 years ago

wendux commented 6 years ago

https://www.flutterchina.club/get-started/codelab/

WeihuaGu commented 6 years ago

@wendux 我看到有人一年前就提过这个issue,开发者说会把这个加入list,都一年了,哭晕啊……

jiangbing0125 commented 6 years ago

列表刷动停止明显出现卡动

jiangbing0125 commented 6 years ago

《如果你遇到了问题,请查看以下链接中应用程序的最终代码》 这种方式很赞

duanpf commented 6 years ago

不错

vincentwu08 commented 6 years ago

签到!

yangxiaoge commented 6 years ago

学习了,成功体验了 flutter,对于需要上手来说还需要学习下 Dart,对于有时间的同学还是可以尝试的,毕竟 google 爸爸的产品。

chenjzcj commented 6 years ago

开始学习中,加油

BingKui commented 6 years ago

开始打怪升级之路啊~~~~

Chainson commented 6 years ago

怎么生成 release 版?

QuestG commented 6 years ago

之前一直想体验flutter, 如今按照指导敲了下代码,表达一下欣喜。没想到一百行左右的代码就实现了ListView的功能。

y1990 commented 6 years ago

mark

msdx commented 6 years ago

错别字:对其 -> 对齐

LinmingDart commented 6 years ago

有没有群,求群号 class RandomWordsState extends State { final _suggestions = []; 这里[]是什么意思 ;class RandomWordState extend State 里的是什么意思呢?小白求指点 跪谢

humanheima commented 6 years ago

还可以这样跳转,也是厉害

Randyshu2018 commented 6 years ago

flutter packages get ...error full logs likes below: The setter 'readEventsEnabled=' was called on null. Receiver: null Tried calling: readEventsEnabled=false package:pub/src/source/hosted.dart 344:7 BoundHostedSource._throwFriendlyError package:pub/src/source/hosted.dart 144:7 BoundHostedSource.doGetVersions ===== asynchronous gap =========================== dart:async _AsyncAwaitCompleter.completeError package:pub/src/source/hosted.dart BoundHostedSource.doGetVersions ===== asynchronous gap =========================== dart:async _asyncErrorWrapperHelper package:pub/src/source/hosted.dart BoundHostedSource.doGetVersions package:pub/src/source.dart 168:12 BoundSource.getVersions package:pub/src/solver/package_lister.dart 76:44 PackageLister._versions.. dart:async runZoned package:pub/src/http.dart 275:10 withDependencyType package:pub/src/solver/package_lister.dart 75:33 PackageLister._versions. ===== asynchronous gap =========================== dart:async _asyncThenWrapperHelper package:pub/src/utils.dart minByAsync package:pub/src/solver/version_solver.dart 351:25 VersionSolver._choosePackageVersion ===== asynchronous gap =========================== dart:async _asyncThenWrapperHelper package:pub/src/solver/version_solver.dart VersionSolver.solve package:pub/src/solver.dart 35:10 resolveVersions. package:pub/src/log.dart 378:18 progress package:pub/src/solver.dart 32:10 resolveVersions package:pub/src/entrypoint.dart 210:24 Entrypoint.acquireDependencies ---- Log transcript ---- FINE: Pub 2.0.0 MSG : Resolving dependencies... SLVR: fact: startup_namer is 0.0.0 SLVR: derived: startup_namer SLVR: fact: startup_namer depends on cupertino_icons ^0.1.2 SLVR: fact: startup_namer depends on flutter any from sdk SLVR: fact: startup_namer depends on english_words ^3.1.0 SLVR: fact: startup_namer depends on flutter_test any from sdk SLVR: selecting startup_namer SLVR: derived: flutter_test any from sdk SLVR: derived: english_words ^3.1.0 SLVR: derived: flutter any from sdk SLVR: derived: cupertino_icons ^0.1.2 IO : Get versions from https://dart-pub.mirrors.sjtug.sjtu.edu.cn//api/packages/english_words. IO : HTTP GET https://dart-pub.mirrors.sjtug.sjtu.edu.cn//api/packages/english_words | Accept: application/vnd.pub.v2+json | user-agent: Dart pub 2.0.0 SLVR: Version solving took 0:00:00.190301 seconds. | Tried 1 solutions. FINE: Resolving dependencies finished (0.1s). ERR : The setter 'readEventsEnabled=' was called on null. | Receiver: null | Tried calling: readEventsEnabled=false FINE: Exception type: NoSuchMethodError ERR : package:pub/src/source/hosted.dart 344:7 BoundHostedSource._throwFriendlyError | package:pub/src/source/hosted.dart 144:7 BoundHostedSource.doGetVersions | ===== asynchronous gap =========================== | dart:async _AsyncAwaitCompleter.completeError | package:pub/src/source/hosted.dart BoundHostedSource.doGetVersions | ===== asynchronous gap =========================== | dart:async _asyncErrorWrapperHelper | package:pub/src/source/hosted.dart BoundHostedSource.doGetVersions | package:pub/src/source.dart 168:12 BoundSource.getVersions | package:pub/src/solver/package_lister.dart 76:44 PackageLister._versions.. | dart:async runZoned | package:pub/src/http.dart 275:10 withDependencyType | package:pub/src/solver/package_lister.dart 75:33 PackageLister._versions. | ===== asynchronous gap =========================== | dart:async _asyncThenWrapperHelper | package:pub/src/utils.dart minByAsync | package:pub/src/solver/version_solver.dart 351:25 VersionSolver._choosePackageVersion | ===== asynchronous gap =========================== | dart:async _asyncThenWrapperHelper | package:pub/src/solver/version_solver.dart VersionSolver.solve | package:pub/src/solver.dart 35:10 resolveVersions. | package:pub/src/log.dart 378:18 progress | package:pub/src/solver.dart 32:10 resolveVersions | package:pub/src/entrypoint.dart 210:24 Entrypoint.acquireDependencies ---- End log transcript ----

chengxianghe commented 6 years ago

@aizhuzi @paizxin Android Studio中拉取不到english_words: ^3.1.0 可以尝试用命令行操作“flutter packages get”

adevjoe commented 6 years ago

很详细了,继续学习

EchoZuo commented 6 years ago

问一下,关于右上面有一个debug的字样,这个怎么去掉?

ErHu1993 commented 6 years ago

第一天学习~

MrMJL commented 6 years ago

Your application could not be compiled, because its dependencies could not be established. Could not read "D:\work_space\zy\flutter_app\lib\main.dart" when determining Dart dependencies.

编译demo时候遇到的,这个问题,环境也重装过,一直都是这样子,读取权限也是有的。各位,求解惑啊。

LIU1462056566 commented 6 years ago

english_words: ^3.1.0。使用这个包 我的模拟器就会隐藏起来,什么原因啊!

ljybill commented 5 years ago

我在学习中发现修改_biggerFont 的 fontSize 并不会热更新,需要Stop后再run,没想明白具体的原因

noblewoman commented 5 years ago

@billdai998 在 class MyApp 中 添加 debugShowCheckedModeBanner : false。

NoelBiao commented 5 years ago

列表滑动起来,抖抖的感觉,华为美腿20 Pro

liqianglai commented 5 years ago

已完成

Weiyi-C commented 5 years ago

第四步代码注释中出现错字

BUG位置:第4步: 创建一个无限滚动ListView 第2条

  1. 向RandomWordsState类添加一个 _buildSuggestions() 函数...

的代码示例中,第8行的注释文本中“该函数会添加一个”被打成了“该行书湖添加一个”

// 在偶数行,该函数会为单词对添加一个ListTile row.  
// 在奇数行,该行书湖添加一个分割线widget,来分隔相邻的词对。
Weiyi-C commented 5 years ago

第5步: 添加交互 高亮的行缺失

BUG位置:第5步: 添加交互 第3条

  1. 同时在 _buildRow()中, 添加一个心形 ❤️ 图标到 ListTiles以启用收藏功能...

的代码示例中,第2行代码也是新添加的代码,但是没有高亮

Widget _buildRow(WordPair pair) {
  final alreadySaved = _saved.contains(pair); // 该行也是新添加的代码,但是没有高亮
  return new ListTile(
    title: new Text(
      pair.asPascalCase,
      style: _biggerFont,
    ),
    trailing: new Icon(
      alreadySaved ? Icons.favorite : Icons.favorite_border,
      color: alreadySaved ? Colors.red : null,
    ),
  );
}
daniuwo commented 5 years ago

很棒,我也完成了第一个 app honor v9 测试很流畅

noblewoman commented 5 years ago

问一下,关于右上面有一个debug的字样,这个怎么去掉? 设置 debugShowCheckedModeBanner 为false

class MyApp extends StatelessWidget{ @override Widget build(BuildContext context){ return new MaterialApp( debugShowCheckedModeBanner: false, ); } }

xiaowanduo commented 5 years ago

问一下,关于右上面有一个debug的字样,这个怎么去掉?

打release包后应该就消失了。

houyanbing commented 5 years ago

这一节跟着敲完了,但是懵懵懂懂的。。。大概能明白代码意思,但是自己写不出来

DengQiSong commented 5 years ago

跟着敲完了代码、意思差不多都理解了、不过代码风格和原生安卓确实不一样、还需要在多敲一点。

FlappyQingniao commented 5 years ago

在Android Studio中拉取不到english_words: ^3.1.0这个库 因为3.1.0已经过期了,可以到官方拉取最新的

chao9267 commented 5 years ago

在Android Studio中拉取不到english_words: ^3.1.0这个库

windows android studio遇到同样的问题 使用flutter pakeages get命令也无效

wangjing013 commented 5 years ago

在Android Studio中拉取不到english_words: ^3.1.0这个库

windows android studio遇到同样的问题 使用flutter pakeages get命令也无效

把默认的 package 获取地址改为访问没有问题的镜像站就可以, 可以添加两个环境变量,今天上午搭建环境也遇到这个问题

PUB_HOSTED_URL https://pub.flutter-io.cn FLUTTER_STORAGE_BASE_URL https://storage.flutter-io.cn

MisterZhu commented 5 years ago

你好,flutter项目是否有类似iOS的.pch文件?进行全局引用头文件功能?如果我的Flutter项目要迁移到WEB端,lib路径下dart文件中的相关引都要修改,岂不是每个dart文件的引用(import 'package:flutter/material.dart')都要改成(import 'package:flutter_web/material.dart')?这样好麻烦呀。

wangxianbiao commented 4 years ago

在Android Studio中拉取不到english_words: ^3.1.0这个库

windows android studio遇到同样的问题 使用flutter pakeages get命令也无效

把默认的 package 获取地址改为访问没有问题的镜像站就可以, 可以添加两个环境变量,今天上午搭建环境也遇到这个问题

PUB_HOSTED_URL https://pub.flutter-io.cn FLUTTER_STORAGE_BASE_URL https://storage.flutter-io.cn

你好,我在环境变量里加了这两个也不行,提示以下异常,这要怎么解决啊。

flutter packages get Unhandled exception: FormatException: Scheme not starting with alphabetic character (at character 1) https://pub.flutter-io.cn ^

0 _Uri._fail (dart:core/uri.dart:1625:5)

1 _Uri._makeScheme (dart:core/uri.dart:2186:7)

2 new _Uri.notSimple (dart:core/uri.dart:1467:18)

3 Uri.parse (dart:core/uri.dart:1024:17)

4 HostedSource._pubHostedUrlConfig (package:pub/src/source/hosted.dart:57:19)

5 HostedSource.defaultUrl (package:pub/src/source/hosted.dart:50:28)

6 new UploaderCommand (package:pub/src/command/uploader.dart:27:42)

7 new PubCommandRunner (package:pub/src/command_runner.dart:107:16)

8 main (file:///C:/b/s/w/ir/cache/builder/src/third_party/dart/third_party/pkg/pub/bin/pub.dart:8:3)

9 _startIsolate. (dart:isolate-patch/isolate_patch.dart:305:32)

10 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:174:12)

Running "flutter pub get" in flutter_app... pub get failed (255; #10 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:174:12))

wangxianbiao commented 4 years ago

在Android Studio中拉取不到english_words: ^3.1.0这个库

windows android studio遇到同样的问题 使用flutter pakeages get命令也无效

把默认的 package 获取地址改为访问没有问题的镜像站就可以, 可以添加两个环境变量,今天上午搭建环境也遇到这个问题 PUB_HOSTED_URL https://pub.flutter-io.cn FLUTTER_STORAGE_BASE_URL https://storage.flutter-io.cn

你好,我在环境变量里加了这两个也不行,提示以下异常,这要怎么解决啊。

flutter packages get Unhandled exception: FormatException: Scheme not starting with alphabetic character (at character 1) https://pub.flutter-io.cn ^

0 _Uri._fail (dart:core/uri.dart:1625:5)

1 _Uri._makeScheme (dart:core/uri.dart:2186:7)

2 new _Uri.notSimple (dart:core/uri.dart:1467:18)

3 Uri.parse (dart:core/uri.dart:1024:17)

4 HostedSource._pubHostedUrlConfig (package:pub/src/source/hosted.dart:57:19)

5 HostedSource.defaultUrl (package:pub/src/source/hosted.dart:50:28)

6 new UploaderCommand (package:pub/src/command/uploader.dart:27:42)

7 new PubCommandRunner (package:pub/src/command_runner.dart:107:16)

8 main (file:///C:/b/s/w/ir/cache/builder/src/third_party/dart/third_party/pkg/pub/bin/pub.dart:8:3)

9 _startIsolate. (dart:isolate-patch/isolate_patch.dart:305:32)

10 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:174:12)

Running "flutter pub get" in flutter_app... pub get failed (255; #10 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:174:12))

问题解决了,在配置环境变量时,PUB_HOSTED_URL的值前面多了个空格,删掉后重启studio就好了

WANG1020 commented 4 years ago

Packages get 这个 在那边看啊?

x634725355 commented 4 years ago

我在子路由添加了一个点击删除当前选中的产品名字 但是点击之后数据改变了 但是并不会刷新 子路由页面 应该如何解决呢 1594194693(1)

ghost commented 3 years ago

Way to go !