Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Splash Screen #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:flutter/material.dart';
import 'package:medium_blog_app/view/blogFeed.dart';
import 'package:medium_blog_app/view/splashView.dart';

void main() {
runApp(MyApp());
Expand All @@ -12,7 +12,7 @@ class MyApp extends StatelessWidget {
title: 'Medium Blog',
debugShowCheckedModeBanner: false,
theme: ThemeData(),
home: BlogFeed(),
home: SplashView(),
);
}
}
45 changes: 45 additions & 0 deletions lib/view/splashView.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:medium_blog_app/view/blogFeed.dart';

class SplashView extends StatefulWidget {
@override
_SplashViewState createState() => _SplashViewState();
}

class _SplashViewState extends State<SplashView> {
@override
void initState() {
Timer(
Duration(seconds: 3),
() => Navigator.of(context).push(MaterialPageRoute(
builder: (_) => BlogFeed(),
)));
super.initState();
}

@override
Widget build(BuildContext context) {
return Scaffold(
body: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Center(
child: Image.asset(
"assets/logo.png",
height: 100,
width: 100,
),
),
SizedBox(
height: 15,
),
Text(
"Medium Blog Feed",
style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
)
],
));
}
}
6 changes: 3 additions & 3 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.5.0"
version: "2.6.1"
boolean_selector:
dependency: transitive
description:
Expand Down Expand Up @@ -230,7 +230,7 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0"
version: "1.8.1"
stack_trace:
dependency: transitive
description:
Expand Down Expand Up @@ -265,7 +265,7 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.19"
version: "0.3.0"
typed_data:
dependency: transitive
description:
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ flutter:
uses-material-design: true

# To add assets to your application, add an assets section, like this:
# assets:
# - images/a_dot_burr.jpeg
assets:
- assets/
# - images/a_dot_ham.jpeg

# An image asset can refer to one or more resolution-specific "variants", see
Expand Down