From cc0f4509a7685ff1e03f0c2b33e049616dacfaa6 Mon Sep 17 00:00:00 2001 From: 21pages Date: Mon, 16 Jan 2023 20:24:21 +0800 Subject: [PATCH] common dialog InputDecoration Signed-off-by: 21pages --- flutter/lib/common.dart | 10 ++++++++-- flutter/lib/desktop/pages/desktop_home_page.dart | 4 ---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/flutter/lib/common.dart b/flutter/lib/common.dart index 6ffa5ccb2..04d7b85d0 100644 --- a/flutter/lib/common.dart +++ b/flutter/lib/common.dart @@ -634,8 +634,14 @@ class CustomAlertDialog extends StatelessWidget { title: title, contentPadding: EdgeInsets.symmetric( horizontal: contentPadding ?? 25, vertical: 10), - content: - ConstrainedBox(constraints: contentBoxConstraints, child: content), + content: ConstrainedBox( + constraints: contentBoxConstraints, + child: Theme( + data: ThemeData( + inputDecorationTheme: InputDecorationTheme( + isDense: true, contentPadding: EdgeInsets.all(15)), + ), + child: content)), actions: actions, ), ); diff --git a/flutter/lib/desktop/pages/desktop_home_page.dart b/flutter/lib/desktop/pages/desktop_home_page.dart index 65c38e06b..2773a3049 100644 --- a/flutter/lib/desktop/pages/desktop_home_page.dart +++ b/flutter/lib/desktop/pages/desktop_home_page.dart @@ -597,8 +597,6 @@ void setPasswordDialog() async { child: TextField( obscureText: true, decoration: InputDecoration( - isDense: true, - contentPadding: EdgeInsets.all(15), labelText: translate('Password'), border: const OutlineInputBorder(), errorText: errMsg0.isNotEmpty ? errMsg0 : null), @@ -625,8 +623,6 @@ void setPasswordDialog() async { child: TextField( obscureText: true, decoration: InputDecoration( - isDense: true, - contentPadding: EdgeInsets.all(15), border: const OutlineInputBorder(), labelText: translate('Confirmation'), errorText: errMsg1.isNotEmpty ? errMsg1 : null),