我正在使用 qr_flutter 库生成二维码,但我需要在手机上保存为图像。现在我只有这个:
QrImage(
data: 'This QR code has an embedded image as well',
version: QrVersions.auto,
size: 320,
gapless: false,
embeddedImage: AssetImage('assets/images/logo.png'),
embeddedImageStyle: QrEmbeddedImageStyle(
size: Size(80, 80),
),
Run Code Online (Sandbox Code Playgroud) 有没有办法在 Android Studio 中自动格式化代码以保存 Flutter?
我知道有很多类似的答案,但我已经检查过它们,观看了相关视频并尝试了无数次。我将 flutter 路径导出到 .bashprofile 并保存为屏幕截图所示,但是如果我关闭终端并尝试使用像flutter --versionor这样的 flutter 命令which flutter,甚至flutter doctor我会得到flutter not found或zsh: command not found: flutter
如何解决这个问题,以便我可以在任何目录或路径中永久使用 flutter


我正在尝试添加一个 sliverlist 但它对我不起作用,我对使用 flutter 很陌生,我很困惑。
@override
Widget build(BuildContext context) {
return Scaffold(
body: const CustomScrollView(
slivers: <Widget>[
SliverAppBar(
title: Text('Sample Slivers'),
leading: Icon(Icons.menu),
backgroundColor: Colors.orangeAccent,
expandedHeight: 90.0,
floating: true,
pinned: true,
snap: false,
),
SliverList(
delegate: SliverChildBuilderDelegate((context) {}),
)
],
),
bottomNavigationBar: _navigatorAppBar(),
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
floatingActionButton: _buildFab(),
);
}
}
Run Code Online (Sandbox Code Playgroud)

我正在尝试将泡菜文件放入数据框。尝试过setrecursionlimit1500-5000 的值仍然会出现错误。
有没有其他方法可以访问pickle文件并将其放入数据框中?
import pandas as pd
import numpy as np
import sys
sys.setrecursionlimit(5000)
df = pd.read_pickle("data.pkl",compression=None)
df.head()
Run Code Online (Sandbox Code Playgroud)

整个日志:
---------------------------------------------------------------------------
RecursionError Traceback (most recent call last)
<ipython-input-4-c42a15b2c7cf> in <module>
----> 1 df.head()
/opt/conda/lib/python3.7/site-packages/pandas/core/generic.py in head(self, n)
4787 """
4788
-> 4789 return self.iloc[:n]
4790
4791 def tail(self: FrameOrSeries, n: int = 5) -> FrameOrSeries:
/opt/conda/lib/python3.7/site-packages/pandas/core/indexing.py in __getitem__(self, key)
1766
1767 maybe_callable = com.apply_if_callable(key, self.obj)
-> 1768 return self._getitem_axis(maybe_callable, axis=axis)
1769
1770 def _is_scalar_access(self, key: Tuple):
/opt/conda/lib/python3.7/site-packages/pandas/core/indexing.py in _getitem_axis(self, …Run Code Online (Sandbox Code Playgroud) 我TextFormField对空进行了验证。
为了控制高度,TextFormField被嵌套在Containerwidget内部。
这会导致将错误消息重叠显示为附加图片的意外副作用。
要测试示例代码,请按“提交”查看错误。
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: SimpleForm(),
);
}
}
class SimpleForm extends StatelessWidget {
@override
Widget build(BuildContext context) {
final formKey = GlobalKey<FormState>();
return SafeArea(
child: Scaffold(
// primary: true,
body: Form(
key: formKey,
child: Column( …Run Code Online (Sandbox Code Playgroud) void _onButtonPressd(BuildContext context) {
TextEditingController customController = TextEditingController();
showModalBottomSheet(
isScrollControlled: true,
context: context,
builder: (context) {
return Container(
height: 350,
child: Column(
children: <Widget>[
Container(
padding: EdgeInsets.only(
left: 10.0, right: 10.0, top: 20.0, bottom: 15.0),
child: Text(
'Meritos',
style: TextStyle(
color: Colors.black,
fontSize: 24,
fontFamily: 'Jost',
fontWeight: FontWeight.bold),
),
),
Container(
height: 80,
padding: EdgeInsets.only(left: 25.0, right: 25.0),
child: Column(
children: <Widget>[
CheckboxListTile(
*Here where the problem arises*
)
],
)),
],
));
});
}
Run Code Online (Sandbox Code Playgroud) 我想要 iOS-Modal-Transition,其中新屏幕从底部开始动画,而旧屏幕被推到后面。我发现这个非常有前途的包:
这是我用来显示模态的函数:
showCupertinoModalBottomSheet(
expand: true,
context: context,
builder: (context) => Container(
color: AppColors.blue,
),
);
Run Code Online (Sandbox Code Playgroud)
然而,这并不能 100% 正确地工作,因为后面的视图没有被推到后面。
我在这里缺少什么?如果有任何不清楚的地方请告诉我!
这是我的更多代码:
这是我的整个页面,我想从这里进行转换:
class _MonthPageState extends State<MonthPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppColors.secondary,
body: SafeArea(
child: Stack(
children: [
...
Positioned(
bottom: 10,
right: 20,
child: Hero(
tag: widget.month.name + 'icon',
child: AddButton(
onTapped: () {
showCupertinoModalBottomSheet(
expand: true,
context: context,
builder: (context) => Container(
color: AppColors.blue,
),
);
},
),
),
),
],
),
), …Run Code Online (Sandbox Code Playgroud) flutter ×8
dart ×4
android ×1
dataframe ×1
macos ×1
modal-dialog ×1
pandas ×1
pickle ×1
python ×1
router ×1
terminal ×1
transition ×1
validation ×1