39 lines
1.4 KiB
Dart
39 lines
1.4 KiB
Dart
import 'package:aman_kassa_flutter/shared/app_colors.dart';
|
|
import 'package:aman_kassa_flutter/shared/shared_styles.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
|
|
|
|
/// A button that shows a busy indicator in place of title
|
|
class AmanIconButtonHorizontal extends StatefulWidget {
|
|
final String title;
|
|
final Function onPressed;
|
|
final Color activeColor;
|
|
final Color inactiveColor;
|
|
final bool selected;
|
|
final IconData icon;
|
|
const AmanIconButtonHorizontal(
|
|
{
|
|
@required this.title,
|
|
this.onPressed,
|
|
this.activeColor = primaryColor,
|
|
this.inactiveColor = Colors.black26,
|
|
this.selected = false,
|
|
@required this.icon
|
|
});
|
|
|
|
@override
|
|
_AmanIconButtonHorizontalState createState() => _AmanIconButtonHorizontalState();
|
|
}
|
|
|
|
class _AmanIconButtonHorizontalState extends State<AmanIconButtonHorizontal> {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return GestureDetector(
|
|
child: InkWell(
|
|
onTap: widget.onPressed,
|
|
child: Row( mainAxisAlignment: MainAxisAlignment.end, children: <Widget>[ Icon(widget.icon , color: widget.selected ? widget.activeColor : widget.inactiveColor ), Text(widget.title, style: TextStyle( color: widget.selected ? widget.activeColor : widget.inactiveColor, fontWeight: FontWeight.w800 ) )],),
|
|
),
|
|
);
|
|
}
|
|
}
|