Skip to content

Commit

Permalink
Change RaisedButton to ElevatedButton
Browse files Browse the repository at this point in the history
  • Loading branch information
miDeb committed Mar 6, 2021
1 parent 7d20452 commit 30c76b1
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class HomeScreen extends StatefulWidget {

class _HomeScreenState extends State<HomeScreen> {
int _counter = 0;
bool showRaisedButtonBadge = true;
bool showElevatedButtonBadge = true;

@override
Widget build(BuildContext context) {
Expand Down Expand Up @@ -56,7 +56,7 @@ class _HomeScreenState extends State<HomeScreen> {
_addRemoveCartButtons(),
_textBadge(),
_directionalBadge(),
_raisedButtonBadge(),
_elevatedButtonBadge(),
_chipWithZeroPadding(),
expandedBadge(),
_badgeWithZeroPadding(),
Expand Down Expand Up @@ -159,15 +159,15 @@ class _HomeScreenState extends State<HomeScreen> {
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
RaisedButton.icon(
ElevatedButton.icon(
onPressed: () {
setState(() {
_counter++;
});
},
icon: Icon(Icons.add),
label: Text('Add to cart')),
RaisedButton.icon(
ElevatedButton.icon(
onPressed: () {
if (_counter > 0) {
setState(() {
Expand Down Expand Up @@ -197,19 +197,19 @@ class _HomeScreenState extends State<HomeScreen> {
);
}

Widget _raisedButtonBadge() {
Widget _elevatedButtonBadge() {
return Badge(
showBadge: showRaisedButtonBadge,
showBadge: showElevatedButtonBadge,
padding: EdgeInsets.all(8),
badgeColor: Colors.deepPurple,
badgeContent: Text(
'!',
style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
),
child: RaisedButton(
child: ElevatedButton(
onPressed: () {
setState(() {
showRaisedButtonBadge = !showRaisedButtonBadge;
showElevatedButtonBadge = !showElevatedButtonBadge;
});
},
child: Text('Raised Button'),
Expand Down

0 comments on commit 30c76b1

Please sign in to comment.