init settings page design

This commit is contained in:
dstark5
2023-08-22 23:29:07 -07:00
parent 1507656944
commit b2a1be7a7e
4 changed files with 109 additions and 2 deletions

View File

@ -9,6 +9,7 @@ import 'package:openlib/ui/extensions.dart';
import 'package:openlib/ui/trending_page.dart';
import 'package:openlib/ui/search_page.dart';
import 'package:openlib/ui/mylibrary_page.dart';
import 'package:openlib/ui/settings_page.dart';
import 'package:openlib/services/database.dart' show Sqlite, MyLibraryDb;
import 'package:openlib/state/state.dart'
show selectedIndexProvider, dbProvider;
@ -87,7 +88,8 @@ class _HomePageState extends ConsumerState<HomePage> {
static const List<Widget> _widgetOptions = <Widget>[
TrendingPage(),
SearchPage(),
MyLibraryPage()
MyLibraryPage(),
SettingsPage()
];
@override
@ -118,7 +120,7 @@ class _HomePageState extends ConsumerState<HomePage> {
activeColor: const Color.fromARGB(255, 255, 255, 255),
iconSize: 21, // tab button icon size
tabBackgroundColor: Theme.of(context).colorScheme.secondary,
padding: const EdgeInsets.symmetric(horizontal: 15, vertical: 6.5),
padding: const EdgeInsets.symmetric(horizontal: 13, vertical: 6.5),
tabs: const [
GButton(
icon: Icons.trending_up,
@ -150,6 +152,16 @@ class _HomePageState extends ConsumerState<HomePage> {
fontSize: 13,
),
),
GButton(
icon: Icons.build,
text: 'Settings',
iconColor: Colors.white,
textStyle: TextStyle(
fontWeight: FontWeight.w900,
color: Colors.white,
fontSize: 13,
),
),
],
selectedIndex: selectedIndex,
onTabChange: (index) async {

View File

@ -21,6 +21,7 @@ class MyLibraryPage extends ConsumerWidget {
return Padding(
padding: const EdgeInsets.only(left: 5, right: 5, top: 10),
child: CustomScrollView(
physics: const BouncingScrollPhysics(),
slivers: <Widget>[
const SliverToBoxAdapter(
child: TitleText("My Library"),

View File

@ -0,0 +1,93 @@
import 'package:flutter/material.dart';
import 'package:openlib/ui/components/page_title_widget.dart';
class SettingsPage extends StatelessWidget {
const SettingsPage({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.only(left: 5, right: 5, top: 10),
child: SingleChildScrollView(
scrollDirection: Axis.vertical,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const TitleText("Settings"),
Padding(
padding: const EdgeInsets.only(left: 5, right: 5, top: 10),
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5),
color: Theme.of(context).colorScheme.tertiaryContainer,
),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const Text(
"Material You",
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
color: Colors.black,
),
),
Switch(
// This bool value toggles the switch.
value: true,
activeColor: Colors.red,
onChanged: (bool value) {
// This is called when the user toggles the switch.
print(value);
},
)
],
),
),
),
),
Padding(
padding: const EdgeInsets.only(left: 5, right: 5, top: 10),
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5),
color: Theme.of(context).colorScheme.tertiaryContainer,
),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const Text(
"Dark Mode",
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
color: Colors.black,
),
),
Switch(
// This bool value toggles the switch.
value: false,
activeColor: Colors.red,
onChanged: (bool value) {
// This is called when the user toggles the switch.
print(value);
},
)
],
),
),
),
),
],
),
),
);
}
}

View File

@ -21,6 +21,7 @@ class TrendingPage extends ConsumerWidget {
return Padding(
padding: const EdgeInsets.only(left: 5, right: 5, top: 10),
child: CustomScrollView(
physics: const BouncingScrollPhysics(),
slivers: [
const SliverToBoxAdapter(
child: TitleText("Trending"),