Logging data
Try-catch function
This commit is contained in:
anhtunz
2025-06-17 16:43:45 +07:00
parent 22fef0e0a8
commit 2d53f2cdd3
41 changed files with 1591 additions and 1299 deletions

View File

@@ -1,10 +1,8 @@
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import '../../product/constant/app/app_constants.dart';
import '../../product/shared/shared_loading_animation.dart';
import '../../product/shared/shared_snack_bar.dart';
import 'profile/profile_screen.dart';
import '../../product/constant/icon/icon_constants.dart';
import '../../product/extension/context_extension.dart';
@@ -29,7 +27,6 @@ class _SettingsScreenState extends State<SettingsScreen> {
void initState() {
super.initState();
settingsBloc = BlocProvider.of(context);
// getUserProfile();
}
@override
@@ -41,7 +38,6 @@ class _SettingsScreenState extends State<SettingsScreen> {
),
body: StreamBuilder<User>(
stream: settingsBloc.streamUserProfile,
// initialData: user,
builder: (context, userSnapshot) {
if (userSnapshot.data == null) {
settingsBloc.getUserProfile(context);
@@ -139,17 +135,6 @@ class _SettingsScreenState extends State<SettingsScreen> {
);
}
// void getUserProfile() async {
// try {
// user = await apiServices.getUserDetail();
// settingsBloc.sinkUserProfile.add(user);
// } catch (e) {
// if (!mounted) return;
// showErrorTopSnackBarCustom(
// context, e.toString());
// }
// }
String getAvatarContent(String username) {
String name = "";
if (username.isNotEmpty) {