forked from baron/baron-sso
chore: Flutter 코드 포맷팅 적용 및 미사용 코드(Dead Code) 정리
This commit is contained in:
@@ -4,8 +4,7 @@ import 'app_theme.dart';
|
||||
import 'theme_controller.dart';
|
||||
|
||||
class ThemeScope extends InheritedWidget {
|
||||
const ThemeScope({super.key, required this.controller, required Widget child})
|
||||
: super(child: child);
|
||||
const ThemeScope({super.key, required this.controller, required super.child});
|
||||
|
||||
final ThemeController controller;
|
||||
|
||||
|
||||
@@ -1289,7 +1289,10 @@ class _SignupScreenState extends State<SignupScreen> {
|
||||
),
|
||||
child: Text(
|
||||
buttonLabel,
|
||||
style: const TextStyle(fontSize: 13, fontWeight: FontWeight.bold),
|
||||
style: const TextStyle(
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -1326,7 +1329,10 @@ class _SignupScreenState extends State<SignupScreen> {
|
||||
),
|
||||
child: Text(
|
||||
buttonLabel,
|
||||
style: const TextStyle(fontSize: 13, fontWeight: FontWeight.bold),
|
||||
style: const TextStyle(
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -1346,7 +1352,9 @@ class _SignupScreenState extends State<SignupScreen> {
|
||||
children: [
|
||||
Expanded(
|
||||
child: ConstrainedBox(
|
||||
constraints: const BoxConstraints(minHeight: 56),
|
||||
constraints: const BoxConstraints(
|
||||
minHeight: 56,
|
||||
),
|
||||
child: TextFormField(
|
||||
controller: verificationController,
|
||||
decoration: InputDecoration(
|
||||
|
||||
@@ -1079,45 +1079,6 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
||||
return tr('ui.userfront.dashboard.sessions.unknown_device');
|
||||
}
|
||||
|
||||
String _sessionPrimaryLabel(UserSessionSummary session) {
|
||||
final appLabel = _sessionAppLabel(session);
|
||||
if (appLabel.isNotEmpty) {
|
||||
return appLabel;
|
||||
}
|
||||
if (session.isCurrent) {
|
||||
return 'UserFront';
|
||||
}
|
||||
return tr('ui.userfront.dashboard.sessions.unknown_session');
|
||||
}
|
||||
|
||||
String _sessionClientLabel(UserSessionSummary session) {
|
||||
return '';
|
||||
}
|
||||
|
||||
String _sessionAppLabel(UserSessionSummary session) {
|
||||
final appName = session.appName.trim();
|
||||
if (appName.isNotEmpty) {
|
||||
return appName;
|
||||
}
|
||||
final clientId = session.clientId.trim().toLowerCase();
|
||||
if (clientId.isEmpty) {
|
||||
return session.isCurrent ? 'UserFront' : '';
|
||||
}
|
||||
if (clientId.contains('adminfront')) {
|
||||
return 'AdminFront';
|
||||
}
|
||||
if (clientId.contains('devfront')) {
|
||||
return 'DevFront';
|
||||
}
|
||||
if (clientId.contains('userfront')) {
|
||||
return 'UserFront';
|
||||
}
|
||||
if (clientId.contains('baron')) {
|
||||
return tr('ui.userfront.app_label.baron');
|
||||
}
|
||||
return session.clientId.trim();
|
||||
}
|
||||
|
||||
String _sessionUserAgentLabel(String userAgent) {
|
||||
final lower = userAgent.toLowerCase();
|
||||
if (lower.isEmpty) {
|
||||
@@ -1173,29 +1134,6 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
||||
return '';
|
||||
}
|
||||
|
||||
String _sessionOsLabel(String userAgent) {
|
||||
final lower = userAgent.toLowerCase();
|
||||
if (lower.isEmpty || _looksLikeInternalUserAgent(lower)) {
|
||||
return '';
|
||||
}
|
||||
if (lower.contains('iphone') || lower.contains('ios')) {
|
||||
return 'iOS';
|
||||
}
|
||||
if (lower.contains('android')) {
|
||||
return 'Android';
|
||||
}
|
||||
if (lower.contains('windows')) {
|
||||
return 'Windows';
|
||||
}
|
||||
if (lower.contains('mac os') || lower.contains('macintosh')) {
|
||||
return 'macOS';
|
||||
}
|
||||
if (lower.contains('linux')) {
|
||||
return 'Linux';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
bool _looksLikeInternalUserAgent(String userAgent) {
|
||||
return userAgent.startsWith('go-http-client/') ||
|
||||
userAgent.startsWith('fasthttp') ||
|
||||
|
||||
Reference in New Issue
Block a user