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:
@@ -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'),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user