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