mirror of
https://github.com/block/buzz.git
synced 2026-11-04 16:31:38 +00:00
## Summary Adds Buzzies and refreshes the agent avatar picker with larger previews, rounded option strips, and clearer category choices. Also moves Agents above Appearance in the home menu and adds a custom agent icon. ### Related issue None found. ### Testing Analysis, 4,138 app tests, package tests, and 121 configured-auth tests pass. Earlier visual build exercised on Pixel and iOS simulator, with iPhone review; snapshots below show that build. | Android · Pixel | iOS · simulator preview | | --- | --- | |  |  | --------- Signed-off-by: kenny lopez <klopez4212@gmail.com> Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz>
55 lines
1.5 KiB
Dart
55 lines
1.5 KiB
Dart
import 'package:flutter/foundation.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
import '../theme/theme.dart';
|
|
import 'concentric_sheet_surface.dart';
|
|
|
|
/// Native iOS glass with an opaque Material capsule on other platforms.
|
|
class NavigationButtonSurface extends StatelessWidget {
|
|
const NavigationButtonSurface({
|
|
required this.child,
|
|
this.capsule = false,
|
|
super.key,
|
|
});
|
|
|
|
final Widget child;
|
|
|
|
/// Uses fully rounded ends instead of device-concentric corners.
|
|
final bool capsule;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
if (NavigationGlassGroup.maybeOf(context)) return child;
|
|
if (defaultTargetPlatform != TargetPlatform.iOS) {
|
|
return Material(
|
|
color: context.controlSurface,
|
|
shape: const StadiumBorder(),
|
|
clipBehavior: Clip.antiAlias,
|
|
child: child,
|
|
);
|
|
}
|
|
return ConcentricSheetSurface(
|
|
enabled: true,
|
|
usesGlass: true,
|
|
capsule: capsule,
|
|
providesSheetSurface: false,
|
|
padding: EdgeInsets.zero,
|
|
minimumRadius: Radii.navigationCapsule,
|
|
contentClipRadius: capsule ? 9999 : Radii.navigationCapsule,
|
|
child: child,
|
|
);
|
|
}
|
|
}
|
|
|
|
/// Uses the shared native navigation glass instead of a separate surface.
|
|
class NavigationGlassGroup extends InheritedWidget {
|
|
const NavigationGlassGroup({super.key, required super.child});
|
|
|
|
static bool maybeOf(BuildContext context) =>
|
|
context.dependOnInheritedWidgetOfExactType<NavigationGlassGroup>() !=
|
|
null;
|
|
|
|
@override
|
|
bool updateShouldNotify(NavigationGlassGroup oldWidget) => false;
|
|
}
|