2019-02-02 17:28:51 +01:00
|
|
|
import 'package:flutter/material.dart';
|
2019-01-23 12:52:51 +01:00
|
|
|
import 'package:flutter/cupertino.dart';
|
2019-02-02 17:28:51 +01:00
|
|
|
import '../providers/settings.dart';
|
2019-01-23 12:52:51 +01:00
|
|
|
|
2019-02-02 17:28:51 +01:00
|
|
|
class SearchScreen extends StatefulWidget {
|
2019-01-23 12:52:51 +01:00
|
|
|
@override
|
2019-02-02 17:28:51 +01:00
|
|
|
_SearchScreenState createState() => _SearchScreenState();
|
|
|
|
}
|
|
|
|
|
|
|
|
class _SearchScreenState extends State<SearchScreen> {
|
|
|
|
int active = 0;
|
|
|
|
List users = [];
|
2019-01-23 12:52:51 +01:00
|
|
|
|
2019-02-02 17:28:51 +01:00
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2019-02-07 07:35:19 +01:00
|
|
|
switch (SettingsProvider.of(context).theme) {
|
|
|
|
case ThemeMap.cupertino:
|
2019-02-02 17:28:51 +01:00
|
|
|
return CupertinoPageScaffold(
|
|
|
|
navigationBar: CupertinoNavigationBar(
|
|
|
|
middle: CupertinoTextField(
|
|
|
|
placeholder: 'Type to search',
|
|
|
|
onChanged: (String value) {
|
|
|
|
//
|
|
|
|
},
|
|
|
|
onSubmitted: (String value) {
|
|
|
|
//
|
|
|
|
},
|
|
|
|
),
|
2019-01-23 12:52:51 +01:00
|
|
|
),
|
2019-02-02 17:28:51 +01:00
|
|
|
child: SafeArea(
|
|
|
|
child: Column(
|
|
|
|
children: <Widget>[
|
|
|
|
CupertinoSegmentedControl(
|
|
|
|
children: {0: Text('Repos'), 1: Text('Users')},
|
|
|
|
onValueChanged: (int value) {
|
|
|
|
//
|
|
|
|
},
|
|
|
|
),
|
|
|
|
ListView.builder(
|
|
|
|
shrinkWrap: true,
|
|
|
|
itemCount: users.length,
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
var user = users[index];
|
|
|
|
return Row(
|
|
|
|
children: <Widget>[
|
2019-02-08 12:34:07 +01:00
|
|
|
Image.network(user['avatarUrl']),
|
|
|
|
Text(user['login']),
|
2019-02-02 17:28:51 +01:00
|
|
|
],
|
|
|
|
);
|
|
|
|
},
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
2019-01-23 12:52:51 +01:00
|
|
|
),
|
2019-02-02 17:28:51 +01:00
|
|
|
);
|
2019-01-23 12:52:51 +01:00
|
|
|
|
2019-02-02 17:28:51 +01:00
|
|
|
default:
|
|
|
|
return Scaffold(
|
|
|
|
appBar: AppBar(title: Text('Search')),
|
|
|
|
body: ListView.builder(
|
|
|
|
itemCount: users.length,
|
|
|
|
itemBuilder: (context, index) => Text(''),
|
2019-01-23 12:52:51 +01:00
|
|
|
),
|
2019-02-02 17:28:51 +01:00
|
|
|
);
|
|
|
|
}
|
2019-01-23 12:52:51 +01:00
|
|
|
}
|
|
|
|
}
|