Skip to content

Commit

Permalink
migrate to null safety
Browse files Browse the repository at this point in the history
  • Loading branch information
zesage committed Mar 13, 2021
1 parent 689b6d5 commit f075454
Show file tree
Hide file tree
Showing 8 changed files with 185 additions and 208 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [0.4.0] - 03/13/2021

* migrate to null safety

## [0.3.2] - 01/09/2021

* Fixed some bugs
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Add panorama as a dependency in your pubspec.yaml file.

```yaml
dependencies:
panorama: ^0.3.2
panorama: ^0.4.0
```
Import and add the Panorama widget to your project.
Expand Down
30 changes: 18 additions & 12 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:panorama/panorama.dart';
import 'package:image_picker/image_picker.dart';
Expand All @@ -16,9 +17,9 @@ class MyApp extends StatelessWidget {
}

class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
MyHomePage({Key? key, this.title}) : super(key: key);

final String title;
final String? title;

@override
_MyHomePageState createState() => _MyHomePageState();
Expand All @@ -34,6 +35,7 @@ class _MyHomePageState extends State<MyHomePage> {
Image.asset('assets/panorama2.webp'),
Image.asset('assets/panorama_cropped.webp'),
];
ImagePicker picker = ImagePicker();

void onViewChanged(longitude, latitude, tilt) {
setState(() {
Expand All @@ -43,13 +45,16 @@ class _MyHomePageState extends State<MyHomePage> {
});
}

Widget hotspotButton({String text, IconData icon, VoidCallback onPressed}) {
Widget hotspotButton({String? text, IconData? icon, VoidCallback? onPressed}) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
FlatButton(
shape: CircleBorder(),
color: Colors.black38,
TextButton(
style: ButtonStyle(
shape: MaterialStateProperty.all(CircleBorder()),
backgroundColor: MaterialStateProperty.all(Colors.black38),
foregroundColor: MaterialStateProperty.all(Colors.white),
),
child: Icon(icon),
onPressed: onPressed,
),
Expand Down Expand Up @@ -142,7 +147,7 @@ class _MyHomePageState extends State<MyHomePage> {
}
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
title: Text(widget.title!),
),
body: Stack(
children: [
Expand All @@ -152,12 +157,13 @@ class _MyHomePageState extends State<MyHomePage> {
),
floatingActionButton: FloatingActionButton(
mini: true,
onPressed: () {
ImagePicker.pickImage(source: ImageSource.gallery).then((value) {
setState(() {
panoImages.add(Image.file(value));
onPressed: () async {
final pickedFile = await picker.getImage(source: ImageSource.gallery);
setState(() {
if (pickedFile != null) {
panoImages.add(Image.file(File(pickedFile.path)));
_panoId = panoImages.length - 1;
});
}
});
},
child: Icon(Icons.panorama),
Expand Down
120 changes: 60 additions & 60 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
@@ -1,62 +1,55 @@
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
archive:
dependency: transitive
description:
name: archive
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.11"
args:
dependency: transitive
description:
name: args
url: "https://pub.dartlang.org"
source: hosted
version: "1.5.2"
async:
dependency: transitive
description:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.0"
version: "2.5.0"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.5"
version: "2.1.0"
characters:
dependency: transitive
description:
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.2"
collection:
version: "1.2.0"
clock:
dependency: transitive
description:
name: collection
name: clock
url: "https://pub.dartlang.org"
source: hosted
version: "1.14.11"
convert:
version: "1.1.0"
collection:
dependency: transitive
description:
name: convert
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
crypto:
version: "1.15.0"
fake_async:
dependency: transitive
description:
name: crypto
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.3"
version: "1.2.0"
flutter:
dependency: "direct main"
description: flutter
Expand All @@ -68,82 +61,96 @@ packages:
name: flutter_cube
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.3"
version: "0.1.1"
flutter_plugin_android_lifecycle:
dependency: transitive
description:
name: flutter_plugin_android_lifecycle
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.6"
version: "2.0.0"
flutter_test:
dependency: "direct dev"
description: flutter
source: sdk
version: "0.0.0"
image:
http:
dependency: transitive
description:
name: http
url: "https://pub.dartlang.org"
source: hosted
version: "0.13.0"
http_parser:
dependency: transitive
description:
name: image
name: http_parser
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.4"
version: "4.0.0"
image_picker:
dependency: "direct main"
description:
name: image_picker
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.3+4"
version: "0.7.2+1"
image_picker_platform_interface:
dependency: transitive
description:
name: image_picker_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
matcher:
dependency: transitive
description:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.6"
version: "0.12.10"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.8"
version: "1.3.0"
motion_sensors:
dependency: transitive
description:
name: motion_sensors
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.1"
version: "0.1.0"
panorama:
dependency: "direct main"
description:
path: ".."
relative: true
source: path
version: "0.0.2"
version: "0.4.0"
path:
dependency: transitive
description:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.6.4"
petitparser:
version: "1.8.0"
pedantic:
dependency: transitive
description:
name: petitparser
name: pedantic
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.0"
quiver:
version: "1.11.0"
plugin_platform_interface:
dependency: transitive
description:
name: quiver
name: plugin_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.5"
version: "2.0.0"
sky_engine:
dependency: transitive
description: flutter
Expand All @@ -155,63 +162,56 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.5.5"
version: "1.8.0"
stack_trace:
dependency: transitive
description:
name: stack_trace
url: "https://pub.dartlang.org"
source: hosted
version: "1.9.3"
version: "1.10.0"
stream_channel:
dependency: transitive
description:
name: stream_channel
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
version: "2.1.0"
string_scanner:
dependency: transitive
description:
name: string_scanner
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.5"
version: "1.1.0"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
version: "1.2.0"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.15"
version: "0.2.19"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.6"
version: "1.3.0"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.8"
xml:
dependency: transitive
description:
name: xml
url: "https://pub.dartlang.org"
source: hosted
version: "3.5.0"
version: "2.1.0"
sdks:
dart: ">=2.4.0 <3.0.0"
flutter: ">=1.12.13 <2.0.0"
dart: ">=2.12.0 <3.0.0"
flutter: ">=1.20.0"
8 changes: 5 additions & 3 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ description: A new Flutter project.
version: 1.0.0+1

environment:
sdk: ">=2.1.0 <3.0.0"
sdk: '>=2.12.0 <3.0.0'

dependencies:
flutter:
sdk: flutter
panorama:
path: ../
image_picker: ^0.6.3+4
image_picker: ^0.7.2+1

dev_dependencies:
flutter_test:
Expand All @@ -20,4 +20,6 @@ dev_dependencies:
flutter:
uses-material-design: true
assets:
- assets/
- assets/

publish_to: none
Loading

0 comments on commit f075454

Please sign in to comment.