Last active
April 9, 2019 04:26
-
-
Save felangel/312c6a8d4f66d139c8107bd3c7aab0a3 to your computer and use it in GitHub Desktop.
[github_search] Flutter Search Form
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
import 'package:flutter/material.dart'; | |
import 'package:flutter_bloc/flutter_bloc.dart'; | |
import 'package:url_launcher/url_launcher.dart'; | |
import 'package:common_github_search/common_github_search.dart'; | |
class SearchForm extends StatefulWidget { | |
final GithubRepository githubRepository; | |
const SearchForm({ | |
Key key, | |
@required this.githubRepository, | |
}) : super(key: key); | |
@override | |
_SearchFormState createState() => _SearchFormState(); | |
} | |
class _SearchFormState extends State<SearchForm> { | |
GithubSearchBloc _githubSearchBloc; | |
@override | |
void initState() { | |
super.initState(); | |
_githubSearchBloc = GithubSearchBloc( | |
githubRepository: widget.githubRepository, | |
); | |
} | |
@override | |
void dispose() { | |
_githubSearchBloc.dispose(); | |
super.dispose(); | |
} | |
@override | |
Widget build(BuildContext context) { | |
return Column( | |
children: <Widget>[ | |
_SearchBar(githubSearchBloc: _githubSearchBloc), | |
_SearchBody(githubSearchBloc: _githubSearchBloc) | |
], | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment