add title to Calculator
This commit is contained in:
@@ -25,6 +25,7 @@ class _MIHCalculatorState extends State<MIHCalculator> {
|
|||||||
appActionButton: getAction(),
|
appActionButton: getAction(),
|
||||||
appTools: getTools(),
|
appTools: getTools(),
|
||||||
appBody: getToolBody(),
|
appBody: getToolBody(),
|
||||||
|
appToolTitles: getToolTitle(),
|
||||||
selectedbodyIndex: _selectedIndex,
|
selectedbodyIndex: _selectedIndex,
|
||||||
onIndexChange: (newValue) {
|
onIndexChange: (newValue) {
|
||||||
setState(() {
|
setState(() {
|
||||||
@@ -71,4 +72,12 @@ class _MIHCalculatorState extends State<MIHCalculator> {
|
|||||||
];
|
];
|
||||||
return toolBodies;
|
return toolBodies;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<String> getToolTitle() {
|
||||||
|
List<String> toolTitles = [
|
||||||
|
"Simple Calculator",
|
||||||
|
"Tip Calculator",
|
||||||
|
];
|
||||||
|
return toolTitles;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ class _SimpleCalcState extends State<SimpleCalc> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MihPackageToolBody(
|
return MihPackageToolBody(
|
||||||
borderOn: true,
|
borderOn: false,
|
||||||
bodyItem: getBody(),
|
bodyItem: getBody(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -96,18 +96,6 @@ class _SimpleCalcState extends State<SimpleCalc> {
|
|||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Text(
|
|
||||||
"Simple Calculator",
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 25,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Divider(
|
|
||||||
color: MzanziInnovationHub.of(context)!.theme.secondaryColor()),
|
|
||||||
const SizedBox(height: 10),
|
|
||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.all(20),
|
padding: const EdgeInsets.all(20),
|
||||||
alignment: Alignment.centerRight,
|
alignment: Alignment.centerRight,
|
||||||
|
|||||||
@@ -263,7 +263,7 @@ class _TipCalcState extends State<TipCalc> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MihPackageToolBody(
|
return MihPackageToolBody(
|
||||||
borderOn: true,
|
borderOn: false,
|
||||||
bodyItem: getBody(),
|
bodyItem: getBody(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -273,18 +273,6 @@ class _TipCalcState extends State<TipCalc> {
|
|||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Text(
|
|
||||||
"Tip Calculator",
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 25,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Divider(
|
|
||||||
color: MzanziInnovationHub.of(context)!.theme.secondaryColor()),
|
|
||||||
const SizedBox(height: 10),
|
|
||||||
MIHNumberField(
|
MIHNumberField(
|
||||||
controller: billAmountController,
|
controller: billAmountController,
|
||||||
hintText: "Bill Amount",
|
hintText: "Bill Amount",
|
||||||
|
|||||||
Reference in New Issue
Block a user