小编Fat*_*Crg的帖子

在 dart 中获取字符串的前几个单词

如何从长文件中获取前几个词(摘录)String。我有一个大故事类型字符串,需要在屏幕上显示前 5-10 个单词,其余的要在下一个屏幕上显示。那么有没有办法做到这一点。我搜索了很多,但无法解决问题。例如:获取我们使用的第一个字母

String sentence = "My single Sentence";
sentence[0] //M
Run Code Online (Sandbox Code Playgroud)

同样,我需要得到一些词。例如:

String bigSentence ='''
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book
''';
//code to get the excerpt()

//predicted output=> Lorem Ipsum is simply dummy text...
Run Code Online (Sandbox Code Playgroud)

string dart flutter

6
推荐指数
3
解决办法
3954
查看次数

cloud_firestore/unavailable 该服务当前不可用

我在我的 flutter 应用程序中使用 Firebase Firestore。模式下一切正常debug。但是,在release模式下,我收到以下错误。\n我看到了类似的问题,但它没有解决我的问题。

\n
[ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: [cloud_firestore/unavailable] \nThe service is currently unavailable. This is a most likely a transient condition and may be corrected by retrying with a backoff.\nE/flutter ( 3646): #0      MethodChannelDocumentReference.get \n(package:cloud_firestore_platform_interface/src/method_channel/method_channel_document_reference.dart:80)\nE/flutter ( 3646): <asynchronous suspension>\nE/flutter ( 3646): #1      DocumentReference.get (package:cloud_firestore/src/document_reference.dart:58)\nE/flutter ( 3646): <asynchronous suspension>\n
Run Code Online (Sandbox Code Playgroud)\n
$ flutter doctor\n>> Flutter (Channel stable, 2.2.3, Version 10.0.21996.1)\n>> \xe2\x80\xa2 No issues found!\n
Run Code Online (Sandbox Code Playgroud)\n

我试过

\n
    \n
  • 添加INTERNET权限。
  • \n
  • 更改 Gradle 版本。
  • \n …

firebase flutter google-cloud-firestore

6
推荐指数
2
解决办法
6968
查看次数

标签 统计

flutter ×2

dart ×1

firebase ×1

google-cloud-firestore ×1

string ×1