lemmur-app-android/lib/pages/profile_tab.dart

56 lines
1.5 KiB
Dart
Raw Normal View History

2020-08-31 01:04:08 +02:00
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:lemmy_api_client/lemmy_api_client.dart';
2020-08-31 12:05:45 +02:00
import '../widgets/user_profile.dart';
2020-08-31 16:17:39 +02:00
import 'settings.dart';
2020-08-31 01:04:08 +02:00
class UserProfileTab extends HookWidget {
final User user;
2020-08-31 12:05:45 +02:00
UserProfileTab(this.user);
2020-08-31 01:04:08 +02:00
@override
Widget build(BuildContext context) {
var theme = Theme.of(context);
return Scaffold(
extendBodyBehindAppBar: true,
2020-08-31 01:04:08 +02:00
appBar: AppBar(
backgroundColor: Colors.transparent,
shadowColor: Colors.transparent,
centerTitle: true,
title: FlatButton(
child: Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'@${user.name}',
style: TextStyle(color: theme.accentTextTheme.bodyText1.color),
),
Icon(
Icons.expand_more,
color: theme.primaryIconTheme.color,
),
],
),
onPressed: () {}, // TODO: should open bottomsheet
),
actions: [
IconButton(
icon: Icon(
Icons.settings,
),
2020-08-31 16:17:39 +02:00
onPressed: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (_) => Settings()));
}, // TODO: go to settings
)
],
2020-08-31 01:04:08 +02:00
),
2020-08-31 12:05:45 +02:00
body: UserProfile(user),
2020-08-31 01:04:08 +02:00
);
}
}