标签: flutter-design

更改 ExpansionTile 中的尾随图标颜色

keyboard_down_arrow我需要更改尾随的颜色ExpansionTile。我尝试将它包装在主题小部件中并设置重音、主要和图标主题,但似乎没有任何效果。

Theme(
                  data: Theme.of(context).copyWith(
                    dividerColor: Colors.transparent,
                    accentColor: Colors.black,
                  ),
                  child: ExpansionTile(
                    //
                    title: Text("Some Text"
                    ),
                    childrenPadding: EdgeInsets.symmetric(horizontal: 15),
                    children: [
                      
                    ],
                  ),
                ),
Run Code Online (Sandbox Code Playgroud)

flutter flutter-design

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

从画布保存后图像看起来模糊并且图像质量与颤振中的旧图像不同

//首先是我写的代码。

class  AreaPainter extends CustomPainter{
List<Offset> points;
bool clear;
bool iscrop;
final ui.Image image;
BuildContext context;
AreaPainter(@required this.image,@required  this.clear,@required this.points,@required  `this.iscrop,@required  this.context);`
  @override
  void paint(Canvas canvas, Size size) async {
    final paint = Paint()
      ..color = Colors.blue

      ..strokeCap = StrokeCap.square
      ..style = PaintingStyle.fill
      ..strokeWidth = 2;

  
    final ui.Rect rect = ui.Offset.zero & size;
    final Size imageSize = new Size(image.width.toDouble(), image.height.toDouble());

    FittedSizes sizes = applyBoxFit(BoxFit.cover, imageSize, size);

    // if you don't want it centered for some reason change this.
    final Rect …
Run Code Online (Sandbox Code Playgroud)

android ios flutter flutter-design

6
推荐指数
0
解决办法
598
查看次数

如何更改 Flutter 中文本字段的字体大小?

我有一个文本字段,我想更改它的字体大小,因为我的应用程序适用于 iPad 和手机。文本字段的字体大小适合手机,但对于 iPad 来说太小。我怎样才能改变它?

dart flutter flutter-layout flutter-design

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

Flutter 桌面打开一个新窗口

单击按钮时,我想在桌面颤动应用程序上打开一个单独的新颤动窗口。我怎样才能做到这一点?它必须单独工作。我的操作系统:Windows 10

flutter flutter-dependencies flutter-layout flutter-desktop flutter-design

6
推荐指数
1
解决办法
6831
查看次数

当 useMaterial3 为 true 时 PrimarySwatch 不工作

当我将 Flutter 更新到 Flutter 3.7.6 时,突然不再反映“primarySwatch”。如果我将“useMaterial3”设置为 false,它就会起作用,但我不知道为什么。

return MaterialApp(
 title: 'Demo',
 theme: ThemeData(
 primarySwatch: Colors.pink,
 appBarTheme: const AppBarTheme(elevation: 0),
 useMaterial3: true,
 ),
home: const HomeScreen(),
);
Run Code Online (Sandbox Code Playgroud)

我尝试将 useMaterial3 设置为 false,但想不出任何其他解决方案。

dart flutter flutter-design

6
推荐指数
1
解决办法
1262
查看次数

如何在Flutter中实现背景模糊的Bottom Modal Sheet?

我正在做一个项目,为此我想要一张图像背景模糊的底页。为此,我实现了这段代码,该代码工作正常,但有一个问题。


  Widget build(BuildContext context) {
    return Container(
      height: MediaQuery.of(context).size.height * 0.33,
      child: Stack(
        overflow: Overflow.visible,
        fit: StackFit.expand,
        children: [
          Container(
            height: MediaQuery.of(context).size.height * 0.25,
            decoration: new BoxDecoration(
                image: new DecorationImage(
              image: new AssetImage("assets/images/bookshelf.jpg"),
              fit: BoxFit.cover,
            )),
          ),
          Positioned(
            width: MediaQuery.of(context).size.width,
            height: MediaQuery.of(context).size.height * 0.25,
            child: BackdropFilter(
              filter: ImageFilter.blur(sigmaX: 3, sigmaY: 3),
              child: Container(color: Colors.white.withOpacity(0)),
            ),
          ),
        ],
      ),
    );
  }
Run Code Online (Sandbox Code Playgroud)

输出是这样的:在此输入图像描述 它使整个屏幕模糊,但我想仅在模态表中模糊。我的问题是什么?我是颤振新手,所以对此了解不多。请在这件事上给予我帮助。

dart flutter flutter-layout flutter-design

5
推荐指数
1
解决办法
1690
查看次数

在 Flutter 中使用“bottomNavigationBar”后“body”部分不可见

每当我使用bottomNavigationBar:它不显示body:部分在屏幕上但是当我删除bottomNavigationBar:然后它显示body: Here is the code

Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Home', textAlign: TextAlign.center),
        actions: <Widget>[],
        backgroundColor: Color(0xffd81b60),
      ),
      bottomNavigationBar: _getNavBar(context),

      body: ListView(children: <Widget>[
        SizedBox(height: 300.0),
        Container(
          height: 50,
          width: 10,
          child: Center(
            child: RaisedButton(
              onPressed: () {
                Navigator.push(context,
                    MaterialPageRoute(builder: (context) => mealwisePage()));
              },
              color: Colors.pink,
              child: Padding(
                padding: const EdgeInsets.all(8.0),
                child: Text(
                  'Meal Wise',
                  textAlign: TextAlign.center,
                  style: TextStyle(fontSize: 20, color: Colors.white),
                ),), ), ), ), ]),);}
_getNavBar(context) { …
Run Code Online (Sandbox Code Playgroud)

dart flutter flutter-layout flutter-appbar flutter-design

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

在容器颤动时制作渐变效果,

如何使渐变像这个图像一样?,我认为这个渐变像 3D 效果

我在运球时发现了这个设计

flutter flutter-design

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