Add a test of an Android platform view that draws a gradient (#153878)

Closes https://github.com/flutter/flutter/issues/152376.

The gradient, for posterity, looks like this:

<img src="https://github.com/user-attachments/assets/bed9599a-4e16-499c-af79-b51980095e89" width="150">

Let's see if CI agrees!

/cc @johnmccutchan
This commit is contained in:
Matan Lurey
2024-08-23 11:25:40 -07:00
committed by GitHub
parent 327193af9a
commit 5e194383af
8 changed files with 189 additions and 17 deletions

View File

@@ -0,0 +1,31 @@
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:io' as io;
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_driver/driver_extension.dart';
void main() {
enableFlutterDriverExtension();
if (kIsWeb || !io.Platform.isAndroid) {
throw UnsupportedError('This app should only run on Android devices.');
}
runApp(const MainApp());
}
final class MainApp extends StatelessWidget {
const MainApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
debugShowCheckedModeBanner: false,
home: AndroidView(viewType: 'blue_orange_gradient_platform_view'),
);
}
}