clean up
This commit is contained in:
38
lib/pages/widgets/badge.dart
Normal file
38
lib/pages/widgets/badge.dart
Normal file
@@ -0,0 +1,38 @@
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
Widget badgeCounter(Widget child, int counter) {
|
||||
return Container(
|
||||
width: 120,
|
||||
height: 140,
|
||||
child: new Stack(
|
||||
children: <Widget>[
|
||||
child,
|
||||
counter != null && counter != 0
|
||||
? new Positioned(
|
||||
right: 12,
|
||||
top: 12,
|
||||
child: new Container(
|
||||
padding: EdgeInsets.all(8),
|
||||
decoration: new BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: secondaryColor,
|
||||
),
|
||||
constraints: BoxConstraints(
|
||||
minWidth: 14,
|
||||
minHeight: 14,
|
||||
),
|
||||
child: Text(
|
||||
counter > 99 ? '+99' : '$counter',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
)
|
||||
: new Container()
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user