CopyPastor

Detecting plagiarism made easy.

Score: 0.8010398745536804; Reported for: String similarity Open both answers

Possible Plagiarism

Plagiarized on 2019-10-20
by jurrdb

Original Post

Original - Posted on 2018-04-25
by Mohit Suthar



            
Present in both answers; Present only in the new answer; Present only in the old answer;

Instead of putting the `RaisedButton` in a `ConstrainedBox`, you can wrap it in an `Expanded` widget within a `Row` like this:
class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( home: Scaffold( body: SafeArea( child: Center( child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ TextFormField(), TextFormField(), Row( children: <Widget>[ Expanded( child: RaisedButton(child: Text("button"), onPressed: () {}), ), ], ), ], ), ), ), ), ); } }
The `Row` will create a horizontal row, and the `Expanded` widget will make sure its child will fill as much space as possible.
After some research, I found out some solution, and thanks to @Günter Zöchbauer,
I used column instead of Container and
set the property to column **CrossAxisAlignment.stretch** to Fill match parent of Button
new Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: <Widget>[ new RaisedButton( child: new Text( "Submit", style: new TextStyle( color: Colors.white, ) ), colorBrightness: Brightness.dark, onPressed: () { _loginAttempt(context); }, color: Colors.blue, ), ], ),

        
Present in both answers; Present only in the new answer; Present only in the old answer;