小编Har*_*han的帖子

Flutter 中 AndroidManifest 中缺少默认通知通道元数据

我正在使用firebase_messaging: ^5.0.1包来实现推送通知,在 IOS 中一切正常,而当我的移动应用程序运行后台时进入 android 我收到通知但它没有导航到相应的屏幕,它只是打开默认屏幕。如何实现导航到该特定屏幕。

PS:我实现了 click_action 功能,这就是它在 iOS 中运行良好的原因,但在 Android 中它显示以下消息

W/FirebaseMessaging( 8260): Missing Default Notification Channel metadata in AndroidManifest. Default value will be used.

这是我的 AndroidManifest:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.check">

    <!-- io.flutter.app.FlutterApplication is an android.app.Application that
         calls FlutterMain.startInitialization(this); in its onCreate method.
         In most cases you can leave this as-is, but you if you want to provide
         additional functionality it is fine to subclass or reimplement
         FlutterApplication and put your custom class here. -->
    <application
        android:name="io.flutter.app.FlutterApplication" …
Run Code Online (Sandbox Code Playgroud)

android flutter firebase-cloud-messaging

9
推荐指数
4
解决办法
2万
查看次数

如何在标签栏指示器中给出渐变线

我有一个标签栏功能,我在其中显示一个甜甜圈图和车辆列表,但我需要显示用户选择的标签我在 TabBar 中有指标颜色,但我需要填充渐变线,如图所示,请帮助我出去。

PS:如果可能的话,请让我知道如何给主题颜色意味着主色中的主色作为渐变???

return Scaffold(
    body: new DefaultTabController(
        length: 2,
        child: new Column(
          children: <Widget>[
            new Container(
              width: 1200.0,
              child: new Container(
                color: Colors.white,
                child: new TabBar(
                  labelColor: Colors.black,
                  tabs: [
                    Tab(
                      child: new Text("Visual",
                      style: new TextStyle(fontSize: 20.0)
                      ),
                    ),

                    Tab(
                      child: new Text("Tabular",
                      style: new TextStyle(fontSize: 20.0)), 
                    ),
                  ],
                ),
              ),
            ),
            new Expanded(
              child: new TabBarView(
                children: [
                  Tab(
                    child: new RefreshIndicator(
                      child: new Text('DONUT CHART'),
                      onRefresh: refreshList,
                      key: refreshKey1,
                    ),
                  ),
                  Tab(
                    child: new RefreshIndicator( …
Run Code Online (Sandbox Code Playgroud)

android dart flutter

5
推荐指数
2
解决办法
3424
查看次数

Flutter中如何实现自定义形状的容器

我想实现一个自定义形状的容器,如下图所示。有没有办法在 Flutter 中构建自定义形状的容器?

在此处输入图片说明

flutter

5
推荐指数
1
解决办法
4124
查看次数

如何在flutter中仅对一个小部件使用setState方法?

单击下图中的任何一点,我想显示与该点相关的一些信息。但是当我使用setState方法更新有关点击事件的以下信息时,图表正在重建。我想在这个时间序列图中的某个时间放大,但重建图是一个问题,看不到图上的标签。如何在setState不重新绘制图形的情况下使用该方法更新以下信息?

在下面的图像中,Angle值应该是,15.0而它没有更新setState

在此处输入图片说明

android dart flutter

5
推荐指数
2
解决办法
4076
查看次数

如何刷新选项卡栏的颤振?

我有一个标签栏,有 5 个标签,每个标签都包含一些数据。当用户下拉刷新时,我想显示一个刷新指示器,选项卡内的数据应该通过 API 调用进行更新。以下是我迄今为止尝试过的代码。

帮助我了解如何在拉动时显示刷新指示器和回调函数来做某事。

import 'dart:async';

import 'package:flutter/material.dart';

void main() => runApp(MaterialApp(
      debugShowCheckedModeBanner: false,
      home: HomePage(),
    ));

class HomePage extends StatefulWidget {
  @override
  _HomePageState createState() => new _HomePageState();
}

class _HomePageState extends State<HomePage> {


  var refreshKey = GlobalKey<RefreshIndicatorState>();

  // @override
  // void initState() {
  //   super.initState();
  //   random = Random();
  //   refreshList();
  // }

  Future<Null> refreshList() async {
    refreshKey.currentState?.show(atTop: false);
    await Future.delayed(Duration(seconds: 2));

    setState(() {
     new HomePage();
    });

    return null;
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold( …
Run Code Online (Sandbox Code Playgroud)

dart flutter

4
推荐指数
1
解决办法
8882
查看次数

升级我的 flutter 版本后无法构建 iOS 应用程序

我是 flutter iOS 开发的新手,我已经升级了我的 flutter 版本,然后在我的应用程序无法构建 iOS 应用程序后,我收到了下面提到的异常,请帮助我。在此之前它工作正常,我应该重新安装 flutter 或者任何其他想法意味着很多,提前致谢

\n\n
Xcode build done.                                           10.7s\nFailed to build iOS app\nError output from Xcode build:\n\xe2\x86\xb3\n    ** BUILD FAILED **\nXcode\'s output:\n\xe2\x86\xb3\n    === BUILD TARGET map_view OF PROJECT Pods WITH CONFIGURATION Debug ===\n    /Users/harshavardhan/Workspace/fleetconnect_flutter/ios/Pods/FMDB/src/fmdb/FMDatabase.m:1486:15: warning: \'sqlite3_wal_checkpoint_v2\' is only available on iOS 5.0 or newer [-Wunguarded-availability]\n        int err = sqlite3_wal_checkpoint_v2(_db, dbName, checkpointMode, logFrameCount, checkpointCount);\n                  ^~~~~~~~~~~~~~~~~~~~~~~~~\n    In module \'SQLite3\' imported from /Users/harshavardhan/Workspace/fleetconnect_flutter/ios/Pods/FMDB/src/fmdb/FMDatabase.m:8:\n    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/sqlite3.h:8244:16: note: \'sqlite3_wal_checkpoint_v2\' has been explicitly marked partial here\n    SQLITE_API int sqlite3_wal_checkpoint_v2(\n                   ^\n    /Users/harshavardhan/Workspace/fleetconnect_flutter/ios/Pods/FMDB/src/fmdb/FMDatabase.m:1486:15: …
Run Code Online (Sandbox Code Playgroud)

ios flutter

3
推荐指数
1
解决办法
4890
查看次数

如何在Flutter中为底部导航栏图标提供渐变

我有一个带有四个图标的底部导航栏,默认颜色是我的应用程序的主题颜色(主色)。我想将选定的图标更改为渐变色,所以我写了一个带有装饰的容器,但是没有任何人可以帮我解决这个问题,它应该如图所示。谢谢

import 'package:flutter/material.dart';
import 'dart:async';
import 'dart:io';
import 'dart:convert';
import 'package:http/http.dart' as http;
import 'package:material_search/material_search.dart';
import 'dart:ui' as ui;


class DrawerItem {
  String title;
  IconData icon;
  DrawerItem(this.title, this.icon);
}


class HomeScreen extends StatefulWidget {

  final drawerItems = [
    new DrawerItem("Dashboard", Icons.dashboard),
    new DrawerItem("Live Tracking", Icons.track_changes),
    new DrawerItem("Notifications", Icons.notifications),
    new DrawerItem("Account Details", Icons.exit_to_app),
    // new DrawerItem("Reports", Icons.dock),
  ];

  @override
  State<StatefulWidget> createState() {
    return new HomeScreenState();
  }
}


class HomeScreenState extends State<HomeScreen> {

  final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>();
  final JsonDecoder _decoder …
Run Code Online (Sandbox Code Playgroud)

android dart flutter

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

如何通过flutter应用程序提供共享选项

我是新来的,我已经通过我的应用程序通过以下链接实现共享选项但该包不起作用我的flutter版本是0.5.1如果我在pubspec.yaml中添加该包我收到此错误请帮助我出去

name: share
description: A new Flutter project.

dependencies:
  flutter:
    sdk: flutter

  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^0.1.2
  share: ^0.5.3

dev_dependencies:
  flutter_test:
    sdk: flutter


# For information on the generic Dart part of this file, see the
# following page: https://www.dartlang.org/tools/pub/pubspec

# The following section is specific to Flutter.
flutter:

  # The following line ensures that the Material Icons font is
  # included …
Run Code Online (Sandbox Code Playgroud)

android dart flutter

2
推荐指数
1
解决办法
652
查看次数

如何在折线图 x 轴抖动中传递字符串参数

我试图在颤振应用程序中制作折线图,Y 轴作为值(整数)和 X 轴作为日期(字符串),如下图所示,但颤振预定义类不允许我这样做,因为当我尝试将字符串作为参数发送然后它抛出错误说String is not Subtype of int,我是颤振的新手,请帮助我..

我试图做的例子点击这里。

这就是我想显示我的图表的方式。 这就是我想要展示的方式

android dart flutter

2
推荐指数
1
解决办法
6088
查看次数

位置包示例对我不起作用 Flutter

我是新来的,并试图从我的移动应用程序中获取当前位置的纬度和经度,为此我使用的是位置 1.4.1,并且还找到了我在下面的链接中提到的这个示例,我完全按照他们提到的步骤进行了操作一步一步的过程,但仍然是它的抛出错误。

请通过示例

Exception has occurred.
PlatformException(PERMISSION_DENIED, The user explicitly denied the use of location services for this app or location services are currently disabled in Settings., null)
Run Code Online (Sandbox Code Playgroud)

这是我运行代码时遇到的异常,但在该示例中有一个针对 PlatformException 的 try catch。我卡在这里,请帮帮我,谢谢。

我的 AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.latlong">

    <!-- The INTERNET permission is required for development. Specifically,
         flutter needs it to communicate with the running application
         to allow setting breakpoints, to provide hot reload, etc.
    -->
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>

    <!-- io.flutter.app.FlutterApplication is an android.app.Application that
         calls FlutterMain.startInitialization(this); …
Run Code Online (Sandbox Code Playgroud)

android dart flutter

1
推荐指数
1
解决办法
2万
查看次数

标签 统计

flutter ×10

android ×7

dart ×7

firebase-cloud-messaging ×1

ios ×1