-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into release/2.5.0
- Loading branch information
Showing
110 changed files
with
1,613 additions
and
1,135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 0 additions & 34 deletions
34
lib/components/search_user/components/search_result_list.dart
This file was deleted.
Oops, something went wrong.
65 changes: 65 additions & 0 deletions
65
lib/components/search_user/components/search_user_text_field.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_bloc/flutter_bloc.dart'; | ||
import 'package:seeds/components/search_user/interactor/search_user_bloc.dart'; | ||
import 'package:seeds/components/search_user/interactor/viewmodels/search_user_events.dart'; | ||
import 'package:seeds/components/search_user/interactor/viewmodels/search_user_state.dart'; | ||
import 'package:seeds/constants/app_colors.dart'; | ||
import 'package:seeds/domain-shared/page_state.dart'; | ||
import 'package:seeds/i18n/components/components.i18n.dart'; | ||
|
||
class SearchUserTextField extends StatefulWidget { | ||
const SearchUserTextField({Key? key}) : super(key: key); | ||
|
||
@override | ||
_SearchUserTextFieldState createState() => _SearchUserTextFieldState(); | ||
} | ||
|
||
class _SearchUserTextFieldState extends State<SearchUserTextField> { | ||
final TextEditingController _controller = TextEditingController(); | ||
final _searchBorder = const OutlineInputBorder( | ||
borderRadius: BorderRadius.all(Radius.circular(8)), | ||
borderSide: BorderSide(color: AppColors.darkGreen2, width: 2.0), | ||
); | ||
|
||
@override | ||
void dispose() { | ||
_controller.dispose(); | ||
super.dispose(); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return TextField( | ||
autofocus: true, | ||
autocorrect: false, | ||
controller: _controller, | ||
onChanged: (value) { | ||
BlocProvider.of<SearchUserBloc>(context).add(OnSearchChange(searchQuery: value)); | ||
}, | ||
decoration: InputDecoration( | ||
suffixIcon: BlocBuilder<SearchUserBloc, SearchUserState>( | ||
builder: (context, state) { | ||
return state.pageState == PageState.loading | ||
? Transform.scale( | ||
scale: 0.5, | ||
child: const CircularProgressIndicator(valueColor: AlwaysStoppedAnimation<Color>(AppColors.green)), | ||
) | ||
: IconButton( | ||
icon: Icon(state.searchBarIcon, color: AppColors.white, size: 26), | ||
onPressed: () { | ||
if (state.searchBarIcon == Icons.clear) { | ||
BlocProvider.of<SearchUserBloc>(context).add(ClearIconTapped()); | ||
_controller.clear(); | ||
} | ||
}, | ||
); | ||
}, | ||
), | ||
enabledBorder: _searchBorder, | ||
focusedBorder: _searchBorder, | ||
border: const OutlineInputBorder(borderRadius: BorderRadius.all(Radius.circular(8))), | ||
hintText: 'Search...'.i18n, | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.