update calculator to use MihSignlewScroll
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import 'package:Mzansi_Innovation_Hub/main.dart';
|
||||
import 'package:Mzansi_Innovation_Hub/mih_components/mih_inputs_and_buttons/mih_button.dart';
|
||||
import 'package:Mzansi_Innovation_Hub/mih_components/mih_layout/mih_single_child_scroll.dart';
|
||||
import 'package:Mzansi_Innovation_Hub/mih_components/mih_package/mih-app_tool_body.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:math_expressions/math_expressions.dart';
|
||||
@@ -73,7 +74,8 @@ class _SimpleCalcState extends State<SimpleCalc> {
|
||||
calcWidth = 300;
|
||||
}
|
||||
}
|
||||
return Column(
|
||||
return MihSingleChildScroll(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
@@ -86,7 +88,8 @@ class _SimpleCalcState extends State<SimpleCalc> {
|
||||
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
),
|
||||
),
|
||||
Divider(color: MzanziInnovationHub.of(context)!.theme.secondaryColor()),
|
||||
Divider(
|
||||
color: MzanziInnovationHub.of(context)!.theme.secondaryColor()),
|
||||
const SizedBox(height: 10),
|
||||
Container(
|
||||
//color: Colors.white,
|
||||
@@ -109,7 +112,8 @@ class _SimpleCalcState extends State<SimpleCalc> {
|
||||
answer,
|
||||
style: TextStyle(
|
||||
fontSize: 30,
|
||||
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
),
|
||||
@@ -148,8 +152,9 @@ class _SimpleCalcState extends State<SimpleCalc> {
|
||||
buttonColor: MzanziInnovationHub.of(context)!
|
||||
.theme
|
||||
.messageTextColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
textColor: MzanziInnovationHub.of(context)!
|
||||
.theme
|
||||
.primaryColor(),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -168,8 +173,9 @@ class _SimpleCalcState extends State<SimpleCalc> {
|
||||
buttonColor: MzanziInnovationHub.of(context)!
|
||||
.theme
|
||||
.messageTextColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
textColor: MzanziInnovationHub.of(context)!
|
||||
.theme
|
||||
.primaryColor(),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -187,8 +193,9 @@ class _SimpleCalcState extends State<SimpleCalc> {
|
||||
buttonColor: MzanziInnovationHub.of(context)!
|
||||
.theme
|
||||
.messageTextColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
textColor: MzanziInnovationHub.of(context)!
|
||||
.theme
|
||||
.primaryColor(),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -206,8 +213,9 @@ class _SimpleCalcState extends State<SimpleCalc> {
|
||||
buttonText: buttons[index],
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.errorColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
textColor: MzanziInnovationHub.of(context)!
|
||||
.theme
|
||||
.primaryColor(),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -222,10 +230,12 @@ class _SimpleCalcState extends State<SimpleCalc> {
|
||||
});
|
||||
},
|
||||
buttonText: buttons[index],
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
buttonColor: MzanziInnovationHub.of(context)!
|
||||
.theme
|
||||
.successColor(),
|
||||
textColor: MzanziInnovationHub.of(context)!
|
||||
.theme
|
||||
.primaryColor(),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -257,8 +267,9 @@ class _SimpleCalcState extends State<SimpleCalc> {
|
||||
buttonColor: MzanziInnovationHub.of(context)!
|
||||
.theme
|
||||
.messageTextColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
textColor: MzanziInnovationHub.of(context)!
|
||||
.theme
|
||||
.primaryColor(),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -276,8 +287,9 @@ class _SimpleCalcState extends State<SimpleCalc> {
|
||||
buttonColor: MzanziInnovationHub.of(context)!
|
||||
.theme
|
||||
.secondaryColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
textColor: MzanziInnovationHub.of(context)!
|
||||
.theme
|
||||
.primaryColor(),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -286,6 +298,7 @@ class _SimpleCalcState extends State<SimpleCalc> {
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'package:Mzansi_Innovation_Hub/main.dart';
|
||||
import 'package:Mzansi_Innovation_Hub/mih_components/mih_inputs_and_buttons/mih_button.dart';
|
||||
import 'package:Mzansi_Innovation_Hub/mih_components/mih_inputs_and_buttons/mih_dropdown_input.dart';
|
||||
import 'package:Mzansi_Innovation_Hub/mih_components/mih_inputs_and_buttons/mih_number_input.dart';
|
||||
import 'package:Mzansi_Innovation_Hub/mih_components/mih_layout/mih_single_child_scroll.dart';
|
||||
import 'package:Mzansi_Innovation_Hub/mih_components/mih_layout/mih_window.dart';
|
||||
import 'package:Mzansi_Innovation_Hub/mih_components/mih_package/mih-app_tool_body.dart';
|
||||
import 'package:Mzansi_Innovation_Hub/mih_components/mih_pop_up_messages/mih_error_message.dart';
|
||||
@@ -268,7 +269,8 @@ class _TipCalcState extends State<TipCalc> {
|
||||
}
|
||||
|
||||
Widget getBody() {
|
||||
return Column(
|
||||
return MihSingleChildScroll(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
@@ -280,7 +282,8 @@ class _TipCalcState extends State<TipCalc> {
|
||||
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
),
|
||||
),
|
||||
Divider(color: MzanziInnovationHub.of(context)!.theme.secondaryColor()),
|
||||
Divider(
|
||||
color: MzanziInnovationHub.of(context)!.theme.secondaryColor()),
|
||||
const SizedBox(height: 10),
|
||||
MIHNumberField(
|
||||
controller: billAmountController,
|
||||
@@ -335,7 +338,8 @@ class _TipCalcState extends State<TipCalc> {
|
||||
validateInput();
|
||||
},
|
||||
buttonText: "Calculate",
|
||||
buttonColor: MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
||||
textColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
),
|
||||
),
|
||||
@@ -353,6 +357,7 @@ class _TipCalcState extends State<TipCalc> {
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user