Skip to content

Commit

Permalink
set line length to 120
Browse files Browse the repository at this point in the history
  • Loading branch information
mdmohsin7 committed Jun 18, 2024
1 parent be27f81 commit d31cc55
Show file tree
Hide file tree
Showing 39 changed files with 367 additions and 788 deletions.
12 changes: 3 additions & 9 deletions lib/components/error_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,16 @@ class ErrorDialog extends StatelessWidget {
final String details;
final VoidCallback? onRightButtonPressed;

const ErrorDialog(
{super.key,
required this.title,
required this.details,
this.onRightButtonPressed});
const ErrorDialog({super.key, required this.title, required this.details, this.onRightButtonPressed});

Future<void> show(BuildContext context) {
return showDialog<void>(
context: context, barrierDismissible: false, builder: (_) => this);
return showDialog<void>(context: context, barrierDismissible: false, builder: (_) => this);
}

@override
Widget build(BuildContext context) {
return CustomDialog(
icon: const CustomPaint(
size: Size(60, 60), painter: RedExclamationCircle()),
icon: const CustomPaint(size: Size(60, 60), painter: RedExclamationCircle()),
rightButtonTitle: 'Retry',
onRightButtonPressed: () {
Navigator.of(context).pop();
Expand Down
11 changes: 3 additions & 8 deletions lib/components/full_page_error_indicator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ class FullPageErrorIndicator extends StatelessWidget {
final String? buttonTitle;
final VoidCallback? buttonOnPressed;

const FullPageErrorIndicator(
{this.errorMessage, this.buttonTitle, this.buttonOnPressed, super.key});
const FullPageErrorIndicator({this.errorMessage, this.buttonTitle, this.buttonOnPressed, super.key});

@override
Widget build(BuildContext context) {
Expand All @@ -20,19 +19,15 @@ class FullPageErrorIndicator extends StatelessWidget {
child: Center(
child: Text(
errorMessage ?? GlobalError.unknown.localizedDescription(context),
style: Theme.of(context)
.textTheme
.titleSmall!
.copyWith(color: AppColors.red1),
style: Theme.of(context).textTheme.titleSmall!.copyWith(color: AppColors.red1),
),
),
),
),
if (buttonTitle != null && buttonOnPressed != null)
Padding(
padding: const EdgeInsets.fromLTRB(16, 16, 16, 16),
child:
FlatButtonLong(title: buttonTitle!, onPressed: buttonOnPressed),
child: FlatButtonLong(title: buttonTitle!, onPressed: buttonOnPressed),
),
]);
}
Expand Down
8 changes: 2 additions & 6 deletions lib/components/member_info_row.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ class MemberInfoRow extends StatelessWidget {
children: [
Flexible(
child: Text(
member.nickname.isNotEmpty
? member.nickname
: member.account,
member.nickname.isNotEmpty ? member.nickname : member.account,
overflow: TextOverflow.ellipsis,
style: Theme.of(context).textTheme.labelLarge,
),
Expand All @@ -45,9 +43,7 @@ class MemberInfoRow extends StatelessWidget {
],
),
const SizedBox(height: 8),
Text(member.account,
style:
Theme.of(context).textTheme.subtitle2OpacityEmphasis)
Text(member.account, style: Theme.of(context).textTheme.subtitle2OpacityEmphasis)
],
),
),
Expand Down
9 changes: 2 additions & 7 deletions lib/components/search_result_row.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ class SearchResultRow extends StatelessWidget {
children: [
Flexible(
child: Text(
member.nickname.isNotEmpty
? member.nickname
: member.account,
member.nickname.isNotEmpty ? member.nickname : member.account,
overflow: TextOverflow.ellipsis,
style: Theme.of(context).textTheme.labelLarge,
),
Expand All @@ -49,10 +47,7 @@ class SearchResultRow extends StatelessWidget {
],
),
const SizedBox(height: 8),
Text(member.account,
style: Theme.of(context)
.textTheme
.subtitle2OpacityEmphasis)
Text(member.account, style: Theme.of(context).textTheme.subtitle2OpacityEmphasis)
],
),
),
Expand Down
14 changes: 4 additions & 10 deletions lib/components/search_user/search_user.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,12 @@ class SearchUser extends StatelessWidget {
child: Column(
children: [
const Padding(
padding: EdgeInsets.only(
right: horizontalEdgePadding,
left: horizontalEdgePadding,
top: 10),
padding: EdgeInsets.only(right: horizontalEdgePadding, left: horizontalEdgePadding, top: 10),
child: SearchUserTextField(),
),
if (title != null)
Padding(
padding:
const EdgeInsets.symmetric(horizontal: horizontalEdgePadding),
padding: const EdgeInsets.symmetric(horizontal: horizontalEdgePadding),
child: Align(
alignment: Alignment.centerLeft,
child: Column(
Expand All @@ -56,12 +52,10 @@ class SearchUser extends StatelessWidget {
case PageState.loading:
case PageState.failure:
case PageState.success:
if (state.pageState == PageState.success &&
state.users.isEmpty) {
if (state.pageState == PageState.success && state.users.isEmpty) {
return Padding(
padding: const EdgeInsets.all(16.0),
child: Center(
child: Text(context.loc.searchUserNoUserFound)),
child: Center(child: Text(context.loc.searchUserNoUserFound)),
);
} else {
return Expanded(
Expand Down
6 changes: 1 addition & 5 deletions lib/components/select_picture_box/select_picture_box.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,7 @@ class SelectPictureBox extends StatelessWidget {
dashPattern: [8, 4],
strokeWidth: 2,
color: AppColors.grey,
child: Ink(
height: 200,
child: Container(
width: width,
child: imageState(pictureBoxState, context)))));
child: Ink(height: 200, child: Container(width: width, child: imageState(pictureBoxState, context)))));
}

Widget imageState(PictureBoxState pictureState, BuildContext context) {
Expand Down
8 changes: 2 additions & 6 deletions lib/components/text_form_field_custom.dart
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,14 @@ class TextFormFieldCustom extends StatelessWidget {
suffixText: suffixText,
suffixStyle: Theme.of(context).textTheme.titleSmall,
suffixIcon: suffixIcon,
focusedBorder: const OutlineInputBorder(
borderSide: BorderSide(color: AppColors.canopy)),
focusedBorder: const OutlineInputBorder(borderSide: BorderSide(color: AppColors.canopy)),
counterText: counterText,
hintText: hintText,
labelText: labelText,
errorText: errorText,
errorMaxLines: 2,
errorStyle: const TextStyle(color: Colors.red, wordSpacing: 4.0),
labelStyle: Theme.of(context)
.textTheme
.subtitle3
.copyWith(color: AppColors.white),
labelStyle: Theme.of(context).textTheme.subtitle3.copyWith(color: AppColors.white),
hintStyle: Theme.of(context).textTheme.labelLarge,
contentPadding: const EdgeInsets.all(16.0),
border: OutlineInputBorder(borderRadius: BorderRadius.circular(8)),
Expand Down
3 changes: 1 addition & 2 deletions lib/datasource/remote/api/esr_callback_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ class ESRCallbackRepository extends HttpRepository {

return http
.post(postURI, headers: headers, body: params)
.then((http.Response response) =>
mapHttpResponse<bool>(response, (dynamic body) {
.then((http.Response response) => mapHttpResponse<bool>(response, (dynamic body) {
return true;
}))
.catchError((error) => mapHttpError(error));
Expand Down
6 changes: 2 additions & 4 deletions lib/datasource/remote/api/stat_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import 'package:seeds/datasource/remote/api/http_repo/http_repository.dart';
import 'package:seeds/datasource/remote/model/stat_model.dart';

class StatRepository extends HttpRepository {
Future<Result<StatModel>> getTokenStat(
{required String tokenContract, required String symbol}) {
Future<Result<StatModel>> getTokenStat({required String tokenContract, required String symbol}) {
print('[http] get getTokenStat for $symbol');

final String request = '''
Expand All @@ -21,8 +20,7 @@ class StatRepository extends HttpRepository {

return http
.post(statURL, headers: headers, body: request)
.then((http.Response response) =>
mapHttpResponse<StatModel>(response, (dynamic body) {
.then((http.Response response) => mapHttpResponse<StatModel>(response, (dynamic body) {
return StatModel.fromJson(body);
}))
.catchError((dynamic error) => mapHttpError(error));
Expand Down
Loading

0 comments on commit d31cc55

Please sign in to comment.