mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-06-13 10:42:12 +00:00
79 lines
2.4 KiB
Dart
79 lines
2.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:twonly/src/utils/misc.dart';
|
|
import 'package:twonly/src/visual/themes/light.dart';
|
|
|
|
class OnboardingWrapper extends StatelessWidget {
|
|
const OnboardingWrapper({
|
|
required this.children,
|
|
super.key,
|
|
});
|
|
final List<Widget> children;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final isDark = isDarkMode(context);
|
|
final backgroundColor = isDark ? const Color(0xFF0F172A) : primaryColor;
|
|
final topBlobColor = isDark
|
|
? primaryColor.withValues(alpha: 0.15)
|
|
: Colors.white.withValues(alpha: 0.1);
|
|
final bottomBlobColor = isDark
|
|
? primaryColor.withValues(alpha: 0.08)
|
|
: Colors.black.withValues(alpha: 0.05);
|
|
|
|
return GestureDetector(
|
|
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
|
behavior: HitTestBehavior.opaque,
|
|
child: Scaffold(
|
|
backgroundColor: backgroundColor,
|
|
body: Stack(
|
|
children: [
|
|
Positioned(
|
|
top: -100,
|
|
right: -100,
|
|
child: Container(
|
|
width: 300,
|
|
height: 300,
|
|
decoration: BoxDecoration(
|
|
shape: BoxShape.circle,
|
|
color: topBlobColor,
|
|
),
|
|
),
|
|
),
|
|
Positioned(
|
|
bottom: -50,
|
|
left: -50,
|
|
child: Container(
|
|
width: 200,
|
|
height: 200,
|
|
decoration: BoxDecoration(
|
|
shape: BoxShape.circle,
|
|
color: bottomBlobColor,
|
|
),
|
|
),
|
|
),
|
|
SafeArea(
|
|
child: LayoutBuilder(
|
|
builder: (context, constraints) {
|
|
return SingleChildScrollView(
|
|
padding: const EdgeInsets.symmetric(horizontal: 24),
|
|
child: ConstrainedBox(
|
|
constraints: BoxConstraints(
|
|
minHeight: constraints.maxHeight,
|
|
),
|
|
child: IntrinsicHeight(
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
children: children,
|
|
),
|
|
),
|
|
),
|
|
);
|
|
},
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|