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

65 lines
1.7 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}',
2020-08-31 21:04:17 +02:00
style: TextStyle(color: Colors.white),
),
Icon(
Icons.expand_more,
color: theme.primaryIconTheme.color,
),
],
),
onPressed: () {}, // TODO: should open bottomsheet
),
actions: [
IconButton(
2020-08-31 21:04:17 +02:00
icon: Container(
decoration: BoxDecoration(boxShadow: [
BoxShadow(
blurRadius: 10,
color: Colors.black54,
)
]),
child: Icon(
Icons.settings,
color: user.banner == null ? theme.iconTheme.color : null,
),
),
2020-08-31 16:17:39 +02:00
onPressed: () {
Navigator.of(context)
2020-09-03 14:33:17 +02:00
.push(MaterialPageRoute(builder: (_) => SettingsPage()));
2020-08-31 21:04:17 +02:00
},
)
],
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
);
}
}