stream image

This commit is contained in:
Felipe
2024-02-16 11:37:12 -05:00
parent d9d6b50d78
commit 1b565d70f4
8 changed files with 129 additions and 211 deletions
+4 -11
View File
@@ -169,29 +169,22 @@ class _SignUpScreenState extends State<SignUpScreen> {
? Colors.green
: Theme.of(context).colorScheme.onBackground),
),
Text(
"⚈ 1 number",
style: TextStyle(
color: containsNumber
? Colors.green
: Theme.of(context).colorScheme.onBackground),
),
],
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"1 special character",
"8 minimum character",
style: TextStyle(
color: containsSpecialChar
color: contains8Length
? Colors.green
: Theme.of(context).colorScheme.onBackground),
),
Text(
"8 minimum character",
"1 number",
style: TextStyle(
color: contains8Length
color: containsNumber
? Colors.green
: Theme.of(context).colorScheme.onBackground),
),
+90 -98
View File
@@ -26,112 +26,104 @@ class _HomeScreenState extends State<HomeScreen> {
},
child: Scaffold(
backgroundColor: Theme.of(context).colorScheme.background,
drawer:
BlocBuilder<MyUserBloc, MyUserState>(builder: (context, state) {
if (state.status == MyUserStatus.success) {
return Drawer(
backgroundColor: Theme.of(context).colorScheme.background,
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Material(
color: Theme.of(context).colorScheme.primary,
child: InkWell(
onTap: () {
Navigator.push(
context,
CupertinoPageRoute(
builder: (context) => const ProfileScreen(),
),
);
},
child: Container(
padding: EdgeInsets.only(
top: 20 + MediaQuery.of(context).padding.top,
bottom: 20,
),
child: Column(
children: [
state.user!.picture == ""
? Container(
width: 80,
height: 80,
decoration: BoxDecoration(
color: Colors.grey.shade300,
shape: BoxShape.circle,
),
child: Icon(
CupertinoIcons.person,
color: Colors.grey.shade400,
size: 35,
),
)
: Container(
width: 80,
height: 80,
decoration: BoxDecoration(
color: Colors.grey,
shape: BoxShape.circle,
image: DecorationImage(
image: NetworkImage(
state.user!.picture!,
),
fit: BoxFit.cover,
),
),
),
const SizedBox(height: 12),
Text(
state.user!.name,
style: const TextStyle(
fontSize: 24,
color: Colors.white,
),
),
Text(
state.user!.email,
style: const TextStyle(
fontSize: 15,
color: Colors.white,
),
)
],
),
drawer: Drawer(
backgroundColor: Theme.of(context).colorScheme.background,
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Material(
color: Theme.of(context).colorScheme.primary,
child: InkWell(
onTap: () {
Navigator.push(
context,
CupertinoPageRoute(
builder: (context) => const ProfileScreen(),
),
);
},
child: Container(
padding: EdgeInsets.only(
top: 20 + MediaQuery.of(context).padding.top,
bottom: 20,
),
),
Container(
height: MediaQuery.of(context).size.height,
color: Theme.of(context).colorScheme.background,
child: ListView(
child: Column(
children: [
ListTile(
onTap: () {
context
.read<SignInBloc>()
.add(const SignOutRequired());
},
title: const Text(
'Cerrar Sesión',
context.read<MyUserBloc>().state.user!.picture == ""
? Container(
width: 80,
height: 80,
decoration: BoxDecoration(
color: Colors.grey.shade300,
shape: BoxShape.circle,
),
child: Icon(
CupertinoIcons.person,
color: Colors.grey.shade400,
size: 35,
),
)
: Container(
width: 80,
height: 80,
decoration: BoxDecoration(
color: Colors.grey,
shape: BoxShape.circle,
image: DecorationImage(
image: NetworkImage(
context
.read<MyUserBloc>()
.state
.user!
.picture!,
),
fit: BoxFit.cover,
),
),
),
const SizedBox(height: 12),
Text(
context.read<MyUserBloc>().state.user!.name,
style: const TextStyle(
fontSize: 24,
color: Colors.white,
),
),
Text(
context.read<MyUserBloc>().state.user!.email,
style: const TextStyle(
fontSize: 15,
color: Colors.white,
),
)
],
),
)
],
),
),
),
),
);
} else {
return Drawer(
backgroundColor: Theme.of(context).colorScheme.background,
child: const Center(
child: CircularProgressIndicator(),
),
);
}
}),
Container(
height: MediaQuery.of(context).size.height,
color: Theme.of(context).colorScheme.background,
child: ListView(
children: [
ListTile(
onTap: () {
context
.read<SignInBloc>()
.add(const SignOutRequired());
},
title: const Text(
'Cerrar Sesión',
),
)
],
),
)
],
),
),
),
appBar: AppBar(),
body: Center(
child: Text(