comp
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:prosappco/blocs/my_user_bloc/my_user_bloc.dart';
|
||||
|
||||
class ProfilePhoneScreen extends StatefulWidget {
|
||||
const ProfilePhoneScreen({super.key});
|
||||
|
||||
@override
|
||||
State<ProfilePhoneScreen> createState() => _ProfilePhoneScreenState();
|
||||
}
|
||||
|
||||
class _ProfilePhoneScreenState extends State<ProfilePhoneScreen> {
|
||||
final TextEditingController _phoneController = TextEditingController();
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_phoneController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocBuilder<MyUserBloc, MyUserState>(
|
||||
builder: (context, state) {
|
||||
if (state.status == MyUserStatus.success) {
|
||||
_phoneController.text = state.user!.phone ?? '';
|
||||
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(
|
||||
_phoneController.text.isEmpty
|
||||
? 'Agregar telefono'
|
||||
: 'Actualizar telefono',
|
||||
),
|
||||
),
|
||||
body: const Placeholder(),
|
||||
);
|
||||
} else {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user