add structure

This commit is contained in:
2020-05-29 07:45:27 +06:30
parent 4c851d9971
commit bad27ba5c4
272 changed files with 36065 additions and 174 deletions

43
lib/widget/badge.dart Normal file
View File

@@ -0,0 +1,43 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
Widget badgeCounter(int counter, {VoidCallback onPressed}) {
return InkWell(
onTap: () => onPressed(),
child: new Stack(
children: <Widget>[
new IconButton(
padding: EdgeInsets.only(top: 10),
icon: Icon(Icons.notifications),
onPressed: () {
onPressed();
}),
counter != 0
? new Positioned(
right: 11,
top: 11,
child: new Container(
padding: EdgeInsets.all(2),
decoration: new BoxDecoration(
color: Colors.blue,
borderRadius: BorderRadius.circular(6),
),
constraints: BoxConstraints(
minWidth: 14,
minHeight: 14,
),
child: Text(
'+${counter > 99 ? 99 : counter}',
style: TextStyle(
color: Colors.white,
fontSize: 10,
),
textAlign: TextAlign.center,
),
),
)
: new Container()
],
),
);
}