mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-17 09:47:37 +00:00
WIP: manage themes ui
This commit is contained in:
parent
e1dd7b47c0
commit
4defe837e7
3 changed files with 127 additions and 0 deletions
|
@ -8,8 +8,11 @@ import 'package:stackwallet/utilities/theme/stack_colors.dart';
|
||||||
import 'package:stackwallet/widgets/background.dart';
|
import 'package:stackwallet/widgets/background.dart';
|
||||||
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
|
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
|
||||||
import 'package:stackwallet/widgets/custom_buttons/draggable_switch_button.dart';
|
import 'package:stackwallet/widgets/custom_buttons/draggable_switch_button.dart';
|
||||||
|
import 'package:stackwallet/widgets/desktop/secondary_button.dart';
|
||||||
import 'package:stackwallet/widgets/rounded_white_container.dart';
|
import 'package:stackwallet/widgets/rounded_white_container.dart';
|
||||||
|
|
||||||
|
import 'manage_themes.dart';
|
||||||
|
|
||||||
class AppearanceSettingsView extends ConsumerWidget {
|
class AppearanceSettingsView extends ConsumerWidget {
|
||||||
const AppearanceSettingsView({Key? key}) : super(key: key);
|
const AppearanceSettingsView({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@ -128,6 +131,14 @@ class AppearanceSettingsView extends ConsumerWidget {
|
||||||
padding: EdgeInsets.all(10),
|
padding: EdgeInsets.all(10),
|
||||||
child: ThemeOptionsWidget(),
|
child: ThemeOptionsWidget(),
|
||||||
),
|
),
|
||||||
|
SecondaryButton(
|
||||||
|
label: "Add more themes",
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.of(context).pushNamed(
|
||||||
|
ManageThemesView.routeName,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|
|
@ -0,0 +1,109 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:stackwallet/utilities/text_styles.dart';
|
||||||
|
import 'package:stackwallet/utilities/theme/stack_colors.dart';
|
||||||
|
import 'package:stackwallet/utilities/util.dart';
|
||||||
|
import 'package:stackwallet/widgets/conditional_parent.dart';
|
||||||
|
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
|
||||||
|
import 'package:stackwallet/widgets/desktop/primary_button.dart';
|
||||||
|
import 'package:stackwallet/widgets/rounded_container.dart';
|
||||||
|
import 'package:stackwallet/widgets/rounded_white_container.dart';
|
||||||
|
|
||||||
|
class ManageThemesView extends StatefulWidget {
|
||||||
|
const ManageThemesView({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
static const String routeName = "/manageThemes";
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<ManageThemesView> createState() => _ManageThemesViewState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _ManageThemesViewState extends State<ManageThemesView> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return ConditionalParent(
|
||||||
|
condition: !Util.isDesktop,
|
||||||
|
builder: (child) => Scaffold(
|
||||||
|
backgroundColor:
|
||||||
|
Theme.of(context).extension<StackColors>()!.background,
|
||||||
|
appBar: AppBar(
|
||||||
|
leading: AppBarBackButton(
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
title: Text(
|
||||||
|
"Settings",
|
||||||
|
style: STextStyles.navBarTitle(context),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
body: LayoutBuilder(
|
||||||
|
builder: (builderContext, constraints) {
|
||||||
|
return SingleChildScrollView(
|
||||||
|
child: ConstrainedBox(
|
||||||
|
constraints: BoxConstraints(
|
||||||
|
minHeight: constraints.maxHeight,
|
||||||
|
),
|
||||||
|
child: IntrinsicHeight(
|
||||||
|
child: child,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
)),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: GridView.builder(
|
||||||
|
gridDelegate: const SliverGridDelegateWithMaxCrossAxisExtent(
|
||||||
|
maxCrossAxisExtent: 100,
|
||||||
|
),
|
||||||
|
itemBuilder: (_, index) {
|
||||||
|
return Container(
|
||||||
|
width: 25,
|
||||||
|
height: 25,
|
||||||
|
color: Colors.red,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class StackThemeCard extends StatefulWidget {
|
||||||
|
const StackThemeCard({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<StackThemeCard> createState() => _StackThemeCardState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _StackThemeCardState extends State<StackThemeCard> {
|
||||||
|
String buttonLabel = "Download";
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return RoundedWhiteContainer(
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
RoundedContainer(
|
||||||
|
color: Colors.grey,
|
||||||
|
radiusMultiplier: 100,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
"Theme name",
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
"10.6 GB (lol)",
|
||||||
|
),
|
||||||
|
PrimaryButton(
|
||||||
|
label: buttonLabel,
|
||||||
|
buttonHeight: ButtonHeight.m,
|
||||||
|
onPressed: () {},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -64,6 +64,7 @@ import 'package:stackwallet/pages/settings_views/global_settings_view/about_view
|
||||||
import 'package:stackwallet/pages/settings_views/global_settings_view/advanced_views/advanced_settings_view.dart';
|
import 'package:stackwallet/pages/settings_views/global_settings_view/advanced_views/advanced_settings_view.dart';
|
||||||
import 'package:stackwallet/pages/settings_views/global_settings_view/advanced_views/debug_view.dart';
|
import 'package:stackwallet/pages/settings_views/global_settings_view/advanced_views/debug_view.dart';
|
||||||
import 'package:stackwallet/pages/settings_views/global_settings_view/appearance_settings/appearance_settings_view.dart';
|
import 'package:stackwallet/pages/settings_views/global_settings_view/appearance_settings/appearance_settings_view.dart';
|
||||||
|
import 'package:stackwallet/pages/settings_views/global_settings_view/appearance_settings/manage_themes.dart';
|
||||||
import 'package:stackwallet/pages/settings_views/global_settings_view/appearance_settings/system_brightness_theme_selection_view.dart';
|
import 'package:stackwallet/pages/settings_views/global_settings_view/appearance_settings/system_brightness_theme_selection_view.dart';
|
||||||
import 'package:stackwallet/pages/settings_views/global_settings_view/currency_view.dart';
|
import 'package:stackwallet/pages/settings_views/global_settings_view/currency_view.dart';
|
||||||
import 'package:stackwallet/pages/settings_views/global_settings_view/delete_account_view.dart';
|
import 'package:stackwallet/pages/settings_views/global_settings_view/delete_account_view.dart';
|
||||||
|
@ -1560,6 +1561,12 @@ class RouteGenerator {
|
||||||
builder: (_) => const AppearanceOptionSettings(),
|
builder: (_) => const AppearanceOptionSettings(),
|
||||||
settings: RouteSettings(name: settings.name));
|
settings: RouteSettings(name: settings.name));
|
||||||
|
|
||||||
|
case ManageThemesView.routeName:
|
||||||
|
return getRoute(
|
||||||
|
shouldUseMaterialRoute: useMaterialPageRoute,
|
||||||
|
builder: (_) => const ManageThemesView(),
|
||||||
|
settings: RouteSettings(name: settings.name));
|
||||||
|
|
||||||
case AdvancedSettings.routeName:
|
case AdvancedSettings.routeName:
|
||||||
return getRoute(
|
return getRoute(
|
||||||
shouldUseMaterialRoute: useMaterialPageRoute,
|
shouldUseMaterialRoute: useMaterialPageRoute,
|
||||||
|
|
Loading…
Reference in a new issue