| // 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 'package:flutter/material.dart'; |
| import '../utils.dart'; |
| import 'use_cases.dart'; |
| |
| class OutlinedButtonUseCase extends UseCase { |
| OutlinedButtonUseCase(); |
| |
| @override |
| String get name => 'OutlinedButton'; |
| |
| @override |
| String get route => '/outlined-button'; |
| |
| @override |
| List<Tag> get tags => <Tag>[Tag.batch2, Tag.core]; |
| |
| @override |
| Widget build(BuildContext context) => const MainWidget(); |
| } |
| |
| class MainWidget extends StatefulWidget { |
| const MainWidget({super.key}); |
| |
| @override |
| State<MainWidget> createState() => MainWidgetState(); |
| } |
| |
| class MainWidgetState extends State<MainWidget> { |
| String pageTitle = getUseCaseName(OutlinedButtonUseCase()); |
| |
| @override |
| Widget build(BuildContext context) { |
| return Scaffold( |
| appBar: AppBar(title: Semantics(headingLevel: 1, child: Text('$pageTitle Demo'))), |
| body: Center( |
| child: Column( |
| mainAxisAlignment: MainAxisAlignment.center, |
| children: <Widget>[ |
| OutlinedButton(onPressed: () {}, child: const Text('Outlined Button')), |
| const OutlinedButton( |
| onPressed: null, // Disabled |
| child: Text('Disabled OutlinedButton'), |
| ), |
| ], |
| ), |
| ), |
| ); |
| } |
| } |