2018-04-20 18:59:26 +02:00
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'home.dart';
|
2018-04-21 14:50:46 +02:00
|
|
|
import 'notification.dart';
|
|
|
|
import 'profile.dart';
|
2018-04-20 18:59:26 +02:00
|
|
|
|
|
|
|
class IosApp extends StatelessWidget {
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return new MaterialApp(
|
|
|
|
title: 'Flutter Demo',
|
|
|
|
theme: new ThemeData(
|
|
|
|
primarySwatch: Colors.blue,
|
|
|
|
),
|
|
|
|
home: new IosHomePage(title: 'GitFlux'),
|
2018-04-21 14:50:46 +02:00
|
|
|
routes: {
|
|
|
|
// '/notification': (context) => new IosNotificationTab(),
|
|
|
|
// '/profile': (context) => new IosProfileTab(),
|
|
|
|
},
|
2018-04-20 18:59:26 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class IosHomePage extends StatefulWidget {
|
|
|
|
IosHomePage({Key key, this.title}) : super(key: key);
|
|
|
|
|
|
|
|
final String title;
|
|
|
|
|
|
|
|
@override
|
|
|
|
_IosHomePageState createState() => new _IosHomePageState();
|
|
|
|
}
|
|
|
|
|
|
|
|
class _IosHomePageState extends State<IosHomePage> {
|
|
|
|
// int _counter = 0;
|
|
|
|
|
|
|
|
// void _incrementCounter() {
|
|
|
|
// setState(() {
|
|
|
|
// _counter++;
|
|
|
|
// });
|
|
|
|
// }
|
|
|
|
|
|
|
|
@override
|
2018-04-21 14:50:46 +02:00
|
|
|
Widget build(context) {
|
2018-04-20 18:59:26 +02:00
|
|
|
return new CupertinoPageScaffold(
|
|
|
|
navigationBar: new CupertinoNavigationBar(
|
|
|
|
middle: new Text(widget.title),
|
|
|
|
),
|
|
|
|
child: new CupertinoTabScaffold(
|
2018-04-21 14:50:46 +02:00
|
|
|
tabBar: new CupertinoTabBar(
|
|
|
|
items: const <BottomNavigationBarItem>[
|
|
|
|
const BottomNavigationBarItem(
|
|
|
|
icon: const Icon(CupertinoIcons.home),
|
|
|
|
title: const Text('Home'),
|
|
|
|
),
|
|
|
|
const BottomNavigationBarItem(
|
|
|
|
icon: const Icon(CupertinoIcons.conversation_bubble),
|
|
|
|
title: const Text('Notification'),
|
|
|
|
),
|
|
|
|
const BottomNavigationBarItem(
|
|
|
|
icon: const Icon(CupertinoIcons.profile_circled),
|
|
|
|
title: const Text('Profile'),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
tabBuilder: (context, int index) {
|
|
|
|
return new DefaultTextStyle(
|
|
|
|
style: const TextStyle(
|
|
|
|
fontFamily: '.SF UI Text',
|
|
|
|
fontSize: 17.0,
|
|
|
|
color: CupertinoColors.black,
|
|
|
|
),
|
|
|
|
child: new CupertinoTabView(
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
switch (index) {
|
|
|
|
case 0:
|
|
|
|
return new IosHomeTab();
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
return new IosNotificationTab();
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
return new IosProfileTab();
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
}
|
|
|
|
},
|
|
|
|
),
|
|
|
|
);
|
|
|
|
},
|
|
|
|
),
|
2018-04-20 18:59:26 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|