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:
22
veggieseasons/lib/screens/details.dart
Normal file
22
veggieseasons/lib/screens/details.dart
Normal 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.'),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
22
veggieseasons/lib/screens/favorites.dart
Normal file
22
veggieseasons/lib/screens/favorites.dart
Normal 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.'),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
47
veggieseasons/lib/screens/home.dart
Normal file
47
veggieseasons/lib/screens/home.dart
Normal 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();
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
22
veggieseasons/lib/screens/list.dart
Normal file
22
veggieseasons/lib/screens/list.dart
Normal 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.'),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
22
veggieseasons/lib/screens/search.dart
Normal file
22
veggieseasons/lib/screens/search.dart
Normal 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.'),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
22
veggieseasons/lib/screens/settings.dart
Normal file
22
veggieseasons/lib/screens/settings.dart
Normal 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.'),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user