Commit 39ab7b67227e5b0606a77af36fedd406363776d7

Authored by 权海
1 parent 2a99dbee

feat(ui):移除watch theme中的dp

import 'package:doublefeel_flutter/core/util/size_extensions.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:doublefeel_flutter/l10n/l10n_extensions.dart';
... ... @@ -20,11 +19,11 @@ class WatchThemeFriendPickerDialog extends StatelessWidget {
child: Align(
alignment: Alignment.bottomCenter,
child: Container(
height: 452.dp,
height: 452,
width: double.infinity,
decoration: BoxDecoration(
color: WatchThemeColors.background,
borderRadius: BorderRadius.vertical(top: Radius.circular(14.dp)),
borderRadius: BorderRadius.vertical(top: Radius.circular(14)),
),
child: SafeArea(
top: false,
... ... @@ -33,7 +32,7 @@ class WatchThemeFriendPickerDialog extends StatelessWidget {
Column(
children: [
SizedBox(
height: 56.dp,
height: 56,
child: Stack(
alignment: Alignment.center,
children: [
... ... @@ -41,21 +40,21 @@ class WatchThemeFriendPickerDialog extends StatelessWidget {
context.l10n.watchThemeSelectFriend,
style: TextStyle(
color: WatchThemeColors.textPrimary,
fontSize: 16.dp,
fontSize: 16,
fontWeight: FontWeight.w600,
),
),
Positioned(
left: 26.dp,
left: 26,
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: Get.back,
child: SizedBox(
width: 32.dp,
height: 32.dp,
width: 32,
height: 32,
child: Icon(
Icons.close,
size: 22.dp,
size: 22,
color: const Color(0xFFA084EF),
),
),
... ... @@ -66,35 +65,35 @@ class WatchThemeFriendPickerDialog extends StatelessWidget {
),
Expanded(
child: ListView.separated(
padding: EdgeInsets.fromLTRB(16.dp, 0, 16.dp, 84.dp),
padding: EdgeInsets.fromLTRB(16, 0, 16, 84),
itemBuilder: (_, index) {
return _FriendPlaceholderCard(selected: index == 0);
},
separatorBuilder: (_, __) => SizedBox(height: 12.dp),
separatorBuilder: (_, __) => SizedBox(height: 12),
itemCount: 3,
),
),
],
),
Positioned(
left: 49.dp,
right: 47.dp,
bottom: 35.dp,
left: 49,
right: 47,
bottom: 35,
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: onConfirm ?? () => Get.back(result: true),
child: Container(
height: 48.dp,
height: 48,
alignment: Alignment.center,
decoration: BoxDecoration(
color: WatchThemeColors.brand,
borderRadius: BorderRadius.circular(24.dp),
borderRadius: BorderRadius.circular(24),
),
child: Text(
context.l10n.watchThemeSelectAndSync,
style: TextStyle(
color: Colors.white,
fontSize: 16.dp,
fontSize: 16,
fontWeight: FontWeight.w600,
),
),
... ... @@ -118,45 +117,45 @@ class _FriendPlaceholderCard extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
height: 220.dp,
height: 220,
decoration: BoxDecoration(
color: selected ? Colors.white : const Color(0xFFFDFDFF),
borderRadius: BorderRadius.circular(16.dp),
borderRadius: BorderRadius.circular(16),
border: selected
? Border.all(color: WatchThemeColors.brand, width: 2.dp)
? Border.all(color: WatchThemeColors.brand, width: 2)
: null,
),
padding: EdgeInsets.all(20.dp),
padding: EdgeInsets.all(20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
_Block(width: 36.dp, height: 36.dp, radius: 18.dp),
SizedBox(width: 12.dp),
_Block(width: 36, height: 36, radius: 18),
SizedBox(width: 12),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_Block(width: 132.dp, height: 16.dp, radius: 8.dp),
SizedBox(height: 6.dp),
_Block(width: 72.dp, height: 10.dp, radius: 5.dp),
_Block(width: 132, height: 16, radius: 8),
SizedBox(height: 6),
_Block(width: 72, height: 10, radius: 5),
],
),
],
),
SizedBox(height: 29.dp),
SizedBox(height: 29),
Row(
children: [
Expanded(
child: _Block(height: 106.dp, radius: 18.dp),
child: _Block(height: 106, radius: 18),
),
SizedBox(width: 32.dp),
SizedBox(width: 32),
Expanded(
child: Column(
children: [
_Block(height: 60.dp, radius: 16.dp),
SizedBox(height: 4.dp),
_Block(height: 60.dp, radius: 16.dp),
_Block(height: 60, radius: 16),
SizedBox(height: 4),
_Block(height: 60, radius: 16),
],
),
),
... ...
import 'package:doublefeel_flutter/core/util/size_extensions.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:doublefeel_flutter/l10n/l10n_extensions.dart';
... ... @@ -14,11 +13,11 @@ class WatchThemeNoWatchDialog extends StatelessWidget {
backgroundColor: Colors.transparent,
insetPadding: EdgeInsets.zero,
child: Container(
width: 300.dp,
padding: EdgeInsets.fromLTRB(24.dp, 24.dp, 24.dp, 20.dp),
width: 300,
padding: EdgeInsets.fromLTRB(24, 24, 24, 20),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(24.dp),
borderRadius: BorderRadius.circular(24),
),
child: Column(
mainAxisSize: MainAxisSize.min,
... ... @@ -28,36 +27,36 @@ class WatchThemeNoWatchDialog extends StatelessWidget {
textAlign: TextAlign.center,
style: TextStyle(
color: const Color(0xFF141414),
fontSize: 18.dp,
fontSize: 18,
fontWeight: FontWeight.w600,
),
),
SizedBox(height: 16.dp),
SizedBox(height: 16),
Text(
context.l10n.watchThemeNoWatchMessage,
textAlign: TextAlign.center,
style: TextStyle(
color: const Color(0xFF6E6D80),
fontSize: 15.dp,
fontSize: 15,
),
),
SizedBox(height: 20.dp),
SizedBox(height: 20),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: Get.back,
child: Container(
width: 220.dp,
height: 48.dp,
width: 220,
height: 48,
alignment: Alignment.center,
decoration: BoxDecoration(
color: WatchThemeColors.brand,
borderRadius: BorderRadius.circular(24.dp),
borderRadius: BorderRadius.circular(24),
),
child: Text(
context.l10n.watchThemeOk,
style: TextStyle(
color: Colors.white,
fontSize: 14.dp,
fontSize: 14,
fontWeight: FontWeight.w500,
),
),
... ...
import 'package:doublefeel_flutter/core/util/size_extensions.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:doublefeel_flutter/l10n/l10n_extensions.dart';
... ... @@ -45,35 +44,35 @@ class _WatchThemeSyncDialogState extends State<WatchThemeSyncDialog> {
child: Align(
alignment: Alignment.bottomCenter,
child: Container(
height: 452.dp,
height: 452,
width: double.infinity,
decoration: BoxDecoration(
color: WatchThemeColors.background,
borderRadius: BorderRadius.vertical(top: Radius.circular(14.dp)),
borderRadius: BorderRadius.vertical(top: Radius.circular(14)),
),
child: SafeArea(
top: false,
child: Stack(
children: [
Positioned(
left: 26.dp,
top: 12.dp,
left: 26,
top: 12,
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: Get.back,
child: SizedBox(
width: 32.dp,
height: 32.dp,
width: 32,
height: 32,
child: Icon(
Icons.close,
size: 22.dp,
size: 22,
color: const Color(0xFFA084EF),
),
),
),
),
Positioned(
top: 66.dp,
top: 66,
left: 0,
right: 0,
child: Center(
... ... @@ -84,15 +83,15 @@ class _WatchThemeSyncDialogState extends State<WatchThemeSyncDialog> {
),
),
Positioned(
top: 246.dp,
top: 246,
left: 0,
right: 0,
child: _buildMessage(),
),
Positioned(
left: 49.dp,
right: 47.dp,
bottom: 35.dp,
left: 49,
right: 47,
bottom: 35,
child: _buildAction(),
),
],
... ... @@ -106,13 +105,13 @@ class _WatchThemeSyncDialogState extends State<WatchThemeSyncDialog> {
Widget _buildMessage() {
return switch (_state) {
_WatchThemeSyncState.intro => Padding(
padding: EdgeInsets.symmetric(horizontal: 46.dp),
padding: EdgeInsets.symmetric(horizontal: 46),
child: Text(
context.l10n.watchThemeSyncIntro,
textAlign: TextAlign.center,
style: TextStyle(
color: WatchThemeColors.textPrimary,
fontSize: 14.dp,
fontSize: 14,
height: 1.35,
),
),
... ... @@ -122,15 +121,15 @@ class _WatchThemeSyncDialogState extends State<WatchThemeSyncDialog> {
textAlign: TextAlign.center,
style: TextStyle(
color: WatchThemeColors.textPrimary,
fontSize: 14.dp,
fontSize: 14,
),
),
_WatchThemeSyncState.done => Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
width: 14.dp,
height: 14.dp,
width: 14,
height: 14,
decoration: BoxDecoration(
color: _success
? WatchThemeColors.excellent
... ... @@ -139,18 +138,18 @@ class _WatchThemeSyncDialogState extends State<WatchThemeSyncDialog> {
),
child: Icon(
_success ? Icons.check : Icons.close,
size: 10.dp,
size: 10,
color: Colors.white,
),
),
SizedBox(width: 4.dp),
SizedBox(width: 4),
Text(
_success
? context.l10n.watchThemeSyncComplete
: context.l10n.watchThemeSyncFailed,
style: TextStyle(
color: WatchThemeColors.textPrimary,
fontSize: 14.dp,
fontSize: 14,
),
),
],
... ... @@ -188,17 +187,17 @@ class _PrimaryButton extends StatelessWidget {
behavior: HitTestBehavior.opaque,
onTap: onTap,
child: Container(
height: 48.dp,
height: 48,
alignment: Alignment.center,
decoration: BoxDecoration(
color: WatchThemeColors.brand,
borderRadius: BorderRadius.circular(24.dp),
borderRadius: BorderRadius.circular(24),
),
child: Text(
label,
style: TextStyle(
color: Colors.white,
fontSize: 16.dp,
fontSize: 16,
fontWeight: FontWeight.w600,
),
),
... ... @@ -215,9 +214,9 @@ class _ProgressButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ClipRRect(
borderRadius: BorderRadius.circular(24.dp),
borderRadius: BorderRadius.circular(24),
child: SizedBox(
height: 48.dp,
height: 48,
child: Stack(
fit: StackFit.expand,
children: [
... ... @@ -234,7 +233,7 @@ class _ProgressButton extends StatelessWidget {
),
style: TextStyle(
color: Colors.white,
fontSize: 16.dp,
fontSize: 16,
fontWeight: FontWeight.w600,
),
),
... ...