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) //首先是我写的代码。
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) 我有一个文本字段,我想更改它的字体大小,因为我的应用程序适用于 iPad 和手机。文本字段的字体大小适合手机,但对于 iPad 来说太小。我怎样才能改变它?
单击按钮时,我想在桌面颤动应用程序上打开一个单独的新颤动窗口。我怎样才能做到这一点?它必须单独工作。我的操作系统:Windows 10
flutter flutter-dependencies flutter-layout flutter-desktop flutter-design
当我将 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,但想不出任何其他解决方案。
我正在做一个项目,为此我想要一张图像背景模糊的底页。为此,我实现了这段代码,该代码工作正常,但有一个问题。
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)
输出是这样的:
它使整个屏幕模糊,但我想仅在模态表中模糊。我的问题是什么?我是颤振新手,所以对此了解不多。请在这件事上给予我帮助。
每当我使用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)