Advertisement
yocky12k

belajar widget 3

Oct 31st, 2023
1,161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 11.63 KB | None | 0 0
  1. import 'package:flutter/material.dart';
  2.  
  3. void main() {
  4.   runApp(const MainApp());
  5. }
  6.  
  7. class MainApp extends StatelessWidget {
  8.   const MainApp({super.key});
  9.  
  10.   @override
  11.   Widget build(BuildContext context) {
  12.     return MaterialApp(
  13.       debugShowCheckedModeBanner: false,
  14.       home: DefaultTabController(
  15.         length: 3,
  16.         child: Scaffold(
  17.           appBar: AppBar(
  18.             title: Text('Latihan Widget 3'),
  19.             actions: [
  20.               PopupMenuButton(
  21.                 onSelected: (value) {
  22.                   //logika ketika menu di tekan
  23.                 },
  24.                 itemBuilder: (context) {
  25.                   return <PopupMenuEntry>[
  26.                     PopupMenuItem(
  27.                       value: 'menu 1',
  28.                       child: Text('Chats'),
  29.                     ),
  30.                     PopupMenuItem(
  31.                       value: 'menu 2',
  32.                       child: Text('Status'),
  33.                     ),
  34.                     PopupMenuItem(
  35.                       value: 'menu 3',
  36.                       child: Text('Call'),
  37.                     ),
  38.                   ];
  39.                 },
  40.               ),
  41.             ],
  42.             bottom: TabBar(
  43.               tabs: [
  44.                 Tab(text: 'Chats'),
  45.                 Tab(text: 'Status'),
  46.                 Tab(text: 'Call'),
  47.               ],
  48.             ),
  49.           ),
  50.           body: TabBarView(
  51.             children: [
  52.               ListView(
  53.                 children: [
  54.                   ListTile(
  55.                     leading: Icon(Icons.person),
  56.                     title: Text('AULIA'),
  57.                     onTap: () {
  58.                       //logic ketika di tekan
  59.                     },
  60.                   ),
  61.                   ListTile(
  62.                     leading: Icon(Icons.person),
  63.                     title: Text('PIAN'),
  64.                     onTap: () {
  65.                       //logic ketika di tekan
  66.                     },
  67.                   ),
  68.                   ListTile(
  69.                     leading: Icon(Icons.person),
  70.                     title: Text('DAENG'),
  71.                     onTap: () {
  72.                       //logic ketika di tekan
  73.                     },
  74.                   ),
  75.                   ListTile(
  76.                     leading: Icon(Icons.person),
  77.                     title: Text('RARA'),
  78.                     onTap: () {
  79.                       //logic ketika di tekan
  80.                     },
  81.                   ),
  82.                   ListTile(
  83.                     leading: Icon(Icons.person),
  84.                     title: Text('ZILAN'),
  85.                     onTap: () {
  86.                       //logic ketika di tekan
  87.                     },
  88.                   ),
  89.                   ListTile(
  90.                     leading: Icon(Icons.person),
  91.                     title: Text('JAFAR'),
  92.                     onTap: () {
  93.                       //logic ketika di tekan
  94.                     },
  95.                   ),
  96.                   ListTile(
  97.                     leading: Icon(Icons.person),
  98.                     title: Text('RAHMAT'),
  99.                     onTap: () {
  100.                       //logic ketika di tekan
  101.                     },
  102.                   ),
  103.                   ListTile(
  104.                     leading: Icon(Icons.person),
  105.                     title: Text('INNA'),
  106.                     onTap: () {
  107.                       //logic ketika di tekan
  108.                     },
  109.                   ),
  110.                   ListTile(
  111.                     leading: Icon(Icons.person),
  112.                     title: Text('LESRIANTO'),
  113.                     onTap: () {
  114.                       //logic ketika di tekan
  115.                     },
  116.                   ),
  117.                   ListTile(
  118.                     leading: Icon(Icons.person),
  119.                     title: Text('BAGUS'),
  120.                     onTap: () {
  121.                       //logic ketika di tekan
  122.                     },
  123.                   ),
  124.                   ListTile(
  125.                     leading: Icon(Icons.person),
  126.                     title: Text('SALEM'),
  127.                     onTap: () {
  128.                       //logic ketika di tekan
  129.                     },
  130.                   ),
  131.                   ListTile(
  132.                     leading: Icon(Icons.person),
  133.                     title: Text('HANNY'),
  134.                     onTap: () {
  135.                       //logic ketika di tekan
  136.                     },
  137.                   ),
  138.                   ListTile(
  139.                     leading: Icon(Icons.person),
  140.                     title: Text('TANIA'),
  141.                     onTap: () {
  142.                       //logic ketika di tekan
  143.                     },
  144.                   ),
  145.                   ListTile(
  146.                     leading: Icon(Icons.person),
  147.                     title: Text('AFIF'),
  148.                     onTap: () {
  149.                       //logic ketika di tekan
  150.                     },
  151.                   ),
  152.                   ListTile(
  153.                     leading: Icon(Icons.person),
  154.                     title: Text('RAVI'),
  155.                     onTap: () {
  156.                       //logic ketika di tekan
  157.                     },
  158.                   ),
  159.                 ],
  160.               ),
  161.               Container(
  162.                 color: Colors.blueGrey,
  163.                 child: ListView(
  164.                   children: [
  165.                     ListTile(
  166.                       leading: Icon(
  167.                         Icons.circle,
  168.                         size: 50,
  169.                       ),
  170.                       title: Text('KHOLIZA'),
  171.                       subtitle: Text('1 menit yang lalu'),
  172.                       textColor: Colors.white,
  173.                       iconColor: Colors.white,
  174.                     ),
  175.                     ListTile(
  176.                       leading: Icon(
  177.                         Icons.circle,
  178.                         size: 50,
  179.                       ),
  180.                       title: Text('PIAN'),
  181.                       subtitle: Text('2 menit yang lalu'),
  182.                       textColor: Colors.white,
  183.                       iconColor: Colors.white,
  184.                     ),
  185.                     ListTile(
  186.                       leading: Icon(
  187.                         Icons.circle,
  188.                         size: 50,
  189.                       ),
  190.                       title: Text('RAFLY'),
  191.                       subtitle: Text('4 menit yang lalu'),
  192.                       textColor: Colors.white,
  193.                       iconColor: Colors.white,
  194.                     ),
  195.                     ListTile(
  196.                       leading: Icon(
  197.                         Icons.circle,
  198.                         size: 50,
  199.                       ),
  200.                       title: Text('FAJAR'),
  201.                       subtitle: Text('3 menit yang lalu'),
  202.                       textColor: Colors.white,
  203.                       iconColor: Colors.white,
  204.                     ),
  205.                     ListTile(
  206.                       leading: Icon(
  207.                         Icons.circle,
  208.                         size: 50,
  209.                       ),
  210.                       title: Text('SASA'),
  211.                       subtitle: Text('1 menit yang lalu'),
  212.                       textColor: Colors.white,
  213.                       iconColor: Colors.white,
  214.                     ),
  215.                     ListTile(
  216.                       leading: Icon(
  217.                         Icons.circle,
  218.                         size: 50,
  219.                       ),
  220.                       title: Text('AFIF'),
  221.                       subtitle: Text('1 menit yang lalu'),
  222.                       textColor: Colors.white,
  223.                       iconColor: Colors.white,
  224.                     ),
  225.                     ListTile(
  226.                       leading: Icon(
  227.                         Icons.circle,
  228.                         size: 50,
  229.                       ),
  230.                       title: Text('RAVI'),
  231.                       subtitle: Text('2 menit yang lalu'),
  232.                       textColor: Colors.white,
  233.                       iconColor: Colors.white,
  234.                     ),
  235.                     ListTile(
  236.                       leading: Icon(
  237.                         Icons.circle,
  238.                         size: 50,
  239.                       ),
  240.                       title: Text('AZMI'),
  241.                       subtitle: Text('4 menit yang lalu'),
  242.                       textColor: Colors.white,
  243.                       iconColor: Colors.white,
  244.                     ),
  245.                     ListTile(
  246.                       leading: Icon(
  247.                         Icons.circle,
  248.                         size: 50,
  249.                       ),
  250.                       title: Text('TANIA'),
  251.                       subtitle: Text('3 menit yang lalu'),
  252.                       textColor: Colors.white,
  253.                       iconColor: Colors.white,
  254.                     ),
  255.                     ListTile(
  256.                       leading: Icon(
  257.                         Icons.circle,
  258.                         size: 50,
  259.                       ),
  260.                       title: Text('PUTRI'),
  261.                       subtitle: Text('1 menit yang lalu'),
  262.                       textColor: Colors.white,
  263.                       iconColor: Colors.white,
  264.                     ),
  265.                     ListTile(
  266.                       leading: Icon(
  267.                         Icons.circle,
  268.                         size: 50,
  269.                       ),
  270.                       title: Text('NOCA'),
  271.                       subtitle: Text('1 menit yang lalu'),
  272.                       textColor: Colors.white,
  273.                       iconColor: Colors.white,
  274.                     ),
  275.                     ListTile(
  276.                       leading: Icon(
  277.                         Icons.circle,
  278.                         size: 50,
  279.                       ),
  280.                       title: Text('NOVI'),
  281.                       subtitle: Text('2 menit yang lalu'),
  282.                       textColor: Colors.white,
  283.                       iconColor: Colors.white,
  284.                     ),
  285.                     ListTile(
  286.                       leading: Icon(
  287.                         Icons.circle,
  288.                         size: 50,
  289.                       ),
  290.                       title: Text('FEBRI'),
  291.                       subtitle: Text('4 menit yang lalu'),
  292.                       textColor: Colors.white,
  293.                       iconColor: Colors.white,
  294.                     ),
  295.                     ListTile(
  296.                       leading: Icon(
  297.                         Icons.circle,
  298.                         size: 50,
  299.                       ),
  300.                       title: Text('FEBRIKA'),
  301.                       subtitle: Text('3 menit yang lalu'),
  302.                       textColor: Colors.white,
  303.                       iconColor: Colors.white,
  304.                     ),
  305.                     ListTile(
  306.                       leading: Icon(
  307.                         Icons.circle,
  308.                         size: 50,
  309.                       ),
  310.                       title: Text('AYU'),
  311.                       subtitle: Text('1 menit yang lalu'),
  312.                       textColor: Colors.white,
  313.                       iconColor: Colors.white,
  314.                     ),
  315.                   ],
  316.                 ),
  317.               ),
  318.               Center(
  319.                 child: Text('Tidak ada riwayat panggilan'),
  320.               )
  321.             ],
  322.           ),
  323.           bottomNavigationBar: Container(
  324.             color: Colors.blue,
  325.             child: TabBar(
  326.               tabs: [
  327.                 Tab(icon: Icon(Icons.chat),
  328.                 ),
  329.                 Tab(icon: Icon(Icons.image),
  330.                 ),
  331.                 Tab(icon: Icon(Icons.call),
  332.                 ),
  333.               ],
  334.             ),
  335.           ),
  336.         ),
  337.       ),
  338.     );
  339.   }
  340. }
  341.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement