Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'package:flutter/material.dart';
- import 'package:chewie/chewie.dart';
- import 'package:video_player/video_player.dart';
- import 'featured.dart';
- import 'profile.dart';
- import 'package:flutter/cupertino.dart';
- void main() => runApp(RambleApp());
- class RambleApp extends StatelessWidget {
- // This widget is the root of your application.
- @override
- Widget build(BuildContext context) {
- return MaterialApp(
- title: "Title",
- home: VideoBG(),
- );
- }
- }
- class VideoBG extends StatefulWidget {
- @override
- VideoState createState() => VideoState();
- }
- class VideoState extends State<VideoBG> {
- VideoPlayerController _controller;
- @override
- void initState() {
- super.initState();
- _controller = new VideoPlayerController.asset('assets/Video.mp4');
- }
- @override
- Widget build(BuildContext context) {
- return new Stack(
- fit: StackFit.passthrough,
- children: [
- new ClipRect(
- child: new OverflowBox(
- maxWidth: double.infinity,
- maxHeight: double.infinity,
- alignment: Alignment.center,
- child: new FittedBox(
- fit: BoxFit.cover,
- alignment: Alignment.center,
- child: new Container(
- child: new Chewie( //video player
- _controller,
- autoPlay: true,
- looping: true,
- autoInitialize: true,
- showControls: false,
- ),
- ),
- ),
- ),
- ),
- new Container(
- margin: EdgeInsets.all(40.0),
- decoration: BoxDecoration(
- image: DecorationImage(
- alignment: Alignment(0.0, -0.75),
- image: AssetImage('assets/title.png')
- ),
- ),
- ),
- new Container(
- alignment: new Alignment(0.0, 0.65),
- child: new Row(
- crossAxisAlignment: CrossAxisAlignment.center,
- mainAxisAlignment: MainAxisAlignment.spaceEvenly,
- children: <Widget>[
- new Container(
- child: new FlatButton(
- child: new Text(
- 'TEXT ONE',
- style: new TextStyle(
- fontWeight: FontWeight.w900,
- fontSize: 17.5,
- ),
- ),
- color: Color(0xFF70E0EF),
- shape: new RoundedRectangleBorder(
- borderRadius: new BorderRadius.circular(7.5)
- ),
- onPressed: () {
- _controller.pause();
- Navigator.push(
- context,
- new MaterialPageRoute(builder: (context) => new FeaturedScreen()),
- );
- },
- ),
- width: 150.0,
- height: 60.0,
- ),
- new Container(
- child: new OutlineButton(
- child: new Text(
- 'TEXT TWO',
- style: new TextStyle(
- fontWeight: FontWeight.w900,
- fontSize: 17.5,
- ),
- ),
- borderSide: new BorderSide(
- color: const Color(0xFF70E0EF),
- width: 5.0,
- style: BorderStyle.solid,
- ),
- shape: new RoundedRectangleBorder(
- borderRadius: new BorderRadius.circular(7.5),
- ),
- onPressed: () {
- _controller.pause();
- Navigator.push(
- context,
- new MaterialPageRoute(builder: (context) => new ProfileScreen()),
- );
- },
- ),
- width: 150.0,
- height: 60.0,
- ),
- ],
- ),
- ),
- ],
- );
- }
- }
- import 'package:flutter/material.dart';
- import 'profile.dart';
- import 'search.dart';
- import 'favorites.dart';
- class FeaturedScreen extends StatelessWidget {
- @override
- Widget build(BuildContext context) {
- return MaterialApp(
- home: Featured(),
- theme: new ThemeData(canvasColor: Color(0xffffffff).withOpacity(0.5)),
- );
- }
- }
- class Featured extends StatefulWidget {
- @override
- FeaturedState createState() => FeaturedState();
- }
- class FeaturedState extends State<Featured>{
- int i = 0;
- var pages = [
- new FeaturedScreen(),
- new ProfileScreen(),
- new SearchScreen(),
- new FavoritesScreen(),
- ];
- @override
- Widget build(BuildContext context) {
- return Stack(
- fit: StackFit.passthrough,
- children: [
- new Container(
- decoration: new BoxDecoration(
- image: new DecorationImage(
- image: new AssetImage('assets/FeaturedBG.png'),
- fit: BoxFit.cover
- ),
- ),
- ),
- new Scaffold(
- body: pages[i],
- bottomNavigationBar: BottomNavigationBar(
- items: <BottomNavigationBarItem>[
- BottomNavigationBarItem(
- icon: i==0?Icon(
- Icons.apps,
- color: Color(0xff70E0EF),
- size: 35.0,
- ):Icon(
- Icons.apps,
- color: Colors.black,
- size: 35.0,
- ),
- title: Text(
- 'Collections',
- style: new TextStyle(
- color: Colors.white,
- fontSize: 0.0,
- height: 0.0,
- ),
- ),
- ),
- BottomNavigationBarItem(
- icon: i==1?Icon(
- Icons.search,
- color: Color(0xff70E0EF),
- size: 35.0,
- ):Icon(
- Icons.search,
- color: Colors.black,
- size: 35.0,
- ),
- title: Text(
- 'Search',
- style: new TextStyle(
- color: Colors.white,
- fontSize: 0.0,
- height: 0.0,
- ),
- ),
- ),
- BottomNavigationBarItem(
- icon: i==2?Icon(
- Icons.favorite,
- color: Color(0xff70E0EF),
- size: 35.0,
- ):Icon(
- Icons.favorite,
- color: Colors.black,
- size: 35.0,
- ),
- title: Text(
- 'Favorites',
- style: new TextStyle(
- color: Colors.white,
- fontSize: 0.0,
- height: 0.0,
- ),
- ),
- ),
- BottomNavigationBarItem(
- icon: i==3?Icon(
- Icons.person,
- color: Color(0xff70E0EF),
- size: 35.0,
- ):Icon(
- Icons.person,
- color: Colors.black,
- size: 35.0,
- ),
- title: Text(
- 'Profile',
- style: new TextStyle(
- color: Colors.white,
- fontSize: 0.0,
- height: 0.0,
- ),
- ),
- ),
- ],
- type: BottomNavigationBarType.fixed,
- currentIndex: i,
- onTap: (int index) {
- setState((){
- i = index;
- });
- },
- ),
- ),
- ],
- );
- }
- }
Add Comment
Please, Sign In to add comment