This commit is contained in:
parent
6eb6f9809e
commit
511e8cda76
9 changed files with 204 additions and 40 deletions
21
lib/page/about_page.dart
Normal file
21
lib/page/about_page.dart
Normal file
|
@ -0,0 +1,21 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../resources/colors_schemes/lib_color_schemes.g.dart';
|
||||
|
||||
class AboutPage extends StatelessWidget {
|
||||
const AboutPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
iconTheme: IconThemeData(
|
||||
color: lightColorScheme.onBackground,
|
||||
),
|
||||
title: Text('About', style: TextStyle(color: lightColorScheme.onPrimaryContainer)),
|
||||
backgroundColor: lightColorScheme.primaryContainer,
|
||||
elevation: 0,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
|
||||
class ActionPage extends StatelessWidget {
|
||||
const ActionPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: Text('B'),
|
||||
);
|
||||
}
|
||||
}
|
63
lib/page/more_page.dart
Normal file
63
lib/page/more_page.dart
Normal file
|
@ -0,0 +1,63 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:simple_git/resources/colors_schemes/lib_color_schemes.g.dart';
|
||||
|
||||
import 'about_page.dart';
|
||||
import 'settings_page.dart';
|
||||
|
||||
class MorePage extends StatefulWidget {
|
||||
const MorePage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<MorePage> createState() => _MorePageState();
|
||||
}
|
||||
|
||||
class _MorePageState extends State<MorePage> {
|
||||
final _texts = [
|
||||
"Settings",
|
||||
"About",
|
||||
];
|
||||
|
||||
final _icons = [
|
||||
Icons.settings_outlined,
|
||||
Icons.info_outline,
|
||||
];
|
||||
|
||||
final _pages = [
|
||||
SettingsPage(),
|
||||
AboutPage(),
|
||||
];
|
||||
|
||||
int stateIndex = 0;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text('More',
|
||||
style: TextStyle(color: lightColorScheme.onPrimaryContainer)),
|
||||
backgroundColor: lightColorScheme.primaryContainer,
|
||||
elevation: 0,
|
||||
),
|
||||
body: ListView.builder(
|
||||
// padding: const EdgeInsets.all(20.0),
|
||||
itemCount: _texts.length,
|
||||
itemBuilder: (context, index) {
|
||||
return ListTile(
|
||||
onTap: () => selectOption(index),
|
||||
title: Text(_texts[index]),
|
||||
leading: Icon(_icons[index], color: lightColorScheme.primary),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
selectOption(index) {
|
||||
stateIndex = index;
|
||||
Navigator.of(context).push(PageRouteBuilder(
|
||||
pageBuilder: (context, animation, secondaryAnimation) => _pages[index],
|
||||
transitionsBuilder: (c, anim, a2, child) => FadeTransition(opacity: anim, child: child),
|
||||
transitionDuration: const Duration(milliseconds: 150),
|
||||
));
|
||||
}
|
||||
}
|
|
@ -1,5 +1,7 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../resources/colors_schemes/lib_color_schemes.g.dart';
|
||||
|
||||
|
||||
class ReposPage extends StatelessWidget {
|
||||
const ReposPage({Key? key}) : super(key: key);
|
||||
|
@ -7,7 +9,14 @@ class ReposPage extends StatelessWidget {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: Text('A'),
|
||||
appBar: AppBar(
|
||||
title: Text('Repositories', style: TextStyle(color: lightColorScheme.onPrimaryContainer)),
|
||||
backgroundColor: lightColorScheme.primaryContainer,
|
||||
elevation: 0,
|
||||
),
|
||||
body: Container(
|
||||
child: Text('A')
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
21
lib/page/settings_page.dart
Normal file
21
lib/page/settings_page.dart
Normal file
|
@ -0,0 +1,21 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../resources/colors_schemes/lib_color_schemes.g.dart';
|
||||
|
||||
class SettingsPage extends StatelessWidget {
|
||||
const SettingsPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
iconTheme: IconThemeData(
|
||||
color: lightColorScheme.onBackground,
|
||||
),
|
||||
title: Text('Settings', style: TextStyle(color: lightColorScheme.onPrimaryContainer)),
|
||||
backgroundColor: lightColorScheme.primaryContainer,
|
||||
elevation: 0,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue