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