feat: overall UI rework in Settings View (#53)

This commit is contained in:
Alberto Ponces
2022-09-02 14:35:25 +01:00
committed by GitHub
parent 036e8c99b3
commit 4f7b1d4520
37 changed files with 485 additions and 361 deletions

View File

@ -1,8 +1,9 @@
import 'package:flutter/material.dart';
import 'package:flutter_i18n/flutter_i18n.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:revanced_manager/theme.dart';
import 'package:revanced_manager/ui/views/installer/installer_viewmodel.dart';
import 'package:revanced_manager/ui/widgets/installerView/custom_material_button.dart';
import 'package:revanced_manager/ui/widgets/shared/custom_sliver_app_bar.dart';
import 'package:stacked/stacked.dart';
class InstallerView extends StatelessWidget {
@ -18,32 +19,12 @@ class InstallerView extends StatelessWidget {
body: CustomScrollView(
controller: model.scrollController,
slivers: <Widget>[
SliverAppBar(
pinned: true,
snap: false,
floating: false,
expandedHeight: 100.0,
automaticallyImplyLeading: false,
backgroundColor: MaterialStateColor.resolveWith(
(states) => states.contains(MaterialState.scrolledUnder)
? isDark
? Theme.of(context).colorScheme.primary
: Theme.of(context)
.navigationBarTheme
.backgroundColor!
: Theme.of(context).scaffoldBackgroundColor,
),
flexibleSpace: FlexibleSpaceBar(
titlePadding: const EdgeInsets.symmetric(
vertical: 23.0,
horizontal: 20.0,
),
title: Text(
model.headerLogs,
style: GoogleFonts.inter(
color: Theme.of(context).textTheme.headline5!.color,
fontWeight: FontWeight.w500,
),
CustomSliverAppBar(
title: Text(
model.headerLogs,
style: GoogleFonts.inter(
color: Theme.of(context).textTheme.headline5!.color,
fontWeight: FontWeight.w500,
),
),
bottom: PreferredSize(
@ -84,17 +65,17 @@ class InstallerView extends StatelessWidget {
visible: !model.isPatching,
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
children: <Widget>[
CustomMaterialButton(
text: 'installerView.shareButton',
label: I18nText('installerView.shareButton'),
isFilled: false,
onPressed: () => model.shareResult(),
),
const SizedBox(width: 16),
CustomMaterialButton(
text: model.isInstalled
? 'installerView.openButton'
: 'installerView.installButton',
label: model.isInstalled
? I18nText('installerView.openButton')
: I18nText('installerView.installButton'),
isFilled: true,
isExpanded: true,
onPressed: () {