mirror of
https://github.com/block/buzz.git
synced 2026-10-27 04:30:52 +00:00
Originally stacked on #8375, now merged. Rebased onto main. Polishes the onboarding landing page, community-link entry, and recovery sheets. Profile setup uses a consistent sheet with a larger avatar, inline display name, and draft photo/emoji/animated editing; iOS uses native controls and coordinated avatar/sheet transitions. Validation: mobile analysis, full tests, and normal pre-push checks passed after rebase. Prior iOS build and device walkthrough passed; native validation was not repeated after this rebase. Snapshots omitted as requested. --------- Signed-off-by: kenny lopez <klopez4212@gmail.com> Signed-off-by: Tom Brow <tomb@block.xyz> Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz> Co-authored-by: Tom Brow <tomb@block.xyz>
43 lines
1.5 KiB
Dart
43 lines
1.5 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter/services.dart';
|
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
|
import 'package:shared_preferences/shared_preferences.dart';
|
|
|
|
import '../../shared/theme/app_theme.dart';
|
|
import '../../shared/theme/theme_provider.dart';
|
|
import 'profile_avatar_draft.dart';
|
|
import 'profile_setup_avatar_editor.dart';
|
|
|
|
/// A local-only editor hosted inside the existing UIKit sheet's navigation stack.
|
|
@pragma('vm:entry-point')
|
|
Future<void> profileAvatarEditorMain() async {
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
const channel = MethodChannel('buzz/profile_avatar_sheet');
|
|
final initial =
|
|
await channel.invokeMapMethod<String, dynamic>('initial') ?? {};
|
|
final prefs = await SharedPreferences.getInstance();
|
|
runApp(
|
|
ProviderScope(
|
|
overrides: [savedPrefsProvider.overrideWithValue(prefs)],
|
|
child: MaterialApp(
|
|
theme: AppTheme.light(),
|
|
darkTheme: AppTheme.dark(),
|
|
themeMode: initial['dark'] == true ? ThemeMode.dark : ThemeMode.light,
|
|
home: ProfileSetupAvatarEditor(
|
|
initialDraft: decodeProfileAvatarDraft(initial['draft'] as Map?),
|
|
onPreviewReady: (rect) => channel.invokeMethod<void>('ready', {
|
|
'x': rect.left,
|
|
'y': rect.top,
|
|
'width': rect.width,
|
|
'height': rect.height,
|
|
}),
|
|
onFinished: (draft) => channel.invokeMethod<void>(
|
|
'finish',
|
|
encodeProfileAvatarDraft(draft),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|