Skip to content

Commit

Permalink
Merge pull request #12 from TaskWeaver/2-dx-관련-린트-설정-제안-드립니다
Browse files Browse the repository at this point in the history
2 dx 관련 린트 설정 제안 드립니다
  • Loading branch information
brownglasses authored Jan 3, 2024
2 parents 6ccac13 + fab12c5 commit 81957b0
Show file tree
Hide file tree
Showing 11 changed files with 603 additions and 104 deletions.
28 changes: 25 additions & 3 deletions front/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,30 @@ linter:
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule

- prefer_const_constructors
- always_declare_return_types
- always_require_non_null_named_parameters
- avoid_types_on_closure_parameters
- avoid_annotating_with_dynamic
- avoid_escaping_inner_quotes
- avoid_function_literals_in_foreach_calls
- avoid_private_typedef_functions
- combinators_ordering
- curly_braces_in_flow_control_structures
- omit_local_variable_types
- annotate_overrides
- sort_constructors_first
- unawaited_futures
- directives_ordering
- unnecessary_final
- unnecessary_parenthesis
- conditional_uri_does_not_exist
- prefer_single_quotes
- await_only_futures
- always_use_package_imports
- avoid_empty_else
- comment_references
- prefer_void_to_null
- use_key_in_widget_constructors
# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
18 changes: 18 additions & 0 deletions front/lib/config/routes.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import 'package:front/domain/presentation/home/home.dart';
import 'package:front/domain/presentation/login/email_singin.dart';
import 'package:front/domain/presentation/login/login.dart';
import 'package:front/domain/presentation/login/signIn.dart';

class RouteName {
static const home = '/';
static const login = '/login';
static const signIn = '/signIn';
static const emailSignIn = '/emailSignIn';
}

var nameRoutes = {
RouteName.home: (context) => const HomeScreen(),
RouteName.login: (context) => const LoginScreen(),
RouteName.signIn: (context) => const SignInScreen(),
RouteName.emailSignIn: (context) => const EmailSignInScreen(),
};
18 changes: 18 additions & 0 deletions front/lib/domain/presentation/home/home.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import 'package:flutter/material.dart';

class HomeScreen extends StatelessWidget {
const HomeScreen({super.key});

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('홈')),
body: Center(
child: ElevatedButton(
onPressed: () {
Navigator.pushNamed(context, '/login'); // 로그인 화면으로 이동
},
child: const Text('로그인'),
)));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import 'package:flutter/material.dart';

class CheckboxTextRow extends StatelessWidget {
const CheckboxTextRow(
{super.key, this.onChanged, required this.text, required this.value});
final Function(bool?)? onChanged;
final bool value;
final String text;
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.fromLTRB(0, 4, 0, 4),
child: Row(
children: [
Checkbox(value: value, onChanged: onChanged),
const SizedBox(
width: 4,
),
Text(
text,
style: const TextStyle(color: Colors.black, fontSize: 12),
)
],
),
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import 'package:flutter/material.dart';

class HintedTextField extends StatelessWidget {
final String? title;
final String hintText;
final FormFieldSetter<String> onSaved;
final FormFieldValidator<String> validator;
final void Function(String?)? onChanged;
const HintedTextField(
{super.key,
this.title,
required this.hintText,
required this.onSaved,
required this.validator,
this.onChanged});

@override
Widget build(BuildContext context) {
TextStyle textStyle = const TextStyle(
fontSize: 12,
color: Colors.black,
);
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
title != null
? Text(
title!,
style: textStyle,
)
: Container(),
Padding(
padding: const EdgeInsets.fromLTRB(0, 6, 0, 6),
child: TextFormField(
onChanged: onChanged,
onSaved: onSaved,
validator: validator,
decoration: InputDecoration(
border: InputBorder.none,
filled: true,
fillColor: Colors.grey[300],
hintText: hintText,
hintStyle: textStyle,
),
),
)
],
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import 'package:flutter/material.dart';

class RoundedElevatedButton extends StatelessWidget {
const RoundedElevatedButton(
{super.key, required this.text, required this.onPressed});
final String text;
final VoidCallback onPressed;
@override
Widget build(BuildContext context) {
TextStyle textStyle = const TextStyle(color: Colors.black, fontSize: 12);
return SizedBox(
width: double.infinity,
child: ElevatedButton(
onPressed: onPressed,
style: ElevatedButton.styleFrom(
elevation: 0,
shadowColor: Colors.transparent,
backgroundColor: Colors.grey[300],
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20.0), // 원하는 둥근 모서리 반지름 값 지정
),
padding: const EdgeInsets.symmetric(
horizontal: 16.0, vertical: 12.0), // 원하는 패딩 값 지정
),
child: Text(
text,
style: textStyle,
),
),
);
}
}
Loading

0 comments on commit 81957b0

Please sign in to comment.