1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-13 00:08:24 +00:00

Adds the start of a new sample showcasing Cupertino widgets. (#12)

This commit is contained in:
Andrew Brogdon
2018-08-31 15:08:33 -07:00
committed by GitHub
parent 9d5686ae13
commit 928c40c097
68 changed files with 1822 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
// Copyright 2018 The Flutter team. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/cupertino.dart';
import 'package:flutter/widgets.dart';
import 'package:veggieseasons/styles.dart';
class DetailsScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
middle: Text('Details'),
),
backgroundColor: Styles.scaffoldBackground,
child: Center(
child: Text('Not yet implemented.'),
),
);
}
}

View File

@@ -0,0 +1,22 @@
// Copyright 2018 The Flutter team. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/cupertino.dart';
import 'package:flutter/widgets.dart';
import 'package:veggieseasons/styles.dart';
class FavoritesScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
middle: Text('My Garden'),
),
backgroundColor: Styles.scaffoldBackground,
child: Center(
child: Text('Not yet implemented.'),
),
);
}
}

View File

@@ -0,0 +1,47 @@
// Copyright 2018 The Flutter team. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/cupertino.dart';
import 'package:flutter/widgets.dart';
import 'package:veggieseasons/screens/favorites.dart';
import 'package:veggieseasons/screens/list.dart';
import 'package:veggieseasons/screens/search.dart';
import 'package:veggieseasons/screens/settings.dart';
class HomeScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return CupertinoTabScaffold(
tabBar: CupertinoTabBar(items: [
BottomNavigationBarItem(
icon: Icon(CupertinoIcons.home),
title: Text('Home'),
),
BottomNavigationBarItem(
icon: Icon(CupertinoIcons.book),
title: Text('My Garden'),
),
BottomNavigationBarItem(
icon: Icon(CupertinoIcons.search),
title: Text('Search'),
),
BottomNavigationBarItem(
icon: Icon(CupertinoIcons.settings),
title: Text('Settings'),
),
]),
tabBuilder: (context, index) {
if (index == 0) {
return ListScreen();
} else if (index == 1) {
return FavoritesScreen();
} else if (index == 2) {
return SearchScreen();
} else {
return SettingsScreen();
}
},
);
}
}

View File

@@ -0,0 +1,22 @@
// Copyright 2018 The Flutter team. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/cupertino.dart';
import 'package:flutter/widgets.dart';
import 'package:veggieseasons/styles.dart';
class ListScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
middle: Text('List'),
),
backgroundColor: Styles.scaffoldBackground,
child: Center(
child: Text('Not yet implemented.'),
),
);
}
}

View File

@@ -0,0 +1,22 @@
// Copyright 2018 The Flutter team. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/cupertino.dart';
import 'package:flutter/widgets.dart';
import 'package:veggieseasons/styles.dart';
class SearchScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
middle: Text('Search'),
),
backgroundColor: Styles.scaffoldBackground,
child: Center(
child: Text('Not yet implemented.'),
),
);
}
}

View File

@@ -0,0 +1,22 @@
// Copyright 2018 The Flutter team. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/cupertino.dart';
import 'package:flutter/widgets.dart';
import 'package:veggieseasons/styles.dart';
class SettingsScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
middle: Text('Settings'),
),
backgroundColor: Styles.scaffoldBackground,
child: Center(
child: Text('Not yet implemented.'),
),
);
}
}