accessibility_tools 0.0.1-dev.0 accessibility_tools: ^0.0.1-dev.0 copied to clipboard
Checkers and tools to ensure your app is accessible to all.
import 'package:flutter/material.dart';
import 'package:accessibility_tools/accessibility_tools.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
builder: (context, child) {
return AccessibilityTools(child: child);
},
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({Key? key, required this.title}) : super(key: key);
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text(widget.title)),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
ElevatedButton(
onPressed: () {
Navigator.of(context).push(
MaterialPageRoute(builder: (_) => const OtherPage()),
);
},
child: const Text('Other page'),
),
// SizedBox(
// width: 100,
// child: Row(children: const [Text('Hello testing')]),
// ),
],
),
),
);
}
}
class OtherPage extends StatelessWidget {
const OtherPage({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(),
body: ListView(
children: [
const Text('Too small'),
Center(
child: Container(
color: Colors.yellow,
width: 10,
height: 10,
child: InkWell(
onTap: () {},
child: Container(),
),
),
),
],
),
);
}
}