This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'com.android.application' | |
apply plugin: 'com.neenbedankt.android-apt' | |
apply plugin: 'me.tatarka.retrolambda' | |
android { | |
compileSdkVersion rootProject.androidCompileSdkVersion | |
buildToolsVersion rootProject.androidBuildToolsVersion | |
defaultConfig { | |
minSdkVersion rootProject.androidMinSdkVersion |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private val HEX_CHARS = "0123456789ABCDEF".toCharArray() | |
fun ByteArray.toHex() : String{ | |
val result = StringBuffer() | |
forEach { | |
val octet = it.toInt() | |
val firstIndex = (octet and 0xF0).ushr(4) | |
val secondIndex = octet and 0x0F | |
result.append(HEX_CHARS[firstIndex]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import '../../data/contact_data.dart'; | |
import 'contact_presenter.dart'; | |
class ContactsPage extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return Drawer( | |
child: ListView( | |
padding: EdgeInsets.zero, | |
children: <Widget>[ | |
// ... | |
_createDrawerItem(icon: Icons.event, text: 'Events', | |
onTap: () => Navigator.pushReplacementNamed(context, Routes.events))), | |
// ... | |
], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class EventsPage extends StatelessWidget { | |
static const String routeName = '/events'; | |
@override | |
Widget build(BuildContext context) { | |
return new Scaffold( | |
appBar: AppBar( | |
title: Text("Events"), | |
), | |
drawer: AppDrawer(), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Routes { | |
static const String contacts = ContactsPage.routeName; | |
static const String events = EventsPage.routeName; | |
static const String notes = NotesPage.routeName; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return Drawer( | |
child: ListView( | |
padding: EdgeInsets.zero, | |
children: <Widget>[ | |
_createHeader(), | |
_createDrawerItem(icon: Icons.contacts, text: 'Contacts', onTap: () => ...) | |
Divider(), | |
_createDrawerItem(icon: Icons.event, text: 'Events', onTap: () => ...), | |
ListTile( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return Drawer( | |
child: ListView( | |
padding: EdgeInsets.zero, | |
children: <Widget>[ | |
_createHeader(), | |
_createDrawerItem(icon: Icons.contacts, text: 'Contacts', onTap: () => ...) | |
Divider(), | |
_createDrawerItem(icon: Icons.event, text: 'Events', onTap: () => ...) | |
], | |
), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return Drawer( | |
child: ListView( | |
padding: EdgeInsets.zero, | |
children: <Widget>[ | |
_createHeader(), | |
_createDrawerItem( | |
icon: Icons.contacts, | |
text: 'Contacts', | |
onTap: () => ..., | |
], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return Drawer( | |
child: ListView( | |
padding: EdgeInsets.zero, | |
children: <Widget>[ | |
_createHeader() | |
], | |
), | |
); |
NewerOlder