我想获得这样的屏幕(上图),但是当我尝试制作它时,我只是得到这个屏幕(下图),我不知道如何获得上屏幕。请帮助我。我认为我的代码有问题。
这是我的代码。
import 'package:flutter/material.dart'; class SettingScreen extends StatefulWidget { const SettingScreen({super.key});[![enter image description here][2]][2] @override State<SettingScreen> createState() => _SettingScreenState(); } class _SettingScreenState extends State<SettingScreen> { @override Widget build(BuildContext context) { return Scaffold( body: SafeArea( child: Column( children: [ Container( width: double.infinity, height: 100, decoration: BoxDecoration( boxShadow: const [ BoxShadow( color: Colors.black26, blurRadius: 90, offset: Offset(4, 9)) ], gradient: LinearGradient( colors: [ Color.fromARGB(255, 170, 148, 210), Color.fromARGB(255, 65, 160, 195), Color.fromARGB(255, 134, 174, 207), Color.fromARGB(255, 155, 187, 212), ], begin: Alignment.topLeft, end: Alignment.topRight, stops: [0.2, 0.7, 0.9, 1.4])), child: Padding( padding: const EdgeInsets.all(18.0), child: Row(children: [ Text( "REL" + '\n' + " ATE", style: TextStyle( color: Colors.white, fontWeight: FontWeight.bold, fontSize: 10, letterSpacing: 20, ), ), SizedBox( width: 130, ), Icon( Icons.skip_next_rounded, color: Colors.white, size: 50, ), ]), ), ), Stack( children: [ Container( width: 300, height: 522, decoration: BoxDecoration(color: Colors.white, boxShadow: const [ BoxShadow( color: Colors.black, offset: Offset(1, 2), blurRadius: 50, ) ]), ), Positioned( top: 10, right: 3, child: SizedBox( child: Container( // width: 500, child: Column( children: [ Text( "SETTINGS", style: TextStyle( color: Colors.black, fontWeight: FontWeight.bold, fontSize: 30, letterSpacing: 20), ), Padding( padding: EdgeInsets.only(right: 100, top: 10), child: Text( "ACCOUNT", style: TextStyle(color: Colors.grey), ), ), Divider( color: Colors.grey, thickness: 100, height: 20, ) ], ), ), ), ) ], ) ], )), ); } }
但我看到第二个屏幕,“设置”中缺少“S”。请帮助我。
可以使用Stack的clipBehavior,将其设置为
希望对您有帮助!