forked from yaso_meth/mih-project
add tool titles and and examples
This commit is contained in:
@@ -117,12 +117,21 @@ class _PackageTestState extends State<PackageTest> {
|
||||
return toolBodies;
|
||||
}
|
||||
|
||||
List<String> getToolTitle() {
|
||||
List<String> toolTitles = [
|
||||
"Tool One",
|
||||
"Tool Two",
|
||||
];
|
||||
return toolTitles;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihPackage(
|
||||
appActionButton: getAction(),
|
||||
appTools: getTools(),
|
||||
appBody: getToolBody(),
|
||||
appToolTitles: getToolTitle(),
|
||||
selectedbodyIndex: _selcetedIndex,
|
||||
onIndexChange: (newValue) {
|
||||
setState(() {
|
||||
|
||||
@@ -9,6 +9,7 @@ class MihPackage extends StatefulWidget {
|
||||
final Widget appActionButton;
|
||||
final MihPackageTools appTools;
|
||||
final List<Widget> appBody;
|
||||
final List<String>? appToolTitles;
|
||||
final MIHAppDrawer? actionDrawer;
|
||||
int selectedbodyIndex;
|
||||
final Function(int) onIndexChange;
|
||||
@@ -17,6 +18,7 @@ class MihPackage extends StatefulWidget {
|
||||
required this.appActionButton,
|
||||
required this.appTools,
|
||||
required this.appBody,
|
||||
this.appToolTitles,
|
||||
this.actionDrawer,
|
||||
required this.selectedbodyIndex,
|
||||
required this.onIndexChange,
|
||||
@@ -112,10 +114,28 @@ class _MihPackageState extends State<MihPackage>
|
||||
children: [
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
widget.appActionButton,
|
||||
Flexible(child: widget.appTools),
|
||||
Expanded(
|
||||
child: Container(
|
||||
alignment: Alignment.centerRight,
|
||||
// color: Colors.black,
|
||||
child: Text(
|
||||
widget.appToolTitles != null
|
||||
? widget.appToolTitles![widget.selectedbodyIndex]
|
||||
: "",
|
||||
style: const TextStyle(
|
||||
fontSize: 23,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
widget.appTools,
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
|
||||
Reference in New Issue
Block a user