我在运行控制台中收到此警告。基本上,我的 chatRoomTile 没有显示在屏幕上。它只显示空白屏幕,即使在我与 10 个人聊天之后也是如此。
它只是显示主屏幕和红色容器 2 秒,如条件语句中。
这是运行中的输出 -
Performing hot restart...
Syncing files to device sdk gphone x86...
Restarted application in 1,522ms.
W/eyansh.whatsap( 6057): Accessing hidden method Ldalvik/system/CloseGuard;->close()V (greylist,core-platform-api, linking, allowed)
W/DynamiteModule( 6057): Local module descriptor class for providerinstaller not found.
I/DynamiteModule( 6057): Considering local module providerinstaller:0 and remote module providerinstaller:0
W/ProviderInstaller( 6057): Failed to load providerinstaller module: No acceptable module found. Local version is 0 and remote version is 0.
Lost connection to device.
Run Code Online (Sandbox Code Playgroud)
这是我的代码 -
import …Run Code Online (Sandbox Code Playgroud) 我正在构建我的应用程序,当构建时发生此错误 -
FAILURE: Build failed with an exception.
* What went wrong:
A problem was found with the configuration of task ':app:checkDebugManifest' (type 'CheckManifest').
- Type 'CheckManifest' property 'manifest' has @Input annotation used on property of type 'File'.
Reason: A property of type 'File' annotated with @Input cannot determine how to interpret the file.
Possible solutions:
1. Annotate with @InputFile for regular files.
2. Annotate with @InputDirectory for directories.
3. If you want to track the path, return File.absolutePath as …Run Code Online (Sandbox Code Playgroud) 我想将圆形头像的一半颜色为深蓝色,另一半颜色为浅蓝色。我的意思是正好一半。我怎样才能实现这个目标?
就像他们一样 -
我尝试过这个,但没有成功-
Container(
decoration: BoxDecoration(
shape: BoxShape.circle,
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
Color(0xFF040663),
Color(0xFF434599),
],
),
),
child: CircleAvatar(
backgroundColor: Colors.transparent,
radius: MediaQuery.of(context).size.height*0.045,
child: Icon(
icon,
size: size,
color: Colors.white,
),
),
),
Run Code Online (Sandbox Code Playgroud)
有人可以告诉我如何编辑此代码,或者告诉我一种实现此目的的新方法吗?
我在我的 flutter 应用程序中使用了socket.io和node.js作为我的后端部分。我创建了一个文件index.json并在页面中创建了一个函数来将我的应用程序连接到后端。但这不起作用。这是我调用的函数initstate-
void connect() {
socket = IO.io("http://my ip address", <String, dynamic>{
"transports":["websocket"],
"autoConnect":false,
});
socket.connect();
socket.onConnect((data) => print("Connected"));
print(socket.connected);
socket.emit("/test", "Hello World");
}
@override
void initState() {
// TODO: implement initState
super.initState();
connect();
//Some other code
}
Run Code Online (Sandbox Code Playgroud)
这是index.js文件 -
const express = require("express");
var http = require("http");
const cors = require("cors");
const app = express();
const port = process.env.PORT || 5000;
var server = http.createServer(app);
var io = …Run Code Online (Sandbox Code Playgroud) 在我的程序中,此错误仅出现在我的笔记本电脑中。我输入了教程中的确切代码,但在教程中,它运行良好,但出现此错误 -
Closure call with mismatched arguments: function '[]'
Receiver: Closure: () => Map<String, dynamic> from Function 'data':.
Tried calling: []("message")
Found: []() => Map<String, dynamic>
Run Code Online (Sandbox Code Playgroud)
这是我的代码,其中出现错误。如果您想要完整的功能详细信息,您可以将其注释掉,我会在评论中为您提供相同的信息。
import 'package:flutter/material.dart';
import 'package:whatsapp/helper/constants.dart';
import 'package:whatsapp/services/database.dart';
import 'package:whatsapp/widget/widgets.dart';
class ConversationScreen extends StatefulWidget {
final String chatRoomId;
ConversationScreen(this.chatRoomId);
@override
_ConversationScreenState createState() => _ConversationScreenState();
}
class _ConversationScreenState extends State<ConversationScreen> {
DatabaseMethods databaseMethods = new DatabaseMethods();
TextEditingController messageController = new TextEditingController();
Stream chatMessageStream;
Widget ChatMessageList() {
return StreamBuilder(
stream: chatMessageStream,
builder: (context, snapshot){
return ListView.builder(
itemCount: …Run Code Online (Sandbox Code Playgroud) 我在 GetX 中制作了两个非常简单的页面来学习它。我为它创建了三个变量,一个是柜台,另一个是目的地和出发城市。计数器变量正在完美更新,而其他变量没有更改其值。它们仅在我热重载时才会改变。
如果您认为我错过了某些内容或者这种疑问很常见,并且您看过像我这样的非常相似的示例,请分享它的链接或如果可以的话更正代码。
这是我的课程:
import 'package:get/get.dart';
class Controller extends GetxController {
var count = 0.obs;
var des = "Delhi".obs;
var dep = "Agra".obs;
void increment() {
count.value++;
update();
}
void updateDes(String input) {
des = input.obs;
}
void updateDep(String input) {
dep = input.obs;
}
}
Run Code Online (Sandbox Code Playgroud)
这是第一页(您可以查看第 14、30-52 行)-
import 'package:flutter/material.dart';
import 'package:flutter_application_firebase_noti_basics/my_controller.dart';
import 'package:flutter_application_firebase_noti_basics/new_home.dart';
import 'package:get/get.dart';
class Sample extends StatefulWidget {
const Sample({Key? key}) : super(key: key);
@override
_SampleState createState() => _SampleState();
}
class _SampleState extends State<Sample> { …Run Code Online (Sandbox Code Playgroud) 我制作了一个自定义函数,可以在颤振中打开模态底部工作表。现在,我想将一些数据从工作表返回到上一页。我该怎么做呢?我尝试将函数的返回类型设置为Future<FilterDataModel>Future,但它不起作用。我希望每当用户单击“取消”时,它应该返回 false,当他按下“应用”时,我应该返回 true 数据。
这是我尝试过的 -
Future<FilterDataModel> showFilterBottomSheet<T>(
{required BuildContext context}) async {
Some code ...........
FilterDataModel filterData = FilterDataModel();
showModalBottomSheet(
context: context,
isScrollControlled: true,
builder: (context) {
String val = "One";
return StatefulBuilder(
builder: (context, StateSetter setState) {
return Wrap(
children: [
Padding(
padding: EdgeInsets.symmetric(
vertical: getProportionateScreenHeight(20),
horizontal: getProportionateScreenWidth(16),
),
child: Column(
..............
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: InkWell(
onTap: () {
Navigator.pop(context, [false, filterData]);
},
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.white), …Run Code Online (Sandbox Code Playgroud) 我想降低 Getx 使用的 Snackbar 的高度。由于标题和消息是强制性的,如果我将它们保留为空字符串,则会显示空格。我怎样才能减少这种情况,我尝试使用 Wrap,但没有成功。我只想在小吃栏中显示一行。有人可以帮帮我吗?