import 'package:flutter/material.dart';
class SignInPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Time Tracker'),
elevation: 5.0,
),
body: _buildContent(),
backgroundColor: Colors.amber[50],
);
}
Widget _buildContent() {
return Padding(
padding: EdgeInsets.all(16.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Text(
'Sing in',
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 32.0,
fontWeight: FontWeight.w600,
),
),
SizedBox(height: 8.0),
ElevatedButton(
child: Text('Sing in with google'),
onPressed: () {},
style: ElevatedButton.styleFrom(
primary: Colors.purple[200],
onPrimary: Colors.black87,
elevation: 6.0,
shadowColor: Colors.yellow[200],
),
],
),
);
}
}
1_ i don't know how to change the shape of my button in this context and i clearly have an error at the end of the last square ], line 41 .please help me to fix it i appreciate your help in advance.
You can use a Container as a child of the Button or do this:
ElevatedButton.styleFrom(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30.0),
),
child: Text(' Elevated Button'),
),
You can use the following way:
Inside elevated button,
style: ButtonStyle(
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(18.0),
side: BorderSide(color: Colors.red)
)
)
)
Here you can play with borderRadius property to get different shapes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With