Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'dart:async';
- import 'package:flutter/material.dart';
- import 'package:google_fonts/google_fonts.dart';
- void main() => runApp(MyApp());
- class MyApp extends StatelessWidget {
- @override
- Widget build(BuildContext context) {
- return MaterialApp(
- debugShowCheckedModeBanner: false,
- title: "Dictionary Medicine App",
- theme: ThemeData(
- primarySwatch: Colors.blue,
- ),
- home: OnBoardingPage(),
- );
- }
- }
- class SplashScren extends StatefulWidget {
- @override
- _SplashScrenState createState() => _SplashScrenState();
- }
- class _SplashScrenState extends State<SplashScren> {
- startTime() async {
- return new Timer(Duration(milliseconds: 4500), navigatorPage);
- }
- /// To navigate layout change
- void navigatorPage() {
- Navigator.push(context,
- MaterialPageRoute(builder: (BuildContext context) => OnBoardingPage()));
- }
- @override
- void initState() {
- super.initState();
- startTime();
- }
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- body: Center(
- child: Card(
- child: Container(
- width: 70,
- height: 70,
- padding: EdgeInsets.all(12),
- child: Image.asset('assets/dlogo.png'),
- ),
- ),
- ),
- );
- }
- }
- class OnBoardingPage extends StatelessWidget {
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- body: Container(
- width: MediaQuery.of(context).size.width,
- height: MediaQuery.of(context).size.height,
- decoration: BoxDecoration(
- gradient: LinearGradient(
- colors: [
- Colors.blue[500],
- Colors.blue[100],
- ],
- begin: Alignment.topCenter,
- end: Alignment.bottomCenter,
- ),
- ),
- child: Column(
- children: <Widget>[
- SizedBox(height: 100),
- Card(
- child: Container(
- width: 70,
- height: 70,
- padding: EdgeInsets.all(12),
- child: Image.asset('assets/dlogo.png'),
- ),
- ),
- SizedBox(height: 25),
- Container(
- width: 270,
- child: Text(
- "Welcome to Simple Dictionary Medicine Pro",
- textAlign: TextAlign.center,
- style: GoogleFonts.roboto(
- fontSize: 25,
- fontWeight: FontWeight.w400,
- textStyle: TextStyle(
- color: Colors.white,
- )),
- ),
- ),
- SizedBox(height: 70),
- Container(
- width: 270,
- child: Text(
- "The dictionary app you've been waiting for",
- textAlign: TextAlign.center,
- style: GoogleFonts.roboto(
- fontSize: 20,
- fontWeight: FontWeight.w300,
- textStyle: TextStyle(
- color: Colors.white,
- ),
- ),
- ),
- ),
- SizedBox(height: 100),
- SizedBox(
- width: 270,
- height: 50,
- child: RaisedButton(
- color: Color(0xFF1BC0c5),
- onPressed: () {},
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(16),
- ),
- child: Text(
- "Get Started",
- style: GoogleFonts.nunito(
- fontSize: 25,
- fontWeight: FontWeight.w700,
- textStyle: TextStyle(
- color: Colors.white,
- ),
- ),
- ),
- ),
- )
- ],
- ),
- ),
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement