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';
|
import 'theme_controller.dart';
|
||||||
|
|
||||||
class ThemeScope extends InheritedWidget {
|
class ThemeScope extends InheritedWidget {
|
||||||
const ThemeScope({super.key, required this.controller, required Widget child})
|
const ThemeScope({super.key, required this.controller, required super.child});
|
||||||
: super(child: child);
|
|
||||||
|
|
||||||
final ThemeController controller;
|
final ThemeController controller;
|
||||||
|
|
||||||
|
|||||||
@@ -1289,7 +1289,10 @@ class _SignupScreenState extends State<SignupScreen> {
|
|||||||
),
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
buttonLabel,
|
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(
|
child: Text(
|
||||||
buttonLabel,
|
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: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: ConstrainedBox(
|
child: ConstrainedBox(
|
||||||
constraints: const BoxConstraints(minHeight: 56),
|
constraints: const BoxConstraints(
|
||||||
|
minHeight: 56,
|
||||||
|
),
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
controller: verificationController,
|
controller: verificationController,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
|
|||||||
@@ -1079,45 +1079,6 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
|||||||
return tr('ui.userfront.dashboard.sessions.unknown_device');
|
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) {
|
String _sessionUserAgentLabel(String userAgent) {
|
||||||
final lower = userAgent.toLowerCase();
|
final lower = userAgent.toLowerCase();
|
||||||
if (lower.isEmpty) {
|
if (lower.isEmpty) {
|
||||||
@@ -1173,29 +1134,6 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
|||||||
return '';
|
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) {
|
bool _looksLikeInternalUserAgent(String userAgent) {
|
||||||
return userAgent.startsWith('go-http-client/') ||
|
return userAgent.startsWith('go-http-client/') ||
|
||||||
userAgent.startsWith('fasthttp') ||
|
userAgent.startsWith('fasthttp') ||
|
||||||
|
|||||||
Reference in New Issue
Block a user