我试图显示当前DateTime的Text按钮后丝锥.目前它的工作原理,但我想改变格式
我用
DateTime now = DateTime.now();
currentTime = new DateTime(now.year, now.month, now.day, now.hour, now.minute);
Run Code Online (Sandbox Code Playgroud)
Text('$currentTime'),
Run Code Online (Sandbox Code Playgroud)
结果是:YYYY-MM-JJ HH-MM:00.000
我不知道如何删除":00.000"
您好,如果我按下第一个页面选项卡上的按钮,我试图跳转到我的第二个页面选项卡。目前我只知道我的第二页小部件的调用路线,但底部导航栏不存在......我不知道如何从我的第一页标签调用我的父小部件以跳转到第二页标签。
class Parent {
int bottomSelectedIndex = 0;
List<BottomNavigationBarItem> buildBottomNavBarItems() {
return [
BottomNavigationBarItem(
icon: new Icon(Icons.home),
title: new Text('First')
),
BottomNavigationBarItem(
icon: new Icon(Icons.search),
title: new Text('Second'),
),
];
}
PageController pageController = PageController(
initialPage: 0,
keepPage: true,
);
Widget buildPageView() {
return PageView(
controller: pageController,
onPageChanged: (index) {
pageChanged(index);
},
children: <Widget>[
First(),
Second(),
],
);
}
@override
void initState() {
super.initState();
}
void pageChanged(int index) {
setState(() {
bottomSelectedIndex = index;
});
}
void bottomTapped(int index) { …Run Code Online (Sandbox Code Playgroud) 目前,我有AlertDialog一个IconButton。用户可以单击IconButton,每次单击都有两种颜色。问题是我需要关闭AlertDialog并重新打开以查看颜色图标的状态更改。我想在用户单击时立即更改IconButton的颜色。
这是代码:
bool pressphone = false;
//....
new IconButton(
icon: new Icon(Icons.phone),
color: pressphone ? Colors.grey : Colors.green,
onPressed: () => setState(() => pressphone = !pressphone),
),
Run Code Online (Sandbox Code Playgroud) 由于最小v1.5 sdk插件需要,我使用flutter upgrade,但由于我无法使用命令......我找不到bash命令,
我尝试手动下载 1.5 sdk 并替换以前的文件夹,当我使用 flutter doctor 他说我有 1.2.1 ...我尝试重新升级但出现此错误:
Your flutter checkout has local changes that would be erased by upgrading. If you want to keep these changes, it is
recommended that you stash them via "git stash" or else commit the changes to a local branch. If it is okay to remove
local changes, then re-run this command with --force.
C:\Users\utilisateur>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[?] Flutter (Channel stable, …Run Code Online (Sandbox Code Playgroud) 您好,我尝试使用 Recipent 启动电子邮件页面。我尝试了使用 android 但不适用于我的 ios 的 flutter 电子邮件发件人。所以我尝试使用 url 启动器来做同样的事情,但不适用于 iOS。我使用iOS模拟器,问题可能是这个?
我使用这个 url 启动器的例子
mailto:xxxxx@xxxxx.com?subject=News&body=New%20plugin
Run Code Online (Sandbox Code Playgroud)
我有这个错误
[VERBOSE-2:ui_dart_state.cc(148)] Unhandled Exception: Could not launch mailto:xxxx@xxxx.com?subject=News&body=New%20plugin
#0 _menuscreenState._launchURL (package:xxxx/bottom.dart:8285:7)
<asynchronous suspension>
#1 _menuscreenState.build.<anonymous closure>.<anonymous closure> (package:xxxx/bottom.dart:8705:13)
Run Code Online (Sandbox Code Playgroud)
这是带有 url 启动器的完整示例
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
void main() => runApp(MyApp());
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
String email="contact@ouiquit.com";
_launchEmail() async {
if (await canLaunch("mailto:$email")) {
await launch("mailto:$email");
} else {
throw 'Could not launch';
} …Run Code Online (Sandbox Code Playgroud) 我使用正则表达式验证了提取gps纬度和经度的功能,但目前它是String,而map_view只接受double
先前的问题: 如何在颤动中显示正则表达式结果
我试图用它来转换成双倍,但不起作用
RegExp regExp = new RegExp( //Here is the regex fonction to extract long, lat
r"maps:google\.com\/maps\?q=(-?[0-9]+.[0-9]+),(-?[0-9]+.[0-9]+)",
);
var match = regExp.firstMatch(input);
group1 = match.group(1); //match groupe seems to be an int
group2 = match.group(2);
var long2 = double.parse('$group1');
assert(long2 is double);
var lat2 = double.parse('$group2');
assert(lat2 is double);
Run Code Online (Sandbox Code Playgroud) 我有一个正在生产的应用程序,一切正常,但是在苹果被迫升级 Xcode 以运行该应用程序后,我开始面临一些问题,但还没有人找到解决方案,我的业务因此陷入困境,我需要一个快速的解决方案。
我有一个问题(对于 mac/appstore 上下文):
我通过创建一个新项目成功地解决了我的运行问题。我想知道是否有一种方法可以将这个新的 Flutter 项目链接到包含正在生产中的应用程序并创建新版本的旧项目?
我认为它需要具有相同的
所有这些都告诉我这是不可能的:(但也许我错了
我有一个随机日期列表,格式如下:
String x ="Text(\"key:[2020-08-23 22:22, 2020-08-22 10:11, 2020-02-22 12:14]\"),"
Run Code Online (Sandbox Code Playgroud)
我可以使用\d{4}\-\d{2}\-\d{2}\s\d{2}:\d{2}正则表达式来匹配中的所有日期x:
RegExp regExp79 = new RegExp(
r'\d{4}\-\d{2}\-\d{2}\s\d{2}:\d{2}',
);
var match79 = regExp79.allMatches("$x");
var mylistdate = match79;
Run Code Online (Sandbox Code Playgroud)
所以,比赛是:
match 1 = 2020-08-22 22:22
match 2 = 2020-08-22 10:11
match 3 = 2020-02-22 12:14
Run Code Online (Sandbox Code Playgroud)
我想将 转换Iterable<RegExpMatch>为字符串列表,以便列表的输出如下所示:
[2020-08-22 22:22, 2020-08-22 10:11, 2020-02-22 12:14]
Run Code Online (Sandbox Code Playgroud) 我更新了我的 1 年苹果开发并更新了我的证书
> Xcode 11 supports the new Apple Development and Apple Distribution certificate types. These certificates support building, running, and
> distributing apps on any Apple platform. Preexisting iOS and macOS
> development and distribution certificates continue to work, however,
> new certificates you create in Xcode 11 use the new types. Previous
> versions of Xcode don’t support these certificates. (45527608)
Run Code Online (Sandbox Code Playgroud)
由于 Xcode11 的这个注释,我测试创建一个 Apple 发行版而不是像以前一样的 iOS 发行版
所以,我创建了这个并在 Xcode 中选择了好的配置文件。
在这一步,一切都很好。
但是现在当我尝试运行应用程序时
我有
No Provisioning Profile …Run Code Online (Sandbox Code Playgroud) flutter ×10
dart ×4
ios ×2
datetime ×1
macos ×1
navigation ×1
pod-install ×1
regex ×1
upgrade ×1
xcode ×1