diff --git a/api/Passport/Deal Abuse Report.bru b/api/Passport/Deal Abuse Report.bru new file mode 100644 index 0000000..adeea85 --- /dev/null +++ b/api/Passport/Deal Abuse Report.bru @@ -0,0 +1,18 @@ +meta { + name: Deal Abuse Report + type: http + seq: 3 +} + +put { + url: {{endpoint}}/cgi/id/reports/abuse/3/status + body: json + auth: inherit +} + +body:json { + { + "status": "processed", + "message": "相关附件已经进行评级处理,未来会将该项权限下放到帖主以及社区成员。" + } +} diff --git a/lib/screens/account/profile_page.dart b/lib/screens/account/profile_page.dart index cef4db3..bc000ba 100644 --- a/lib/screens/account/profile_page.dart +++ b/lib/screens/account/profile_page.dart @@ -65,14 +65,18 @@ class _UserScreenState extends State } } - Future> _getCheckInRecords() async { + List? _records; + + Future _getCheckInRecords() async { try { final sn = context.read(); final resp = await sn.client.get('/cgi/id/users/${widget.name}/check-in?take=14'); - return List.from( - resp.data['data']?.map((x) => SnCheckInRecord.fromJson(x)) ?? [], - ); + setState(() { + _records = List.from( + resp.data['data']?.map((x) => SnCheckInRecord.fromJson(x)) ?? [], + ); + }); } catch (err) { if (mounted) context.showErrorDialog(err); rethrow; @@ -213,6 +217,7 @@ class _UserScreenState extends State _fetchStatus(); _fetchPublishers(); + _getCheckInRecords(); try { final rel = context.read(); @@ -542,12 +547,10 @@ class _UserScreenState extends State SliverToBoxAdapter(child: const Divider()), const SliverGap(12), SliverToBoxAdapter( - child: FutureBuilder>( - key: GlobalKey(), - future: _getCheckInRecords(), - builder: (context, snapshot) { - if (!snapshot.hasData) return const SizedBox.shrink(); - if (snapshot.data!.length <= 1) { + child: Builder( + builder: (context) { + if (_records == null) return const SizedBox.shrink(); + if (_records!.length <= 1) { return Text( 'accountCheckInNoRecords', textAlign: TextAlign.center, @@ -557,11 +560,10 @@ class _UserScreenState extends State .center() .padding(horizontal: 20, vertical: 8); } - final records = snapshot.data!; return SizedBox( width: double.infinity, height: 240, - child: CheckInRecordChart(records: records), + child: CheckInRecordChart(records: _records!), ).padding( right: 24, left: 16, diff --git a/lib/theme.dart b/lib/theme.dart index 87bbde6..eb2a98f 100644 --- a/lib/theme.dart +++ b/lib/theme.dart @@ -45,7 +45,7 @@ Future createAppTheme( useMaterial3: useM3, colorScheme: colorScheme, brightness: brightness, - textTheme: GoogleFonts.rubikTextTheme(), + // textTheme: GoogleFonts.rubikTextTheme(), iconTheme: IconThemeData( fill: 0, weight: 400,