小编Moh*_*min的帖子

尝试在初始化时区数据库之前获取位置

我正在尝试安排通知:但我收到此错误:

未处理的异常:在初始化时区数据库之前尝试获取位置

虽然我在 init 函数中初始化了时区:

  tz.initializeTimeZones();
Run Code Online (Sandbox Code Playgroud)

时间表代码:

  Future<void> scheduleNotifications(String title,int yy,int mm,int dd,int hh,int ii) async {
 
    final   loc_egypt = tz.getLocation('Africa/Cairo');       
    final tz.TZDateTime now = tz.TZDateTime.now(loc_egypt);
    var schedule_30before=tz.TZDateTime(loc_egypt,yy,mm,dd,hh,ii).subtract(Duration(minutes: 30));


      await flutterLocalNotificationsPlugin.zonedSchedule(
          0,
          title,
          "The Webinar will start after 30 minutes",
          schedule_30before,
          NotificationDetails(android: _androidNotificationDetails),
          androidAllowWhileIdle: true,
          uiLocalNotificationDateInterpretation:
          UILocalNotificationDateInterpretation.absoluteTime);


  }
Run Code Online (Sandbox Code Playgroud)

notifications flutter

10
推荐指数
1
解决办法
2356
查看次数

模块中找不到类

我用kotlin制作了一个项目:

Group id-> com.programming.kotlin

Artifact id->chapter01

Module name->chapter01

package->com.programming.kotlin.chapter01
Run Code Online (Sandbox Code Playgroud)

我做了一个名为Program.kt的kotlin类

问题是:当我尝试在包内创建一个新类(称为Program2.kt)时,当我尝试运行它时,我收到此错误:

class com.programming.kotlin.chapter01.Program2kt not found in module 'chapter01_main'
Run Code Online (Sandbox Code Playgroud)

我的问题是:如何允许除Main类之外的任何新类在intellij中运行?

kotlin

8
推荐指数
1
解决办法
2506
查看次数

Firestore 错误:流已关闭,状态为:PERMISSION_DENIED

我正在尝试对某些数据使用 firestore,但我在 firestore 控制台错误中看不到任何数据:

(c4326c7) Stream closed with status: Status{code=PERMISSION_DENIED, description=Cloud Firestore API has not been used in project 508621789005 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/firestore.googleapis.com/overview?project=508621789005 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry., cause=null}.
Run Code Online (Sandbox Code Playgroud)

尽管我允许读取,但写入规则为 true。

val db = FirebaseFirestore.getInstance()
    // Create a new user with a first and last name
            val user: MutableMap<String, Any> = HashMap()
            user["first"] = "Ada"
            user["last"] …
Run Code Online (Sandbox Code Playgroud)

kotlin firebase

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

Kotlin的参考和结构平等

Kotlin中的参照平等和结构平等有什么区别?

val a = File("/myfile.txt")
val b = File("/myfile.txt")
val sameRef = a === b
Run Code Online (Sandbox Code Playgroud)

和:

  val a = File("/myfile.txt")
    val b = File("/myfile.txt")
    val both= a == b
Run Code Online (Sandbox Code Playgroud)

kotlin

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

标签 统计

kotlin ×3

firebase ×1

flutter ×1

notifications ×1