无法在JavaScript中设置Cookie

时间:2019-12-25 07:59:04

标签: javascript cookies

我正在使用它一个小时,但是我无法弄清楚这是怎么回事。

 import 'package:flutter/material.dart';
 import 'package:quick_actions/quick_actions.dart';

 void main() {
     WidgetsFlutterBinding.ensureInitialized();
     final QuickActions quickActions = QuickActions();

     quickActions.initialize((shortcutType) {
       if (shortcutType == 'action_one') {
          print('The user tapped on the "Main view" action.');
       }
     });

     quickActions.setShortcutItems(<ShortcutItem>[
       const ShortcutItem(
         type: 'action_one',
         localizedTitle: 'Action one',
         icon: 'AppIcon',
         ),
       const ShortcutItem(
         type: 'action_two', localizedTitle: 'Action two', icon: 'ic_launcher'),
       ]);
   //runApp(MyApp());<-- comment
   }

1 个答案:

答案 0 :(得分:1)

使用此方法..希望对您有帮助

Cookies.set('key',value);