diff --git a/lib/app_page.dart b/lib/app_page.dart index c1aa97b..ff0c210 100644 --- a/lib/app_page.dart +++ b/lib/app_page.dart @@ -179,7 +179,7 @@ class _AppPageState extends State { } class _InfoCard extends StatelessWidget { - const _InfoCard({super.key, required this.topText, required this.bottomText}); + const _InfoCard({required this.topText, required this.bottomText}); final String topText; final String bottomText; diff --git a/lib/main.dart b/lib/main.dart index e11710b..adcae2c 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -3,6 +3,8 @@ import 'package:openstore/app_page.dart'; import 'package:openstore/search_page.dart'; import 'package:go_router/go_router.dart'; import 'package:dynamic_color/dynamic_color.dart'; +import 'package:url_launcher/url_launcher_string.dart'; +import 'dart:io' show Platform; void main() { runApp(const MyApp()); @@ -65,34 +67,80 @@ class HomePage extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar( - title: const Text("OpenStore"), - ), - body: Center( - child: Row( - children: [ - const SizedBox( - width: 15, - ), - Flexible( - child: TextField( - onSubmitted: (value) => context.push( - Uri(path: '/search', queryParameters: {'q': value}) - .toString()), - textInputAction: TextInputAction.search, - decoration: InputDecoration( - prefixIcon: Icon(Icons.search), - border: OutlineInputBorder()), - ), - ), - //const SizedBox(width: 5,), - //FilledButton(onPressed: (){}, child: Text("GO")), - const SizedBox( - width: 15, - ), - ], + appBar: AppBar( + title: const Text("OpenStore"), ), - ), - ); + body: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container(), + Row( + children: [ + const SizedBox( + width: 15, + ), + Flexible( + child: TextField( + onSubmitted: (value) => context.push( + Uri(path: '/search', queryParameters: {'q': value}) + .toString()), + textInputAction: TextInputAction.search, + decoration: const InputDecoration( + prefixIcon: Icon(Icons.search), + border: OutlineInputBorder()), + ), + ), + //const SizedBox(width: 5,), + //FilledButton(onPressed: (){}, child: Text("GO")), + const SizedBox( + width: 15, + ), + ], + ), + Padding( + padding: const EdgeInsets.fromLTRB(0, 0, 0, 15), + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + InkWell( + onTap: () async => await launchUrlString( + "https://git.mi6e4ka.dev/mi6e4ka/openstore"), + child: const Text( + "source code", + style: TextStyle( + decoration: TextDecoration.underline), + ), + ), + const SizedBox( + width: 8, + ), + const Text("|"), + !Platform.isAndroid + ? const SizedBox( + width: 8, + ) + : Container(), + !Platform.isAndroid + ? InkWell( + onTap: () async => await launchUrlString( + "https://git.mi6e4ka.dev/mi6e4ka/openstore/releases"), + child: const Text( + "android app", + style: TextStyle( + decoration: TextDecoration.underline), + ), + ) + : Container(), + ], + ), + const Text("v1.2.0") + ], + ), + ) + ]), + )); } } diff --git a/lib/search_page.dart b/lib/search_page.dart index 4f17313..96ca250 100644 --- a/lib/search_page.dart +++ b/lib/search_page.dart @@ -4,7 +4,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; -import 'package:openstore/app_page.dart'; import 'package:openstore/get_app_link.dart'; class SearchPage extends StatefulWidget { @@ -56,9 +55,9 @@ class _SearchPageState extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar(title: Text("Поиск")), + appBar: AppBar(title: const Text("Поиск")), body: _searchResults == null - ? LinearProgressIndicator() + ? const LinearProgressIndicator() : ListView.builder( itemCount: _searchResults?.length, padding: const EdgeInsets.fromLTRB(15, 0, 15, 0), diff --git a/pubspec.yaml b/pubspec.yaml index 459a47d..d352742 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ name: openstore description: "A new Flutter project." # The following line prevents the package from being accidentally published to # pub.dev using `flutter pub publish`. This is preferred for private packages. -publish_to: 'none' # Remove this line if you wish to publish to pub.dev +publish_to: "none" # Remove this line if you wish to publish to pub.dev # The following defines the version and build number for your application. # A version number is three numbers separated by dots, like 1.2.43 @@ -16,10 +16,10 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 1.0.0+1 +version: 1.2.0+1 environment: - sdk: '>=3.4.3 <4.0.0' + sdk: ">=3.4.3 <4.0.0" # Dependencies specify other packages that your package needs in order to work. # To automatically upgrade your package dependencies to the latest versions @@ -55,7 +55,6 @@ dev_dependencies: # The following section is specific to Flutter packages. flutter: - # The following line ensures that the Material Icons font is # included with your application, so that you can use the icons in # the material Icons class.