Skip to content

Instantly share code, notes, and snippets.

@felangel
Last active April 9, 2019 04:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save felangel/312c6a8d4f66d139c8107bd3c7aab0a3 to your computer and use it in GitHub Desktop.
Save felangel/312c6a8d4f66d139c8107bd3c7aab0a3 to your computer and use it in GitHub Desktop.
[github_search] Flutter Search Form
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