Giter VIP home page Giter VIP logo

tugas's Introduction

Tugas Liburan

Eudeka OSG4 - UI / UX Flutte Aplication

Page Home

Page About

main.dart


 
import 'dart:io';

import 'package:flutter/material.dart';

import './hal_home.dart' as hal_home;
import './hal_about.dart' as hal_about;

void main() {
  runApp(new MaterialApp(
    title: "Tab Bar",
    home: new Home(),
  ));
}

class Home extends StatefulWidget {
  @override
  _HomeState createState() => _HomeState();
}

class _HomeState extends State with SingleTickerProviderStateMixin {
  TabController controller;

  @override
  void initState() {
    controller = new TabController(length: 2, vsync: this);
    super.initState();
  }

  @override
  void dispose() {
    controller.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(
        backgroundColor: Colors.red[400],
        title: new Text("Eudeka - OSG4"),
        leading: Icon(Icons.android),
        actions: [
          IconButton(
            icon: Icon(Icons.local_bar),
            onPressed: (){

            },
          )
        ],
      ),
      body: new TabBarView(
        controller: controller,
        children: [
          new hal_home.Home(),
          new hal_about.About(),
        ],
      ),
      bottomNavigationBar: new Material(
        color: Colors.red[400],
        child: new TabBar(
          controller: controller,
          tabs: [
            new Tab(
              icon: new Icon(Icons.home),
              text: "Home",
            ),
            new Tab(
              icon: new Icon(Icons.people),
              text: "About",
            ),
          ],
        ),
      ),
      floatingActionButton: Builder(builder: (context) {
        return FloatingActionButton(
          child: Icon(Icons.exit_to_app),
          onPressed: () {
            return showDialog(
                context: context,
                barrierDismissible: false,
                builder: (context) {
                  return AlertDialog(
                    title: Text('Peringatan'),
                    content: Text('Apakah Yakin akan keluar?'),
                    actions: [
                      FlatButton(
                        child: Text('TIDAK'),
                        onPressed: () {
                          Navigator.pop(context);
                        },
                      ),
                      FlatButton(
                        child: Text('YA'),
                        onPressed: () {
                          exit(0);
                        },
                      )
                    ],
                  );
                });
          },
        );
      }),
    );
  }
}

hal_home.dart



import 'package:flutter/material.dart';

class Home extends StatelessWidget {
  final List titles = [
    'Flutter',
    'react native',
    'java',
    'kotlin',
    'swift'
  ];

  final List subtitles = [
    'flutter adalah SDK untuk pengembangan aplikasi mobile yang dikembangkan oleh Google',
    'React Native adalah sebuah framework javascript yang di kembang kan oleh facebook dan memungkin kan kita membuat aplikasi mobile android atau ios menggunakan teknologi web',
    'Java adalah bahasa pemrograman yang dapat dijalankan di berbagai komputer termasuk telepon genggam',
    'Google kini telah memberikan dukungan penuh untuk bahasa pemrograman Kotlin. Android Studio 3.0 yang akan segera diluncurkan dalam waktu dekat nantinya akan langsung mendukung bahasa pemrograman Kotlin.',
    'Swift adalah bahasa pemrograman objek fungsional untuk pengembangan iOS dan OS X yang dibuat oleh Apple.'
  ];


  final List images = [
    'https://cdn-images-1.medium.com/max/2400/1*73IgUxPfyXUKZAaIXgutrw.png',
    'https://ds1hty5qgiz73.cloudfront.net/wp-content/uploads/2018/12/2018-12-06.jpg',
    'https://cdn-images-1.medium.com/max/1200/1*E4CO83SmCCrvRrge7U3Ahw.jpeg',
    'https://i.udemycdn.com/course/750x422/2099848_c9db.jpg',
    'http://www.developersacademy.org/blog/wp-content/uploads/2018/05/wc-swift.jpg'
  ];

  @override
  Widget build(BuildContext context) {
    return Container(
        child: ListView.builder(
          itemCount: titles.length,
          itemBuilder: (context, index) {
            return Card(
                child: ListTile(
                  title: Text(titles[index],style: new TextStyle(fontSize: 20.0)),
                  subtitle: Text(subtitles[index],style: new TextStyle(fontSize: 15.0)),
                  leading: Image.network(images[index])
                ),
            );
          },
        )
    );
  }


}

hal_about.dart



import 'package:flutter/material.dart';

class About extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Container(
      child: new Column(
        children: [
          new Container(
             child: Card(
              margin: EdgeInsets.all(10),
               child: Image(image : new NetworkImage("https://pbs.twimg.com/profile_images/2250340911/577168_3422605636996_1025859888_32529160_1367636733_n_400x400.jpg")),
             ),
          ),

          new Container(
            margin: EdgeInsets.all(5),
            child: new Column(
              children: [
                Text("Kode : OSG04010", style: new TextStyle(fontSize: 20.0),),
                Text("Nama : Ilham Maulana", style: new TextStyle(fontSize: 20.0),),
                Text("Email : [email protected]", style: new TextStyle(fontSize: 20.0),),
              ],
            ),
          ),

        ],
      ),
    );
  }
}

Terima Kasih

Kode : OSG04010 Nama : Ilham Maulana Email: [email protected]

tugas's People

Contributors

k4ilham avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.