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() {
}
class Flavor extends StatefulWidget {
const Flavor({Key key}) : super(key: key);
const Flavor({Key? key}) : super(key: key);
@override
_FlavorState createState() => _FlavorState();
}
class _FlavorState extends State<Flavor> {
String _flavor;
String? _flavor;
@override
void initState() {
super.initState();
const MethodChannel('flavor').invokeMethod<String>('getFlavor').then((String flavor) {
const MethodChannel('flavor').invokeMethod<String>('getFlavor').then((String? flavor) {
setState(() {
_flavor = flavor;
});
......@@ -37,7 +37,7 @@ class _FlavorState extends State<Flavor> {
textDirection: TextDirection.ltr,
child: _flavor == null
? const Text('Awaiting flavor...')
: Text(_flavor, key: const ValueKey<String>('flavor')),
: Text(_flavor!, key: const ValueKey<String>('flavor')),
);
}
}
......@@ -2,7 +2,7 @@ name: flavors
description: Integration test for build flavors.
environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"
sdk: ">=2.12.0 <3.0.0"
dependencies:
flutter:
......
......@@ -7,7 +7,7 @@ import 'package:test/test.dart' hide TypeMatcher, isInstanceOf;
void main() {
group('flavors suite', () {
FlutterDriver driver;
late FlutterDriver driver;
setUpAll(() async {
driver = await FlutterDriver.connect();
......@@ -20,7 +20,7 @@ void main() {
});
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