【发布时间】:2022-01-09 04:42:04
【问题描述】:
我的问题是如何将透明图像扩展得比应用栏的边框更远?我希望图像覆盖整个应用栏,我尝试过使用 fit: 但它不起作用。我想要图像覆盖的整个橙色。
下面是我的代码:
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
var title = 'Web Images';
return MaterialApp(
title: title,
home: Scaffold(
appBar: AppBar(
title: SizedBox(
width: 1000,
child: Image.asset('assets/images/foodBackground.png'),
),
backgroundColor: const Color(0xffFA7343),
),
body: Text('test1'),
),
);
}
}
This is the image of how it looks, as you can see it hasn't filled to the edges of the appbar.
【问题讨论】:
标签: flutter android-studio dart