Anonymous
Reaktionsschnelle Benutzeroberfläche im Flattern
Post
by Anonymous » 05 Mar 2025, 06:00
In der UI -Rand erhalten die Polster-, Text- und Bildgrößen konstante Werte. Ich habe kein Bruchbox und das Einschränkungsfeld usw. verwendet
Code: Select all
double width = MediaQuery.of(context).size.width;
double height = MediaQuery.of(context).size.height;
double height35 = height * 0.35;
< /code>
Wenn meine Polsterung gepolstert wird: const handeinsets Hier 1, hier 2
sind das Dokument und das Beispiel, aber nicht aus der Medienabfrage.class _LoginPageState extends State {
@override
Widget build(BuildContext context) {
MediaQueryData queryData;
queryData = MediaQuery.of(context);
double width = MediaQuery.of(context).size.width;
double height = MediaQuery.of(context).size.height;
double height35 = height * 0.35;
return Scaffold(
body: Container(
decoration: BoxDecoration(color: Color(0xFFE7F6FD)),
child: Column(
children: [
SizedBox(height: height35,),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Container(
height: 50.0,
child: IconButton(icon: Icon(Icons.close,color: Color(0xFF005283),size: 36.0,), onPressed: null),
),
],),
Container(child: SingleChildScrollView(
padding:const EdgeInsets.only(left: 25.0,right: 25.0),
child: Column(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Container(
height: 60.0,
child: Image.asset('assets/images/login_logo.png')),
SizedBox(
height: 30.0,
),
TextFormField(
style: new TextStyle(fontSize:18.0,color: Color(0xFF005283)),
decoration: InputDecoration(
// prefixIcon: Icon(Icons.email, color: Colors.grey),
enabledBorder: UnderlineInputBorder(borderSide: new BorderSide(color: Color(0xFF005283))),
hintStyle: TextStyle(color: Color(0xFF005283),fontSize:18.0,fontFamily: "WorkSansLight"),
hintText: 'Email/Mobile No.'),
),
SizedBox(
height: 30.0,
),
TextFormField(
style: new TextStyle(fontSize:18.0,color: Color(0xFF005283)),
obscureText: true,
decoration: InputDecoration(
// prefixIcon: Icon(Icons.email, color: Colors.grey),
labelStyle: new TextStyle(color: Colors.blue),
enabledBorder: UnderlineInputBorder(borderSide: new BorderSide(color: Color(0xFF005283))),
hintStyle: TextStyle(color: Color(0xFF005283),fontSize:18.0,fontFamily: "WorkSansLight"),
hintText: 'Password'),
),
SizedBox(
height: 30.0,
),
RaisedButton(
onPressed: () {
},
shape: new RoundedRectangleBorder(borderRadius: new BorderRadius.circular(60.0)),
child: Padding(
padding: EdgeInsets.only(top:18.0,bottom: 18.0,left: 10.0,right: 10.0),
child: Text('LOG IN',style: new TextStyle(fontSize:18.0,color: Color(0xFF005283),fontFamily: "WorkSansMedium"),)),
color: Color(0xFFc1ff02),
textColor: Colors.white,),
SizedBox(
height: 30.0,),
Row(
children: [
Expanded(
child: Divider(
color: Color(0xFF005283),
height: 8.0,
),
),
SizedBox(
width: 8.0,
),
Text(
'OR CONNECT WITH',
style: TextStyle(fontSize:14.0,color: Color(0xFF005283),fontFamily: "WorkSansLight",fontWeight: FontWeight.normal),
),
SizedBox(
width: 8.0,
),
Expanded(
child: Divider(
color: Color(0xFF005283),
height: 8.0,
),
)
],
),
Row(
children: [
FlatButton.icon(
onPressed: null,
label: Text('Login with Facebook',style: TextStyle(color: Colors.white),),
icon: Icon(Icons.local_gas_station,color: Colors.white,),
shape: Border.all(color: Colors.grey,width: 2.0,style: BorderStyle.none ),
//shape: new RoundedRectangleBorder(borderRadius: new BorderRadius.circular(30.0),)
),
OutlineButton(
color: Colors.black,
child: new Text("Button text"),
onPressed: null,
shape: new RoundedRectangleBorder(borderRadius: new BorderRadius.circular(30.0))
),
],
),
SizedBox(
height: 20.0,
),
Center(
child: GestureDetector(
onTap: () {
Navigator.pushNamed(context, "myRoute");
},
child: RichText(
text: new TextSpan(
children: [
TextSpan(text:'Not a Member? ',style: TextStyle(color: Color(0xFF005283),fontSize: 14.0,fontWeight: FontWeight.w400),),
TextSpan(text:'Register Now',style: TextStyle(color: Color(0xFF005283),fontSize: 18.0,fontWeight: FontWeight.w600),),
],
),
),
) ,
),
SizedBox(
height: 20.0,
),
OutlineButton(
color: Color(0xFF005283),
child: new Text("CONTINUE AS GUEST",style: TextStyle(color: Color(0xFF005283),fontSize: 14.0,)),
onPressed: null,
shape: new RoundedRectangleBorder(borderRadius: new BorderRadius.circular(30.0))
),
],),))
],
),
),
);
}
}
1741150847
Anonymous
In der UI -Rand erhalten die Polster-, Text- und Bildgrößen konstante Werte. Ich habe kein Bruchbox und das Einschränkungsfeld usw. verwendet[code] double width = MediaQuery.of(context).size.width; double height = MediaQuery.of(context).size.height; double height35 = height * 0.35; < /code> Wenn meine Polsterung gepolstert wird: const handeinsets Hier 1, hier 2 sind das Dokument und das Beispiel, aber nicht aus der Medienabfrage.class _LoginPageState extends State { @override Widget build(BuildContext context) { MediaQueryData queryData; queryData = MediaQuery.of(context); double width = MediaQuery.of(context).size.width; double height = MediaQuery.of(context).size.height; double height35 = height * 0.35; return Scaffold( body: Container( decoration: BoxDecoration(color: Color(0xFFE7F6FD)), child: Column( children: [ SizedBox(height: height35,), Row( mainAxisAlignment: MainAxisAlignment.start, children: [ Container( height: 50.0, child: IconButton(icon: Icon(Icons.close,color: Color(0xFF005283),size: 36.0,), onPressed: null), ), ],), Container(child: SingleChildScrollView( padding:const EdgeInsets.only(left: 25.0,right: 25.0), child: Column( mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.stretch, children: [ Container( height: 60.0, child: Image.asset('assets/images/login_logo.png')), SizedBox( height: 30.0, ), TextFormField( style: new TextStyle(fontSize:18.0,color: Color(0xFF005283)), decoration: InputDecoration( // prefixIcon: Icon(Icons.email, color: Colors.grey), enabledBorder: UnderlineInputBorder(borderSide: new BorderSide(color: Color(0xFF005283))), hintStyle: TextStyle(color: Color(0xFF005283),fontSize:18.0,fontFamily: "WorkSansLight"), hintText: 'Email/Mobile No.'), ), SizedBox( height: 30.0, ), TextFormField( style: new TextStyle(fontSize:18.0,color: Color(0xFF005283)), obscureText: true, decoration: InputDecoration( // prefixIcon: Icon(Icons.email, color: Colors.grey), labelStyle: new TextStyle(color: Colors.blue), enabledBorder: UnderlineInputBorder(borderSide: new BorderSide(color: Color(0xFF005283))), hintStyle: TextStyle(color: Color(0xFF005283),fontSize:18.0,fontFamily: "WorkSansLight"), hintText: 'Password'), ), SizedBox( height: 30.0, ), RaisedButton( onPressed: () { }, shape: new RoundedRectangleBorder(borderRadius: new BorderRadius.circular(60.0)), child: Padding( padding: EdgeInsets.only(top:18.0,bottom: 18.0,left: 10.0,right: 10.0), child: Text('LOG IN',style: new TextStyle(fontSize:18.0,color: Color(0xFF005283),fontFamily: "WorkSansMedium"),)), color: Color(0xFFc1ff02), textColor: Colors.white,), SizedBox( height: 30.0,), Row( children: [ Expanded( child: Divider( color: Color(0xFF005283), height: 8.0, ), ), SizedBox( width: 8.0, ), Text( 'OR CONNECT WITH', style: TextStyle(fontSize:14.0,color: Color(0xFF005283),fontFamily: "WorkSansLight",fontWeight: FontWeight.normal), ), SizedBox( width: 8.0, ), Expanded( child: Divider( color: Color(0xFF005283), height: 8.0, ), ) ], ), Row( children: [ FlatButton.icon( onPressed: null, label: Text('Login with Facebook',style: TextStyle(color: Colors.white),), icon: Icon(Icons.local_gas_station,color: Colors.white,), shape: Border.all(color: Colors.grey,width: 2.0,style: BorderStyle.none ), //shape: new RoundedRectangleBorder(borderRadius: new BorderRadius.circular(30.0),) ), OutlineButton( color: Colors.black, child: new Text("Button text"), onPressed: null, shape: new RoundedRectangleBorder(borderRadius: new BorderRadius.circular(30.0)) ), ], ), SizedBox( height: 20.0, ), Center( child: GestureDetector( onTap: () { Navigator.pushNamed(context, "myRoute"); }, child: RichText( text: new TextSpan( children: [ TextSpan(text:'Not a Member? ',style: TextStyle(color: Color(0xFF005283),fontSize: 14.0,fontWeight: FontWeight.w400),), TextSpan(text:'Register Now',style: TextStyle(color: Color(0xFF005283),fontSize: 18.0,fontWeight: FontWeight.w600),), ], ), ), ) , ), SizedBox( height: 20.0, ), OutlineButton( color: Color(0xFF005283), child: new Text("CONTINUE AS GUEST",style: TextStyle(color: Color(0xFF005283),fontSize: 14.0,)), onPressed: null, shape: new RoundedRectangleBorder(borderRadius: new BorderRadius.circular(30.0)) ), ],),)) ], ), ), ); } } [/code]