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 CounterText extends StatelessWidget { | |
final ValueListenable<int> _counter; | |
CounterText(this._counter); | |
@override | |
Widget build(BuildContext context) { | |
return ValueListenableBuilder<int>( | |
valueListenable: _counter, | |
builder: (context, value, child) { |
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 Timer extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return FlatButton( | |
child: Text("Get time!"), | |
onPressed: () { | |
final time = DateTime.now().toIso8601String(); | |
TimeNotification(time: time)..dispatch(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 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
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
import 'dart:async'; | |
import 'package:intl/intl.dart'; | |
class Contact { | |
static final DateFormat _formatter = DateFormat('MMMM d, yyyy'); | |
final String fullName; | |
final String gender; |
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
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
import 'package:flutter/material.dart'; | |
void main() { | |
runApp( | |
MaterialApp( | |
home: Center( | |
child: Padding( | |
padding: const EdgeInsets.only(left: 128.0), | |
child: Text("Hello, World", textAlign: TextAlign.center) | |
) |
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'; | |
void main() { | |
runApp( | |
MaterialApp( | |
home: Center( | |
child: Text("Hello, World", textAlign: TextAlign.center) | |
) | |
) | |
); |
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'; | |
void main() { | |
runApp( | |
MaterialApp( | |
home: Padding( | |
padding: const EdgeInsets.only(top: 24.0), | |
child: Text("Hello, World") | |
) | |
) |