WallPaper_FSX_Flutter/lib/modules/me/me_view.dart
2024-05-13 13:44:27 +08:00

67 lines
1.9 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:wallpaper/common/components/title_bar_widget.dart';
import 'package:wallpaper/modules/me/me_controller.dart';
class MeView extends GetView<MeController> {
const MeView({super.key});
@override
Widget build(BuildContext context) {
Get.lazyPut(() => MeController());
return SafeArea(
child: Column(
children: [
const TitleBarWidget(title: 'Me'),
Expanded(
child: ListView.separated(
padding: const EdgeInsets.symmetric(horizontal: 16).w,
itemCount: controller.options.length,
itemBuilder: (context, index) {
return _optionItem(index);
},
separatorBuilder: (context, index) {
return SizedBox(height: 10.h);
},
),
),
],
),
);
}
Widget _optionItem(index) {
return Material(
color: Colors.transparent,
child: InkWell(
borderRadius: BorderRadius.circular(8).r,
onTap: () => controller.itemOnTap(index),
child: Container(
height: 50.h,
padding: const EdgeInsets.symmetric(horizontal: 16).w,
decoration: BoxDecoration(
color: Colors.white10,
borderRadius: BorderRadius.circular(8).r,
),
child: Row(
children: [
Expanded(
child: Text(
controller.options[index],
style: TextStyle(
color: Colors.white,
fontSize: 16.sp,
fontWeight: FontWeight.w500,
),
),
),
const Icon(Icons.keyboard_arrow_right, color: Colors.white),
],
),
),
),
);
}
}