Skip to content

Commit

Permalink
Added Screens
Browse files Browse the repository at this point in the history
  • Loading branch information
insfirred committed Jun 14, 2022
1 parent 0c6492f commit 4d2c93e
Show file tree
Hide file tree
Showing 6 changed files with 110 additions and 80 deletions.
15 changes: 15 additions & 0 deletions lib/Screens/bookmarks.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import 'package:flutter/material.dart';

class Bookmarks extends StatefulWidget {
const Bookmarks({Key? key}) : super(key: key);

@override
State<Bookmarks> createState() => _BookmarksState();
}

class _BookmarksState extends State<Bookmarks> {
@override
Widget build(BuildContext context) {
return Center(child: Text('Bookmarks'));
}
}
64 changes: 64 additions & 0 deletions lib/Screens/newsList.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import 'package:flutter/material.dart';

class NewsList extends StatefulWidget {
const NewsList({Key? key}) : super(key: key);

@override
State<NewsList> createState() => _NewsListState();
}

class _NewsListState extends State<NewsList> {
String Heading = "Indian street food restaurant Chai Pani named best in US";
String description =
"It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).";

@override
Widget build(BuildContext context) {
return PageView.builder(
scrollDirection: Axis.vertical,
itemCount: 3,
itemBuilder: (context, index) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
height: MediaQuery.of(context).size.height / 3,
color: Colors.amber,
child: Image(
fit: BoxFit.fill,
image: AssetImage('assets/images/img.png')),
),
Expanded(
child: Container(
padding: EdgeInsets.all(15),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(18)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(Heading,
style: TextStyle(fontSize: 25),
textAlign: TextAlign.justify),
SizedBox(
height: 10,
),
Text(
description,
style: TextStyle(
color: Colors.grey[600], fontSize: 17),
textAlign: TextAlign.justify,
),
SizedBox(height: 15),
Text(
'swipe left for more info.',
style: TextStyle(color: Colors.grey, fontSize: 14),
textAlign: TextAlign.justify,
),
],
),
))
],
);
});
}
}
15 changes: 15 additions & 0 deletions lib/Screens/webView.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import 'package:flutter/material.dart';

class WebView extends StatefulWidget {
const WebView({Key? key}) : super(key: key);

@override
State<WebView> createState() => _WebViewState();
}

class _WebViewState extends State<WebView> {
@override
Widget build(BuildContext context) {
return Center(child: Text('WebView'),);
}
}
22 changes: 0 additions & 22 deletions lib/homeScreen.dart

This file was deleted.

19 changes: 16 additions & 3 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
import 'package:flutter/material.dart';

import './homeScreen.dart';
import './newsList.dart';
import './Screens/bookmarks.dart';
import './Screens/newsList.dart';
import './Screens/webView.dart';

void main() {
var controller = PageController(initialPage: 1);
runApp(MaterialApp(
title: 'Flutter Demo',
themeMode: ThemeMode.system,
theme: ThemeData.light(),
darkTheme: ThemeData.dark(),
home: HomeScreen(),
home: SafeArea(
child: Scaffold(
body: PageView(
controller: controller,
children: [
Bookmarks(),
NewsList(),
WebView(),
],
),
),
),
));
}

55 changes: 0 additions & 55 deletions lib/newsList.dart

This file was deleted.

0 comments on commit 4d2c93e

Please sign in to comment.