|
| 1 | +import 'package:algorithm_visualizer/config/routes/route_app.dart'; |
| 2 | +import 'package:algorithm_visualizer/core/extensions/navigators.dart'; |
| 3 | +import 'package:algorithm_visualizer/core/helpers/screen_size.dart'; |
| 4 | +import 'package:algorithm_visualizer/core/resources/strings_manager.dart'; |
| 5 | +import 'package:algorithm_visualizer/core/resources/theme_manager.dart'; |
| 6 | +import 'package:algorithm_visualizer/core/widgets/adaptive/text/adaptive_text.dart'; |
| 7 | +import 'package:algorithm_visualizer/core/widgets/custom_widgets/custom_rounded_elevated_button.dart'; |
| 8 | +import 'package:flutter/material.dart'; |
| 9 | + |
| 10 | +class BasePage extends StatefulWidget { |
| 11 | + const BasePage({super.key}); |
| 12 | + |
| 13 | + @override |
| 14 | + State<BasePage> createState() => _BasePageState(); |
| 15 | +} |
| 16 | + |
| 17 | +class _BasePageState extends State<BasePage> { |
| 18 | + @override |
| 19 | + void initState() { |
| 20 | + WidgetsBinding.instance.addPostFrameCallback((_) { |
| 21 | + ScreenSize.initContext(context); |
| 22 | + }); |
| 23 | + super.initState(); |
| 24 | + } |
| 25 | + |
| 26 | + @override |
| 27 | + Widget build(BuildContext context) { |
| 28 | + return Scaffold( |
| 29 | + body: SafeArea( |
| 30 | + child: Center( |
| 31 | + child: Row( |
| 32 | + mainAxisAlignment: MainAxisAlignment.spaceEvenly, |
| 33 | + children: [ |
| 34 | + CustomRoundedElevatedButton( |
| 35 | + roundedRadius: 3, |
| 36 | + backgroundColor: ThemeEnum.whiteD5Color, |
| 37 | + child: const RegularText(StringsManager.searching), |
| 38 | + onPressed: () { |
| 39 | + context.pushTo(Routes.searching); |
| 40 | + }, |
| 41 | + ), |
| 42 | + CustomRoundedElevatedButton( |
| 43 | + roundedRadius: 3, |
| 44 | + backgroundColor: ThemeEnum.whiteD5Color, |
| 45 | + child: const RegularText(StringsManager.sorting), |
| 46 | + onPressed: () { |
| 47 | + context.pushTo(Routes.sorting); |
| 48 | + }, |
| 49 | + ), |
| 50 | + ], |
| 51 | + ), |
| 52 | + ), |
| 53 | + ), |
| 54 | + ); |
| 55 | + } |
| 56 | +} |
0 commit comments