Skip to content

[Migration] RaisedButton to ElevatedButton and FlatButton to TextButton #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 56 additions & 42 deletions lib/screens/elements.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,18 @@ class _ElementsState extends State<Elements> {
child: Padding(
padding:
const EdgeInsets.only(left: 34.0, right: 34.0, top: 16),
child: RaisedButton(
textColor: ArgonColors.white,
color: ArgonColors.initial,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
foregroundColor: ArgonColors.white,
backgroundColor: ArgonColors.initial,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4.0),
),
),
onPressed: () {
// Respond to button press
Navigator.pushReplacementNamed(context, '/home');
},
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4.0),
),
child: Padding(
padding: EdgeInsets.only(
left: 16.0, right: 16.0, top: 12, bottom: 12),
Expand All @@ -79,16 +81,18 @@ class _ElementsState extends State<Elements> {
child: Padding(
padding:
const EdgeInsets.only(left: 34.0, right: 34.0, top: 8),
child: RaisedButton(
textColor: ArgonColors.text,
color: ArgonColors.secondary,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
foregroundColor: ArgonColors.text,
backgroundColor: ArgonColors.secondary,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4.0),
),
),
onPressed: () {
// Respond to button press
Navigator.pushReplacementNamed(context, '/home');
},
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4.0),
),
child: Padding(
padding: EdgeInsets.only(
left: 16.0, right: 16.0, top: 12, bottom: 12),
Expand All @@ -103,16 +107,18 @@ class _ElementsState extends State<Elements> {
child: Padding(
padding:
const EdgeInsets.only(left: 34.0, right: 34.0, top: 8),
child: RaisedButton(
textColor: ArgonColors.white,
color: ArgonColors.primary,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
foregroundColor: ArgonColors.white,
backgroundColor: ArgonColors.primary,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4.0),
),
),
onPressed: () {
// Respond to button press
Navigator.pushReplacementNamed(context, '/home');
},
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4.0),
),
child: Padding(
padding: EdgeInsets.only(
left: 16.0, right: 16.0, top: 12, bottom: 12),
Expand All @@ -127,16 +133,18 @@ class _ElementsState extends State<Elements> {
child: Padding(
padding:
const EdgeInsets.only(left: 34.0, right: 34.0, top: 8),
child: RaisedButton(
textColor: ArgonColors.white,
color: ArgonColors.info,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
foregroundColor: ArgonColors.white,
backgroundColor: ArgonColors.info,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4.0),
),
),
onPressed: () {
// Respond to button press
Navigator.pushReplacementNamed(context, '/home');
},
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4.0),
),
child: Padding(
padding: EdgeInsets.only(
left: 16.0, right: 16.0, top: 12, bottom: 12),
Expand All @@ -151,16 +159,18 @@ class _ElementsState extends State<Elements> {
child: Padding(
padding:
const EdgeInsets.only(left: 34.0, right: 34.0, top: 8),
child: RaisedButton(
textColor: ArgonColors.white,
color: ArgonColors.success,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
foregroundColor: ArgonColors.white,
backgroundColor: ArgonColors.success,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4.0),
),
),
onPressed: () {
// Respond to button press
Navigator.pushReplacementNamed(context, '/home');
},
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4.0),
),
child: Padding(
padding: EdgeInsets.only(
left: 16.0, right: 16.0, top: 12, bottom: 12),
Expand All @@ -175,16 +185,18 @@ class _ElementsState extends State<Elements> {
child: Padding(
padding:
const EdgeInsets.only(left: 34.0, right: 34.0, top: 8),
child: RaisedButton(
textColor: ArgonColors.white,
color: ArgonColors.warning,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
foregroundColor: ArgonColors.white,
backgroundColor: ArgonColors.warning,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4.0),
),
),
onPressed: () {
// Respond to button press
Navigator.pushReplacementNamed(context, '/home');
},
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4.0),
),
child: Padding(
padding: EdgeInsets.only(
left: 16.0, right: 16.0, top: 12, bottom: 12),
Expand All @@ -199,16 +211,18 @@ class _ElementsState extends State<Elements> {
child: Padding(
padding:
const EdgeInsets.only(left: 34.0, right: 34.0, top: 8),
child: RaisedButton(
textColor: ArgonColors.white,
color: ArgonColors.error,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
foregroundColor: ArgonColors.white,
backgroundColor: ArgonColors.error,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4.0),
),
),
onPressed: () {
// Respond to button press
Navigator.pushReplacementNamed(context, '/home');
},
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4.0),
),
child: Padding(
padding: EdgeInsets.only(
left: 16.0, right: 16.0, top: 12, bottom: 12),
Expand Down
14 changes: 8 additions & 6 deletions lib/screens/onboarding.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,17 @@ class Onboarding extends StatelessWidget {
padding: const EdgeInsets.only(top: 16.0),
child: SizedBox(
width: double.infinity,
child: FlatButton(
textColor: ArgonColors.text,
color: ArgonColors.secondary,
child: TextButton(
style: TextButton.styleFrom(
foregroundColor: ArgonColors.text,
backgroundColor: ArgonColors.secondary,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4.0),
),
),
onPressed: () {
Navigator.pushReplacementNamed(context, '/home');
},
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4.0),
),
child: Padding(
padding: EdgeInsets.only(
left: 16.0, right: 16.0, top: 12, bottom: 12),
Expand Down
14 changes: 8 additions & 6 deletions lib/screens/pro.dart
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,15 @@ class Pro extends StatelessWidget {
padding: const EdgeInsets.only(top: 16.0),
child: SizedBox(
width: double.infinity,
child: FlatButton(
textColor: ArgonColors.white,
color: ArgonColors.info,
onPressed: _launchURL,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4.0),
child: TextButton(
style: TextButton.styleFrom(
foregroundColor: ArgonColors.white,
backgroundColor: ArgonColors.info,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4.0),
),
),
onPressed: _launchURL,
child: Padding(
padding: EdgeInsets.only(
left: 16.0, right: 16.0, top: 12, bottom: 12),
Expand Down
40 changes: 23 additions & 17 deletions lib/screens/register.dart
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,15 @@ class _RegisterState extends State<Register> {
Container(
// width: 0,
height: 36,
child: RaisedButton(
textColor: ArgonColors.primary,
color: ArgonColors.secondary,
onPressed: () {},
shape: RoundedRectangleBorder(
child: ElevatedButton(
style: ElevatedButton.styleFrom(
foregroundColor: ArgonColors.primary,
backgroundColor: ArgonColors.secondary,
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(4)),
),
onPressed: () {},
child: Padding(
padding: EdgeInsets.only(
bottom: 10,
Expand Down Expand Up @@ -113,13 +115,15 @@ class _RegisterState extends State<Register> {
Container(
// width: 0,
height: 36,
child: RaisedButton(
textColor: ArgonColors.primary,
color: ArgonColors.secondary,
onPressed: () {},
shape: RoundedRectangleBorder(
child: ElevatedButton(
style: ElevatedButton.styleFrom(
foregroundColor: ArgonColors.primary,
backgroundColor: ArgonColors.secondary,
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(4)),
),
onPressed: () {},
child: Padding(
padding: EdgeInsets.only(
bottom: 10,
Expand Down Expand Up @@ -260,18 +264,20 @@ class _RegisterState extends State<Register> {
Padding(
padding: const EdgeInsets.only(top: 16),
child: Center(
child: FlatButton(
textColor: ArgonColors.white,
color: ArgonColors.primary,
child: TextButton(
style: TextButton.styleFrom(
foregroundColor: ArgonColors.white,
backgroundColor: ArgonColors.primary,
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(4.0),
),
),
onPressed: () {
// Respond to button press
Navigator.pushNamed(
context, '/home');
},
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(4.0),
),
child: Padding(
padding: EdgeInsets.only(
left: 16.0,
Expand Down
15 changes: 12 additions & 3 deletions lib/widgets/button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,19 @@ class StretchableButton extends StatelessWidget {
borderRadius: BorderRadius.circular(borderRadius),
side: bs,
),
child: RaisedButton(
child: ElevatedButton(
onPressed: onPressed,
color: buttonColor,
splashColor: splashColor,
style: ButtonStyle(
backgroundColor: MaterialStateProperty.resolveWith<Color>((states) {
return buttonColor;
}),
overlayColor: MaterialStateProperty.resolveWith<Color>((states) {
if (states.contains(MaterialState.pressed)) {
return splashColor;
}
return buttonColor;
}),
),
child: Row(
mainAxisSize: MainAxisSize.min,
children: contents,
Expand Down
42 changes: 24 additions & 18 deletions lib/widgets/card-shopping.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@ class CardShopping extends StatelessWidget {
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(3.0)),
)),
FlatButton(
textColor: ArgonColors.white,
color: ArgonColors.initial,
onPressed: () {},
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4.0),
TextButton(
style: TextButton.styleFrom(
foregroundColor: ArgonColors.white,
backgroundColor: ArgonColors.initial,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4.0),
),
),
onPressed: () {},
child: Padding(
padding: EdgeInsets.only(
left: 5.0, right: 5.0, top: 12, bottom: 12),
Expand Down Expand Up @@ -97,15 +99,17 @@ class CardShopping extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
FlatButton(
textColor: ArgonColors.white,
color: ArgonColors.initial,
TextButton(
style: TextButton.styleFrom(
foregroundColor: ArgonColors.white,
backgroundColor: ArgonColors.initial,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4.0),
),
),
onPressed: () {
deleteOnPress();
},
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4.0),
),
child: Padding(
padding: EdgeInsets.only(
left: 5.0, right: 5.0, top: 12, bottom: 12),
Expand All @@ -114,13 +118,15 @@ class CardShopping extends StatelessWidget {
fontWeight: FontWeight.w600,
fontSize: 11.0))),
),
FlatButton(
textColor: ArgonColors.white,
color: ArgonColors.initial,
onPressed: () {},
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4.0),
TextButton(
style: TextButton.styleFrom(
foregroundColor: ArgonColors.white,
backgroundColor: ArgonColors.initial,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4.0),
),
),
onPressed: () {},
child: Padding(
padding: EdgeInsets.only(
left: 5.0, right: 5.0, top: 12, bottom: 12),
Expand Down