165 lines
4.5 KiB
Dart
165 lines
4.5 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_localizations/flutter_localizations.dart';
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
|
import 'package:yumi/app/constants/sc_global_config.dart';
|
|
import 'package:yumi/app_localizations.dart';
|
|
import 'package:yumi/ui_kit/widgets/room/room_animation_switch_dialog.dart';
|
|
|
|
void main() {
|
|
SCGlobalConfig.isGiftSpecialEffects = true;
|
|
SCGlobalConfig.isLuckGiftSpecialEffects = true;
|
|
SCGlobalConfig.isEntryVehicleAnimation = false;
|
|
runApp(const RoomAnimationSwitchDialogPreviewApp());
|
|
}
|
|
|
|
class RoomAnimationSwitchDialogPreviewApp extends StatelessWidget {
|
|
const RoomAnimationSwitchDialogPreviewApp({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return ScreenUtilInit(
|
|
designSize: const Size(375, 812),
|
|
minTextAdapt: true,
|
|
splitScreenMode: true,
|
|
builder:
|
|
(_, child) => MaterialApp(
|
|
debugShowCheckedModeBanner: false,
|
|
locale: const Locale('en'),
|
|
supportedLocales: SCAppLocalizations.supportedLocales,
|
|
localizationsDelegates: const [
|
|
SCAppLocalizations.delegate,
|
|
GlobalMaterialLocalizations.delegate,
|
|
GlobalWidgetsLocalizations.delegate,
|
|
GlobalCupertinoLocalizations.delegate,
|
|
],
|
|
builder: FlutterSmartDialog.init(),
|
|
home: const _RoomAnimationSwitchDialogPreviewPage(),
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
class _RoomAnimationSwitchDialogPreviewPage extends StatelessWidget {
|
|
const _RoomAnimationSwitchDialogPreviewPage();
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
backgroundColor: Colors.black,
|
|
body: Stack(
|
|
fit: StackFit.expand,
|
|
children: const [
|
|
_PreviewRoomBackground(),
|
|
Positioned(
|
|
left: 0,
|
|
right: 0,
|
|
bottom: 0,
|
|
child: RoomAnimationSwitchDialog(),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
class _PreviewRoomBackground extends StatelessWidget {
|
|
const _PreviewRoomBackground();
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return DecoratedBox(
|
|
decoration: const BoxDecoration(
|
|
gradient: LinearGradient(
|
|
begin: Alignment.topCenter,
|
|
end: Alignment.bottomCenter,
|
|
colors: [Color(0xFF172F35), Color(0xFF071B17), Color(0xFF1B1308)],
|
|
),
|
|
),
|
|
child: Stack(
|
|
children: [
|
|
Positioned(
|
|
left: 24.w,
|
|
top: 70.w,
|
|
child: _PreviewLine(width: 128.w, opacity: 0.55),
|
|
),
|
|
for (var index = 0; index < 10; index++)
|
|
Positioned(
|
|
left: (38 + (index % 5) * 66).w,
|
|
top: (145 + (index ~/ 5) * 80).w,
|
|
child: const _PreviewSeat(),
|
|
),
|
|
Positioned(
|
|
left: 26.w,
|
|
right: 26.w,
|
|
top: 355.w,
|
|
child: _PreviewPanel(height: 150.w),
|
|
),
|
|
Positioned(
|
|
left: 24.w,
|
|
right: 24.w,
|
|
bottom: 36.w,
|
|
child: _PreviewPanel(height: 52.w),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
class _PreviewSeat extends StatelessWidget {
|
|
const _PreviewSeat();
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return DecoratedBox(
|
|
decoration: BoxDecoration(
|
|
shape: BoxShape.circle,
|
|
border: Border.all(
|
|
color: const Color(0xFFFFCE7C).withValues(alpha: 0.36),
|
|
width: 2.w,
|
|
),
|
|
color: Colors.black.withValues(alpha: 0.18),
|
|
),
|
|
child: SizedBox(width: 44.w, height: 44.w),
|
|
);
|
|
}
|
|
}
|
|
|
|
class _PreviewLine extends StatelessWidget {
|
|
const _PreviewLine({required this.width, required this.opacity});
|
|
|
|
final double width;
|
|
final double opacity;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
width: width,
|
|
height: 14.w,
|
|
decoration: BoxDecoration(
|
|
color: Colors.white.withValues(alpha: opacity),
|
|
borderRadius: BorderRadius.circular(7.w),
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
class _PreviewPanel extends StatelessWidget {
|
|
const _PreviewPanel({required this.height});
|
|
|
|
final double height;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
height: height,
|
|
decoration: BoxDecoration(
|
|
color: Colors.black.withValues(alpha: 0.24),
|
|
borderRadius: BorderRadius.circular(16.w),
|
|
border: Border.all(color: Colors.white.withValues(alpha: 0.08)),
|
|
),
|
|
);
|
|
}
|
|
}
|