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