我的問題是如何將透明影像擴展到比應用欄邊框更遠的地方?我希望影像覆寫整個應用程式欄,我嘗試使用 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'),
),
);
}
}

uj5u.com熱心網友回復:
AppBar(
flexibleSpace: Image.asset(
'assets/images/foodBackground.png',
),
),
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/372200.html
