小编Lan*_*don的帖子

触摸手势可以传递给同级小部件吗?

import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Container(
        child: MaterialButton(
          height: 100,
          color: Colors.grey,
          child: Text("DSG"),
          onPressed: () {
            print("Drawer sent gesture");
          },
        ),
      ),
      drawer: Container(
        height: 300,
        decoration: BoxDecoration(
          color: Colors.yellow,
        ),
        child: Center(
          child: MaterialButton(
            height: 100,
            color: Colors.grey,
            child: Text("DKG"),
            onPressed: () {
              print("Drawer kept gesture");
            }, …
Run Code Online (Sandbox Code Playgroud)

touch gesture uigesturerecognizer flutter flutter-layout

5
推荐指数
0
解决办法
389
查看次数

使用极坐标在 Python 中绘制相图

我需要以下以极坐标形式给出的非线性系统的相图......

\dot{r} = 0.5*(r - r^3)
\dot{\theta} = 1

我知道如何在 Mathematica 中做到这一点...

field1 = {0.5*(r - r^3), 1};
p1 = StreamPlot[Evaluate@TransformedField["Polar" -> "Cartesian", field1, {r, \[Theta]} -> {x, y}], {x, -3, 3}, {y, -3, 3}, Axes -> True, StreamStyle -> Gray, ImageSize -> Large];
Show[p1, AxesLabel->{x,y}, ImageSize -> Large]
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

如何在 Python 中使用 pyplot.quiver 执行相同操作?

python plot wolfram-mathematica matplotlib polar-coordinates

3
推荐指数
1
解决办法
1万
查看次数

什么?在 Dart 中做什么?

"?." 是什么意思 语法在 Dart 语言中做什么?我这里有一个来自 Flutter 的 scaffold.dart 代码的例子:

_drawerKey.currentState?.open();
Run Code Online (Sandbox Code Playgroud)

syntax conditional-statements dart flutter

3
推荐指数
1
解决办法
1235
查看次数

如何使 TextField 的 suffix/suffixIcon 高度调整大小?

import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: SafeArea(
        child: Scaffold(
          body: Column(
            children: [
              Container(
                color: Colors.orange,
                child: TextField(
                  decoration: InputDecoration(
                    suffix: IconButton(
                        icon: Icon(Icons.check_circle),
                        onPressed: () {
                          print('222');
                        }),
                  ),
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
Run Code Online (Sandbox Code Playgroud)

如何强制check_circle图标自动调整大小以匹配实际 TextField 的高度,即与其光标高度相匹配?

user-interface textfield flutter flutter-layout

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