137 lines
3.9 KiB
Dart
137 lines
3.9 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:novyronst/common/help/help_image.dart';
|
|
import 'package:novyronst/pages/my/widgets/ny_dash_line.dart';
|
|
import 'package:novyronst/root/lib_export.dart';
|
|
import 'package:novyronst/tools/widgets/app_bg_page.dart';
|
|
import 'package:novyronst/tools/widgets/extend_widget.dart';
|
|
import 'package:novyronst/tools/widgets/novy_com_widget.dart';
|
|
|
|
class MyPage extends StatefulWidget {
|
|
const MyPage({super.key});
|
|
|
|
@override
|
|
State<StatefulWidget> createState() {
|
|
return _RootPageState();
|
|
}
|
|
}
|
|
|
|
class _RootPageState extends State<MyPage> {
|
|
|
|
List<String> _titles = [
|
|
'History', 'Settings', 'About', 'Privacy Policy', 'User Agreement'
|
|
];
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return AppBgPage(
|
|
typeBg: 2,
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(16),
|
|
child: Column(
|
|
children: [
|
|
SizedBox(height: AppScreen.statusBarHeight + 48),
|
|
_buildUserInfo(),
|
|
const SizedBox(height: 26),
|
|
...List.generate(_titles.length, (index) {
|
|
return _buildSectionView(_titles[index], index, onTap: () {
|
|
if (index == 0) {
|
|
|
|
} else if (index == 1) {
|
|
|
|
} else if (index == 2) {
|
|
|
|
} else if (index == 3) {
|
|
|
|
} else if (index == 4) {
|
|
|
|
}
|
|
});
|
|
})
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|
|
Widget _buildSectionView(String title, int index, {Function()? onTap}) {
|
|
String imgName = ConstImage.history;
|
|
if (index == 1) {
|
|
imgName = ConstImage.settings;
|
|
} else if (index == 2) {
|
|
imgName = ConstImage.about;
|
|
} else if (index == 3) {
|
|
imgName = ConstImage.primary;
|
|
} else if (index == 4) {
|
|
imgName = ConstImage.webSite;
|
|
}
|
|
return Container(
|
|
height: 60,
|
|
padding: const EdgeInsets.symmetric(horizontal: 10),
|
|
child: Column(
|
|
children: [
|
|
Expanded(child: Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: [
|
|
Row(
|
|
children: [
|
|
HelpImage.asset(imgName, width: 36, height: 36),
|
|
const SizedBox(width: 10),
|
|
NovyText(title,
|
|
fontSize: 14,
|
|
)
|
|
],
|
|
),
|
|
Icon(Icons.arrow_forward_ios, size: 17, color: Colors.white)
|
|
],
|
|
)),
|
|
if (index < 4) NyDashLine()
|
|
],
|
|
),
|
|
).addInkWell(onTap: onTap);
|
|
}
|
|
|
|
Widget _buildUserInfo() {
|
|
return Row(
|
|
children: [
|
|
Container(
|
|
clipBehavior: Clip.antiAlias,
|
|
width: 60, height: 60,
|
|
decoration: BoxDecoration(
|
|
borderRadius: BorderRadius.circular(30),
|
|
border: Border.all(color: Colors.white.withAlpha(127), width: 1)
|
|
),
|
|
child: ClipOval(
|
|
child: HelpImage.asset(ConstImage.homeTopLogo, width: 60, height: 60, fit: BoxFit.fill),
|
|
)
|
|
),
|
|
const SizedBox(width: 16),
|
|
Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
NovyText('Visitor',
|
|
fontSize: 18,
|
|
),
|
|
const SizedBox(height: 6),
|
|
Container(
|
|
height: 18,
|
|
padding: const EdgeInsets.symmetric(horizontal: 9),
|
|
decoration: BoxDecoration(
|
|
color: Colors.white.withAlpha(60),
|
|
borderRadius: BorderRadius.circular(9),
|
|
),
|
|
child: Row(
|
|
children: [
|
|
NovyText('ID: 3242545454',
|
|
fontSize: 11,
|
|
),
|
|
const SizedBox(width: 6),
|
|
HelpImage.asset(ConstImage.copy, width: 12, height: 12)
|
|
],
|
|
),
|
|
)
|
|
],
|
|
)
|
|
],
|
|
);
|
|
}
|
|
} |