mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
fix(mobile): address timeline review feedback
Signed-off-by: kenny lopez <klopez4212@gmail.com>
This commit is contained in:
@@ -516,6 +516,7 @@ class _MessageList extends HookConsumerWidget {
|
||||
entries.length,
|
||||
itemPositionsListener,
|
||||
appBarTitleContentHeight,
|
||||
composerBottomInset,
|
||||
],
|
||||
);
|
||||
|
||||
|
||||
@@ -6,12 +6,13 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:lucide_icons_flutter/lucide_icons.dart';
|
||||
|
||||
import '../../shared/theme/theme.dart';
|
||||
|
||||
/// Compact conversation control that returns a detached timeline to its tail.
|
||||
class JumpToLatestButton extends HookWidget {
|
||||
class JumpToLatestButton extends HookConsumerWidget {
|
||||
final VoidCallback onPressed;
|
||||
|
||||
const JumpToLatestButton({required this.onPressed, super.key});
|
||||
@@ -19,7 +20,7 @@ class JumpToLatestButton extends HookWidget {
|
||||
static const _iosViewType = 'buzz/jump_to_latest_glass';
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final nativeChannel = useState<MethodChannel?>(null);
|
||||
final onPressedRef = useRef(onPressed)..value = onPressed;
|
||||
final brightness = context.theme.brightness.name;
|
||||
|
||||
@@ -7,6 +7,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
|
||||
import '../../shared/theme/theme.dart';
|
||||
|
||||
@@ -154,7 +155,7 @@ class StickyDateHeader extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
class _IosStickyDateGlass extends HookWidget {
|
||||
class _IosStickyDateGlass extends HookConsumerWidget {
|
||||
final String label;
|
||||
final double width;
|
||||
final double height;
|
||||
@@ -166,7 +167,7 @@ class _IosStickyDateGlass extends HookWidget {
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final nativeChannel = useState<MethodChannel?>(null);
|
||||
final brightness = context.theme.brightness.name;
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('keeps the native iOS glass in sync with the app theme', (
|
||||
@@ -20,9 +21,11 @@ void main() {
|
||||
});
|
||||
try {
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
theme: AppTheme.light(),
|
||||
home: Scaffold(body: JumpToLatestButton(onPressed: () {})),
|
||||
ProviderScope(
|
||||
child: MaterialApp(
|
||||
theme: AppTheme.light(),
|
||||
home: Scaffold(body: JumpToLatestButton(onPressed: () {})),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -47,9 +50,11 @@ void main() {
|
||||
|
||||
methodCalls.clear();
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
theme: AppTheme.dark(),
|
||||
home: Scaffold(body: JumpToLatestButton(onPressed: () {})),
|
||||
ProviderScope(
|
||||
child: MaterialApp(
|
||||
theme: AppTheme.dark(),
|
||||
home: Scaffold(body: JumpToLatestButton(onPressed: () {})),
|
||||
),
|
||||
),
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
@@ -4,6 +4,7 @@ import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('updates the native iOS glass date and app theme', (
|
||||
@@ -23,9 +24,11 @@ void main() {
|
||||
});
|
||||
try {
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
theme: AppTheme.light(),
|
||||
home: Scaffold(body: StickyDateHeader(state: state)),
|
||||
ProviderScope(
|
||||
child: MaterialApp(
|
||||
theme: AppTheme.light(),
|
||||
home: Scaffold(body: StickyDateHeader(state: state)),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -65,9 +68,11 @@ void main() {
|
||||
|
||||
methodCalls.clear();
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
theme: AppTheme.dark(),
|
||||
home: Scaffold(body: StickyDateHeader(state: state)),
|
||||
ProviderScope(
|
||||
child: MaterialApp(
|
||||
theme: AppTheme.dark(),
|
||||
home: Scaffold(body: StickyDateHeader(state: state)),
|
||||
),
|
||||
),
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
@@ -93,9 +98,11 @@ void main() {
|
||||
final state = ValueNotifier(const StickyDateHeaderState(label: 'Today'));
|
||||
try {
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
theme: AppTheme.light(),
|
||||
home: Scaffold(body: StickyDateHeader(state: state)),
|
||||
ProviderScope(
|
||||
child: MaterialApp(
|
||||
theme: AppTheme.light(),
|
||||
home: Scaffold(body: StickyDateHeader(state: state)),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user