-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Andrew Julow
authored and
Andrew Julow
committed
May 12, 2020
1 parent
58ab25d
commit 82ac869
Showing
4 changed files
with
75 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,38 @@ | ||
import 'package:farmers_market/src/screens/landing.dart'; | ||
import 'package:farmers_market/src/screens/login.dart'; | ||
import 'package:farmers_market/src/screens/signup.dart'; | ||
import 'package:farmers_market/src/screens/vendor.dart'; | ||
import 'package:flutter/cupertino.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
abstract class Routes { | ||
|
||
static MaterialPageRoute materialRoutes(RouteSettings settings){ | ||
switch(settings.name){ | ||
static MaterialPageRoute materialRoutes(RouteSettings settings) { | ||
switch (settings.name) { | ||
case "/landing": | ||
return MaterialPageRoute(builder: (context) => Landing()); | ||
return MaterialPageRoute(builder: (context) => Landing()); | ||
case "/signup": | ||
return MaterialPageRoute(builder: (context) => Signup()); | ||
return MaterialPageRoute(builder: (context) => Signup()); | ||
case "/login": | ||
return MaterialPageRoute(builder: (context) => Login()); | ||
return MaterialPageRoute(builder: (context) => Login()); | ||
case "/vendor": | ||
return MaterialPageRoute(builder: (context) => Vendor()); | ||
default: | ||
return MaterialPageRoute(builder: (context) => Login()); | ||
return MaterialPageRoute(builder: (context) => Login()); | ||
} | ||
} | ||
|
||
static CupertinoPageRoute cupertinoRoutes(RouteSettings settings){ | ||
switch(settings.name){ | ||
static CupertinoPageRoute cupertinoRoutes(RouteSettings settings) { | ||
switch (settings.name) { | ||
case "/landing": | ||
return CupertinoPageRoute(builder: (context) => Landing()); | ||
return CupertinoPageRoute(builder: (context) => Landing()); | ||
case "/signup": | ||
return CupertinoPageRoute(builder: (context) => Signup()); | ||
return CupertinoPageRoute(builder: (context) => Signup()); | ||
case "/login": | ||
return CupertinoPageRoute(builder: (context) => Login()); | ||
return CupertinoPageRoute(builder: (context) => Login()); | ||
case "/vendor": | ||
return CupertinoPageRoute(builder: (context) => Vendor()); | ||
default: | ||
return CupertinoPageRoute(builder: (context) => Login()); | ||
return CupertinoPageRoute(builder: (context) => Login()); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,30 @@ | ||
import 'package:farmers_market/src/widgets/button.dart'; | ||
import 'package:flutter/cupertino.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'dart:io'; | ||
|
||
class Landing extends StatelessWidget{ | ||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold(body: Center(child: Text('Landing'),)); | ||
if (Platform.isIOS){ | ||
return CupertinoPageScaffold( | ||
child: pageBody(context), | ||
); | ||
} else { | ||
return Scaffold(body:pageBody(context)); | ||
} | ||
} | ||
|
||
Widget pageBody(BuildContext context){ | ||
return Column( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
children: <Widget>[ | ||
AppButton( | ||
buttonText: 'Vendor Page', | ||
buttonType: ButtonType.Straw, | ||
onPressed: () => Navigator.pushNamed(context, '/vendor'), | ||
) | ||
], | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import 'package:farmers_market/src/widgets/navbar.dart'; | ||
import 'package:flutter/cupertino.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'dart:io'; | ||
|
||
class Vendor extends StatelessWidget { | ||
@override | ||
Widget build(BuildContext context) { | ||
|
||
if (Platform.isIOS) { | ||
return CupertinoPageScaffold( | ||
child: NestedScrollView( | ||
headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled){ | ||
return <Widget> [ | ||
AppNavbar.cupertinoNavBar(title: 'Vendor Name', context:context), | ||
]; | ||
}, | ||
body: Center(child: Text('Placeholder'),)), | ||
); | ||
} else { | ||
return Center(child: Scaffold(body: Text('Material'),)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import 'package:flutter/cupertino.dart'; | ||
|
||
abstract class AppNavbar { | ||
|
||
static CupertinoSliverNavigationBar cupertinoNavBar ({String title, BuildContext context}) { | ||
return CupertinoSliverNavigationBar( | ||
largeTitle: Text(title), | ||
); | ||
} | ||
} |