39 lines
1012 B
Dart
39 lines
1012 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:matule/presentation/pages/profile.dart';
|
|
import 'package:matule_uikit/matule_uikit.dart';
|
|
|
|
class TabbarPage extends StatefulWidget {
|
|
final int? defaultIndex;
|
|
|
|
const TabbarPage({super.key, this.defaultIndex});
|
|
|
|
@override
|
|
State<TabbarPage> createState() => _TabbarPageState();
|
|
}
|
|
|
|
class _TabbarPageState extends State<TabbarPage> {
|
|
int? currentIndex;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
var theme = CustomTheme.of(context);
|
|
setState(() {
|
|
currentIndex ??= widget.defaultIndex ?? 0;
|
|
});
|
|
return Scaffold(
|
|
backgroundColor: theme.palette.whiteOld,
|
|
resizeToAvoidBottomInset: false,
|
|
bottomNavigationBar: TabbarWidget(
|
|
onTap: (int index) {
|
|
setState(() {
|
|
currentIndex = index;
|
|
debugPrint(currentIndex.toString());
|
|
});
|
|
},
|
|
currentIndex: currentIndex!,
|
|
),
|
|
body: [null, null, null, ProfilePage()][currentIndex!],
|
|
);
|
|
}
|
|
}
|