Commit 73074efa authored by DatHV's avatar DatHV
Browse files

update authen

parent e8a305af
...@@ -26,7 +26,7 @@ class _OtpScreenState extends BaseState<OtpScreen> with BasicState { ...@@ -26,7 +26,7 @@ class _OtpScreenState extends BaseState<OtpScreen> with BasicState {
ever(otpVM.errorMessage, (value) { ever(otpVM.errorMessage, (value) {
if (value != null && value.toString().isNotEmpty) { if (value != null && value.toString().isNotEmpty) {
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
showAlertError(value); showAlertError(content: value);
}); });
} }
}); });
......
...@@ -34,7 +34,7 @@ class _CampaignDetailScreenState extends BaseState<CampaignDetailScreen> with Ba ...@@ -34,7 +34,7 @@ class _CampaignDetailScreenState extends BaseState<CampaignDetailScreen> with Ba
ever(_viewModel.errorMessage, (value) { ever(_viewModel.errorMessage, (value) {
if (value != null && value.toString().isNotEmpty) { if (value != null && value.toString().isNotEmpty) {
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
showAlertError(value); showAlertError(content: value);
}); });
} }
}); });
......
// setting_screen.dart
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:get/get_core/src/get_main.dart';
import '../../widgets/custom_app_bar.dart';
import '../change_pass/change_pass_screen.dart';
class SettingScreen extends StatelessWidget {
const SettingScreen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: CustomAppBar.back(title: "Cài đặt"),
backgroundColor: const Color(0xFFF5F6F7),
body: Column(
children: [
Container(
width: double.infinity,
margin: const EdgeInsets.symmetric(horizontal: 0, vertical: 16),
decoration: BoxDecoration(
color: Colors.white,
// borderRadius: BorderRadius.circular(12),
// boxShadow: [
// BoxShadow(
// color: Colors.black12,
// blurRadius: 8,
// offset: const Offset(0, 4),
// ),
// ],
),
child: Column(
children: [
_buildSettingItem(
icon: Icons.apps,
title: 'Các lĩnh vực quan tâm',
onTap: () {},
),
_buildDivider(),
_buildSettingItem(
icon: Icons.lock_outline,
title: 'Đổi mật khẩu',
onTap: () => Get.to(ChangePassScreen()),
),
_buildDivider(),
_buildSettingItem(
icon: Icons.fingerprint,
title: 'Xác thực sinh trắc học',
showTrailing: false,
onTap: () {},
),
_buildDivider(),
_buildSettingItem(
icon: Icons.devices_other,
title: 'Quản lý thiết bị đăng nhập',
onTap: () {},
),
_buildDivider(),
_buildSettingItem(
icon: Icons.delete_outline,
title: 'Xóa tài khoản',
onTap: () {},
textColor: Colors.red,
iconColor: Colors.red,
showTrailing: false,
),
],
),
),
const Expanded(child: SizedBox()),
],
),
);
}
Widget _buildSettingItem({
required IconData icon,
required String title,
required VoidCallback onTap,
Color? textColor,
Color? iconColor,
bool showTrailing = true,
}) {
return ListTile(
leading: Icon(icon, color: iconColor ?? Colors.black54),
title: Text(
title,
style: TextStyle(
fontSize: 16,
color: textColor ?? Colors.black87,
fontWeight: FontWeight.w500,
),
),
trailing: showTrailing ? const Icon(Icons.chevron_right, color: Colors.black26) : null,
onTap: onTap,
contentPadding: const EdgeInsets.symmetric(horizontal: 16),
);
}
Widget _buildDivider() {
return const Divider(height: 1, indent: 16, endIndent: 16);
}
}
\ No newline at end of file
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_widget_from_html/flutter_widget_from_html.dart'; import 'package:flutter_widget_from_html/flutter_widget_from_html.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:mypoint_flutter_app/resouce/define_image.dart';
import 'data_alert_model.dart'; import 'data_alert_model.dart';
enum ButtonsDirection { row, column } enum ButtonsDirection { row, column }
......
import 'package:flutter/material.dart';
import 'back_button.dart';
class CustomAppBar extends StatelessWidget implements PreferredSizeWidget {
final String title;
final List<Widget> leftButtons;
final List<Widget> rightButtons;
final double height;
const CustomAppBar({
super.key,
required this.title,
this.leftButtons = const [],
this.rightButtons = const [],
this.height = 56,
});
/// 🔥 AppBar mặc định với nút back và title
static CustomAppBar back({required String title}) {
return CustomAppBar(
title: title,
leftButtons: [CustomBackButton()],
);
}
@override
Widget build(BuildContext context) {
return SafeArea(
child: Container(
height: height,
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Stack(
alignment: Alignment.center,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(children: leftButtons),
Row(children: rightButtons),
],
),
Center(
child: Text(
title,
style: const TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
color: Colors.black87,
),
),
),
],
),
),
);
}
@override
Size get preferredSize => Size.fromHeight(height);
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment