mirror of
https://github.com/nostrlabs-io/zap-stream-flutter.git
synced 2025-06-20 13:16:34 +00:00
feat: category / hashtag pages
- with links form stream info closes #12
This commit is contained in:
45
lib/pages/hashtag.dart
Normal file
45
lib/pages/hashtag.dart
Normal file
@ -0,0 +1,45 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:ndk/ndk.dart';
|
||||
import 'package:zap_stream_flutter/rx_filter.dart';
|
||||
import 'package:zap_stream_flutter/widgets/category_top_zapped.dart';
|
||||
import 'package:zap_stream_flutter/widgets/header.dart';
|
||||
import 'package:zap_stream_flutter/widgets/stream_grid.dart';
|
||||
|
||||
class HashtagPage extends StatelessWidget {
|
||||
final String tag;
|
||||
|
||||
const HashtagPage({super.key, required this.tag});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SingleChildScrollView(
|
||||
child: Container(
|
||||
margin: EdgeInsets.all(5.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
HeaderWidget(),
|
||||
Text(
|
||||
"#$tag",
|
||||
style: TextStyle(fontSize: 30, fontWeight: FontWeight.bold),
|
||||
),
|
||||
CategoryTopZapped(tag: tag),
|
||||
RxFilter<Nip01Event>(
|
||||
Key("tags-page:$tag"),
|
||||
filters: [
|
||||
Filter(kinds: [30_311], limit: 50, tTags: [tag.toLowerCase()]),
|
||||
],
|
||||
builder: (ctx, state) {
|
||||
if (state == null) {
|
||||
return SizedBox.shrink();
|
||||
} else {
|
||||
return StreamGrid(events: state);
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user