mirror of
https://github.com/flutter/samples.git
synced 2025-11-08 13:58:47 +00:00
Samples maintenance (#435)
This commit is contained in:
@@ -63,7 +63,7 @@ packages:
|
||||
name: espresso
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.0.1+4"
|
||||
version: "0.0.1+5"
|
||||
file:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -167,7 +167,7 @@ packages:
|
||||
name: provider
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "4.0.5"
|
||||
version: "4.1.0"
|
||||
pub_semver:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -279,5 +279,5 @@ packages:
|
||||
source: hosted
|
||||
version: "3.6.1"
|
||||
sdks:
|
||||
dart: ">=2.6.0 <3.0.0"
|
||||
flutter: ">=1.12.1 <2.0.0"
|
||||
dart: ">=2.7.0 <3.0.0"
|
||||
flutter: ">=1.17.0 <2.0.0"
|
||||
|
||||
@@ -79,6 +79,13 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.12"
|
||||
js:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: js
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.6.1+1"
|
||||
matcher:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -93,6 +100,13 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.8"
|
||||
nested:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: nested
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.0.4"
|
||||
path:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -120,7 +134,7 @@ packages:
|
||||
name: provider
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.2.0"
|
||||
version: "4.1.0"
|
||||
quiver:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -188,14 +202,14 @@ packages:
|
||||
name: url_launcher
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "5.4.2"
|
||||
version: "5.4.5"
|
||||
url_launcher_macos:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: url_launcher_macos
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.0.1+4"
|
||||
version: "0.0.1+5"
|
||||
url_launcher_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -209,7 +223,7 @@ packages:
|
||||
name: url_launcher_web
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.1.1+1"
|
||||
version: "0.1.1+4"
|
||||
vector_math:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -225,5 +239,5 @@ packages:
|
||||
source: hosted
|
||||
version: "3.6.1"
|
||||
sdks:
|
||||
dart: ">=2.6.0 <3.0.0"
|
||||
flutter: ">=1.12.8 <2.0.0"
|
||||
dart: ">=2.7.0 <3.0.0"
|
||||
flutter: ">=1.17.0 <2.0.0"
|
||||
|
||||
@@ -9,7 +9,7 @@ environment:
|
||||
dependencies:
|
||||
flutter:
|
||||
sdk: flutter
|
||||
provider: ^3.1.0
|
||||
provider: ^4.1.0
|
||||
url_launcher: ^5.2.5
|
||||
|
||||
dev_dependencies:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
include: package:pedantic/analysis_options.1.8.0.yaml
|
||||
include: package:pedantic/analysis_options.1.9.0.yaml
|
||||
|
||||
analyzer:
|
||||
strong-mode:
|
||||
|
||||
@@ -128,6 +128,7 @@ final allRoutes = <String, WidgetBuilder>{
|
||||
};
|
||||
|
||||
class AnimationSamples extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
title: 'Animation Samples',
|
||||
@@ -141,6 +142,7 @@ class AnimationSamples extends StatelessWidget {
|
||||
}
|
||||
|
||||
class HomePage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final headerStyle = Theme.of(context).textTheme.headline6;
|
||||
return Scaffold(
|
||||
@@ -164,6 +166,7 @@ class DemoTile extends StatelessWidget {
|
||||
|
||||
DemoTile(this.demo);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListTile(
|
||||
title: Text(demo.name),
|
||||
|
||||
@@ -13,6 +13,7 @@ Color generateColor() => Color(0xFFFFFFFF & Random().nextInt(0xFFFFFFFF));
|
||||
class AnimatedContainerDemo extends StatefulWidget {
|
||||
static String routeName = '/basics/01_animated_container';
|
||||
|
||||
@override
|
||||
_AnimatedContainerDemoState createState() => _AnimatedContainerDemoState();
|
||||
}
|
||||
|
||||
@@ -21,6 +22,7 @@ class _AnimatedContainerDemoState extends State<AnimatedContainerDemo> {
|
||||
double borderRadius;
|
||||
double margin;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
color = Colors.deepPurple;
|
||||
@@ -36,6 +38,7 @@ class _AnimatedContainerDemoState extends State<AnimatedContainerDemo> {
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// This widget is built using an AnimatedContainer, one of the easiest to use
|
||||
// animated Widgets. Whenever the AnimatedContainer's properties, such as decoration,
|
||||
|
||||
@@ -7,6 +7,7 @@ import 'package:flutter/material.dart';
|
||||
class PageRouteBuilderDemo extends StatelessWidget {
|
||||
static const String routeName = '/basics/page_route_builder';
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(),
|
||||
@@ -38,6 +39,7 @@ Route _createRoute() {
|
||||
}
|
||||
|
||||
class _Page2 extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(),
|
||||
|
||||
@@ -7,6 +7,7 @@ import 'package:flutter/material.dart';
|
||||
class TweenDemo extends StatefulWidget {
|
||||
static const String routeName = '/basics/tweens';
|
||||
|
||||
@override
|
||||
_TweenDemoState createState() => _TweenDemoState();
|
||||
}
|
||||
|
||||
@@ -17,6 +18,7 @@ class _TweenDemoState extends State<TweenDemo>
|
||||
AnimationController controller;
|
||||
Animation<double> animation;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
@@ -28,11 +30,13 @@ class _TweenDemoState extends State<TweenDemo>
|
||||
animation = Tween(begin: 0.0, end: accountBalance).animate(controller);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
controller.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(),
|
||||
|
||||
@@ -7,6 +7,7 @@ import 'package:flutter/material.dart';
|
||||
class AnimatedBuilderDemo extends StatefulWidget {
|
||||
static const String routeName = '/basics/animated_builder';
|
||||
|
||||
@override
|
||||
_AnimatedBuilderDemoState createState() => _AnimatedBuilderDemoState();
|
||||
}
|
||||
|
||||
@@ -18,6 +19,7 @@ class _AnimatedBuilderDemoState extends State<AnimatedBuilderDemo>
|
||||
AnimationController controller;
|
||||
Animation<Color> animation;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
@@ -26,11 +28,13 @@ class _AnimatedBuilderDemoState extends State<AnimatedBuilderDemo>
|
||||
ColorTween(begin: beginColor, end: endColor).animate(controller);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
controller.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(),
|
||||
|
||||
@@ -8,6 +8,7 @@ class TypewriterTween extends Tween<String> {
|
||||
TypewriterTween({String begin = '', String end})
|
||||
: super(begin: begin, end: end);
|
||||
|
||||
@override
|
||||
String lerp(double t) {
|
||||
var cutoff = (end.length * t).round();
|
||||
return end.substring(0, cutoff);
|
||||
@@ -17,6 +18,7 @@ class TypewriterTween extends Tween<String> {
|
||||
class CustomTweenDemo extends StatefulWidget {
|
||||
static const String routeName = '/basics/custom_tweens';
|
||||
|
||||
@override
|
||||
_CustomTweenDemoState createState() => _CustomTweenDemoState();
|
||||
}
|
||||
|
||||
@@ -27,6 +29,7 @@ class _CustomTweenDemoState extends State<CustomTweenDemo>
|
||||
AnimationController controller;
|
||||
Animation<String> animation;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
@@ -34,11 +37,13 @@ class _CustomTweenDemoState extends State<CustomTweenDemo>
|
||||
animation = TypewriterTween(end: message).animate(controller);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
controller.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
|
||||
@@ -27,6 +27,7 @@ class _TweenSequenceDemoState extends State<TweenSequenceDemo>
|
||||
Colors.purple,
|
||||
];
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
@@ -49,6 +50,7 @@ class _TweenSequenceDemoState extends State<TweenSequenceDemo>
|
||||
animation = TweenSequence<Color>(sequenceItems).animate(controller);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
controller.dispose();
|
||||
super.dispose();
|
||||
|
||||
@@ -8,6 +8,7 @@ import 'package:flutter/widgets.dart';
|
||||
class AnimatedListDemo extends StatefulWidget {
|
||||
static String routeName = '/misc/animated_list';
|
||||
|
||||
@override
|
||||
_AnimatedListDemoState createState() => _AnimatedListDemoState();
|
||||
}
|
||||
|
||||
@@ -17,9 +18,9 @@ class _AnimatedListDemoState extends State<AnimatedListDemo> {
|
||||
|
||||
void addUser() {
|
||||
setState(() {
|
||||
int index = listData.length;
|
||||
var index = listData.length;
|
||||
listData.add(
|
||||
UserModel(firstName: "New", lastName: "Person"),
|
||||
UserModel(firstName: 'New', lastName: 'Person'),
|
||||
);
|
||||
_listKey.currentState
|
||||
.insertItem(index, duration: Duration(milliseconds: 300));
|
||||
@@ -96,23 +97,23 @@ class UserModel {
|
||||
|
||||
List<UserModel> initialListData = [
|
||||
UserModel(
|
||||
firstName: "Govind",
|
||||
lastName: "Dixit",
|
||||
firstName: 'Govind',
|
||||
lastName: 'Dixit',
|
||||
),
|
||||
UserModel(
|
||||
firstName: "Greta",
|
||||
lastName: "Stoll",
|
||||
firstName: 'Greta',
|
||||
lastName: 'Stoll',
|
||||
),
|
||||
UserModel(
|
||||
firstName: "Monty",
|
||||
lastName: "Carlo",
|
||||
firstName: 'Monty',
|
||||
lastName: 'Carlo',
|
||||
),
|
||||
UserModel(
|
||||
firstName: "Petey",
|
||||
lastName: "Cruiser",
|
||||
firstName: 'Petey',
|
||||
lastName: 'Cruiser',
|
||||
),
|
||||
UserModel(
|
||||
firstName: "Barry",
|
||||
lastName: "Cade",
|
||||
firstName: 'Barry',
|
||||
lastName: 'Cade',
|
||||
),
|
||||
];
|
||||
|
||||
@@ -9,6 +9,7 @@ import 'package:flutter/material.dart';
|
||||
class AnimatedPositionedDemo extends StatefulWidget {
|
||||
static String routeName = '/basics/09_animated_positioned';
|
||||
|
||||
@override
|
||||
_AnimatedPositionedDemoState createState() => _AnimatedPositionedDemoState();
|
||||
}
|
||||
|
||||
@@ -20,6 +21,7 @@ class _AnimatedPositionedDemoState extends State<AnimatedPositionedDemo> {
|
||||
|
||||
double generateLeftPosition(double left) => Random().nextDouble() * left;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
topPosition = generateTopPosition(30);
|
||||
@@ -33,6 +35,7 @@ class _AnimatedPositionedDemoState extends State<AnimatedPositionedDemo> {
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final size = MediaQuery.of(context).size;
|
||||
final appBar = AppBar();
|
||||
@@ -60,7 +63,7 @@ class _AnimatedPositionedDemoState extends State<AnimatedPositionedDemo> {
|
||||
width: 150,
|
||||
height: 50,
|
||||
child: Text(
|
||||
"Click Me",
|
||||
'Click Me',
|
||||
style: TextStyle(
|
||||
color:
|
||||
Theme.of(context).buttonTheme.colorScheme.onPrimary,
|
||||
|
||||
@@ -25,6 +25,7 @@ Widget generateContainer(int keyCount) => Container(
|
||||
class AnimatedSwitcherDemo extends StatefulWidget {
|
||||
static String routeName = '/basics/10_animated_switcher';
|
||||
|
||||
@override
|
||||
_AnimatedSwitcherDemoState createState() => _AnimatedSwitcherDemoState();
|
||||
}
|
||||
|
||||
@@ -32,12 +33,14 @@ class _AnimatedSwitcherDemoState extends State<AnimatedSwitcherDemo> {
|
||||
Widget container;
|
||||
int keyCount;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
keyCount = 0;
|
||||
container = generateContainer(keyCount);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
@@ -47,7 +50,7 @@ class _AnimatedSwitcherDemoState extends State<AnimatedSwitcherDemo> {
|
||||
() => container = generateContainer(++keyCount),
|
||||
),
|
||||
child: Text(
|
||||
"Change Widget",
|
||||
'Change Widget',
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).buttonTheme.colorScheme.onPrimary),
|
||||
),
|
||||
|
||||
@@ -17,6 +17,7 @@ class CardSwipeDemo extends StatefulWidget {
|
||||
class _CardSwipeDemoState extends State<CardSwipeDemo> {
|
||||
List<String> fileNames;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_resetCards();
|
||||
@@ -30,6 +31,7 @@ class _CardSwipeDemoState extends State<CardSwipeDemo> {
|
||||
];
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
@@ -79,6 +81,7 @@ class Card extends StatelessWidget {
|
||||
|
||||
Card(this.imageAssetName);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AspectRatio(
|
||||
aspectRatio: 3 / 5,
|
||||
@@ -104,6 +107,7 @@ class SwipeableCard extends StatefulWidget {
|
||||
this.imageAssetName,
|
||||
});
|
||||
|
||||
@override
|
||||
_SwipeableCardState createState() => _SwipeableCardState();
|
||||
}
|
||||
|
||||
@@ -114,6 +118,7 @@ class _SwipeableCardState extends State<SwipeableCard>
|
||||
double _dragStartX;
|
||||
bool _isSwipingLeft = false;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_controller = AnimationController.unbounded(vsync: this);
|
||||
@@ -123,6 +128,7 @@ class _SwipeableCardState extends State<SwipeableCard>
|
||||
));
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SlideTransition(
|
||||
position: _animation,
|
||||
@@ -181,6 +187,7 @@ class _SwipeableCardState extends State<SwipeableCard>
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_controller.dispose();
|
||||
super.dispose();
|
||||
|
||||
@@ -41,7 +41,7 @@ class CarouselDemo extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
typedef void OnCurrentItemChangedCallback(int currentItem);
|
||||
typedef OnCurrentItemChangedCallback = void Function(int currentItem);
|
||||
|
||||
class Carousel extends StatefulWidget {
|
||||
final IndexedWidgetBuilder itemBuilder;
|
||||
|
||||
@@ -19,6 +19,7 @@ class ExpandCardDemo extends StatelessWidget {
|
||||
}
|
||||
|
||||
class ExpandCard extends StatefulWidget {
|
||||
@override
|
||||
_ExpandCardState createState() => _ExpandCardState();
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import 'package:flutter/material.dart';
|
||||
class FocusImageDemo extends StatelessWidget {
|
||||
static String routeName = '/misc/focus_image';
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(title: Text('Focus Image')),
|
||||
@@ -16,6 +17,7 @@ class FocusImageDemo extends StatelessWidget {
|
||||
}
|
||||
|
||||
class Grid extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: GridView.builder(
|
||||
@@ -68,6 +70,7 @@ class SmallCard extends StatelessWidget {
|
||||
|
||||
SmallCard(this.imageAssetName);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Card(
|
||||
child: Material(
|
||||
@@ -91,6 +94,7 @@ class _SecondPage extends StatelessWidget {
|
||||
|
||||
_SecondPage(this.imageAssetName);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.black,
|
||||
|
||||
@@ -7,42 +7,42 @@ packages:
|
||||
name: archive
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.11"
|
||||
version: "2.0.13"
|
||||
args:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: args
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.5.2"
|
||||
version: "1.6.0"
|
||||
async:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: async
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.4.0"
|
||||
version: "2.4.1"
|
||||
boolean_selector:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: boolean_selector
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.5"
|
||||
version: "2.0.0"
|
||||
charcode:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: charcode
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.2"
|
||||
version: "1.1.3"
|
||||
collection:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: collection
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.14.11"
|
||||
version: "1.14.12"
|
||||
convert:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -56,7 +56,7 @@ packages:
|
||||
name: crypto
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.3"
|
||||
version: "2.1.4"
|
||||
cupertino_icons:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -80,7 +80,7 @@ packages:
|
||||
name: image
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.4"
|
||||
version: "2.1.12"
|
||||
matcher:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -108,7 +108,7 @@ packages:
|
||||
name: pedantic
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.8.0+1"
|
||||
version: "1.9.0"
|
||||
petitparser:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -122,7 +122,7 @@ packages:
|
||||
name: quiver
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.5"
|
||||
version: "2.1.3"
|
||||
sky_engine:
|
||||
dependency: transitive
|
||||
description: flutter
|
||||
@@ -134,7 +134,7 @@ packages:
|
||||
name: source_span
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.5.5"
|
||||
version: "1.7.0"
|
||||
stack_trace:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -169,7 +169,7 @@ packages:
|
||||
name: test_api
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.2.11"
|
||||
version: "0.2.15"
|
||||
typed_data:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -190,6 +190,6 @@ packages:
|
||||
name: xml
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.5.0"
|
||||
version: "3.6.1"
|
||||
sdks:
|
||||
dart: ">=2.5.0 <3.0.0"
|
||||
dart: ">=2.6.0 <3.0.0"
|
||||
|
||||
@@ -13,7 +13,7 @@ dependencies:
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
pedantic: ^1.8.0
|
||||
pedantic: ^1.9.0
|
||||
|
||||
flutter:
|
||||
uses-material-design: true
|
||||
|
||||
@@ -16,7 +16,7 @@ void main() {
|
||||
await tester.pumpWidget(createExpandCardScreen());
|
||||
|
||||
// Get the initial size of ExpandCard.
|
||||
Size initialSize = tester.getSize(find.byType(ExpandCard));
|
||||
var initialSize = tester.getSize(find.byType(ExpandCard));
|
||||
|
||||
// Tap on the ExpandCard.
|
||||
await tester.tap(find.byType(ExpandCard));
|
||||
@@ -33,7 +33,7 @@ void main() {
|
||||
testWidgets('ExpandCard changes image on tap', (tester) async {
|
||||
await tester.pumpWidget(createExpandCardScreen());
|
||||
|
||||
Image initialImage = tester.widget(find.byType(Image).last);
|
||||
var initialImage = tester.widget(find.byType(Image).last);
|
||||
|
||||
// Tap on ExpandCard.
|
||||
await tester.tap(find.byType(ExpandCard));
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
include: package:pedantic/analysis_options.1.8.0.yaml
|
||||
include: package:pedantic/analysis_options.1.9.0.yaml
|
||||
|
||||
analyzer:
|
||||
strong-mode:
|
||||
|
||||
@@ -59,16 +59,16 @@ class _DataTreeInkWellState extends State<DataTreeInkWell>
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final ColorScheme colorScheme = Theme.of(context).colorScheme;
|
||||
final colorScheme = Theme.of(context).colorScheme;
|
||||
|
||||
final Animation<Color> backgroundColor = controller
|
||||
final backgroundColor = controller
|
||||
.drive(CurveTween(curve: Curves.fastOutSlowIn))
|
||||
.drive(ColorTween(
|
||||
begin: colorScheme.primary.withOpacity(0.0),
|
||||
end: colorScheme.primary.withOpacity(0.08),
|
||||
));
|
||||
|
||||
final Animation<Color> iconColor = controller
|
||||
final iconColor = controller
|
||||
.drive(CurveTween(curve: Curves.fastOutSlowIn))
|
||||
.drive(ColorTween(
|
||||
begin: colorScheme.onBackground.withOpacity(0.54),
|
||||
@@ -235,10 +235,10 @@ class _DataTreeNodeState extends State<DataTreeNode>
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final ColorScheme colorScheme = Theme.of(context).colorScheme;
|
||||
final Color textColor = colorScheme.onBackground.withOpacity(0.87);
|
||||
final colorScheme = Theme.of(context).colorScheme;
|
||||
final textColor = colorScheme.onBackground.withOpacity(0.87);
|
||||
|
||||
final bool closed = !_isExpanded && _controller.isDismissed;
|
||||
final closed = !_isExpanded && _controller.isDismissed;
|
||||
|
||||
return widget.children.isEmpty
|
||||
// Leaf node.
|
||||
|
||||
@@ -107,8 +107,8 @@ class _SplitState extends State<Split> {
|
||||
|
||||
// Determine what fraction to give each child, including enough space to
|
||||
// display the divider.
|
||||
double firstSize = axisSize * firstFraction;
|
||||
double secondSize = axisSize * secondFraction;
|
||||
var firstSize = axisSize * firstFraction;
|
||||
var secondSize = axisSize * secondFraction;
|
||||
|
||||
// Clamp the sizes to be sure there is enough space for the dividers.
|
||||
firstSize = firstSize.clamp(halfDivider, axisSize - halfDivider) as double;
|
||||
|
||||
@@ -7,7 +7,7 @@ packages:
|
||||
name: _fe_analyzer_shared
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0"
|
||||
version: "3.0.0"
|
||||
analysis_server_lib:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -21,7 +21,7 @@ packages:
|
||||
name: analyzer
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.39.6"
|
||||
version: "0.39.8"
|
||||
archive:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -77,21 +77,21 @@ packages:
|
||||
name: build_resolvers
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.3.4"
|
||||
version: "1.3.7"
|
||||
build_runner:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: build_runner
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.8.1"
|
||||
version: "1.9.0"
|
||||
build_runner_core:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: build_runner_core
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "5.0.0"
|
||||
version: "5.1.0"
|
||||
built_collection:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -105,14 +105,14 @@ packages:
|
||||
name: built_value
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "7.0.9"
|
||||
version: "7.1.0"
|
||||
built_value_generator:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: built_value_generator
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "7.0.9"
|
||||
version: "7.1.0"
|
||||
charcode:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -133,7 +133,7 @@ packages:
|
||||
name: cli_util
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.1.3+2"
|
||||
version: "0.1.4"
|
||||
code_builder:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -189,13 +189,13 @@ packages:
|
||||
name: dart_style
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.3.4"
|
||||
version: "1.3.6"
|
||||
file_chooser:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
path: "plugins/file_chooser"
|
||||
ref: HEAD
|
||||
resolved-ref: "588f89e5a5d8495eb95568175978f88405e443a2"
|
||||
resolved-ref: "100bc306dd15532dbbb2b353170aea47e8173a13"
|
||||
url: "https://github.com/google/flutter-desktop-embedding.git"
|
||||
source: git
|
||||
version: "0.1.0"
|
||||
@@ -255,7 +255,7 @@ packages:
|
||||
name: http
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.12.0+4"
|
||||
version: "0.12.1"
|
||||
http_multi_server:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -283,7 +283,7 @@ packages:
|
||||
name: intl
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.15.8"
|
||||
version: "0.16.1"
|
||||
io:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -324,7 +324,7 @@ packages:
|
||||
description:
|
||||
path: "plugins/menubar"
|
||||
ref: HEAD
|
||||
resolved-ref: "588f89e5a5d8495eb95568175978f88405e443a2"
|
||||
resolved-ref: "100bc306dd15532dbbb2b353170aea47e8173a13"
|
||||
url: "https://github.com/google/flutter-desktop-embedding.git"
|
||||
source: git
|
||||
version: "0.0.1"
|
||||
@@ -349,6 +349,13 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.2"
|
||||
nested:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: nested
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.0.4"
|
||||
node_interop:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -362,7 +369,7 @@ packages:
|
||||
name: node_io
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.1+2"
|
||||
version: "1.1.0"
|
||||
node_preamble:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -418,7 +425,7 @@ packages:
|
||||
name: provider
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.2.0"
|
||||
version: "4.1.0"
|
||||
pub_semver:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -542,7 +549,7 @@ packages:
|
||||
name: test
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.14.2"
|
||||
version: "1.14.3"
|
||||
test_api:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -556,7 +563,7 @@ packages:
|
||||
name: test_core
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.3.3"
|
||||
version: "0.3.4"
|
||||
timing:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -577,7 +584,7 @@ packages:
|
||||
name: tuneup
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.3.6+1"
|
||||
version: "0.3.6+2"
|
||||
typed_data:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -591,14 +598,14 @@ packages:
|
||||
name: url_launcher
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "5.4.2"
|
||||
version: "5.4.5"
|
||||
url_launcher_macos:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: url_launcher_macos
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.0.1+4"
|
||||
version: "0.0.1+5"
|
||||
url_launcher_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -612,7 +619,7 @@ packages:
|
||||
name: url_launcher_web
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.1.1+1"
|
||||
version: "0.1.1+4"
|
||||
uuid:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -633,14 +640,14 @@ packages:
|
||||
name: vm_service
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "4.0.0"
|
||||
version: "4.0.2"
|
||||
watcher:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: watcher
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.9.7+14"
|
||||
version: "0.9.7+15"
|
||||
web_socket_channel:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -654,7 +661,7 @@ packages:
|
||||
name: webkit_inspection_protocol
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.5.0+1"
|
||||
version: "0.5.3"
|
||||
xml:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -668,7 +675,7 @@ packages:
|
||||
name: yaml
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.2.0"
|
||||
version: "2.2.1"
|
||||
sdks:
|
||||
dart: ">=2.7.0 <3.0.0"
|
||||
flutter: ">=1.13.1-pre <2.0.0"
|
||||
flutter: ">=1.17.0 <2.0.0"
|
||||
|
||||
@@ -22,8 +22,8 @@ dependencies:
|
||||
url: https://github.com/google/flutter-desktop-embedding.git
|
||||
path: plugins/menubar
|
||||
meta: ^1.1.8
|
||||
pedantic: ^1.8.0
|
||||
provider: ^3.2.0
|
||||
pedantic: ^1.9.0
|
||||
provider: ^4.1.0
|
||||
transparent_image: ^1.0.0
|
||||
uuid: ^2.0.4
|
||||
url_launcher: ^5.4.0
|
||||
|
||||
@@ -7,14 +7,14 @@ packages:
|
||||
name: _fe_analyzer_shared
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0"
|
||||
version: "3.0.0"
|
||||
analyzer:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: analyzer
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.39.6"
|
||||
version: "0.39.8"
|
||||
archive:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -122,7 +122,7 @@ packages:
|
||||
name: http
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.12.0+4"
|
||||
version: "0.12.1"
|
||||
http_multi_server:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -213,7 +213,7 @@ packages:
|
||||
name: node_io
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.1+2"
|
||||
version: "1.1.0"
|
||||
node_preamble:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -262,7 +262,7 @@ packages:
|
||||
name: provider
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "4.0.4"
|
||||
version: "4.1.0"
|
||||
pub_semver:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -365,7 +365,7 @@ packages:
|
||||
name: test
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.14.2"
|
||||
version: "1.14.3"
|
||||
test_api:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -379,7 +379,7 @@ packages:
|
||||
name: test_core
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.3.3"
|
||||
version: "0.3.4"
|
||||
typed_data:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -407,14 +407,14 @@ packages:
|
||||
name: vm_service
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "4.0.0"
|
||||
version: "4.0.2"
|
||||
watcher:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: watcher
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.9.7+14"
|
||||
version: "0.9.7+15"
|
||||
web_socket_channel:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -428,7 +428,7 @@ packages:
|
||||
name: webkit_inspection_protocol
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.5.0+1"
|
||||
version: "0.5.3"
|
||||
xml:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -442,7 +442,7 @@ packages:
|
||||
name: yaml
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.2.0"
|
||||
version: "2.2.1"
|
||||
sdks:
|
||||
dart: ">=2.7.0 <3.0.0"
|
||||
flutter: ">=1.12.1"
|
||||
flutter: ">=1.17.0"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
include: package:pedantic/analysis_options.1.8.0.yaml
|
||||
include: package:pedantic/analysis_options.1.9.0.yaml
|
||||
|
||||
analyzer:
|
||||
strong-mode:
|
||||
|
||||
@@ -42,7 +42,21 @@ packages:
|
||||
name: cloud_firestore
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.12.11"
|
||||
version: "0.13.5"
|
||||
cloud_firestore_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: cloud_firestore_platform_interface
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
cloud_firestore_web:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: cloud_firestore_web
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.1.1+2"
|
||||
collection:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -103,7 +117,7 @@ packages:
|
||||
name: flutter_plugin_android_lifecycle
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.6"
|
||||
version: "1.0.7"
|
||||
flutter_test:
|
||||
dependency: "direct dev"
|
||||
description: flutter
|
||||
@@ -120,7 +134,14 @@ packages:
|
||||
name: google_maps_flutter
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.5.25+3"
|
||||
version: "0.5.27+1"
|
||||
google_maps_flutter_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: google_maps_flutter_platform_interface
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.1"
|
||||
google_maps_webservice:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -134,7 +155,7 @@ packages:
|
||||
name: http
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.12.0+4"
|
||||
version: "0.12.1"
|
||||
http_parser:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -162,7 +183,21 @@ packages:
|
||||
name: location
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.5.4"
|
||||
version: "3.0.2"
|
||||
location_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: location_platform_interface
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.0"
|
||||
location_web:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: location_web
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.0"
|
||||
matcher:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -238,6 +273,13 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.0"
|
||||
stream_transform:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stream_transform
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0"
|
||||
string_scanner:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
||||
@@ -8,15 +8,15 @@ environment:
|
||||
dependencies:
|
||||
flutter:
|
||||
sdk: flutter
|
||||
cloud_firestore: ^0.12.5+1
|
||||
cloud_firestore: ^0.13.5
|
||||
google_maps_flutter: ^0.5.17
|
||||
google_maps_webservice: ^0.0.14
|
||||
location: ^2.3.5
|
||||
location: ^3.0.2
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
pedantic: ^1.8.0
|
||||
pedantic: ^1.9.0
|
||||
|
||||
flutter:
|
||||
uses-material-design: true
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
include: package:pedantic/analysis_options.1.8.0.yaml
|
||||
include: package:pedantic/analysis_options.1.9.0.yaml
|
||||
|
||||
analyzer:
|
||||
strong-mode:
|
||||
|
||||
@@ -159,11 +159,11 @@ class DataTransferIsolateController extends ChangeNotifier {
|
||||
_timer.reset();
|
||||
_timer.start();
|
||||
|
||||
List<int> randNums = [];
|
||||
for (int i = 0; i < 100; i++) {
|
||||
var randNums = <int>[];
|
||||
for (var i = 0; i < 100; i++) {
|
||||
randNums.clear();
|
||||
|
||||
for (int j = 0; j < 1000000; j++) {
|
||||
for (var j = 0; j < 1000000; j++) {
|
||||
randNums.add(random.nextInt(100));
|
||||
}
|
||||
|
||||
@@ -183,6 +183,7 @@ class DataTransferIsolateController extends ChangeNotifier {
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
_isolate?.kill(priority: Isolate.immediate);
|
||||
@@ -226,7 +227,7 @@ class RunningList extends StatelessWidget {
|
||||
Future<void> _secondIsolateEntryPoint(SendPort sendPort) async {
|
||||
var receivePort = ReceivePort();
|
||||
sendPort.send(receivePort.sendPort);
|
||||
int length = 1;
|
||||
var length = 1;
|
||||
|
||||
receivePort.listen(
|
||||
(dynamic message) async {
|
||||
@@ -253,7 +254,7 @@ Future<void> _secondIsolateEntryPoint(SendPort sendPort) async {
|
||||
|
||||
Iterable<int> createNums() sync* {
|
||||
var random = Random();
|
||||
for (int i = 0; i < 100000000; i++) {
|
||||
for (var i = 0; i < 100000000; i++) {
|
||||
yield random.nextInt(100);
|
||||
}
|
||||
}
|
||||
@@ -263,10 +264,10 @@ Future<void> generateAndSum(
|
||||
Iterable<int> iter,
|
||||
int length,
|
||||
) async {
|
||||
int sum = 0;
|
||||
int count = 1;
|
||||
var sum = 0;
|
||||
var count = 1;
|
||||
|
||||
for (int x in iter) {
|
||||
for (var x in iter) {
|
||||
sum += x;
|
||||
if (count % 1000000 == 0) {
|
||||
callerSP.send((count ~/ 1000000) * length);
|
||||
|
||||
@@ -107,7 +107,7 @@ class InfiniteProcessIsolateController extends ChangeNotifier {
|
||||
Capability capability;
|
||||
|
||||
int _currentMultiplier = 1;
|
||||
List<int> _currentResults = [];
|
||||
final List<int> _currentResults = [];
|
||||
bool _created = false;
|
||||
bool _paused = false;
|
||||
|
||||
@@ -174,6 +174,7 @@ class InfiniteProcessIsolateController extends ChangeNotifier {
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
newIsolate?.kill(priority: Isolate.immediate);
|
||||
newIsolate = null;
|
||||
@@ -186,7 +187,7 @@ class RunningList extends StatelessWidget {
|
||||
Widget build(context) {
|
||||
final controller = Provider.of<InfiniteProcessIsolateController>(context);
|
||||
|
||||
List<int> sums = controller.currentResults;
|
||||
var sums = controller.currentResults;
|
||||
|
||||
return DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
@@ -219,9 +220,9 @@ class RunningList extends StatelessWidget {
|
||||
}
|
||||
|
||||
Future<void> _secondIsolateEntryPoint(SendPort callerSP) async {
|
||||
int multiplyValue = 1;
|
||||
var multiplyValue = 1;
|
||||
|
||||
ReceivePort newIceRP = ReceivePort();
|
||||
var newIceRP = ReceivePort();
|
||||
callerSP.send(newIceRP.sendPort);
|
||||
|
||||
newIceRP.listen((dynamic message) {
|
||||
@@ -232,9 +233,9 @@ Future<void> _secondIsolateEntryPoint(SendPort callerSP) async {
|
||||
|
||||
// This runs until the isolate is terminated.
|
||||
while (true) {
|
||||
int sum = 0;
|
||||
var sum = 0;
|
||||
|
||||
for (int i = 0; i < 10000; i++) {
|
||||
for (var i = 0; i < 10000; i++) {
|
||||
sum += await doSomeWork();
|
||||
}
|
||||
|
||||
@@ -243,12 +244,12 @@ Future<void> _secondIsolateEntryPoint(SendPort callerSP) async {
|
||||
}
|
||||
|
||||
Future<int> doSomeWork() {
|
||||
Random rng = Random();
|
||||
var rng = Random();
|
||||
|
||||
return Future(() {
|
||||
int sum = 0;
|
||||
var sum = 0;
|
||||
|
||||
for (int i = 0; i < 1000; i++) {
|
||||
for (var i = 0; i < 1000; i++) {
|
||||
sum += rng.nextInt(100);
|
||||
}
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ packages:
|
||||
name: provider
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "4.0.5"
|
||||
version: "4.1.0"
|
||||
quiver:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -199,5 +199,5 @@ packages:
|
||||
source: hosted
|
||||
version: "3.6.1"
|
||||
sdks:
|
||||
dart: ">=2.6.0 <3.0.0"
|
||||
flutter: ">=1.12.1"
|
||||
dart: ">=2.7.0 <3.0.0"
|
||||
flutter: ">=1.17.0"
|
||||
|
||||
@@ -13,7 +13,7 @@ dependencies:
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
pedantic: ^1.8.0
|
||||
pedantic: ^1.9.0
|
||||
|
||||
|
||||
flutter:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
include: package:pedantic/analysis_options.1.8.0.yaml
|
||||
include: package:pedantic/analysis_options.1.9.0.yaml
|
||||
|
||||
analyzer:
|
||||
exclude:
|
||||
|
||||
@@ -149,7 +149,7 @@ class BasicsPage extends StatelessWidget {
|
||||
class ConvertedSimplePage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
List<ConvertedSimpleObject> objects = JsonStrings.simpleObjects.map(
|
||||
var objects = JsonStrings.simpleObjects.map(
|
||||
(jsonString) {
|
||||
final dynamic parsedJson = json.decode(jsonString);
|
||||
return ConvertedSimpleObject.fromJson(parsedJson);
|
||||
@@ -170,7 +170,7 @@ class ConvertedSimplePage extends StatelessWidget {
|
||||
class ConvertedComplexPage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
List<ConvertedComplexObject> objects = JsonStrings.complexObjects.map(
|
||||
var objects = JsonStrings.complexObjects.map(
|
||||
(jsonString) {
|
||||
final dynamic parsedJson = json.decode(jsonString);
|
||||
return ConvertedComplexObject.fromJson(parsedJson);
|
||||
@@ -212,7 +212,7 @@ class ConvertedListPage extends StatelessWidget {
|
||||
class SerializableSimplePage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
List<SerializableSimpleObject> objects = JsonStrings.simpleObjects.map(
|
||||
var objects = JsonStrings.simpleObjects.map(
|
||||
(jsonString) {
|
||||
final dynamic parsedJson = json.decode(jsonString);
|
||||
return SerializableSimpleObject.fromJson(parsedJson);
|
||||
@@ -233,7 +233,7 @@ class SerializableSimplePage extends StatelessWidget {
|
||||
class SerializableComplexPage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
List<SerializableComplexObject> objects = JsonStrings.complexObjects.map(
|
||||
var objects = JsonStrings.complexObjects.map(
|
||||
(jsonString) {
|
||||
final dynamic parsedJson = json.decode(jsonString);
|
||||
return SerializableComplexObject.fromJson(parsedJson);
|
||||
@@ -275,7 +275,7 @@ class SerializableListPage extends StatelessWidget {
|
||||
class BuiltSimplePage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
List<BuiltSimpleObject> objects = JsonStrings.simpleObjects.map(
|
||||
var objects = JsonStrings.simpleObjects.map(
|
||||
(jsonString) {
|
||||
final dynamic parsedJson = json.decode(jsonString);
|
||||
return serializers.deserializeWith(
|
||||
@@ -297,7 +297,7 @@ class BuiltSimplePage extends StatelessWidget {
|
||||
class BuiltComplexPage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
List<BuiltComplexObject> objects = JsonStrings.complexObjects.map(
|
||||
var objects = JsonStrings.complexObjects.map(
|
||||
(jsonString) {
|
||||
final dynamic parsedJson = json.decode(jsonString);
|
||||
return serializers.deserializeWith(
|
||||
|
||||
@@ -100,7 +100,7 @@ class SimpleObjectViewList extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
final widgets = <Widget>[];
|
||||
|
||||
for (int i = 0; i < simpleObjects.length; i++) {
|
||||
for (var i = 0; i < simpleObjects.length; i++) {
|
||||
widgets.addAll([
|
||||
Text(
|
||||
'SimpleObject $i:',
|
||||
@@ -274,7 +274,7 @@ class ComplexObjectViewList extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
final widgets = <Widget>[];
|
||||
|
||||
for (int i = 0; i < complexObjects.length; i++) {
|
||||
for (var i = 0; i < complexObjects.length; i++) {
|
||||
widgets.addAll([
|
||||
Text(
|
||||
'Complex Object $i:',
|
||||
|
||||
@@ -7,14 +7,14 @@ packages:
|
||||
name: _fe_analyzer_shared
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0"
|
||||
version: "3.0.0"
|
||||
analyzer:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: analyzer
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.39.6"
|
||||
version: "0.39.8"
|
||||
archive:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -70,21 +70,21 @@ packages:
|
||||
name: build_resolvers
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.3.4"
|
||||
version: "1.3.7"
|
||||
build_runner:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: build_runner
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.8.1"
|
||||
version: "1.9.0"
|
||||
build_runner_core:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: build_runner_core
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "5.0.0"
|
||||
version: "5.1.0"
|
||||
built_collection:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -98,14 +98,14 @@ packages:
|
||||
name: built_value
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "7.0.9"
|
||||
version: "7.1.0"
|
||||
built_value_generator:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: built_value_generator
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "7.0.9"
|
||||
version: "7.1.0"
|
||||
charcode:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -161,7 +161,7 @@ packages:
|
||||
name: dart_style
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.3.4"
|
||||
version: "1.3.6"
|
||||
fixnum:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -290,7 +290,7 @@ packages:
|
||||
name: node_io
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.1+2"
|
||||
version: "1.1.0"
|
||||
package_config:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -449,7 +449,7 @@ packages:
|
||||
name: watcher
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.9.7+14"
|
||||
version: "0.9.7+15"
|
||||
web_socket_channel:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -470,6 +470,6 @@ packages:
|
||||
name: yaml
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.2.0"
|
||||
version: "2.2.1"
|
||||
sdks:
|
||||
dart: ">=2.7.0 <3.0.0"
|
||||
|
||||
@@ -18,7 +18,7 @@ dev_dependencies:
|
||||
build_runner: ^1.7.2
|
||||
built_value_generator: ^7.0.4
|
||||
json_serializable: ^3.2.5
|
||||
pedantic: ^1.8.0+1
|
||||
pedantic: ^1.9.0
|
||||
|
||||
flutter:
|
||||
uses-material-design: true
|
||||
|
||||
@@ -121,13 +121,13 @@ void main() {
|
||||
test('Typical object is converted correctly', () {
|
||||
final complexObject = ConvertedComplexObject.fromJson(typicalObjectJson);
|
||||
|
||||
expect(complexObject.aString, "Blah, blah, blah.");
|
||||
expect(complexObject.aString, 'Blah, blah, blah.');
|
||||
expect(complexObject.anInt, 1);
|
||||
expect(complexObject.aDouble, 1.0);
|
||||
expect(complexObject.aListOfStrings, ['one', 'two', 'three']);
|
||||
expect(complexObject.aListOfInts, [1, 2, 3]);
|
||||
expect(complexObject.aListOfDoubles, [1.0, 2.0, 3.0]);
|
||||
expect(complexObject.anObject.aString, "Blah, blah, blah.");
|
||||
expect(complexObject.anObject.aString, 'Blah, blah, blah.');
|
||||
expect(complexObject.anObject.anInt, 1);
|
||||
expect(complexObject.anObject.aDouble, 1.0);
|
||||
expect(complexObject.anObject.aListOfStrings, ['one', 'two', 'three']);
|
||||
@@ -135,8 +135,8 @@ void main() {
|
||||
expect(complexObject.anObject.aListOfDoubles, [1.0, 2.0, 3.0]);
|
||||
expect(complexObject.aListOfObjects.length, 3);
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
expect(complexObject.aListOfObjects[i].aString, "Blah, blah, blah.");
|
||||
for (var i = 0; i < 3; i++) {
|
||||
expect(complexObject.aListOfObjects[i].aString, 'Blah, blah, blah.');
|
||||
expect(complexObject.aListOfObjects[i].anInt, i + 1);
|
||||
expect(complexObject.aListOfObjects[i].aDouble, 1.0);
|
||||
expect(complexObject.aListOfObjects[i].aListOfStrings,
|
||||
@@ -163,7 +163,7 @@ void main() {
|
||||
final complexObject =
|
||||
ConvertedComplexObject.fromJson(emptySimpleObjectsJson);
|
||||
|
||||
expect(complexObject.aString, "Blah, blah, blah.");
|
||||
expect(complexObject.aString, 'Blah, blah, blah.');
|
||||
expect(complexObject.anInt, 1);
|
||||
expect(complexObject.aDouble, 1.0);
|
||||
expect(complexObject.aListOfStrings, ['one', 'two', 'three']);
|
||||
@@ -177,7 +177,7 @@ void main() {
|
||||
expect(complexObject.anObject.aListOfDoubles, isNull);
|
||||
expect(complexObject.aListOfObjects.length, 3);
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
for (var i = 0; i < 3; i++) {
|
||||
expect(complexObject.aListOfObjects[i].aString, isNull);
|
||||
expect(complexObject.aListOfObjects[i].anInt, isNull);
|
||||
expect(complexObject.aListOfObjects[i].aDouble, isNull);
|
||||
@@ -191,13 +191,13 @@ void main() {
|
||||
final complexObject =
|
||||
ConvertedComplexObject.fromJson(unexpectedPropertiesJson);
|
||||
|
||||
expect(complexObject.aString, "Blah, blah, blah.");
|
||||
expect(complexObject.aString, 'Blah, blah, blah.');
|
||||
expect(complexObject.anInt, 1);
|
||||
expect(complexObject.aDouble, 1.0);
|
||||
expect(complexObject.aListOfStrings, ['one', 'two', 'three']);
|
||||
expect(complexObject.aListOfInts, [1, 2, 3]);
|
||||
expect(complexObject.aListOfDoubles, [1.0, 2.0, 3.0]);
|
||||
expect(complexObject.anObject.aString, "Blah, blah, blah.");
|
||||
expect(complexObject.anObject.aString, 'Blah, blah, blah.');
|
||||
expect(complexObject.anObject.anInt, 1);
|
||||
expect(complexObject.anObject.aDouble, 1.0);
|
||||
expect(complexObject.anObject.aListOfStrings, ['one', 'two', 'three']);
|
||||
@@ -205,8 +205,8 @@ void main() {
|
||||
expect(complexObject.anObject.aListOfDoubles, [1.0, 2.0, 3.0]);
|
||||
expect(complexObject.aListOfObjects.length, 3);
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
expect(complexObject.aListOfObjects[i].aString, "Blah, blah, blah.");
|
||||
for (var i = 0; i < 3; i++) {
|
||||
expect(complexObject.aListOfObjects[i].aString, 'Blah, blah, blah.');
|
||||
expect(complexObject.aListOfObjects[i].anInt, i + 1);
|
||||
expect(complexObject.aListOfObjects[i].aDouble, 1.0);
|
||||
expect(complexObject.aListOfObjects[i].aListOfStrings,
|
||||
@@ -222,13 +222,13 @@ void main() {
|
||||
final complexObject =
|
||||
SerializableComplexObject.fromJson(typicalObjectJson);
|
||||
|
||||
expect(complexObject.aString, "Blah, blah, blah.");
|
||||
expect(complexObject.aString, 'Blah, blah, blah.');
|
||||
expect(complexObject.anInt, 1);
|
||||
expect(complexObject.aDouble, 1.0);
|
||||
expect(complexObject.aListOfStrings, ['one', 'two', 'three']);
|
||||
expect(complexObject.aListOfInts, [1, 2, 3]);
|
||||
expect(complexObject.aListOfDoubles, [1.0, 2.0, 3.0]);
|
||||
expect(complexObject.anObject.aString, "Blah, blah, blah.");
|
||||
expect(complexObject.anObject.aString, 'Blah, blah, blah.');
|
||||
expect(complexObject.anObject.anInt, 1);
|
||||
expect(complexObject.anObject.aDouble, 1.0);
|
||||
expect(complexObject.anObject.aListOfStrings, ['one', 'two', 'three']);
|
||||
@@ -236,8 +236,8 @@ void main() {
|
||||
expect(complexObject.anObject.aListOfDoubles, [1.0, 2.0, 3.0]);
|
||||
expect(complexObject.aListOfObjects.length, 3);
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
expect(complexObject.aListOfObjects[i].aString, "Blah, blah, blah.");
|
||||
for (var i = 0; i < 3; i++) {
|
||||
expect(complexObject.aListOfObjects[i].aString, 'Blah, blah, blah.');
|
||||
expect(complexObject.aListOfObjects[i].anInt, i + 1);
|
||||
expect(complexObject.aListOfObjects[i].aDouble, 1.0);
|
||||
expect(complexObject.aListOfObjects[i].aListOfStrings,
|
||||
@@ -264,7 +264,7 @@ void main() {
|
||||
final complexObject =
|
||||
SerializableComplexObject.fromJson(emptySimpleObjectsJson);
|
||||
|
||||
expect(complexObject.aString, "Blah, blah, blah.");
|
||||
expect(complexObject.aString, 'Blah, blah, blah.');
|
||||
expect(complexObject.anInt, 1);
|
||||
expect(complexObject.aDouble, 1.0);
|
||||
expect(complexObject.aListOfStrings, ['one', 'two', 'three']);
|
||||
@@ -278,7 +278,7 @@ void main() {
|
||||
expect(complexObject.anObject.aListOfDoubles, isNull);
|
||||
expect(complexObject.aListOfObjects.length, 3);
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
for (var i = 0; i < 3; i++) {
|
||||
expect(complexObject.aListOfObjects[i].aString, isNull);
|
||||
expect(complexObject.aListOfObjects[i].anInt, isNull);
|
||||
expect(complexObject.aListOfObjects[i].aDouble, isNull);
|
||||
@@ -292,13 +292,13 @@ void main() {
|
||||
final complexObject =
|
||||
SerializableComplexObject.fromJson(unexpectedPropertiesJson);
|
||||
|
||||
expect(complexObject.aString, "Blah, blah, blah.");
|
||||
expect(complexObject.aString, 'Blah, blah, blah.');
|
||||
expect(complexObject.anInt, 1);
|
||||
expect(complexObject.aDouble, 1.0);
|
||||
expect(complexObject.aListOfStrings, ['one', 'two', 'three']);
|
||||
expect(complexObject.aListOfInts, [1, 2, 3]);
|
||||
expect(complexObject.aListOfDoubles, [1.0, 2.0, 3.0]);
|
||||
expect(complexObject.anObject.aString, "Blah, blah, blah.");
|
||||
expect(complexObject.anObject.aString, 'Blah, blah, blah.');
|
||||
expect(complexObject.anObject.anInt, 1);
|
||||
expect(complexObject.anObject.aDouble, 1.0);
|
||||
expect(complexObject.anObject.aListOfStrings, ['one', 'two', 'three']);
|
||||
@@ -306,8 +306,8 @@ void main() {
|
||||
expect(complexObject.anObject.aListOfDoubles, [1.0, 2.0, 3.0]);
|
||||
expect(complexObject.aListOfObjects.length, 3);
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
expect(complexObject.aListOfObjects[i].aString, "Blah, blah, blah.");
|
||||
for (var i = 0; i < 3; i++) {
|
||||
expect(complexObject.aListOfObjects[i].aString, 'Blah, blah, blah.');
|
||||
expect(complexObject.aListOfObjects[i].anInt, i + 1);
|
||||
expect(complexObject.aListOfObjects[i].aDouble, 1.0);
|
||||
expect(complexObject.aListOfObjects[i].aListOfStrings,
|
||||
@@ -323,13 +323,13 @@ void main() {
|
||||
final complexObject = serializers.deserializeWith(
|
||||
BuiltComplexObject.serializer, typicalObjectJson);
|
||||
|
||||
expect(complexObject.aString, "Blah, blah, blah.");
|
||||
expect(complexObject.aString, 'Blah, blah, blah.');
|
||||
expect(complexObject.anInt, 1);
|
||||
expect(complexObject.aDouble, 1.0);
|
||||
expect(complexObject.aListOfStrings, ['one', 'two', 'three']);
|
||||
expect(complexObject.aListOfInts, [1, 2, 3]);
|
||||
expect(complexObject.aListOfDoubles, [1.0, 2.0, 3.0]);
|
||||
expect(complexObject.anObject.aString, "Blah, blah, blah.");
|
||||
expect(complexObject.anObject.aString, 'Blah, blah, blah.');
|
||||
expect(complexObject.anObject.anInt, 1);
|
||||
expect(complexObject.anObject.aDouble, 1.0);
|
||||
expect(complexObject.anObject.aListOfStrings, ['one', 'two', 'three']);
|
||||
@@ -337,8 +337,8 @@ void main() {
|
||||
expect(complexObject.anObject.aListOfDoubles, [1.0, 2.0, 3.0]);
|
||||
expect(complexObject.aListOfObjects.length, 3);
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
expect(complexObject.aListOfObjects[i].aString, "Blah, blah, blah.");
|
||||
for (var i = 0; i < 3; i++) {
|
||||
expect(complexObject.aListOfObjects[i].aString, 'Blah, blah, blah.');
|
||||
expect(complexObject.aListOfObjects[i].anInt, i + 1);
|
||||
expect(complexObject.aListOfObjects[i].aDouble, 1.0);
|
||||
expect(complexObject.aListOfObjects[i].aListOfStrings,
|
||||
@@ -366,7 +366,7 @@ void main() {
|
||||
final complexObject = serializers.deserializeWith(
|
||||
BuiltComplexObject.serializer, emptySimpleObjectsJson);
|
||||
|
||||
expect(complexObject.aString, "Blah, blah, blah.");
|
||||
expect(complexObject.aString, 'Blah, blah, blah.');
|
||||
expect(complexObject.anInt, 1);
|
||||
expect(complexObject.aDouble, 1.0);
|
||||
expect(complexObject.aListOfStrings, ['one', 'two', 'three']);
|
||||
@@ -380,7 +380,7 @@ void main() {
|
||||
expect(complexObject.anObject.aListOfDoubles, isNull);
|
||||
expect(complexObject.aListOfObjects.length, 3);
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
for (var i = 0; i < 3; i++) {
|
||||
expect(complexObject.aListOfObjects[i].aString, isNull);
|
||||
expect(complexObject.aListOfObjects[i].anInt, isNull);
|
||||
expect(complexObject.aListOfObjects[i].aDouble, isNull);
|
||||
@@ -394,13 +394,13 @@ void main() {
|
||||
final complexObject = serializers.deserializeWith(
|
||||
BuiltComplexObject.serializer, unexpectedPropertiesJson);
|
||||
|
||||
expect(complexObject.aString, "Blah, blah, blah.");
|
||||
expect(complexObject.aString, 'Blah, blah, blah.');
|
||||
expect(complexObject.anInt, 1);
|
||||
expect(complexObject.aDouble, 1.0);
|
||||
expect(complexObject.aListOfStrings, ['one', 'two', 'three']);
|
||||
expect(complexObject.aListOfInts, [1, 2, 3]);
|
||||
expect(complexObject.aListOfDoubles, [1.0, 2.0, 3.0]);
|
||||
expect(complexObject.anObject.aString, "Blah, blah, blah.");
|
||||
expect(complexObject.anObject.aString, 'Blah, blah, blah.');
|
||||
expect(complexObject.anObject.anInt, 1);
|
||||
expect(complexObject.anObject.aDouble, 1.0);
|
||||
expect(complexObject.anObject.aListOfStrings, ['one', 'two', 'three']);
|
||||
@@ -408,8 +408,8 @@ void main() {
|
||||
expect(complexObject.anObject.aListOfDoubles, [1.0, 2.0, 3.0]);
|
||||
expect(complexObject.aListOfObjects.length, 3);
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
expect(complexObject.aListOfObjects[i].aString, "Blah, blah, blah.");
|
||||
for (var i = 0; i < 3; i++) {
|
||||
expect(complexObject.aListOfObjects[i].aString, 'Blah, blah, blah.');
|
||||
expect(complexObject.aListOfObjects[i].anInt, i + 1);
|
||||
expect(complexObject.aListOfObjects[i].aDouble, 1.0);
|
||||
expect(complexObject.aListOfObjects[i].aListOfStrings,
|
||||
|
||||
@@ -46,7 +46,7 @@ void main() {
|
||||
final simpleObject = ConvertedSimpleObject.fromJson(typicalObjectJson);
|
||||
|
||||
expect(simpleObject, isNotNull);
|
||||
expect(simpleObject.aString, "Blah, blah, blah.");
|
||||
expect(simpleObject.aString, 'Blah, blah, blah.');
|
||||
expect(simpleObject.anInt, 1);
|
||||
expect(simpleObject.aDouble, 1.0);
|
||||
expect(simpleObject.aListOfStrings, ['one', 'two', 'three']);
|
||||
@@ -70,7 +70,7 @@ void main() {
|
||||
final simpleObject = ConvertedSimpleObject.fromJson(emptyListJson);
|
||||
|
||||
expect(simpleObject, isNotNull);
|
||||
expect(simpleObject.aString, "Blah, blah, blah.");
|
||||
expect(simpleObject.aString, 'Blah, blah, blah.');
|
||||
expect(simpleObject.anInt, 1);
|
||||
expect(simpleObject.aDouble, 1.0);
|
||||
expect(simpleObject.aListOfStrings, <String>[]);
|
||||
@@ -83,7 +83,7 @@ void main() {
|
||||
ConvertedSimpleObject.fromJson(unexpectedPropertiesJson);
|
||||
|
||||
expect(simpleObject, isNotNull);
|
||||
expect(simpleObject.aString, "Blah, blah, blah.");
|
||||
expect(simpleObject.aString, 'Blah, blah, blah.');
|
||||
expect(simpleObject.anInt, 1);
|
||||
expect(simpleObject.aDouble, 1.0);
|
||||
expect(simpleObject.aListOfStrings, ['one', 'two', 'three']);
|
||||
@@ -97,7 +97,7 @@ void main() {
|
||||
final simpleObject = SerializableSimpleObject.fromJson(typicalObjectJson);
|
||||
|
||||
expect(simpleObject, isNotNull);
|
||||
expect(simpleObject.aString, "Blah, blah, blah.");
|
||||
expect(simpleObject.aString, 'Blah, blah, blah.');
|
||||
expect(simpleObject.anInt, 1);
|
||||
expect(simpleObject.aDouble, 1.0);
|
||||
expect(simpleObject.aListOfStrings, ['one', 'two', 'three']);
|
||||
@@ -121,7 +121,7 @@ void main() {
|
||||
final simpleObject = SerializableSimpleObject.fromJson(emptyListJson);
|
||||
|
||||
expect(simpleObject, isNotNull);
|
||||
expect(simpleObject.aString, "Blah, blah, blah.");
|
||||
expect(simpleObject.aString, 'Blah, blah, blah.');
|
||||
expect(simpleObject.anInt, 1);
|
||||
expect(simpleObject.aDouble, 1.0);
|
||||
expect(simpleObject.aListOfStrings, <String>[]);
|
||||
@@ -134,7 +134,7 @@ void main() {
|
||||
SerializableSimpleObject.fromJson(unexpectedPropertiesJson);
|
||||
|
||||
expect(simpleObject, isNotNull);
|
||||
expect(simpleObject.aString, "Blah, blah, blah.");
|
||||
expect(simpleObject.aString, 'Blah, blah, blah.');
|
||||
expect(simpleObject.anInt, 1);
|
||||
expect(simpleObject.aDouble, 1.0);
|
||||
expect(simpleObject.aListOfStrings, ['one', 'two', 'three']);
|
||||
@@ -149,7 +149,7 @@ void main() {
|
||||
BuiltSimpleObject.serializer, typicalObjectJson);
|
||||
|
||||
expect(simpleObject, isNotNull);
|
||||
expect(simpleObject.aString, "Blah, blah, blah.");
|
||||
expect(simpleObject.aString, 'Blah, blah, blah.');
|
||||
expect(simpleObject.anInt, 1);
|
||||
expect(simpleObject.aDouble, 1.0);
|
||||
expect(simpleObject.aListOfStrings, ['one', 'two', 'three']);
|
||||
@@ -175,7 +175,7 @@ void main() {
|
||||
BuiltSimpleObject.serializer, emptyListJson);
|
||||
|
||||
expect(simpleObject, isNotNull);
|
||||
expect(simpleObject.aString, "Blah, blah, blah.");
|
||||
expect(simpleObject.aString, 'Blah, blah, blah.');
|
||||
expect(simpleObject.anInt, 1);
|
||||
expect(simpleObject.aDouble, 1.0);
|
||||
expect(simpleObject.aListOfStrings, <String>[]);
|
||||
@@ -188,7 +188,7 @@ void main() {
|
||||
BuiltSimpleObject.serializer, unexpectedPropertiesJson);
|
||||
|
||||
expect(simpleObject, isNotNull);
|
||||
expect(simpleObject.aString, "Blah, blah, blah.");
|
||||
expect(simpleObject.aString, 'Blah, blah, blah.');
|
||||
expect(simpleObject.anInt, 1);
|
||||
expect(simpleObject.aDouble, 1.0);
|
||||
expect(simpleObject.aListOfStrings, ['one', 'two', 'three']);
|
||||
|
||||
@@ -83,7 +83,7 @@ void main() {
|
||||
aListOfInts: [1, 2, 3],
|
||||
aListOfDoubles: [1.0, 2.0, 3.0],
|
||||
anObject: ConvertedSimpleObject(
|
||||
aString: "Child 1",
|
||||
aString: 'Child 1',
|
||||
anInt: 101,
|
||||
aDouble: 101.0,
|
||||
aListOfStrings: ['1011', '1012', '1013'],
|
||||
@@ -92,7 +92,7 @@ void main() {
|
||||
),
|
||||
aListOfObjects: [
|
||||
ConvertedSimpleObject(
|
||||
aString: "Child 2",
|
||||
aString: 'Child 2',
|
||||
anInt: 102,
|
||||
aDouble: 102.0,
|
||||
aListOfStrings: ['1021', '1022', '1023'],
|
||||
@@ -100,7 +100,7 @@ void main() {
|
||||
aListOfDoubles: [1021.0, 1022.0, 1023.0],
|
||||
),
|
||||
ConvertedSimpleObject(
|
||||
aString: "Child 3",
|
||||
aString: 'Child 3',
|
||||
anInt: 103,
|
||||
aDouble: 103.0,
|
||||
aListOfStrings: ['1031', '1032', '1033'],
|
||||
@@ -108,7 +108,7 @@ void main() {
|
||||
aListOfDoubles: [1031.0, 1032.0, 1033.0],
|
||||
),
|
||||
ConvertedSimpleObject(
|
||||
aString: "Child 4",
|
||||
aString: 'Child 4',
|
||||
anInt: 104,
|
||||
aDouble: 104.0,
|
||||
aListOfStrings: ['1041', '1042', '1043'],
|
||||
@@ -131,7 +131,7 @@ void main() {
|
||||
expect(find.text('[1, 2, 3]'), findsOneWidget);
|
||||
expect(find.text('[1.0, 2.0, 3.0]'), findsOneWidget);
|
||||
|
||||
for (int i = 1; i <= 4; i++) {
|
||||
for (var i = 1; i <= 4; i++) {
|
||||
expect(find.text('"Child $i"'), findsOneWidget);
|
||||
expect(find.text('10$i'), findsOneWidget);
|
||||
expect(find.text('10$i.0'), findsOneWidget);
|
||||
@@ -150,7 +150,7 @@ void main() {
|
||||
aListOfInts: [],
|
||||
aListOfDoubles: [],
|
||||
anObject: ConvertedSimpleObject(
|
||||
aString: "Child 1",
|
||||
aString: 'Child 1',
|
||||
anInt: 101,
|
||||
aDouble: 101.0,
|
||||
aListOfStrings: ['1011', '1012', '1013'],
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
include: package:pedantic/analysis_options.1.8.0.yaml
|
||||
include: package:pedantic/analysis_options.1.9.0.yaml
|
||||
|
||||
analyzer:
|
||||
strong-mode:
|
||||
|
||||
@@ -24,16 +24,17 @@ class AppModel<T> extends StatefulWidget {
|
||||
final T initialState;
|
||||
final Widget child;
|
||||
|
||||
@override
|
||||
_AppModelState<T> createState() => _AppModelState<T>();
|
||||
|
||||
static T of<T>(BuildContext context) {
|
||||
final _AppModelScope<T> scope =
|
||||
final scope =
|
||||
context.dependOnInheritedWidgetOfExactType<_AppModelScope<T>>();
|
||||
return scope.appModelState.currentState;
|
||||
}
|
||||
|
||||
static void update<T>(BuildContext context, T newState) {
|
||||
final _AppModelScope<T> scope =
|
||||
final scope =
|
||||
context.dependOnInheritedWidgetOfExactType<_AppModelScope<T>>();
|
||||
scope.appModelState.updateState(newState);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ class PlaceList extends StatefulWidget {
|
||||
}
|
||||
|
||||
class PlaceListState extends State<PlaceList> {
|
||||
ScrollController _scrollController = ScrollController();
|
||||
final ScrollController _scrollController = ScrollController();
|
||||
|
||||
void _onCategoryChanged(PlaceCategory newCategory) {
|
||||
_scrollController.jumpTo(0.0);
|
||||
@@ -107,7 +107,7 @@ class _PlaceListTile extends StatelessWidget {
|
||||
}).toList(),
|
||||
),
|
||||
Text(
|
||||
place.description != null ? place.description : '',
|
||||
place.description ?? '',
|
||||
style: Theme.of(context).textTheme.subtitle1,
|
||||
maxLines: 4,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
|
||||
@@ -22,13 +22,16 @@ class PlaceMap extends StatefulWidget {
|
||||
}
|
||||
|
||||
class PlaceMapState extends State<PlaceMap> {
|
||||
static BitmapDescriptor _getPlaceMarkerIcon(PlaceCategory category) {
|
||||
static Future<BitmapDescriptor> _getPlaceMarkerIcon(
|
||||
BuildContext context, PlaceCategory category) async {
|
||||
switch (category) {
|
||||
case PlaceCategory.favorite:
|
||||
return BitmapDescriptor.fromAsset('assets/heart.png');
|
||||
return BitmapDescriptor.fromAssetImage(
|
||||
createLocalImageConfiguration(context), 'assets/heart.png');
|
||||
break;
|
||||
case PlaceCategory.visited:
|
||||
return BitmapDescriptor.fromAsset('assets/visited.png');
|
||||
return BitmapDescriptor.fromAssetImage(
|
||||
createLocalImageConfiguration(context), 'assets/visited.png');
|
||||
break;
|
||||
case PlaceCategory.wantToGo:
|
||||
default:
|
||||
@@ -47,7 +50,7 @@ class PlaceMapState extends State<PlaceMap> {
|
||||
|
||||
LatLng _lastMapPosition;
|
||||
|
||||
Map<Marker, Place> _markedPlaces = Map<Marker, Place>();
|
||||
final Map<Marker, Place> _markedPlaces = <Marker, Place>{};
|
||||
|
||||
final Set<Marker> _markers = {};
|
||||
|
||||
@@ -61,10 +64,12 @@ class PlaceMapState extends State<PlaceMap> {
|
||||
|
||||
// Draw initial place markers on creation so that we have something
|
||||
// interesting to look at.
|
||||
var markers = <Marker>{};
|
||||
for (var place in AppState.of(context).places) {
|
||||
markers.add(await _createPlaceMarker(context, place));
|
||||
}
|
||||
setState(() {
|
||||
for (Place place in AppState.of(context).places) {
|
||||
_markers.add(_createPlaceMarker(place));
|
||||
}
|
||||
_markers.addAll(markers);
|
||||
});
|
||||
|
||||
// Zoom to fit the initially selected category.
|
||||
@@ -76,7 +81,7 @@ class PlaceMapState extends State<PlaceMap> {
|
||||
);
|
||||
}
|
||||
|
||||
Marker _createPlaceMarker(Place place) {
|
||||
Future<Marker> _createPlaceMarker(BuildContext context, Place place) async {
|
||||
final marker = Marker(
|
||||
markerId: MarkerId(place.latLng.toString()),
|
||||
position: place.latLng,
|
||||
@@ -85,7 +90,7 @@ class PlaceMapState extends State<PlaceMap> {
|
||||
snippet: '${place.starRating} Star Rating',
|
||||
onTap: () => _pushPlaceDetailsScreen(place),
|
||||
),
|
||||
icon: _getPlaceMarkerIcon(place.category),
|
||||
icon: await _getPlaceMarkerIcon(context, place.category),
|
||||
visible: place.category == AppState.of(context).selectedCategory,
|
||||
);
|
||||
_markedPlaces[marker] = place;
|
||||
@@ -126,7 +131,7 @@ class PlaceMapState extends State<PlaceMap> {
|
||||
}
|
||||
|
||||
void _updateExistingPlaceMarker({@required Place place}) {
|
||||
Marker marker = _markedPlaces.keys
|
||||
var marker = _markedPlaces.keys
|
||||
.singleWhere((value) => _markedPlaces[value].id == place.id);
|
||||
|
||||
setState(() {
|
||||
@@ -160,7 +165,7 @@ class PlaceMapState extends State<PlaceMap> {
|
||||
|
||||
Future<void> _showPlacesForSelectedCategory(PlaceCategory category) async {
|
||||
setState(() {
|
||||
for (Marker marker in List.of(_markedPlaces.keys)) {
|
||||
for (var marker in List.of(_markedPlaces.keys)) {
|
||||
final place = _markedPlaces[marker];
|
||||
final updatedMarker = marker.copyWith(
|
||||
visibleParam: place.category == category,
|
||||
@@ -181,15 +186,15 @@ class PlaceMapState extends State<PlaceMap> {
|
||||
}
|
||||
|
||||
Future<void> _zoomToFitPlaces(List<Place> places) async {
|
||||
GoogleMapController controller = await mapController.future;
|
||||
var controller = await mapController.future;
|
||||
|
||||
// Default min/max values to latitude and longitude of center.
|
||||
double minLat = widget.center.latitude;
|
||||
double maxLat = widget.center.latitude;
|
||||
double minLong = widget.center.longitude;
|
||||
double maxLong = widget.center.longitude;
|
||||
var minLat = widget.center.latitude;
|
||||
var maxLat = widget.center.latitude;
|
||||
var minLong = widget.center.longitude;
|
||||
var maxLong = widget.center.longitude;
|
||||
|
||||
for (Place place in places) {
|
||||
for (var place in places) {
|
||||
minLat = min(minLat, place.latitude);
|
||||
maxLat = max(maxLat, place.latitude);
|
||||
minLong = min(minLong, place.longitude);
|
||||
@@ -224,16 +229,19 @@ class PlaceMapState extends State<PlaceMap> {
|
||||
Future<void> _confirmAddPlace(BuildContext context) async {
|
||||
if (_pendingMarker != null) {
|
||||
// Create a new Place and map it to the marker we just added.
|
||||
final Place newPlace = Place(
|
||||
id: Uuid().v1() as String,
|
||||
final newPlace = Place(
|
||||
id: Uuid().v1(),
|
||||
latLng: _pendingMarker.position,
|
||||
name: _pendingMarker.infoWindow.title,
|
||||
category: AppState.of(context).selectedCategory,
|
||||
);
|
||||
|
||||
var placeMarker = await _getPlaceMarkerIcon(
|
||||
context, AppState.of(context).selectedCategory);
|
||||
|
||||
setState(() {
|
||||
final updatedMarker = _pendingMarker.copyWith(
|
||||
iconParam: _getPlaceMarkerIcon(AppState.of(context).selectedCategory),
|
||||
iconParam: placeMarker,
|
||||
infoWindowParam: InfoWindow(
|
||||
title: 'New Place',
|
||||
snippet: null,
|
||||
@@ -267,7 +275,7 @@ class PlaceMapState extends State<PlaceMap> {
|
||||
);
|
||||
|
||||
// Add the new place to the places stored in appState.
|
||||
final List<Place> newPlaces = List.from(AppState.of(context).places)
|
||||
final newPlaces = List<Place>.from(AppState.of(context).places)
|
||||
..add(newPlace);
|
||||
|
||||
// Manually update our map configuration here since our map is already
|
||||
@@ -292,7 +300,7 @@ class PlaceMapState extends State<PlaceMap> {
|
||||
}
|
||||
|
||||
void _onToggleMapTypePressed() {
|
||||
final MapType nextType =
|
||||
final nextType =
|
||||
MapType.values[(_currentMapType.index + 1) % MapType.values.length];
|
||||
|
||||
setState(() {
|
||||
@@ -302,8 +310,7 @@ class PlaceMapState extends State<PlaceMap> {
|
||||
|
||||
Future<void> _maybeUpdateMapConfiguration() async {
|
||||
_configuration ??= MapConfiguration.of(AppState.of(context));
|
||||
final MapConfiguration newConfiguration =
|
||||
MapConfiguration.of(AppState.of(context));
|
||||
final newConfiguration = MapConfiguration.of(AppState.of(context));
|
||||
|
||||
// Since we manually update [_configuration] when place or selectedCategory
|
||||
// changes come from the [place_map], we should only enter this if statement
|
||||
|
||||
@@ -69,6 +69,13 @@ packages:
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
flutter_plugin_android_lifecycle:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flutter_plugin_android_lifecycle
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.7"
|
||||
flutter_test:
|
||||
dependency: "direct dev"
|
||||
description: flutter
|
||||
@@ -80,7 +87,14 @@ packages:
|
||||
name: google_maps_flutter
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.4.0"
|
||||
version: "0.5.27+1"
|
||||
google_maps_flutter_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: google_maps_flutter_platform_interface
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.1"
|
||||
image:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -123,6 +137,13 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.4.0"
|
||||
plugin_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: plugin_platform_interface
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.2"
|
||||
quiver:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -156,6 +177,13 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.0"
|
||||
stream_transform:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stream_transform
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0"
|
||||
string_scanner:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -190,7 +218,7 @@ packages:
|
||||
name: uuid
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.3"
|
||||
version: "2.0.4"
|
||||
vector_math:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -207,4 +235,4 @@ packages:
|
||||
version: "3.6.1"
|
||||
sdks:
|
||||
dart: ">=2.6.0 <3.0.0"
|
||||
flutter: ">=0.11.9 <2.0.0"
|
||||
flutter: ">=1.12.13+hotfix.5 <2.0.0"
|
||||
|
||||
@@ -11,13 +11,13 @@ dependencies:
|
||||
sdk: flutter
|
||||
|
||||
cupertino_icons: ^0.1.3
|
||||
google_maps_flutter: ^0.4.0
|
||||
uuid: ^1.0.3
|
||||
google_maps_flutter: ^0.5.27+1
|
||||
uuid: ^2.0.4
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
pedantic: ^1.8.0
|
||||
pedantic: ^1.9.0
|
||||
|
||||
flutter:
|
||||
assets:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
include: package:pedantic/analysis_options.1.8.0.yaml
|
||||
include: package:pedantic/analysis_options.1.9.0.yaml
|
||||
|
||||
analyzer:
|
||||
strong-mode:
|
||||
|
||||
@@ -283,7 +283,7 @@ void showChoices(BuildContext context, List<String> choices) {
|
||||
showDialog<void>(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
int selectedRadio = 1;
|
||||
var selectedRadio = 1;
|
||||
return AlertDialog(
|
||||
contentPadding: EdgeInsets.only(top: 12),
|
||||
content: StatefulBuilder(
|
||||
|
||||
@@ -16,7 +16,7 @@ dependencies:
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
pedantic: ^1.8.0
|
||||
pedantic: ^1.9.0
|
||||
|
||||
flutter:
|
||||
uses-material-design: true
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
include: package:pedantic/analysis_options.1.8.0.yaml
|
||||
include: package:pedantic/analysis_options.1.9.0.yaml
|
||||
|
||||
analyzer:
|
||||
strong-mode:
|
||||
|
||||
@@ -40,8 +40,8 @@ class _HomePageState extends State<HomePage> {
|
||||
int _counter = 0;
|
||||
|
||||
Future<void> _launchPlatformCount() async {
|
||||
final int platformCounter =
|
||||
await _methodChannel.invokeMethod('switchView', _counter);
|
||||
final platformCounter =
|
||||
await _methodChannel.invokeMethod<int>('switchView', _counter);
|
||||
setState(() => _counter = platformCounter);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ dependencies:
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
pedantic: ^1.8.0
|
||||
pedantic: ^1.9.0
|
||||
|
||||
flutter:
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
include: package:pedantic/analysis_options.1.8.0.yaml
|
||||
include: package:pedantic/analysis_options.1.9.0.yaml
|
||||
|
||||
analyzer:
|
||||
strong-mode:
|
||||
|
||||
@@ -95,6 +95,13 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.8"
|
||||
nested:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: nested
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.0.4"
|
||||
path:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -122,7 +129,7 @@ packages:
|
||||
name: provider
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.2.0"
|
||||
version: "4.1.0"
|
||||
quiver:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -199,4 +206,5 @@ packages:
|
||||
source: hosted
|
||||
version: "3.6.1"
|
||||
sdks:
|
||||
dart: ">=2.6.0 <3.0.0"
|
||||
dart: ">=2.7.0 <3.0.0"
|
||||
flutter: ">=1.17.0"
|
||||
|
||||
@@ -11,13 +11,13 @@ dependencies:
|
||||
flutter:
|
||||
sdk: flutter
|
||||
|
||||
provider: ^3.1.0+1
|
||||
provider: ^4.1.0
|
||||
cupertino_icons: ^0.1.3
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
pedantic: ^1.8.0
|
||||
pedantic: ^1.9.0
|
||||
|
||||
|
||||
flutter:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
include: package:pedantic/analysis_options.1.8.0.yaml
|
||||
include: package:pedantic/analysis_options.1.9.0.yaml
|
||||
|
||||
analyzer:
|
||||
strong-mode:
|
||||
|
||||
@@ -122,7 +122,7 @@ packages:
|
||||
name: provider
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "4.0.4"
|
||||
version: "4.1.0"
|
||||
quiver:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -199,5 +199,5 @@ packages:
|
||||
source: hosted
|
||||
version: "3.6.1"
|
||||
sdks:
|
||||
dart: ">=2.6.0 <3.0.0"
|
||||
flutter: ">=1.12.1"
|
||||
dart: ">=2.7.0 <3.0.0"
|
||||
flutter: ">=1.17.0"
|
||||
|
||||
@@ -16,7 +16,7 @@ dependencies:
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
pedantic: ^1.8.0
|
||||
pedantic: ^1.9.0
|
||||
|
||||
flutter:
|
||||
uses-material-design: true
|
||||
|
||||
@@ -47,7 +47,7 @@ void main() {
|
||||
await tester.pumpWidget(createCartScreen());
|
||||
|
||||
// Adding five items in the cart and testing.
|
||||
for (int i = 0; i < 5; i++) {
|
||||
for (var i = 0; i < 5; i++) {
|
||||
var item = catalogModel.getByPosition(i);
|
||||
cartModel.add(item);
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
@@ -35,7 +35,7 @@ void main() {
|
||||
|
||||
// Testing for the items on the screen after modifying
|
||||
// the model for a fixed number of items.
|
||||
for (String item in catalogListItems) {
|
||||
for (var item in catalogListItems) {
|
||||
expect(find.text(item), findsWidgets);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -10,5 +10,6 @@ do
|
||||
cd `dirname $file`
|
||||
echo "Updating `pwd`"
|
||||
flutter pub upgrade
|
||||
flutter pub outdated
|
||||
)
|
||||
done
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
include: package:pedantic/analysis_options.1.8.0.yaml
|
||||
include: package:pedantic/analysis_options.1.9.0.yaml
|
||||
|
||||
analyzer:
|
||||
strong-mode:
|
||||
|
||||
@@ -7,7 +7,7 @@ import 'package:veggieseasons/data/veggie.dart';
|
||||
import 'package:veggieseasons/data/local_veggie_provider.dart';
|
||||
|
||||
class AppState extends Model {
|
||||
List<Veggie> _veggies;
|
||||
final List<Veggie> _veggies;
|
||||
|
||||
AppState() : _veggies = LocalVeggieProvider.veggies;
|
||||
|
||||
@@ -16,12 +16,12 @@ class AppState extends Model {
|
||||
Veggie getVeggie(int id) => _veggies.singleWhere((v) => v.id == id);
|
||||
|
||||
List<Veggie> get availableVeggies {
|
||||
Season currentSeason = _getSeasonForDate(DateTime.now());
|
||||
var currentSeason = _getSeasonForDate(DateTime.now());
|
||||
return _veggies.where((v) => v.seasons.contains(currentSeason)).toList();
|
||||
}
|
||||
|
||||
List<Veggie> get unavailableVeggies {
|
||||
Season currentSeason = _getSeasonForDate(DateTime.now());
|
||||
var currentSeason = _getSeasonForDate(DateTime.now());
|
||||
return _veggies.where((v) => !v.seasons.contains(currentSeason)).toList();
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ class AppState extends Model {
|
||||
.toList();
|
||||
|
||||
void setFavorite(int id, bool isFavorite) {
|
||||
Veggie veggie = getVeggie(id);
|
||||
var veggie = getVeggie(id);
|
||||
veggie.isFavorite = isFavorite;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ class Preferences extends Model {
|
||||
|
||||
int _desiredCalories = 2000;
|
||||
|
||||
Set<VeggieCategory> _preferredCategories = Set<VeggieCategory>();
|
||||
final Set<VeggieCategory> _preferredCategories = <VeggieCategory>{};
|
||||
|
||||
Future<int> get desiredCalories async {
|
||||
await _loading;
|
||||
|
||||
@@ -28,7 +28,7 @@ class ServingInfoChart extends StatelessWidget {
|
||||
builder: (context, snapshot) {
|
||||
final target = snapshot?.data ?? 2000;
|
||||
final percent = standardPercentage * 2000 ~/ target;
|
||||
final CupertinoThemeData themeData = CupertinoTheme.of(context);
|
||||
final themeData = CupertinoTheme.of(context);
|
||||
|
||||
return Text(
|
||||
'$percent% DV',
|
||||
@@ -41,7 +41,7 @@ class ServingInfoChart extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final CupertinoThemeData themeData = CupertinoTheme.of(context);
|
||||
final themeData = CupertinoTheme.of(context);
|
||||
return Column(
|
||||
children: [
|
||||
SizedBox(height: 16),
|
||||
@@ -141,8 +141,8 @@ class ServingInfoChart extends StatelessWidget {
|
||||
future: prefs.desiredCalories,
|
||||
builder: (context, snapshot) {
|
||||
return Text(
|
||||
'Percent daily values based on a diet of ' +
|
||||
'${snapshot?.data ?? '2,000'} calories.',
|
||||
'Percent daily values based on a diet of '
|
||||
'${snapshot?.data ?? '2,000'} calories.',
|
||||
style: Styles.detailsServingNoteText(themeData),
|
||||
);
|
||||
},
|
||||
@@ -161,11 +161,12 @@ class InfoView extends StatelessWidget {
|
||||
|
||||
const InfoView(this.id);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final appState = ScopedModel.of<AppState>(context, rebuildOnChange: true);
|
||||
final prefs = ScopedModel.of<Preferences>(context, rebuildOnChange: true);
|
||||
final veggie = appState.getVeggie(id);
|
||||
final CupertinoThemeData themeData = CupertinoTheme.of(context);
|
||||
final themeData = CupertinoTheme.of(context);
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(24),
|
||||
|
||||
@@ -20,7 +20,7 @@ class ListScreen extends StatelessWidget {
|
||||
child: FutureBuilder<Set<VeggieCategory>>(
|
||||
future: prefs.preferredCategories,
|
||||
builder: (context, snapshot) {
|
||||
final data = snapshot.data ?? Set<VeggieCategory>();
|
||||
final data = snapshot.data ?? <VeggieCategory>{};
|
||||
return VeggieCard(veggie, inSeason, data.contains(veggie.category));
|
||||
}),
|
||||
);
|
||||
@@ -30,13 +30,13 @@ class ListScreen extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return CupertinoTabView(
|
||||
builder: (context) {
|
||||
String dateString = DateFormat("MMMM y").format(DateTime.now());
|
||||
var dateString = DateFormat('MMMM y').format(DateTime.now());
|
||||
|
||||
final appState =
|
||||
ScopedModel.of<AppState>(context, rebuildOnChange: true);
|
||||
final prefs =
|
||||
ScopedModel.of<Preferences>(context, rebuildOnChange: true);
|
||||
final CupertinoThemeData themeData = CupertinoTheme.of(context);
|
||||
final themeData = CupertinoTheme.of(context);
|
||||
return SafeArea(
|
||||
bottom: false,
|
||||
child: ListView.builder(
|
||||
@@ -66,7 +66,7 @@ class ListScreen extends StatelessWidget {
|
||||
style: Styles.headlineText(themeData)),
|
||||
);
|
||||
} else {
|
||||
int relativeIndex =
|
||||
var relativeIndex =
|
||||
index - (appState.availableVeggies.length + 2);
|
||||
return _generateVeggieRow(
|
||||
appState.unavailableVeggies[relativeIndex], prefs,
|
||||
|
||||
@@ -17,7 +17,7 @@ class VeggieCategorySettingsScreen extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
final model = ScopedModel.of<Preferences>(context, rebuildOnChange: true);
|
||||
final currentPrefs = model.preferredCategories;
|
||||
Brightness brightness = CupertinoTheme.brightnessOf(context);
|
||||
var brightness = CupertinoTheme.brightnessOf(context);
|
||||
return CupertinoPageScaffold(
|
||||
navigationBar: CupertinoNavigationBar(
|
||||
middle: Text('Preferred Categories'),
|
||||
@@ -80,7 +80,7 @@ class CalorieSettingsScreen extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final model = ScopedModel.of<Preferences>(context, rebuildOnChange: true);
|
||||
Brightness brightness = CupertinoTheme.brightnessOf(context);
|
||||
var brightness = CupertinoTheme.brightnessOf(context);
|
||||
return CupertinoPageScaffold(
|
||||
navigationBar: CupertinoNavigationBar(
|
||||
previousPageTitle: 'Settings',
|
||||
@@ -93,7 +93,7 @@ class CalorieSettingsScreen extends StatelessWidget {
|
||||
builder: (context, snapshot) {
|
||||
final steps = <SettingsItem>[];
|
||||
|
||||
for (int cals = max; cals < min; cals += step) {
|
||||
for (var cals = max; cals < min; cals += step) {
|
||||
steps.add(
|
||||
SettingsItem(
|
||||
label: cals.toString(),
|
||||
|
||||
@@ -17,7 +17,7 @@ class SearchBar extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final CupertinoThemeData themeData = CupertinoTheme.of(context);
|
||||
final themeData = CupertinoTheme.of(context);
|
||||
|
||||
return DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
|
||||
@@ -76,9 +76,9 @@ class SettingsGroup extends StatelessWidget {
|
||||
final Widget footer;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Brightness brightness = CupertinoTheme.brightnessOf(context);
|
||||
var brightness = CupertinoTheme.brightnessOf(context);
|
||||
final dividedItems = <Widget>[items[0]];
|
||||
for (int i = 1; i < items.length; i++) {
|
||||
for (var i = 1; i < items.length; i++) {
|
||||
dividedItems.add(Container(
|
||||
color: Styles.settingsLineation(brightness),
|
||||
height: 0.3,
|
||||
|
||||
@@ -85,8 +85,8 @@ class SettingsItemState extends State<SettingsItem> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
CupertinoThemeData themeData = CupertinoTheme.of(context);
|
||||
Brightness brightness = CupertinoTheme.brightnessOf(context);
|
||||
var themeData = CupertinoTheme.of(context);
|
||||
var brightness = CupertinoTheme.brightnessOf(context);
|
||||
return AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 200),
|
||||
color: Styles.settingsItemColor(brightness),
|
||||
|
||||
@@ -106,7 +106,7 @@ class _TriviaViewState extends State<TriviaView> {
|
||||
// Widget shown when the game is over. It includes the score and a button to
|
||||
// restart everything.
|
||||
Widget _buildFinishedView() {
|
||||
final CupertinoThemeData themeData = CupertinoTheme.of(context);
|
||||
final themeData = CupertinoTheme.of(context);
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(32),
|
||||
|
||||
@@ -46,9 +46,9 @@ class VeggieHeadline extends StatelessWidget {
|
||||
const VeggieHeadline(this.veggie);
|
||||
|
||||
List<Widget> _buildSeasonDots(List<Season> seasons) {
|
||||
List<Widget> widgets = <Widget>[];
|
||||
var widgets = <Widget>[];
|
||||
|
||||
for (Season season in seasons) {
|
||||
for (var season in seasons) {
|
||||
widgets.add(SizedBox(width: 4));
|
||||
widgets.add(
|
||||
Container(
|
||||
@@ -67,7 +67,7 @@ class VeggieHeadline extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final CupertinoThemeData themeData = CupertinoTheme.of(context);
|
||||
final themeData = CupertinoTheme.of(context);
|
||||
|
||||
return GestureDetector(
|
||||
onTap: () => Navigator.of(context).push<void>(CupertinoPageRoute(
|
||||
|
||||
@@ -36,13 +36,6 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.3"
|
||||
clock:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: clock
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.1"
|
||||
collection:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -71,13 +64,6 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.1.3"
|
||||
fake_async:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: fake_async
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
flutter:
|
||||
dependency: "direct main"
|
||||
description: flutter
|
||||
@@ -141,7 +127,7 @@ packages:
|
||||
name: path
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.7.0"
|
||||
version: "1.6.4"
|
||||
pedantic:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
@@ -155,7 +141,14 @@ packages:
|
||||
name: petitparser
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.0.2"
|
||||
version: "2.4.0"
|
||||
quiver:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: quiver
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.3"
|
||||
scoped_model:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -258,7 +251,7 @@ packages:
|
||||
name: xml
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.7.0"
|
||||
version: "3.6.1"
|
||||
yaml:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -267,5 +260,5 @@ packages:
|
||||
source: hosted
|
||||
version: "2.2.1"
|
||||
sdks:
|
||||
dart: ">=2.7.0 <3.0.0"
|
||||
dart: ">=2.6.0 <3.0.0"
|
||||
flutter: ">=1.12.13+hotfix.5 <2.0.0"
|
||||
|
||||
@@ -19,7 +19,7 @@ dependencies:
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
pedantic: ^1.8.0+1
|
||||
pedantic: ^1.9.0
|
||||
flutter_launcher_icons: ^0.7.5
|
||||
|
||||
flutter:
|
||||
|
||||
@@ -28,6 +28,6 @@ packages:
|
||||
name: path
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.6.4"
|
||||
version: "1.7.0"
|
||||
sdks:
|
||||
dart: ">=2.3.0 <3.0.0"
|
||||
|
||||
@@ -54,7 +54,7 @@ packages:
|
||||
name: path
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.6.4"
|
||||
version: "1.7.0"
|
||||
sky_engine:
|
||||
dependency: transitive
|
||||
description: flutter
|
||||
|
||||
@@ -36,7 +36,7 @@ class CState extends State<Cook> {
|
||||
title: Text(widget.nme,
|
||||
style: Theme.of(ct)
|
||||
.textTheme
|
||||
.display2
|
||||
.headline3
|
||||
.copyWith(fontFamily: 'ark', color: Colors.black))),
|
||||
margin: EdgeInsets.only(top: 40, bottom: 30, left: 20)),
|
||||
Expanded(
|
||||
|
||||
@@ -71,16 +71,16 @@ class HState extends State<Home> {
|
||||
scale: .9)),
|
||||
Text(fi['fn'],
|
||||
style:
|
||||
t.display3.copyWith(fontFamily: 'ark', color: Colors.black)),
|
||||
t.headline2.copyWith(fontFamily: 'ark', color: Colors.black)),
|
||||
Container(
|
||||
child: Text(fi['cn'],
|
||||
style: t.subhead.apply(color: Colors.red, fontFamily: 'opb')),
|
||||
style: t.subtitle1.apply(color: Colors.red, fontFamily: 'opb')),
|
||||
margin: EdgeInsets.only(top: 10, bottom: 30),
|
||||
),
|
||||
Container(
|
||||
child: Text(fi['dc'],
|
||||
textAlign: TextAlign.center,
|
||||
style: t.subhead.copyWith(fontFamily: 'opr')),
|
||||
style: t.subtitle1.copyWith(fontFamily: 'opr')),
|
||||
margin: EdgeInsets.only(left: 10, right: 10)),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
@@ -101,7 +101,7 @@ class HState extends State<Home> {
|
||||
children: <Widget>[
|
||||
Text(fi['ig'][i]['n'],
|
||||
style:
|
||||
t.subtitle.copyWith(fontFamily: 'opb')),
|
||||
t.subtitle2.copyWith(fontFamily: 'opb')),
|
||||
Text(fi['ig'][i]['c'],
|
||||
style:
|
||||
t.caption.copyWith(fontFamily: 'opr'))
|
||||
|
||||
@@ -1,13 +1,6 @@
|
||||
# Generated by pub
|
||||
# See https://dart.dev/tools/pub/glossary#lockfile
|
||||
packages:
|
||||
async:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: async
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.4.1"
|
||||
charcode:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -47,7 +40,7 @@ packages:
|
||||
name: http
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.12.0+4"
|
||||
version: "0.12.1"
|
||||
http_parser:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -68,7 +61,7 @@ packages:
|
||||
name: path
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.6.4"
|
||||
version: "1.7.0"
|
||||
pedantic:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
|
||||
@@ -10,7 +10,7 @@ dependencies:
|
||||
http: ^0.12.0
|
||||
|
||||
dev_dependencies:
|
||||
pedantic: ^1.8.0
|
||||
pedantic: ^1.9.0
|
||||
|
||||
|
||||
flutter_icons:
|
||||
|
||||
@@ -191,15 +191,18 @@ class _MainLayoutState extends State<MainLayout> with TickerProviderStateMixin {
|
||||
|
||||
int numWeeksTotal = contributionList[0].contributions.length;
|
||||
|
||||
String starsByWeekStr = (await http.get("assets/github_data/stars.tsv")).body;
|
||||
String starsByWeekStr =
|
||||
(await http.get("assets/github_data/stars.tsv")).body;
|
||||
List<StatForWeek> starsByWeekLoaded =
|
||||
summarizeWeeksFromTSV(starsByWeekStr, numWeeksTotal);
|
||||
|
||||
String forksByWeekStr = (await http.get("assets/github_data/forks.tsv")).body;
|
||||
String forksByWeekStr =
|
||||
(await http.get("assets/github_data/forks.tsv")).body;
|
||||
List<StatForWeek> forksByWeekLoaded =
|
||||
summarizeWeeksFromTSV(forksByWeekStr, numWeeksTotal);
|
||||
|
||||
String commitsByWeekStr = (await http.get("assets/github_data/commits.tsv")).body;
|
||||
String commitsByWeekStr =
|
||||
(await http.get("assets/github_data/commits.tsv")).body;
|
||||
List<StatForWeek> commitsByWeekLoaded =
|
||||
summarizeWeeksFromTSV(commitsByWeekStr, numWeeksTotal);
|
||||
|
||||
|
||||
@@ -1,13 +1,6 @@
|
||||
# Generated by pub
|
||||
# See https://dart.dev/tools/pub/glossary#lockfile
|
||||
packages:
|
||||
async:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: async
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.4.1"
|
||||
charcode:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -33,7 +26,7 @@ packages:
|
||||
name: http
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.12.0+4"
|
||||
version: "0.12.1"
|
||||
http_parser:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -61,7 +54,7 @@ packages:
|
||||
name: path
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.6.4"
|
||||
version: "1.7.0"
|
||||
pedantic:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
||||
@@ -40,7 +40,7 @@ class CookbookScraper {
|
||||
var description = page.querySelectorAll('main>.container>p').first.text;
|
||||
|
||||
var urlSegments = Uri.parse(url).pathSegments;
|
||||
var category = urlSegments[urlSegments.length-2];
|
||||
var category = urlSegments[urlSegments.length - 2];
|
||||
|
||||
return Sample(
|
||||
name: name,
|
||||
|
||||
@@ -147,7 +147,7 @@ class Sample {
|
||||
var nameWithoutChars = name.replaceAll(RegExp(r'[^A-Za-z0-9\-\_\ ]'), '');
|
||||
var nameWithUnderscores = nameWithoutChars.replaceAll(' ', '_');
|
||||
var snake = util.snakeCase(nameWithUnderscores);
|
||||
var s = snake.replaceAll('__', '_');
|
||||
var s = snake.replaceAll('__', '_');
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,8 @@ import 'util.dart' as util;
|
||||
|
||||
String _escapeAttribute(String s) =>
|
||||
HtmlEscape(HtmlEscapeMode.attribute).convert(s);
|
||||
String _escapeElement(String s) => HtmlEscape(HtmlEscapeMode.element).convert(s);
|
||||
String _escapeElement(String s) =>
|
||||
HtmlEscape(HtmlEscapeMode.element).convert(s);
|
||||
|
||||
String description(Sample sample) => '''
|
||||
<!DOCTYPE html>
|
||||
@@ -184,19 +185,24 @@ String _descriptionPage(Sample sample) => '''
|
||||
String _descriptionButtons(Sample sample) {
|
||||
var buf = StringBuffer();
|
||||
if (sample?.web?.isNotEmpty == true) {
|
||||
buf.write('''<button class="mdc-button mdc-button--outlined" onclick="window.location.href = '${sample.web}';"><span class="mdc-button__ripple"></span> Launch App</button>''');
|
||||
buf.write(
|
||||
'''<button class="mdc-button mdc-button--outlined" onclick="window.location.href = '${sample.web}';"><span class="mdc-button__ripple"></span> Launch App</button>''');
|
||||
}
|
||||
|
||||
if (sample.type == 'app' || sample.type == 'sample' || sample.type == 'demo') {
|
||||
buf.write('''<button class="mdc-button mdc-button--outlined" onclick="window.location.href = '${sample.source}';">
|
||||
if (sample.type == 'app' ||
|
||||
sample.type == 'sample' ||
|
||||
sample.type == 'demo') {
|
||||
buf.write(
|
||||
'''<button class="mdc-button mdc-button--outlined" onclick="window.location.href = '${sample.source}';">
|
||||
<div class="mdc-button__ripple"></div>
|
||||
<i class="material-icons mdc-button__icon" aria-hidden="true">code</i>
|
||||
<span class="mdc-button__label">Source Code</span>
|
||||
</button>''');
|
||||
}
|
||||
|
||||
if (sample.type =='cookbook') {
|
||||
buf.write('''<button class="mdc-button mdc-button--outlined" onclick="window.location.href = '${sample.source}';"> <span class="mdc-button__ripple"></span>View Recipe</button>''');
|
||||
if (sample.type == 'cookbook') {
|
||||
buf.write(
|
||||
'''<button class="mdc-button mdc-button--outlined" onclick="window.location.href = '${sample.source}';"> <span class="mdc-button__ripple"></span>View Recipe</button>''');
|
||||
}
|
||||
return buf.toString();
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ dependencies:
|
||||
html: ^0.14.0
|
||||
dev_dependencies:
|
||||
grinder: ^0.8.3
|
||||
pedantic: ^1.8.0
|
||||
pedantic: ^1.9.0
|
||||
test: ^1.6.0
|
||||
json_serializable: ^3.2.0
|
||||
build: ^1.2.0
|
||||
|
||||
@@ -62,8 +62,8 @@ Future generate() async {
|
||||
Future scrapeCookbook() async {
|
||||
var driver = await Process.start(
|
||||
'chromedriver', ['--port=4444', '--url-base=wd/hub', '--verbose']);
|
||||
driver.stdout.pipe(stdout);
|
||||
driver.stderr.pipe(stderr);
|
||||
await driver.stdout.pipe(stdout);
|
||||
await driver.stderr.pipe(stderr);
|
||||
var scraper = CookbookScraper();
|
||||
await scraper.init();
|
||||
var links = await scraper.fetchCookbookLinks();
|
||||
|
||||
@@ -160,9 +160,11 @@ class DecorationImagePlus implements DecorationImage {
|
||||
|
||||
@override
|
||||
ImageErrorListener get onError => (error, stackTrace) {
|
||||
developer.log('Failed to load image.\n'
|
||||
developer.log(
|
||||
'Failed to load image.\n'
|
||||
'$error\n'
|
||||
'$stackTrace', name: 'slide_puzzle.decoration_image_plus');
|
||||
'$stackTrace',
|
||||
name: 'slide_puzzle.decoration_image_plus');
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -7,14 +7,14 @@ packages:
|
||||
name: _fe_analyzer_shared
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.2.0"
|
||||
version: "3.0.0"
|
||||
analyzer:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: analyzer
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.39.7"
|
||||
version: "0.39.8"
|
||||
archive:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -115,7 +115,7 @@ packages:
|
||||
name: http
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.12.0+4"
|
||||
version: "0.12.1"
|
||||
http_multi_server:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -199,7 +199,7 @@ packages:
|
||||
name: node_io
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.1+2"
|
||||
version: "1.1.0"
|
||||
node_preamble:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -351,7 +351,7 @@ packages:
|
||||
name: test
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.14.2"
|
||||
version: "1.14.3"
|
||||
test_api:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -365,7 +365,7 @@ packages:
|
||||
name: test_core
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.3.3"
|
||||
version: "0.3.4"
|
||||
typed_data:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -386,7 +386,7 @@ packages:
|
||||
name: vm_service
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "4.0.1"
|
||||
version: "4.0.2"
|
||||
watcher:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -407,7 +407,7 @@ packages:
|
||||
name: webkit_inspection_protocol
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.5.0+1"
|
||||
version: "0.5.3"
|
||||
xml:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -421,6 +421,6 @@ packages:
|
||||
name: yaml
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.2.0"
|
||||
version: "2.2.1"
|
||||
sdks:
|
||||
dart: ">=2.7.0 <3.0.0"
|
||||
|
||||
@@ -186,9 +186,9 @@ class NumberPicker extends StatelessWidget {
|
||||
}
|
||||
|
||||
Widget _integerListView(ThemeData themeData) {
|
||||
TextStyle defaultStyle = themeData.textTheme.body1;
|
||||
TextStyle defaultStyle = themeData.textTheme.bodyText2;
|
||||
TextStyle selectedStyle =
|
||||
themeData.textTheme.headline.copyWith(color: themeData.accentColor);
|
||||
themeData.textTheme.headline5.copyWith(color: themeData.accentColor);
|
||||
|
||||
var listItemCount = integerItemCount + 2;
|
||||
|
||||
@@ -223,9 +223,9 @@ class NumberPicker extends StatelessWidget {
|
||||
}
|
||||
|
||||
Widget _decimalListView(ThemeData themeData) {
|
||||
TextStyle defaultStyle = themeData.textTheme.body1;
|
||||
TextStyle defaultStyle = themeData.textTheme.bodyText2;
|
||||
TextStyle selectedStyle =
|
||||
themeData.textTheme.headline.copyWith(color: themeData.accentColor);
|
||||
themeData.textTheme.headline5.copyWith(color: themeData.accentColor);
|
||||
|
||||
int decimalItemCount =
|
||||
selectedIntValue == maxValue ? 3 : math.pow(10, decimalPlaces) + 2;
|
||||
@@ -262,9 +262,9 @@ class NumberPicker extends StatelessWidget {
|
||||
}
|
||||
|
||||
Widget _integerInfiniteListView(ThemeData themeData) {
|
||||
TextStyle defaultStyle = themeData.textTheme.body1;
|
||||
TextStyle defaultStyle = themeData.textTheme.bodyText2;
|
||||
TextStyle selectedStyle =
|
||||
themeData.textTheme.headline.copyWith(color: themeData.accentColor);
|
||||
themeData.textTheme.headline5.copyWith(color: themeData.accentColor);
|
||||
|
||||
return new NotificationListener(
|
||||
child: new Container(
|
||||
|
||||
Reference in New Issue
Block a user