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(
|
2020-08-31 03:54:24 +02:00
|
|
|
extendBodyBehindAppBar: true,
|
2020-08-31 01:04:08 +02:00
|
|
|
appBar: AppBar(
|
2020-08-31 03:54:24 +02:00
|
|
|
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),
|
2020-08-31 03:54:24 +02:00
|
|
|
),
|
|
|
|
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 03:54:24 +02:00
|
|
|
),
|
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 03:54:24 +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
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|