Skip to content

Commit 14e9e64

Browse files
committed
rename Badge to SampleBadage to avoid naming conflict after upgrading to flutter 3.7
1 parent a84e61d commit 14e9e64

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

example/lib/components/chip_item.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ import '../model/badge.dart';
2222
class ChipItem extends StatelessWidget {
2323
const ChipItem(this.chips, this.selectedChip, this.onChanged);
2424

25-
final List<Badge?> chips;
26-
final Badge? selectedChip;
27-
final ValueChanged<Badge?> onChanged;
25+
final List<SampleBadge?> chips;
26+
final SampleBadge? selectedChip;
27+
final ValueChanged<SampleBadge?> onChanged;
2828

2929
@override
3030
Widget build(BuildContext context) {
3131
return Row(
3232
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
33-
children: chips.map<Widget>((Badge? chip) {
33+
children: chips.map<Widget>((SampleBadge? chip) {
3434
return GestureDetector(
3535
onTap: () => onChanged(chip),
3636
child: Container(

example/lib/data.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ class Data {
6363
];
6464
static const badges = [
6565
null,
66-
Badge('1'),
67-
Badge('hot',
66+
SampleBadge('1'),
67+
SampleBadge('hot',
6868
badgeColor: Colors.orange, padding: EdgeInsets.only(left: 7, right: 7)),
69-
Badge('99+', borderRadius: 2)
69+
SampleBadge('99+', borderRadius: 2)
7070
];
7171

7272
static const curves = [

example/lib/default_appbar_demo.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ class _State extends State<DefaultAppBarDemo>
9898
Color _barColor = Data.namedColors.first.color;
9999
Color _shadowColor = Data.namedColors.first.color;
100100
Gradient? _gradient = Data.gradients.first;
101-
Badge? _badge;
101+
SampleBadge? _badge;
102102
TabController? _tabController;
103103
TextDirection _textDirection = TextDirection.ltr;
104104

@@ -269,7 +269,7 @@ class _State extends State<DefaultAppBarDemo>
269269
});
270270
}
271271

272-
void _onBadgeChanged(Badge? value) {
272+
void _onBadgeChanged(SampleBadge? value) {
273273
setState(() {
274274
_badge = value;
275275
});

example/lib/model/badge.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616

1717
import 'package:flutter/material.dart';
1818

19-
class Badge {
19+
class SampleBadge {
2020
final Color? color;
2121
final Color? badgeColor;
2222
final EdgeInsets? padding;
2323
final double? borderRadius;
2424
final String text;
2525

26-
const Badge(
26+
const SampleBadge(
2727
this.text, {
2828
this.color,
2929
this.badgeColor,

0 commit comments

Comments
 (0)