70 lines
2.4 KiB
Dart
70 lines
2.4 KiB
Dart
import 'package:fcs/fcs/common/localization/app_translations.dart';
|
|
import 'package:fcs/fcs/common/pages/model/language_model.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter/widgets.dart';
|
|
import 'package:provider/provider.dart';
|
|
|
|
typedef BtnCallback();
|
|
|
|
class ActionButton extends StatelessWidget {
|
|
final String title;
|
|
final Image imgIcon;
|
|
final IconData icon;
|
|
final BtnCallback btnCallback;
|
|
|
|
const ActionButton(
|
|
{Key key, this.title, this.imgIcon, this.icon, this.btnCallback})
|
|
: super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
var languageModel = Provider.of<LanguageModel>(context);
|
|
return InkWell(
|
|
onTap: btnCallback != null ? btnCallback : () => {},
|
|
child: Container(
|
|
width: 120,
|
|
height: 130,
|
|
padding: EdgeInsets.only(top: 10.0, left: 5, right: 5),
|
|
decoration: new BoxDecoration(
|
|
color: Colors.transparent,
|
|
borderRadius: new BorderRadius.only(
|
|
topLeft: const Radius.circular(40.0),
|
|
topRight: const Radius.circular(40.0))),
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(5.0),
|
|
child: Column(children: <Widget>[
|
|
ClipOval(
|
|
child: Material(
|
|
color: Colors.black54, // button color
|
|
child: SizedBox(
|
|
width: 60,
|
|
height: 60,
|
|
child: icon == null
|
|
? Container(width: 10, height: 10, child: imgIcon)
|
|
: Icon(icon, color: Colors.white, size: 30)),
|
|
),
|
|
),
|
|
Container(
|
|
height: 50,
|
|
alignment: Alignment.topCenter,
|
|
child: Text(AppTranslations.of(context).text(title),
|
|
textAlign: TextAlign.center,
|
|
style: languageModel.isEng
|
|
? TextStyle(
|
|
color: Colors.white,
|
|
fontWeight: FontWeight.w500,
|
|
fontSize: 15.0,
|
|
fontFamily: "Roboto")
|
|
: TextStyle(
|
|
color: Colors.white,
|
|
fontWeight: FontWeight.w500,
|
|
fontSize: 14.0,
|
|
fontFamily: "MyanmarUnicode")),
|
|
),
|
|
]),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|