abstracted into safezone
This commit is contained in:
@@ -1,21 +1,16 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:ything_radio/SafeZone.dart';
|
||||
|
||||
class About extends StatelessWidget {
|
||||
const About({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final safeLeftPadding = MediaQuery.of(context).padding.left + 16;
|
||||
final safeRightPadding = MediaQuery.of(context).padding.right + 16;
|
||||
final safeBottomPadding = MediaQuery.of(context).padding.bottom;
|
||||
final safeTopPadding = MediaQuery.of(context).padding.top;
|
||||
|
||||
return DefaultTextStyle(
|
||||
style: Theme.of(context).textTheme.bodyLarge!,
|
||||
child: SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(left: safeLeftPadding, right: safeRightPadding, bottom: safeBottomPadding, top: safeTopPadding),
|
||||
child: const Text(
|
||||
return SafeZone(
|
||||
child: DefaultTextStyle(
|
||||
style: Theme.of(context).textTheme.bodyLarge!,
|
||||
child: const SingleChildScrollView(
|
||||
child: Text(
|
||||
'Ything Radio is an app that is intended to provide a demonstration of the '
|
||||
'open source ything_radio app. This app is used to provide the ability for the '
|
||||
'"look and feel" of the app to be tested on real devices for those wishing to '
|
||||
|
||||
24
lib/SafeZone.dart
Normal file
24
lib/SafeZone.dart
Normal file
@@ -0,0 +1,24 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class SafeZone extends StatelessWidget {
|
||||
const SafeZone({super.key, required this.child});
|
||||
|
||||
final Widget child;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final safeLeftPadding = MediaQuery.of(context).padding.left + 16;
|
||||
final safeRightPadding = MediaQuery.of(context).padding.right + 16;
|
||||
final safeBottomPadding = MediaQuery.of(context).padding.bottom + 16;
|
||||
final safeTopPadding = MediaQuery.of(context).padding.top + 16;
|
||||
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(
|
||||
left: safeLeftPadding,
|
||||
right: safeRightPadding,
|
||||
bottom: safeBottomPadding,
|
||||
top: safeTopPadding),
|
||||
child: child,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user