मैं नीचे एक पृष्ठभूमि लागू करने में सक्षम था Scaffold(और यहां तक कि यह है AppBar) डाल कर Scaffoldएक के तहत Stackऔर एक की स्थापना Containerकी पृष्ठभूमि छवि सेट और के साथ पहली बार "परत" में fit: BoxFit.coverसंपत्ति।
दोनों Scaffoldऔर AppBarके लिए है backgroundColorके रूप में सेट Color.transparentऔर elevationके AppBar0 (शून्य) हो गया है।
देखा! अब आपके पास पूरे पाड़ और AppBar के नीचे एक अच्छी पृष्ठभूमि है! :)
import 'package:flutter/material.dart';
import 'package:mynamespace/ui/shared/colors.dart';
import 'package:mynamespace/ui/shared/textstyle.dart';
import 'package:mynamespace/ui/shared/ui_helpers.dart';
import 'package:mynamespace/ui/widgets/custom_text_form_field_widget.dart';
class SignUpView extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Stack( // <-- STACK AS THE SCAFFOLD PARENT
children: [
Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/images/bg.png"), // <-- BACKGROUND IMAGE
fit: BoxFit.cover,
),
),
),
Scaffold(
backgroundColor: Colors.transparent, // <-- SCAFFOLD WITH TRANSPARENT BG
appBar: AppBar(
title: Text('NEW USER'),
backgroundColor: Colors.transparent, // <-- APPBAR WITH TRANSPARENT BG
elevation: 0, // <-- ELEVATION ZEROED
),
body: Padding(
padding: EdgeInsets.all(spaceXS),
child: Column(
children: [
CustomTextFormFieldWidget(labelText: 'Email', hintText: 'Type your Email'),
UIHelper.verticalSpaceSM,
SizedBox(
width: double.maxFinite,
child: RaisedButton(
color: regularCyan,
child: Text('Finish Registration', style: TextStyle(color: white)),
onPressed: () => {},
),
),
],
),
),
),
],
);
}
}