mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-05-02 14:26:12 -04:00
refactor
This commit is contained in:
parent
1e6b9f4a43
commit
4a8958a868
7 changed files with 104 additions and 138 deletions
|
@ -10,7 +10,6 @@ import '../../../layout/default_app_bar.dart';
|
|||
import '../../../tools/tools.dart';
|
||||
import '../../../veilid_processor/veilid_processor.dart';
|
||||
import '../../account_manager.dart';
|
||||
import '../../models/models.dart';
|
||||
|
||||
class NewAccountPage extends StatefulWidget {
|
||||
const NewAccountPage({super.key});
|
||||
|
|
|
@ -1,25 +1,24 @@
|
|||
import 'package:awesome_extensions/awesome_extensions.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
|
||||
import '../../proto/proto.dart' as proto;
|
||||
import '../../theme/theme.dart';
|
||||
import '../../tools/tools.dart';
|
||||
import '../cubit/cubit.dart';
|
||||
|
||||
class ProfileWidget extends StatelessWidget {
|
||||
const ProfileWidget({
|
||||
required proto.Profile profile,
|
||||
super.key,
|
||||
});
|
||||
}) : _profile = profile;
|
||||
|
||||
//
|
||||
|
||||
final proto.Profile _profile;
|
||||
|
||||
//
|
||||
|
||||
@override
|
||||
// ignore: prefer_expression_function_bodies
|
||||
Widget build(BuildContext context) {
|
||||
final accountData = context.watch<AccountRecordCubit>().state.data;
|
||||
if (accountData == null) {
|
||||
return waitingPage(context);
|
||||
}
|
||||
final account = accountData.value;
|
||||
|
||||
final theme = Theme.of(context);
|
||||
final scale = theme.extension<ScaleScheme>()!;
|
||||
final textTheme = theme.textTheme;
|
||||
|
@ -31,12 +30,12 @@ class ProfileWidget extends StatelessWidget {
|
|||
RoundedRectangleBorder(borderRadius: BorderRadius.circular(16))),
|
||||
child: Column(children: [
|
||||
Text(
|
||||
account.profile.name,
|
||||
_profile.name,
|
||||
style: textTheme.headlineSmall,
|
||||
textAlign: TextAlign.left,
|
||||
).paddingAll(4),
|
||||
if (account.profile.pronouns.isNotEmpty)
|
||||
Text(account.profile.pronouns, style: textTheme.bodyMedium)
|
||||
if (_profile.pronouns.isNotEmpty)
|
||||
Text(_profile.pronouns, style: textTheme.bodyMedium)
|
||||
.paddingLTRB(4, 0, 4, 4),
|
||||
]),
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue