Unverified Commit 0c1652f4 authored by Abhishek Ghaskata's avatar Abhishek Ghaskata Committed by GitHub

Migrate flavors to null safety (#80558)

parent ecbea9a9
...@@ -12,19 +12,19 @@ void main() { ...@@ -12,19 +12,19 @@ void main() {
} }
class Flavor extends StatefulWidget { class Flavor extends StatefulWidget {
const Flavor({Key key}) : super(key: key); const Flavor({Key? key}) : super(key: key);
@override @override
_FlavorState createState() => _FlavorState(); _FlavorState createState() => _FlavorState();
} }
class _FlavorState extends State<Flavor> { class _FlavorState extends State<Flavor> {
String _flavor; String? _flavor;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
const MethodChannel('flavor').invokeMethod<String>('getFlavor').then((String flavor) { const MethodChannel('flavor').invokeMethod<String>('getFlavor').then((String? flavor) {
setState(() { setState(() {
_flavor = flavor; _flavor = flavor;
}); });
...@@ -37,7 +37,7 @@ class _FlavorState extends State<Flavor> { ...@@ -37,7 +37,7 @@ class _FlavorState extends State<Flavor> {
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: _flavor == null child: _flavor == null
? const Text('Awaiting flavor...') ? const Text('Awaiting flavor...')
: Text(_flavor, key: const ValueKey<String>('flavor')), : Text(_flavor!, key: const ValueKey<String>('flavor')),
); );
} }
} }
...@@ -2,7 +2,7 @@ name: flavors ...@@ -2,7 +2,7 @@ name: flavors
description: Integration test for build flavors. description: Integration test for build flavors.
environment: environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0" sdk: ">=2.12.0 <3.0.0"
dependencies: dependencies:
flutter: flutter:
......
...@@ -7,7 +7,7 @@ import 'package:test/test.dart' hide TypeMatcher, isInstanceOf; ...@@ -7,7 +7,7 @@ import 'package:test/test.dart' hide TypeMatcher, isInstanceOf;
void main() { void main() {
group('flavors suite', () { group('flavors suite', () {
FlutterDriver driver; late FlutterDriver driver;
setUpAll(() async { setUpAll(() async {
driver = await FlutterDriver.connect(); driver = await FlutterDriver.connect();
...@@ -20,7 +20,7 @@ void main() { ...@@ -20,7 +20,7 @@ void main() {
}); });
tearDownAll(() async { tearDownAll(() async {
driver?.close(); driver.close();
}); });
}); });
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment