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 TimeNotification extends Notification { | |
final String time; | |
const TimeNotification({this.time}); | |
} |
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
void preTranslate(Matrix4 leftMatrix, double x, double y) { | |
if(x == 0 && y == 0) { | |
return; | |
} | |
for (int i = 0; i < 4; ++i) { | |
var value = leftMatrix.entry(0, i) * x + leftMatrix.entry(1, i) * y; | |
value += leftMatrix.entry(2, i) + leftMatrix.entry(3, i); | |
leftMatrix.setEntry( 3, i, value); | |
} |
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 _ContactListState extends State<ContactList> implements ContactListViewContract { | |
// ... | |
List<_ContactListItem> _buildContactList() { | |
return _contacts.map((contact) => | |
_ContactListItem ( | |
contact: contact, | |
onTap: () { _showContactPage(context, contact); } | |
)) |
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 ContactPage extends StatelessWidget { | |
// ... | |
_ContactCategory _buildPhoneCategory() { | |
var phoneItems = _contact.phones.map((phone) => | |
_ContactCategoryItem( | |
icon: Icons.message, | |
lines: <String>[phone.number, phone.type] | |
)).toList(); |
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 ContactPage extends StatelessWidget { | |
static const String routeName = '/contact'; | |
final Contact _contact; | |
ContactPage(this._contact); | |
@override | |
Widget build(BuildContext context) { |
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 _ContactCategory extends StatelessWidget { | |
final IconData icon; | |
final List<_ContactCategoryItem> children; | |
_ContactCategory({Key key, this.icon, this.children}): super(key: key); | |
@override | |
Widget build(BuildContext context) { | |
final ThemeData themeData = Theme.of(context); |
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 _ContactCategoryItem extends StatelessWidget { | |
final IconData icon; | |
final List<String> lines; | |
_ContactCategoryItem({ Key key, @required this.icon, @required this.lines }) | |
: super(key: key); | |
@override | |
Widget build(BuildContext context) { |
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
DecoratedBox( | |
decoration: BoxDecoration( | |
gradient: LinearGradient( | |
begin: const FractionalOffset(0.5, 0.6), | |
end: const FractionalOffset(0.5, 1.0), | |
colors: <Color>[const Color(0x00000000), const Color(0x70000000)] | |
) | |
) | |
) |
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'; | |
class FlexibleAppBar extends SliverAppBar { | |
static const double height = 256.0; | |
FlexibleAppBar(String title, String imageUrl) : super( | |
pinned: true, | |
expandedHeight: height, | |
flexibleSpace: FlexibleSpaceBar( | |
title: Text(title), |
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 'dart:async'; | |
import 'package:intl/intl.dart'; | |
class Contact { | |
static final DateFormat _formatter = DateFormat('MMMM d, yyyy'); | |
final String fullName; | |
final String gender; |