151 lines
4.8 KiB
Dart
151 lines
4.8 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter/widgets.dart';
|
|
import 'package:libacflutter/Constants.dart';
|
|
import 'package:pokedex/Session.dart';
|
|
|
|
class FilterPage extends StatefulWidget {
|
|
@override
|
|
State<StatefulWidget> createState() {
|
|
return _filterPage();
|
|
}
|
|
}
|
|
|
|
class _filterPage extends State<FilterPage> {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
appBar: AppBar(
|
|
title: Text("PokeDex - Filters"),
|
|
backgroundColor:
|
|
SessionData.darkMode
|
|
? LibACFlutterConstants.TITLEBAR_COLOR
|
|
: Colors.cyan,
|
|
),
|
|
body: Padding(
|
|
padding: EdgeInsets.all(8),
|
|
child: SingleChildScrollView(
|
|
child: Column(
|
|
children: [
|
|
Text(
|
|
"The PokeDex's filters will allow you to customize what Generations are shown in the app.\n\n** WARNING **\nThis will prevent evolutions from showing up if the Pokemon resides in a future generation.\n\nThe dex entries will also not show the evolution conditions, or catch conditions for disabled generations.",
|
|
style: TextStyle(fontSize: 24),
|
|
),
|
|
SwitchListTile(
|
|
value: SessionData.enableDescription,
|
|
onChanged: (X) {
|
|
SessionData.enableDescription =
|
|
!SessionData.enableDescription;
|
|
setState(() {});
|
|
},
|
|
title: Text("Enable Dex Descriptions"),
|
|
subtitle: Text(
|
|
"Enables or disables the pokedex descriptions for the pokemon",
|
|
),
|
|
),
|
|
SizedBox(height: 50),
|
|
SwitchListTile(
|
|
value: (SessionData.highest >= 1),
|
|
title: Text("Generation 1"),
|
|
|
|
onChanged: (val) {
|
|
setState(() {
|
|
SessionData.highest = 1;
|
|
SessionData.resetHighestGenCache();
|
|
});
|
|
},
|
|
),
|
|
SwitchListTile(
|
|
value: (SessionData.highest >= 2),
|
|
title: Text("Generation 2"),
|
|
|
|
onChanged: (val) {
|
|
setState(() {
|
|
SessionData.highest = 2;
|
|
SessionData.resetHighestGenCache();
|
|
});
|
|
},
|
|
),
|
|
SwitchListTile(
|
|
value: (SessionData.highest >= 3),
|
|
title: Text("Generation 3"),
|
|
|
|
onChanged: (val) {
|
|
setState(() {
|
|
SessionData.highest = 3;
|
|
SessionData.resetHighestGenCache();
|
|
});
|
|
},
|
|
),
|
|
SwitchListTile(
|
|
value: (SessionData.highest >= 4),
|
|
title: Text("Generation 4"),
|
|
|
|
onChanged: (val) {
|
|
setState(() {
|
|
SessionData.highest = 4;
|
|
SessionData.resetHighestGenCache();
|
|
});
|
|
},
|
|
),
|
|
SwitchListTile(
|
|
value: (SessionData.highest >= 5),
|
|
title: Text("Generation 5"),
|
|
|
|
onChanged: (val) {
|
|
setState(() {
|
|
SessionData.highest = 5;
|
|
SessionData.resetHighestGenCache();
|
|
});
|
|
},
|
|
),
|
|
SwitchListTile(
|
|
value: (SessionData.highest >= 6),
|
|
title: Text("Generation 6"),
|
|
|
|
onChanged: (val) {
|
|
setState(() {
|
|
SessionData.highest = 6;
|
|
SessionData.resetHighestGenCache();
|
|
});
|
|
},
|
|
),
|
|
SwitchListTile(
|
|
value: (SessionData.highest >= 7),
|
|
title: Text("Generation 7"),
|
|
|
|
onChanged: (val) {
|
|
setState(() {
|
|
SessionData.highest = 7;
|
|
SessionData.resetHighestGenCache();
|
|
});
|
|
},
|
|
),
|
|
SwitchListTile(
|
|
value: (SessionData.highest >= 8),
|
|
title: Text("Generation 8"),
|
|
|
|
onChanged: (val) {
|
|
setState(() {
|
|
SessionData.highest = 8;
|
|
SessionData.resetHighestGenCache();
|
|
});
|
|
},
|
|
),
|
|
SwitchListTile(
|
|
value: (SessionData.highest >= 9),
|
|
title: Text("Generation 9"),
|
|
|
|
onChanged: (val) {
|
|
setState(() {
|
|
SessionData.highest = 9;
|
|
SessionData.resetHighestGenCache();
|
|
});
|
|
},
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|