1
0
mirror of https://github.com/git-touch/git-touch synced 2024-12-15 01:45:05 +01:00

feat(gitee): empty search screen

This commit is contained in:
Rongjian Zhang 2020-11-02 00:32:47 +08:00
parent 895f4792d6
commit db035601de
3 changed files with 31 additions and 2 deletions

View File

@ -21,6 +21,7 @@ import 'package:provider/provider.dart';
import 'package:git_touch/screens/gh_news.dart';
import 'package:git_touch/screens/gh_search.dart';
import 'package:git_touch/screens/gh_trending.dart';
import 'package:git_touch/screens/ge_search.dart';
class Home extends StatefulWidget {
@override
@ -91,6 +92,7 @@ class _HomeState extends State<Home> {
case PlatformType.gitee:
switch (index) {
case 0:
return GeSearchScreen();
case 1:
return GeUserScreen(auth.activeAccount.login, isViewer: true);
}
@ -187,8 +189,7 @@ class _HomeState extends State<Home> {
break;
case PlatformType.gitee:
navigationItems = [
BottomNavigationBarItem(
icon: Icon(Icons.group), label: 'Organizations'),
BottomNavigationBarItem(icon: Icon(Icons.search), label: 'Search'),
BottomNavigationBarItem(icon: Icon(Icons.person), label: 'Me'),
];
break;

View File

@ -10,6 +10,7 @@ import 'package:git_touch/screens/ge_blob.dart';
import 'package:git_touch/screens/ge_commits.dart';
import 'package:git_touch/screens/ge_repo.dart';
import 'package:git_touch/screens/ge_repos.dart';
import 'package:git_touch/screens/ge_search.dart';
import 'package:git_touch/screens/ge_tree.dart';
import 'package:git_touch/screens/ge_user.dart';
import 'package:git_touch/screens/ge_users.dart';
@ -382,6 +383,7 @@ class BitbucketRouter {
class GiteeRouter {
static const prefix = '/gitee';
static final routes = [
GiteeRouter.search,
GiteeRouter.user,
GiteeRouter.repo,
GiteeRouter.stargazers,
@ -391,6 +393,9 @@ class GiteeRouter {
GiteeRouter.tree,
GiteeRouter.blob,
];
static final search = RouterScreen('/search', (context, parameters) {
return GeSearchScreen();
});
static final user = RouterScreen('/:login', (context, p) {
final login = p['login'].first;
final tab = p['tab']?.first;

View File

@ -0,0 +1,23 @@
import 'package:flutter/material.dart';
import 'package:git_touch/scaffolds/refresh_stateful.dart';
import 'package:git_touch/widgets/app_bar_title.dart';
class GeSearchScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return RefreshStatefulScaffold<String>(
title: AppBarTitle('Search'),
fetch: () async {
return '';
},
bodyBuilder: (content, _) {
return Center(
child: Container(
padding: EdgeInsets.symmetric(vertical: 20),
child: Text('Coming soon...'),
),
);
},
);
}
}