Added tests for the new Android heading semantic flag to android_semantics_testing (#44031)

Added tests for the new Android heading semantic flag to android_semantics_testing.
This commit is contained in:
Darren Austin
2019-11-04 16:35:04 -08:00
committed by GitHub
parent bbb2a0f837
commit b815f76293
8 changed files with 98 additions and 1 deletions

View File

@@ -0,0 +1,12 @@
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/// The name of the route containing the test suite.
const String headingsRoute = 'headings';
/// The string supplied to the [ValueKey] for the app bar title widget.
const String appBarTitleKeyValue = 'Headings#AppBarTitle';
/// The string supplied to the [ValueKey] for the body text widget.
const String bodyTextKeyValue = 'Headings#BodyText';

View File

@@ -0,0 +1,28 @@
// Copyright 2019 The Chromium 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 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'headings_constants.dart';
export 'headings_constants.dart';
/// A test page with an app bar and some body text for testing heading flags.
class HeadingsPage extends StatelessWidget {
static const ValueKey<String> _appBarTitleKey = ValueKey<String>(appBarTitleKeyValue);
static const ValueKey<String> _bodyTextKey = ValueKey<String>(bodyTextKeyValue);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
leading: const BackButton(key: ValueKey<String>('back')),
title: const Text('Heading', key: _appBarTitleKey),
),
body: const Center(
child: Text('Body text', key: _bodyTextKey),
),
);
}
}