46 lines
1.1 KiB
Dart
46 lines
1.1 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'package:pweb/pages/settings/profile/account/name/editing.dart';
|
|
import 'package:pweb/pages/settings/profile/account/name/text_view.dart';
|
|
import 'package:pweb/providers/account_name.dart';
|
|
|
|
|
|
class AccountNameText extends StatelessWidget {
|
|
const AccountNameText({
|
|
super.key,
|
|
required this.hintText,
|
|
required this.lastNameHint,
|
|
required this.inputWidth,
|
|
required this.borderWidth,
|
|
});
|
|
|
|
final String hintText;
|
|
final String lastNameHint;
|
|
final double inputWidth;
|
|
final double borderWidth;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final state = context.watch<AccountNameState>();
|
|
|
|
if (state.isEditing) {
|
|
return AccountNameEditingFields(
|
|
hintText: hintText,
|
|
lastNameHint: lastNameHint,
|
|
borderWidth: borderWidth,
|
|
inputWidth: inputWidth,
|
|
state: state,
|
|
);
|
|
}
|
|
|
|
return AccountNameViewText(
|
|
hintText: hintText,
|
|
inputWidth: inputWidth,
|
|
firstName: state.currentFirstName,
|
|
lastName: state.currentLastName,
|
|
);
|
|
}
|
|
}
|