Skip to content

Instantly share code, notes, and snippets.

@CoderJava
Created December 19, 2020 15:59
Show Gist options
  • Select an option

  • Save CoderJava/f515f4564076edbfdbe478665efb75f0 to your computer and use it in GitHub Desktop.

Select an option

Save CoderJava/f515f4564076edbfdbe478665efb75f0 to your computer and use it in GitHub Desktop.
Flutter Instagram Desktop (rev 4)
import 'package:flutter/material.dart';
final color1 = Color(0xFF282A34);
final color2 = Color(0XFF3C3F51);
final color3 = Color(0xFFE2336B);
final color4 = Color(0xFFFCAC46);
final fontFamilyAvenir = 'Avenir';
final fontFamilyBillabong = 'Billabong';
void main() => runApp(App());
class App extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: HomePage(),
debugShowCheckedModeBanner: false,
);
}
}
class HomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Row(
children: [
WidgetNavigationDrawer(),
WidgetContent(),
],
),
);
}
}
class WidgetNavigationDrawer extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
color: color1,
width: 300,
height: double.infinity,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_buildWidgetInstagramLogo(),
SizedBox(height: 24),
// TODO: buat fungsi widget bernama '_buildWidgetPhotoProfile'
// TODO: buat widget yang menampilkan teks 'Hello Ditta'
// TODO: buat widget yang menampilkan teks '@helloditta'
// TODO: buat fungsi widget bernama '_buildWidgetInfoPostsFollowersFollowing'
// TODO: buat fungsi widget bernama '_buildWidgetItemMenu' dan menampilkan setiap menu item
// TODO: buat widget yang menampilkan garis horizontal
// TODO: buat fungsi widget bernama '_buildWidgetItemMenu' yang menampilkan menu logout
],
),
);
}
Widget _buildWidgetInstagramLogo() {
return Padding(
padding: const EdgeInsets.only(
left: 24,
top: 24,
),
child: Row(
children: [
Image.asset(
'assets/images/instagram_logo.png',
width: 32,
),
SizedBox(width: 16),
Text(
'Instagram',
style: TextStyle(
fontFamily: fontFamilyBillabong,
color: Colors.white,
fontSize: 28,
),
),
],
),
);
}
}
class WidgetContent extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container();
// TODO: buat widget content
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment