我试图使用FCM消息将通知发送到Android模拟器设备中,但我没有收到任何通知。google app ID与google-services.json中的相同
这是我从控制台得到的:
D / FA:已连接到远程服务
V / FA:处理排队的服务任务:1
V / FA:不活动,正在与AppMeasurementService断开连接
我的build.gradle(Module:app):
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.example.cris.firebasenotificationexam"
minSdkVersion 22
targetSdkVersion 23
Run Code Online (Sandbox Code Playgroud)
....
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
apply plugin: 'com.google.gms.google-services'
compile 'com.google.firebase:firebase-messaging:9.0.2'
}
Run Code Online (Sandbox Code Playgroud)
有人知道如何解决此问题吗?
您好,我正在使用带有占位符和图像的FadeInImage,但是第二个图像没有覆盖整个父对象,我使用的是fit:BoxFit.cover,但是无论如何结果都不好。任何人都知道如何使其成为可能。这是我的实际代码。'document [_newsImage]是从CloudFirebase获取的URL。
Widget _itemCard(BuildContext context, DocumentSnapshot document, int index) {
return new Padding(
padding: EdgeInsets.fromLTRB(8.0, 8.0, 8.0, 8.0),
child: new Card(
child: Column(children: <Widget>[
new Container(
height: 250.0,
child: new FadeInImage.assetNetwork(
placeholder: 'assets/images/esperanza.jpg',
image: document[_newsImage],
fit: BoxFit.cover,
)),
Container(
height: 150.0,
child: Padding(
padding: EdgeInsets.fromLTRB(16.0, 0.0, 16.0, 0.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Text(
document[_newsTitle],
style: TextStyle(
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 16),
),
Text(document[_newsDate])
]),
Text(
document[_textShortDescription],
style: TextStyle(color: Colors.grey, fontSize: …Run Code Online (Sandbox Code Playgroud) 我正在使用日历轮播日历轮播小部件进行颤振。我正在尝试单击日历上的随机日期并更改按钮颜色并保持此颜色,但现在我无法获得此行为。这是我的代码:
import 'package:flutter/material.dart';
import 'package:father_home_flutter/model/constants.dart';
import 'package:flutter_calendar_carousel/classes/event.dart';
import 'package:flutter_calendar_carousel/classes/event_list.dart';
import 'package:flutter_calendar_carousel/flutter_calendar_carousel.dart'
show CalendarCarousel;
class ScreenCalendar extends StatefulWidget {
@override
_ScreenCalendarState createState() => new _ScreenCalendarState();
}
class _ScreenCalendarState extends State<ScreenCalendar> {
static String noEventText = "No event here";
String calendarText = noEventText;
@override
void initState() {
_markedDateMap.add(
new DateTime(2019, 1, 25),
new Event(
date: new DateTime(2019, 1, 25),
title: 'Event 5',
icon: _eventIcon,
));
_markedDateMap.add(
new DateTime(2019, 1, 10),
new Event(
date: new DateTime(2019, 1, 10),
title: 'Event 4', …Run Code Online (Sandbox Code Playgroud)