当我点击按钮时,我想切换到 Instagram 个人资料。我使用这个库url_launcher。但我只能使用网络浏览器来实现此目的。为了实现我的目标,我要做什么?
我的应用程序中有 Stepper,并且在屏幕上放置文本字段时遇到问题,当我想在文本字段中输入一些文本时,会出现键盘并显示:
\n\n\n\n\nRenderFlex 底部溢出了 139 个像素。
\n
我读了一些文章并理解,我必须使用它FittedBox,但我不知道如何以最佳方式使用它。我怎样才能达到我的目标?
代码:
\n\n@override\n Widget build(BuildContext context) {\n globalHeight = (MediaQuery.of(context).size.height) * 0.85;\n return Scaffold(\n body: AnnotatedRegion<SystemUiOverlayStyle>(\n value: SystemUiOverlayStyle.light,\n child: Container(\n decoration: BoxDecoration(color: colorsBackround[_currentPage]),\n child: Padding(\n padding: EdgeInsets.symmetric(vertical: 10.0),\n child: Column(\n crossAxisAlignment: CrossAxisAlignment.stretch,\n children: <Widget>[\n Container(\n height: globalHeight,\n child: PageView(\n physics: ClampingScrollPhysics(),\n controller: _pageController,\n onPageChanged: (int page) {\n setState(() {\n _currentPage = page;\n });\n },\n children: <Widget>[\n // some code\n Padding(\n padding: EdgeInsets.all(10.0),\n child: Center(\n child: Column(\n …Run Code Online (Sandbox Code Playgroud) 当我想在 Textfield 中写入一些文本时,键盘会关闭我的模态底部工作表。我无法理解,为什么会发生这种情况。我尝试使用这行代码:
padding: EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom)
但是在输出中我得到了文本字段,它会延伸。
我花了很多时间来解决这个问题,我真的很想关闭这个问题。
这是完整的代码
import 'package:flutter/material.dart';
class NutritionScreen extends StatefulWidget {
@override
_NutritionScreenState createState() => _NutritionScreenState();
}
class _NutritionScreenState extends State<NutritionScreen> {
double height = 500.0;
void _modalBottomSheetMenu(){
showModalBottomSheet(
context: context,
builder: (builder){
return new Container(
height: height,
color: Colors.transparent, //could change this to Color(0xFF737373),
//so you don't have to change MaterialApp canvasColor
child: new Container(
decoration: new BoxDecoration(
color: Colors.white,
borderRadius: new BorderRadius.only(
topLeft: const Radius.circular(10.0),
topRight: const Radius.circular(10.0))),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: …Run Code Online (Sandbox Code Playgroud) 我想拆分一些字符串并将每一行包含在数组中的单独元素中。我使用此代码来实现我的目标:
List _masForUsing;
_masForUsing = new List(numberOfLines);
void gpsHelper(String text, int count){
for(int i =0; i<count;i++){
_masForUsing[i] = text.split("\\r?\\n");
}
print(_masForUsing[2]);
}
Run Code Online (Sandbox Code Playgroud)
但是当我想唤起数组的第三个元素时,它只显示完整的字符串。请帮我 :)
这是字符串的示例:
Run Code Online (Sandbox Code Playgroud)real time: 23-09-2019, 23:08:55, Mon system time: 5362 gps coordinates: 55.376538; 037.431973; gps satellites: 3; gps time: 20:09:02; gps date: 23.09.19; temperature: 19 *C humidity: 35 % dust: 1 zivert: 21