|
|
@ -18,59 +18,59 @@ class _PowerLoggerViewState extends State<PowerLoggerView> {
|
|
|
|
void Function(void Function())? _setState;
|
|
|
|
void Function(void Function())? _setState;
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Theme(
|
|
|
|
return Scaffold(
|
|
|
|
data: ThemeData.light(),
|
|
|
|
appBar: AppBar(
|
|
|
|
child: Scaffold(
|
|
|
|
title: Text('Logger View'),
|
|
|
|
appBar: AppBar(
|
|
|
|
actions: [
|
|
|
|
title: Text('Logger View'),
|
|
|
|
IconButton(
|
|
|
|
actions: [
|
|
|
|
icon: Icon(Icons.clear_all_rounded),
|
|
|
|
IconButton(
|
|
|
|
onPressed: () {
|
|
|
|
icon: Icon(Icons.clear_all_rounded),
|
|
|
|
LoggerData.clear();
|
|
|
|
onPressed: () {
|
|
|
|
setState(() {});
|
|
|
|
LoggerData.clear();
|
|
|
|
},
|
|
|
|
setState(() {});
|
|
|
|
),
|
|
|
|
},
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
body: PageView(
|
|
|
|
),
|
|
|
|
controller: _pageController,
|
|
|
|
body: PageView(
|
|
|
|
onPageChanged: (index) {
|
|
|
|
controller: _pageController,
|
|
|
|
_currentIndex = index;
|
|
|
|
onPageChanged: (index) {
|
|
|
|
if (_setState != null) _setState!(() {});
|
|
|
|
_currentIndex = index;
|
|
|
|
},
|
|
|
|
if (_setState != null) _setState!(() {});
|
|
|
|
children: [
|
|
|
|
},
|
|
|
|
LoggerView(),
|
|
|
|
children: [
|
|
|
|
InfoView(),
|
|
|
|
LoggerView(),
|
|
|
|
SettingsView(),
|
|
|
|
InfoView(),
|
|
|
|
],
|
|
|
|
SettingsView(),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
bottomNavigationBar: StatefulBuilder(
|
|
|
|
),
|
|
|
|
builder: (context, kSetState) {
|
|
|
|
bottomNavigationBar: StatefulBuilder(
|
|
|
|
_setState = kSetState;
|
|
|
|
builder: (context, kSetState) {
|
|
|
|
return BottomNavigationBar(
|
|
|
|
_setState = kSetState;
|
|
|
|
currentIndex: _currentIndex,
|
|
|
|
return BottomNavigationBar(
|
|
|
|
onTap: (index) {
|
|
|
|
currentIndex: _currentIndex,
|
|
|
|
_currentIndex = index;
|
|
|
|
backgroundColor: Colors.white,
|
|
|
|
kSetState(() {});
|
|
|
|
onTap: (index) {
|
|
|
|
_pageController.animateToPage(
|
|
|
|
_currentIndex = index;
|
|
|
|
index,
|
|
|
|
kSetState(() {});
|
|
|
|
duration: Duration(milliseconds: 300),
|
|
|
|
_pageController.animateToPage(
|
|
|
|
curve: Curves.easeInOutCubic,
|
|
|
|
index,
|
|
|
|
);
|
|
|
|
duration: Duration(milliseconds: 300),
|
|
|
|
},
|
|
|
|
curve: Curves.easeInOutCubic,
|
|
|
|
items: [
|
|
|
|
);
|
|
|
|
BottomNavigationBarItem(
|
|
|
|
},
|
|
|
|
icon: Icon(Icons.assessment), label: 'Log'),
|
|
|
|
items: [
|
|
|
|
BottomNavigationBarItem(
|
|
|
|
BottomNavigationBarItem(
|
|
|
|
icon: Icon(Icons.perm_device_information),
|
|
|
|
icon: Icon(Icons.assessment), label: '日志'),
|
|
|
|
label: 'Info',
|
|
|
|
BottomNavigationBarItem(
|
|
|
|
),
|
|
|
|
icon: Icon(Icons.perm_device_information), label: '信息'),
|
|
|
|
BottomNavigationBarItem(
|
|
|
|
BottomNavigationBarItem(
|
|
|
|
icon: Icon(Icons.settings),
|
|
|
|
icon: Icon(Icons.settings), label: '设置'),
|
|
|
|
label: 'Settings',
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
],
|
|
|
|
},
|
|
|
|
);
|
|
|
|
),
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|