|
| 1 | +import 'package:appium_testing_app/components/custom_app_bar.dart'; |
| 2 | +import 'package:flutter/material.dart'; |
| 3 | + |
| 4 | +class UiElementsScreen extends StatefulWidget { |
| 5 | + final String title; |
| 6 | + |
| 7 | + const UiElementsScreen({required this.title, super.key}); |
| 8 | + |
| 9 | + @override |
| 10 | + State<UiElementsScreen> createState() => _UiElementsScreenState(); |
| 11 | +} |
| 12 | + |
| 13 | +class _UiElementsScreenState extends State<UiElementsScreen> { |
| 14 | + @override |
| 15 | + Widget build(BuildContext context) { |
| 16 | + return Scaffold( |
| 17 | + appBar: CustomAppBarWidget(title: widget.title), |
| 18 | + body: Padding( |
| 19 | + padding: const EdgeInsets.all(16.0), |
| 20 | + child: ListView( |
| 21 | + children: [ |
| 22 | + const SizedBox( |
| 23 | + height: 30, |
| 24 | + ), |
| 25 | + Semantics( |
| 26 | + label: "enabled_text_field", |
| 27 | + // textField: true, |
| 28 | + explicitChildNodes: true, |
| 29 | + container: true, |
| 30 | + child: const TextField( |
| 31 | + decoration: InputDecoration( |
| 32 | + hintText: "Input", |
| 33 | + enabledBorder: UnderlineInputBorder( |
| 34 | + borderSide: BorderSide(color: Colors.grey)), |
| 35 | + ), |
| 36 | + ), |
| 37 | + ), |
| 38 | + const SizedBox( |
| 39 | + height: 30, |
| 40 | + ), |
| 41 | + Semantics( |
| 42 | + label: "disabled_text_field", |
| 43 | + // textField: true, |
| 44 | + explicitChildNodes: true, |
| 45 | + container: true, |
| 46 | + child: const TextField( |
| 47 | + enabled: false, |
| 48 | + decoration: InputDecoration( |
| 49 | + hintText: "Last Name", |
| 50 | + enabledBorder: UnderlineInputBorder( |
| 51 | + borderSide: BorderSide(color: Colors.grey)), |
| 52 | + ), |
| 53 | + ), |
| 54 | + ), |
| 55 | + const SizedBox( |
| 56 | + height: 30, |
| 57 | + ), |
| 58 | + Semantics( |
| 59 | + label: "enabled_checkbox", |
| 60 | + // textField: true, |
| 61 | + explicitChildNodes: true, |
| 62 | + container: true, |
| 63 | + child: const CheckboxListTile( |
| 64 | + title: Text( |
| 65 | + 'Remember Password', |
| 66 | + style: TextStyle(color: Colors.grey), |
| 67 | + ), |
| 68 | + value: true, |
| 69 | + onChanged: null, |
| 70 | + ), |
| 71 | + ), |
| 72 | + const SizedBox( |
| 73 | + height: 30, |
| 74 | + ), |
| 75 | + Semantics( |
| 76 | + label: "disabled_checkbox", |
| 77 | + // textField: true, |
| 78 | + explicitChildNodes: true, |
| 79 | + container: true, |
| 80 | + child: CheckboxListTile( |
| 81 | + title: const Text( |
| 82 | + 'Remember Password', |
| 83 | + style: TextStyle(color: Colors.grey), |
| 84 | + ), |
| 85 | + value: true, |
| 86 | + onChanged: (bool? value) {}, |
| 87 | + ), |
| 88 | + ), |
| 89 | + ], |
| 90 | + ), |
| 91 | + ), |
| 92 | + ); |
| 93 | + } |
| 94 | +} |
0 commit comments