refactor(ui): Remove SafeArea where they are not needed

pull/193/head
Inex Code 2023-02-01 01:40:42 +03:00
parent 80547785d3
commit c271331f29
2 changed files with 47 additions and 53 deletions

View File

@ -21,17 +21,15 @@ class _OnboardingPageState extends State<OnboardingPage> {
}
@override
Widget build(final BuildContext context) => SafeArea(
child: Scaffold(
body: PageView(
controller: pageController,
children: [
_withPadding(firstPage()),
_withPadding(secondPage()),
],
),
),
);
Widget build(final BuildContext context) => Scaffold(
body: PageView(
controller: pageController,
children: [
_withPadding(firstPage()),
_withPadding(secondPage()),
],
),
);
Widget _withPadding(final Widget child) => Padding(
padding: const EdgeInsets.symmetric(
@ -60,15 +58,13 @@ class _OnboardingPageState extends State<OnboardingPage> {
style: Theme.of(context).textTheme.bodyMedium,
),
const SizedBox(height: 32),
Flexible(
child: Center(
child: Image.asset(
_fileName(
context: context,
path: 'assets/images/onboarding',
fileExtention: 'png',
fileName: 'onboarding1',
),
Center(
child: Image.asset(
_fileName(
context: context,
path: 'assets/images/onboarding',
fileExtention: 'png',
fileName: 'onboarding1',
),
),
),

View File

@ -52,40 +52,38 @@ class _RootPageState extends State<RootPage> with TickerProviderStateMixin {
final bool isReady = context.watch<ServerInstallationCubit>().state
is ServerInstallationFinished;
return SafeArea(
child: Provider<ChangeTab>(
create: (final _) => ChangeTab(tabController.animateTo),
child: Scaffold(
body: TabBarView(
controller: tabController,
children: const [
ProvidersPage(),
ServicesPage(),
UsersPage(),
MorePage(),
],
),
bottomNavigationBar: BrandTabBar(
controller: tabController,
),
floatingActionButton: isReady
? SizedBox(
height: 104 + 16,
child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.end,
children: [
ScaleTransition(
scale: _animation,
child: const AddUserFab(),
),
const SizedBox(height: 16),
const BrandFab(),
],
),
)
: null,
return Provider<ChangeTab>(
create: (final _) => ChangeTab(tabController.animateTo),
child: Scaffold(
body: TabBarView(
controller: tabController,
children: const [
ProvidersPage(),
ServicesPage(),
UsersPage(),
MorePage(),
],
),
bottomNavigationBar: BrandTabBar(
controller: tabController,
),
floatingActionButton: isReady
? SizedBox(
height: 104 + 16,
child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.end,
children: [
ScaleTransition(
scale: _animation,
child: const AddUserFab(),
),
const SizedBox(height: 16),
const BrandFab(),
],
),
)
: null,
),
);
}