153 lines
5.5 KiB
Dart
153 lines
5.5 KiB
Dart
import 'dart:io';
|
|
|
|
import 'package:agrilink_vocpro/core/constant/app_color.dart';
|
|
import 'package:agrilink_vocpro/core/constant/app_theme.dart';
|
|
import 'package:bootstrap_icons/bootstrap_icons.dart';
|
|
import 'package:flutter/cupertino.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
class SettingScreen extends StatelessWidget {
|
|
const SettingScreen({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
appBar: AppBar(
|
|
title: Text('Setting', style: AppTheme.labelMedium),
|
|
centerTitle: true,
|
|
backgroundColor: Colors.white,
|
|
scrolledUnderElevation: 0,
|
|
),
|
|
body: SafeArea(
|
|
child: ListView(
|
|
padding: EdgeInsets.all(16.r),
|
|
children: [
|
|
Row(
|
|
children: [
|
|
const CircleAvatar(
|
|
radius: 30,
|
|
backgroundColor: AppColor.secondary,
|
|
child: Icon(BootstrapIcons.person_fill, color: Colors.white),
|
|
),
|
|
SizedBox(width: 8.w),
|
|
Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text('User Name', style: AppTheme.labelMedium),
|
|
Text('useremail@gmail.com', style: AppTheme.labelSmall)
|
|
],
|
|
)
|
|
],
|
|
),
|
|
SizedBox(height: 16.h),
|
|
Container(
|
|
decoration: BoxDecoration(
|
|
borderRadius: BorderRadius.circular(8.r),
|
|
),
|
|
child: Column(
|
|
children: [
|
|
ListTile(
|
|
tileColor: Colors.white,
|
|
title: Text('Account',
|
|
style:
|
|
AppTheme.labelSmall.copyWith(color: Colors.black87)),
|
|
leading: const Icon(BootstrapIcons.person),
|
|
trailing: Icon(
|
|
Icons.arrow_forward_ios,
|
|
size: 16.r,
|
|
),
|
|
onTap: () {},
|
|
),
|
|
ListTile(
|
|
tileColor: Colors.white,
|
|
title: Text('Kebijakan & privasi',
|
|
style:
|
|
AppTheme.labelSmall.copyWith(color: Colors.black87)),
|
|
leading: const Icon(BootstrapIcons.shield_check),
|
|
trailing: Icon(
|
|
Icons.arrow_forward_ios,
|
|
size: 16.r,
|
|
),
|
|
onTap: () {},
|
|
),
|
|
ListTile(
|
|
tileColor: Colors.white,
|
|
title: Text('Syarat & ketentuan',
|
|
style:
|
|
AppTheme.labelSmall.copyWith(color: Colors.black87)),
|
|
leading: const Icon(BootstrapIcons.file_text),
|
|
trailing: Icon(
|
|
Icons.arrow_forward_ios,
|
|
size: 16.r,
|
|
),
|
|
onTap: () {},
|
|
),
|
|
ListTile(
|
|
tileColor: Colors.white,
|
|
title: Text('Logout',
|
|
style: AppTheme.labelSmall.copyWith(color: Colors.red)),
|
|
leading: const Icon(
|
|
BootstrapIcons.box_arrow_right,
|
|
color: Colors.red,
|
|
),
|
|
trailing: Icon(
|
|
Icons.arrow_forward_ios,
|
|
size: 16.r,
|
|
),
|
|
onTap: () {
|
|
if (Platform.isAndroid) {
|
|
showDialog(
|
|
context: context,
|
|
builder: (context) => AlertDialog(
|
|
title: Text('Logout'),
|
|
content: Text('Apakah anda yakin ingin logout?'),
|
|
actions: [
|
|
TextButton(
|
|
child: Text('Batal'),
|
|
onPressed: () {
|
|
Navigator.pop(context);
|
|
},
|
|
),
|
|
TextButton(
|
|
child: Text('Ya'),
|
|
onPressed: () {
|
|
Navigator.pop(context);
|
|
},
|
|
),
|
|
],
|
|
),
|
|
);
|
|
} else {
|
|
showDialog(
|
|
context: context,
|
|
builder: (context) => CupertinoAlertDialog(
|
|
title: Text('Logout'),
|
|
content: Text('Apakah anda yakin ingin logout?'),
|
|
actions: [
|
|
TextButton(
|
|
child: Text('Batal'),
|
|
onPressed: () {
|
|
Navigator.pop(context);
|
|
},
|
|
),
|
|
TextButton(
|
|
child: Text('Ya'),
|
|
onPressed: () {
|
|
Navigator.pop(context);
|
|
},
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}),
|
|
],
|
|
),
|
|
),
|
|
],
|
|
)),
|
|
);
|
|
}
|
|
}
|