This commit is contained in:
Win 2024-03-03 18:04:45 +07:00
parent 438e9a80ad
commit 668661df4b
19 changed files with 428 additions and 166 deletions

View File

@ -23,6 +23,22 @@
<action android:name="android.intent.action.MAIN"/> <action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/> <category android:name="android.intent.category.LAUNCHER"/>
</intent-filter> </intent-filter>
<queries>
<intent>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
</intent>
<intent>
<action android:name="android.intent.action.DIAL" />
<data android:scheme="tel" />
</intent>
<intent>
<action android:name="android.intent.action.SEND" />
<data android:mimeType="*/*" />
</intent>
</queries>
</activity> </activity>
<!-- Don't delete the meta-data below. <!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java --> This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->

20
assets/app_icons/external/Discord.svg vendored Normal file
View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg">
<defs>
<path d="M24 0L24 0L24 24L0 24L0 0L24 0Z" id="path_1" />
<path d="M20 0L20 0L20 20L0 20L0 0L20 0Z" id="path_2" />
<clipPath id="clip_1">
<use xlink:href="#path_1" clip-rule="evenodd" fill-rule="evenodd" />
</clipPath>
<clipPath id="clip_2">
<use xlink:href="#path_2" clip-rule="evenodd" fill-rule="evenodd" />
</clipPath>
</defs>
<g id="electrical_services_FILL0_wght400_GRAD0_opsz24">
<path d="M24 0L24 0L24 24L0 24L0 0L24 0Z" id="electrical_services_FILL0_wght400_GRAD0_opsz24" fill="none" stroke="none" />
<g id="discord-icon-svgrepo-com" clip-path="url(#clip_1)">
<path d="M20 0L20 0L20 20L0 20L0 0L20 0Z" id="discord-icon-svgrepo-com" fill="none" stroke="none" transform="translate(2 2)" />
<path d="M16.9395 3.52299C15.6451 2.91735 14.261 2.47719 12.814 2.22656C12.6363 2.54786 12.4286 2.98001 12.2855 3.32379C10.7473 3.09246 9.22317 3.09246 7.71323 3.32379C7.57011 2.98001 7.35777 2.54786 7.17847 2.22656C5.72988 2.47719 4.34419 2.91897 3.04974 3.5262C0.438808 7.47166 -0.268972 11.3191 0.0849187 15.1119C1.81662 16.4051 3.49486 17.1907 5.14476 17.7048C5.55214 17.1441 5.91546 16.5481 6.22845 15.92C5.63234 15.6935 5.0614 15.414 4.52193 15.0895C4.66505 14.9834 4.80505 14.8726 4.9403 14.7585C8.23069 16.2975 11.8058 16.2975 15.0569 14.7585C15.1937 14.8726 15.3337 14.9834 15.4752 15.0895C14.9342 15.4156 14.3617 15.6951 13.7656 15.9216C14.0785 16.5481 14.4403 17.1457 14.8492 17.7064C16.5007 17.1923 18.1805 16.4068 19.9122 15.1119C20.3275 10.7151 19.2029 6.90296 16.9395 3.52299L16.9395 3.52299ZM6.67671 12.7794C5.68897 12.7794 4.87894 11.8573 4.87894 10.7344C4.87894 9.61148 5.67167 8.68778 6.67671 8.68778C7.68178 8.68778 8.49178 9.60987 8.47448 10.7344C8.47604 11.8573 7.68178 12.7794 6.67671 12.7794L6.67671 12.7794ZM13.3204 12.7794C12.3327 12.7794 11.5227 11.8573 11.5227 10.7344C11.5227 9.61148 12.3154 8.68778 13.3204 8.68778C14.3255 8.68778 15.1355 9.60987 15.1182 10.7344C15.1182 11.8573 14.3255 12.7794 13.3204 12.7794L13.3204 12.7794Z" id="Group" fill="#000000" fill-rule="evenodd" stroke="none" clip-path="url(#clip_2)" transform="translate(2 2)" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

20
assets/app_icons/external/Matrix.svg vendored Normal file
View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg">
<defs>
<path d="M24 0L24 0L24 24L0 24L0 0L24 0Z" id="path_1" />
<path d="M18 0L18 0L18 20L0 20L0 0L18 0Z" id="path_2" />
<clipPath id="clip_1">
<use xlink:href="#path_1" clip-rule="evenodd" fill-rule="evenodd" />
</clipPath>
<clipPath id="clip_2">
<use xlink:href="#path_2" clip-rule="evenodd" fill-rule="evenodd" />
</clipPath>
</defs>
<g id="electrical_services_FILL0_wght400_GRAD0_opsz24">
<path d="M24 0L24 0L24 24L0 24L0 0L24 0Z" id="electrical_services_FILL0_wght400_GRAD0_opsz24" fill="none" stroke="none" />
<g id="Matrix (protocol) logo" clip-path="url(#clip_1)">
<path d="M18 0L18 0L18 20L0 20L0 0L18 0Z" id="Matrix-(protocol)-logo" fill="none" stroke="none" transform="translate(3 2)" />
<path d="M0.542554 0.460709L0.542554 19.5258L1.9554 19.5258L1.9554 19.9834L-0.00581119 19.9834L-0.00581119 -0.0193569L1.94895 -0.0193569L1.94895 0.438206L0.542554 0.460709ZM17.4225 19.5058L17.4225 0.440706L16.0097 0.440706L16.0097 -0.0168573L17.9709 -0.0168573L17.9709 19.9859L16.0097 19.9859L16.0097 19.5283L17.4225 19.5058ZM5.2483 6.50317L5.2483 7.4658L5.27669 7.4658C5.52507 7.11325 5.8528 6.82196 6.23794 6.60943C6.61212 6.40753 7.04436 6.30627 7.52176 6.30627C7.98626 6.30627 8.41205 6.39378 8.79268 6.5688C9.17653 6.74321 9.47007 7.05075 9.67006 7.49393C9.88812 7.18139 10.1836 6.90573 10.5604 6.66882C10.9345 6.42941 11.3797 6.31002 11.8893 6.31002C12.2777 6.31002 12.6377 6.35628 12.9667 6.44754C13.2983 6.54005 13.5822 6.68695 13.8183 6.88948C14.0544 7.09138 14.2396 7.35579 14.3725 7.68334C14.5047 8.00963 14.5712 8.40218 14.5712 8.86475L14.5712 13.6342L12.5519 13.6342L12.5519 9.5961C12.5519 9.35669 12.5422 9.13166 12.5235 8.921C12.51 8.7291 12.457 8.54158 12.3674 8.36968C12.2816 8.21278 12.1506 8.08339 11.9906 7.99713C11.8248 7.90587 11.5997 7.85961 11.3132 7.85961C11.0294 7.85961 10.7997 7.91274 10.6229 8.01776C10.4474 8.12402 10.31 8.26154 10.2107 8.43156C10.1081 8.61096 10.0404 8.80786 10.012 9.01102C9.97844 9.22792 9.96167 9.4467 9.96167 9.66736L9.96167 13.6367L7.94239 13.6367L7.94239 9.6361C7.94239 9.42483 7.93787 9.21542 7.92884 9.01102C7.92149 8.81474 7.88052 8.62159 7.80756 8.43844C7.73788 8.26529 7.61402 8.11839 7.45273 8.01776C7.28629 7.91274 7.04242 7.85961 6.71728 7.85961C6.58954 7.8648 6.4631 7.88586 6.34052 7.92212C6.17407 7.96869 6.01924 8.04838 5.8857 8.1559C5.73861 8.27092 5.61345 8.43656 5.50894 8.65222C5.40507 8.8685 5.35281 9.15104 5.35281 9.50234L5.35281 13.6404L3.33354 13.6404L3.33354 6.51442L5.2483 6.50317Z" id="Group" fill="#000000" fill-rule="evenodd" stroke="none" clip-path="url(#clip_2)" transform="translate(3 2)" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.8 KiB

20
assets/app_icons/external/Telegram.svg vendored Normal file
View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg">
<defs>
<path d="M24 0L24 0L24 24L0 24L0 0L24 0Z" id="path_1" />
<path d="M22 0L22 0L22 22L0 22L0 0L22 0Z" id="path_2" />
<clipPath id="clip_1">
<use xlink:href="#path_1" clip-rule="evenodd" fill-rule="evenodd" />
</clipPath>
<clipPath id="clip_2">
<use xlink:href="#path_2" clip-rule="evenodd" fill-rule="evenodd" />
</clipPath>
</defs>
<g id="electrical_services_FILL0_wght400_GRAD0_opsz24">
<path d="M24 0L24 0L24 24L0 24L0 0L24 0Z" id="electrical_services_FILL0_wght400_GRAD0_opsz24" fill="none" stroke="none" />
<g id="icons8-telegram" clip-path="url(#clip_1)">
<path d="M22 0L22 0L22 22L0 22L0 0L22 0Z" id="icons8-telegram" fill="none" stroke="none" transform="translate(1 1)" />
<path d="M11 0.88C5.41609 0.88 0.88 5.41609 0.88 11C0.88 16.5839 5.41609 21.12 11 21.12C16.5839 21.12 21.12 16.5839 21.12 11C21.12 5.41609 16.5839 0.88 11 0.88L11 0.88ZM11 1.76C16.1083 1.76 20.24 5.89168 20.24 11C20.24 16.1083 16.1083 20.24 11 20.24C5.89167 20.24 1.76 16.1083 1.76 11C1.76 5.89168 5.89167 1.76 11 1.76L11 1.76ZM14.9987 6.17547C14.6977 6.17547 14.3595 6.24517 13.964 6.38773C13.3497 6.60905 6.12512 9.67655 5.3032 10.0255C4.83328 10.2252 3.95828 10.5968 3.95828 11.483C3.95828 12.0704 4.30248 12.4905 4.98008 12.7325C5.3444 12.8623 6.20968 13.1246 6.71172 13.2627C6.92468 13.3213 7.15099 13.3512 7.38375 13.3512C7.83915 13.3512 8.29744 13.2378 8.65648 13.0376C8.6534 13.1115 8.65542 13.1862 8.66422 13.261C8.71834 13.723 9.00323 14.1575 9.42562 14.4237C9.70195 14.598 11.9589 16.1102 12.2959 16.3505C12.7694 16.6888 13.2928 16.8678 13.8084 16.8678C14.794 16.8678 15.1247 15.8502 15.284 15.3613C15.515 14.6516 16.38 8.88014 16.4777 7.86242C16.5441 7.16502 16.2534 6.59074 15.6999 6.32586C15.4927 6.22598 15.2561 6.17547 14.9987 6.17547L14.9987 6.17547ZM14.9987 7.05547C15.1197 7.05547 15.2277 7.07548 15.3192 7.11992C15.5273 7.2198 15.6332 7.44246 15.6011 7.77906C15.4946 8.88918 14.6317 14.5239 14.4478 15.0889C14.2903 15.572 14.1244 15.9878 13.8084 15.9878C13.4925 15.9878 13.1474 15.8771 12.8073 15.6338C12.4671 15.3909 10.2086 13.8762 9.89484 13.6787C9.61984 13.5053 9.3288 13.0732 9.73844 12.6552C10.0759 12.3111 12.6359 9.82649 12.8545 9.60781C13.0173 9.44457 12.9412 9.24774 12.7815 9.24774C12.7265 9.24774 12.6606 9.27092 12.5924 9.3268C12.3249 9.54548 8.5953 12.0412 8.27234 12.2418C8.0585 12.3747 7.72739 12.4704 7.38375 12.4704C7.23723 12.4704 7.08889 12.4528 6.94633 12.4137C6.45001 12.2768 5.61008 12.022 5.27656 11.9032C4.9558 11.7888 4.83914 11.6792 4.83914 11.483C4.83914 11.204 5.23289 11.0114 5.64781 10.835C6.08605 10.6489 13.6691 7.42871 14.2622 7.21531C14.5367 7.11587 14.7879 7.05547 14.9987 7.05547L14.9987 7.05547Z" id="Shape" fill="#000000" fill-rule="evenodd" stroke="none" clip-path="url(#clip_2)" transform="translate(1 1)" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@ -1 +1,2 @@
const String versionString = "0.0.6"; const String versionString = "0.0.7";
const String iconPath = "assets/app_icons/net.winscloud.Datecalculator.svg";

View File

@ -1,14 +1,17 @@
import 'package:dynamic_color/dynamic_color.dart'; import 'package:dynamic_color/dynamic_color.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_adaptive_scaffold/flutter_adaptive_scaffold.dart';
import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'pages/calendar.dart'; import 'pages/calendar.dart';
import 'pages/day.dart'; import 'pages/day.dart';
import 'pages/settings.dart'; import 'pages/settings.dart';
import 'pages/test.dart';
import 'utils/scroll.dart'; import 'utils/scroll.dart';
import 'constants/info.dart';
void main() { void main() {
runApp(const MyApp()); runApp(const MyApp());
} }
@ -41,16 +44,12 @@ class MyApp extends StatelessWidget {
ThemeData lightTheme = ThemeData( ThemeData lightTheme = ThemeData(
colorScheme: lightColorScheme, colorScheme: lightColorScheme,
useMaterial3: true, useMaterial3: true,
navigationRailTheme: NavigationRailThemeData(
backgroundColor: Colors.black.withOpacity(0.03)),
); );
ThemeData darkTheme = ThemeData( ThemeData darkTheme = ThemeData(
brightness: Brightness.dark, brightness: Brightness.dark,
colorScheme: darkColorScheme, colorScheme: darkColorScheme,
useMaterial3: true, useMaterial3: true,
navigationRailTheme: NavigationRailThemeData(
backgroundColor: Colors.white.withOpacity(0.03)),
); );
return MaterialApp( return MaterialApp(
@ -87,18 +86,50 @@ class _MyHomePageState extends State<MyHomePage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AdaptiveScaffold( double screenWidth = MediaQuery.of(context).size.width;
smallBreakpoint: const WidthPlatformBreakpoint(end: 700), bool extendedValue = true;
mediumBreakpoint: const WidthPlatformBreakpoint(begin: 700, end: 1000), NavigationRailLabelType labelType = NavigationRailLabelType.none;
largeBreakpoint: const WidthPlatformBreakpoint(begin: 1000), Widget leading = const Visibility(
useDrawer: false, visible: false,
selectedIndex: _selectedTab, child: SizedBox.shrink(),
onSelectedIndexChange: (int index) { );
if (screenWidth >= 600 && screenWidth < 800) {
extendedValue = false;
labelType = NavigationRailLabelType.all;
}
if (screenWidth >= 800) {
leading = Visibility(
visible: true,
child: Column(
children: [
SvgPicture.asset(iconPath, semanticsLabel: 'Acme Logo'),
const Text(
"Date Calculator",
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 30.0),
),
const SizedBox(
height: 5,
)
],
),
);
}
return LayoutBuilder(builder: (context, constraints) {
return Scaffold(
bottomNavigationBar: MediaQuery.of(context).size.width < 600
? NavigationBar(
onDestinationSelected: (int index) {
setState(() { setState(() {
_selectedTab = index; _selectedTab = index;
}); });
}, },
destinations: const <NavigationDestination>[ indicatorColor:
Theme.of(context).colorScheme.secondaryContainer,
selectedIndex: _selectedTab,
destinations: const <Widget>[
NavigationDestination( NavigationDestination(
icon: Icon(Icons.calendar_month_outlined), icon: Icon(Icons.calendar_month_outlined),
selectedIcon: Icon(Icons.calendar_month), selectedIcon: Icon(Icons.calendar_month),
@ -112,17 +143,64 @@ class _MyHomePageState extends State<MyHomePage> {
NavigationDestination( NavigationDestination(
icon: Icon(Icons.settings_outlined), icon: Icon(Icons.settings_outlined),
selectedIcon: Icon(Icons.settings), selectedIcon: Icon(Icons.settings),
label: 'Settings', label: 'Day',
),
])
: null,
body: Row(
mainAxisSize: MainAxisSize.max,
children: [
if (MediaQuery.of(context).size.width >= 600)
SafeArea(
child: NavigationRail(
labelType: labelType,
elevation: 4,
leading: leading,
backgroundColor: ElevationOverlay.applySurfaceTint(
Theme.of(context).cardColor,
Theme.of(context).colorScheme.surfaceTint,
1),
extended: extendedValue,
destinations: const [
NavigationRailDestination(
icon: Icon(Icons.calendar_month_outlined),
selectedIcon: Icon(Icons.calendar_month),
label: Text('Calendar'),
),
NavigationRailDestination(
icon: Icon(Icons.calendar_today_outlined),
selectedIcon: Icon(Icons.calendar_today),
label: Text('Day'),
),
NavigationRailDestination(
icon: Icon(Icons.settings_outlined),
selectedIcon: Icon(Icons.settings),
label: Text('Settings'),
),
NavigationRailDestination(
icon: Icon(Icons.edit),
selectedIcon: Icon(Icons.edit),
label: Text('Edit'),
)
],
selectedIndex: _selectedTab,
onDestinationSelected: (value) {
setState(() {
_selectedTab = value;
});
},
),
),
Expanded(
child: Container(
color: Theme.of(context).colorScheme.primaryContainer,
child: _getScreen(context, _selectedTab),
),
), ),
], ],
body: (_) => _getScreen(context, _selectedTab), ),
smallBody: (_) => _getScreen(context, _selectedTab),
// Define a default secondaryBody.
// Override the default secondaryBody during the smallBreakpoint to be
// empty. Must use AdaptiveScaffold.emptyBuilder to ensure it is properly
// overridden.
smallSecondaryBody: AdaptiveScaffold.emptyBuilder,
); );
});
} }
} }
@ -134,6 +212,8 @@ Widget _getScreen(BuildContext context, int index) {
return const DayScreen(); return const DayScreen();
case 2: case 2:
return const SettingsScreen(); return const SettingsScreen();
case 3:
return const TestScreen();
default: default:
return const Text('Something went wrong'); return const Text('Something went wrong');
} }

View File

@ -44,11 +44,6 @@ class _CalendarScreenState extends State<CalendarScreen> {
DateFormat("dd MMM yyyy").format(endDate).toString(); DateFormat("dd MMM yyyy").format(endDate).toString();
return Scaffold( return Scaffold(
appBar: AppBar(
title: const Text("Calendar Calculator"),
elevation: 4,
shadowColor: Theme.of(context).shadowColor,
),
body: _selectedDateRange == null body: _selectedDateRange == null
? const Padding( ? const Padding(
padding: EdgeInsets.all(30), padding: EdgeInsets.all(30),

View File

@ -48,11 +48,6 @@ class _DayScreenState extends State<DayScreen> {
DateFormat("EEEE, d MMM yyyy").format(DateTime.now()).toString(); DateFormat("EEEE, d MMM yyyy").format(DateTime.now()).toString();
return Scaffold( return Scaffold(
appBar: AppBar(
title: const Text("Day Calculator"),
elevation: 4,
shadowColor: Theme.of(context).shadowColor,
),
body: _selectedDate == null body: _selectedDate == null
? const Padding( ? const Padding(
padding: EdgeInsets.all(30), padding: EdgeInsets.all(30),

View File

@ -1,6 +1,8 @@
import 'package:dateapp/widgets/dialogs/community.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../widgets/license.dart'; import 'package:url_launcher/url_launcher.dart';
import '../constants/info.dart';
import '../widgets/dialogs/about.dart';
class SettingsScreen extends StatelessWidget { class SettingsScreen extends StatelessWidget {
const SettingsScreen({Key? key}) : super(key: key); const SettingsScreen({Key? key}) : super(key: key);
@ -19,11 +21,6 @@ class _Body extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar(
title: const Text("Settings"),
elevation: 4,
shadowColor: Theme.of(context).shadowColor,
),
body: Column( body: Column(
children: [ children: [
Expanded( Expanded(
@ -49,106 +46,64 @@ class _ListItem extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return DecoratedBox( return Column(
decoration: BoxDecoration( children: [
borderRadius: BorderRadius.circular(8), Card(
), elevation: 4.0,
shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(10.0)),
margin: const EdgeInsets.all(8.0),
child: Column( child: Column(
children: [ children: [
InkWell(
onTap: () async {
await launchUrl(
Uri.parse(
'https://git.winscloud.net/WinsDominoes/dateapp'),
mode: LaunchMode.externalApplication);
},
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(10.0),
topRight: Radius.circular(10.0)),
child: const ListTile(
leading: Icon(Icons.code),
title: Text("Source Code"),
trailing: Wrap(
// space between two icons
children: <Widget>[
Icon(Icons.open_in_new), // icon-1// icon-2
],
),
),
),
const Divider(
height: 1.0,
),
InkWell(
onTap: () => communityDialogBuilder(context),
borderRadius: const BorderRadius.only(
bottomLeft: Radius.circular(10.0),
bottomRight: Radius.circular(10.0)),
child: const ListTile(
leading: Icon(Icons.people),
title: Text("Join Community"),
)),
],
),
),
Card( Card(
elevation: 4.0, elevation: 4.0,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0)), borderRadius: BorderRadius.circular(10.0)),
margin: const EdgeInsets.all(8.0), margin: const EdgeInsets.all(8.0),
child: InkWell( child: InkWell(
onTap: () => _dialogBuilder(context), onTap: () => aboutDialogBuilder(context),
borderRadius: BorderRadius.circular(10.0),
child: const ListTile( child: const ListTile(
leading: Icon(Icons.info_outlined), leading: Icon(Icons.info_outlined),
title: Text("About"), title: Text("About"),
), ),
)) ))
], ],
),
); );
} }
} }
class _PageButton extends StatelessWidget {
const _PageButton();
@override
Widget build(BuildContext context) {
return SafeArea(
child: Padding(
padding: const EdgeInsets.fromLTRB(16, 0, 16, 16),
child: ElevatedButton(
onPressed: () {},
child: const Text("Some Button"),
),
),
);
}
}
Future<void> _dialogBuilder(BuildContext context) {
return showDialog<void>(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: Row(
children: <Widget>[
Container(
width: 80,
height: 80,
decoration: const BoxDecoration(
image: DecorationImage(
alignment: Alignment.centerLeft,
image: ExactAssetImage('assets/app_icons/icon.png')
)
),
),
Container(
child: const Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text("Date Calculator"),
Text(
"v$versionString",
style: TextStyle(
fontSize: 14
)
),
],
),
)
]
),
content: const Text(
'Date Calculator by WinsDominoes and AtiusAmy'
),
actions: <Widget>[
TextButton(
style: TextButton.styleFrom(
textStyle: Theme.of(context).textTheme.labelLarge,
),
child: const Text('View Licenses'),
onPressed: () {
Navigator.push(context, MaterialPageRoute(builder: (context) => LicensePageCustom()));
},
),
TextButton(
style: TextButton.styleFrom(
textStyle: Theme.of(context).textTheme.labelLarge,
),
child: const Text('Close'),
onPressed: () {
Navigator.of(context).pop();
},
),
],
);
},
);
}

37
lib/pages/test.dart Normal file
View File

@ -0,0 +1,37 @@
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
final Uri _url = Uri.parse('https://flutter.dev');
class TestScreen extends StatelessWidget {
const TestScreen({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return const Scaffold(
body: _Body(),
);
}
}
class _Body extends StatelessWidget {
const _Body();
@override
Widget build(BuildContext context) {
return const Center(
child: Center(
child: ElevatedButton(
onPressed: _launchUrl,
child: Text('Show Flutter homepage'),
),
),
);
}
}
Future<void> _launchUrl() async {
if (!await launchUrl(_url)) {
throw Exception('Could not launch $_url');
}
}

View File

@ -0,0 +1,54 @@
import 'package:flutter/material.dart';
import '../license.dart';
import '../../constants/info.dart';
Future<void> aboutDialogBuilder(BuildContext context) {
return showDialog<void>(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: Row(children: <Widget>[
Container(
width: 80,
height: 80,
decoration: const BoxDecoration(
image: DecorationImage(
alignment: Alignment.centerLeft,
image: ExactAssetImage('assets/app_icons/icon.png'))),
),
Container(
child: const Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text("Date Calculator"),
Text("v$versionString", style: TextStyle(fontSize: 14)),
],
),
)
]),
content: const Text('Date Calculator by WinsDominoes and AtiusAmy'),
actions: <Widget>[
TextButton(
style: TextButton.styleFrom(
textStyle: Theme.of(context).textTheme.labelLarge,
),
child: const Text('View Licenses'),
onPressed: () {
Navigator.push(context,
MaterialPageRoute(builder: (context) => LicensePageCustom()));
},
),
TextButton(
style: TextButton.styleFrom(
textStyle: Theme.of(context).textTheme.labelLarge,
),
child: const Text('Close'),
onPressed: () {
Navigator.of(context).pop();
},
),
],
);
},
);
}

View File

@ -0,0 +1,54 @@
import 'package:flutter/material.dart';
import '../license.dart';
import '../../constants/info.dart';
Future<void> communityDialogBuilder(BuildContext context) {
return showDialog<void>(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: Row(children: <Widget>[
Container(
width: 80,
height: 80,
decoration: const BoxDecoration(
image: DecorationImage(
alignment: Alignment.centerLeft,
image: ExactAssetImage('assets/app_icons/icon.png'))),
),
Container(
child: const Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text("Date Calculator"),
Text("v$versionString", style: TextStyle(fontSize: 14)),
],
),
)
]),
content: const Text('Date Calculator by WinsDominoes and AtiusAmy'),
actions: <Widget>[
TextButton(
style: TextButton.styleFrom(
textStyle: Theme.of(context).textTheme.labelLarge,
),
child: const Text('View Licenses'),
onPressed: () {
Navigator.push(context,
MaterialPageRoute(builder: (context) => LicensePageCustom()));
},
),
TextButton(
style: TextButton.styleFrom(
textStyle: Theme.of(context).textTheme.labelLarge,
),
child: const Text('Close'),
onPressed: () {
Navigator.of(context).pop();
},
),
],
);
},
);
}

View File

@ -7,9 +7,13 @@
#include "generated_plugin_registrant.h" #include "generated_plugin_registrant.h"
#include <dynamic_color/dynamic_color_plugin.h> #include <dynamic_color/dynamic_color_plugin.h>
#include <url_launcher_linux/url_launcher_plugin.h>
void fl_register_plugins(FlPluginRegistry* registry) { void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) dynamic_color_registrar = g_autoptr(FlPluginRegistrar) dynamic_color_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "DynamicColorPlugin"); fl_plugin_registry_get_registrar_for_plugin(registry, "DynamicColorPlugin");
dynamic_color_plugin_register_with_registrar(dynamic_color_registrar); dynamic_color_plugin_register_with_registrar(dynamic_color_registrar);
g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");
url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);
} }

View File

@ -4,6 +4,7 @@
list(APPEND FLUTTER_PLUGIN_LIST list(APPEND FLUTTER_PLUGIN_LIST
dynamic_color dynamic_color
url_launcher_linux
) )
list(APPEND FLUTTER_FFI_PLUGIN_LIST list(APPEND FLUTTER_FFI_PLUGIN_LIST

View File

@ -5,7 +5,7 @@
<name>Date Calculator</name> <name>Date Calculator</name>
<summary>The go-to minimal date calculator</summary> <summary>The go-to minimal date calculator</summary>
<url type="homepage">https://datecalculator.winscloud.net</url> <url type="homepage">https://datecalculator.winscloud.net</url>
<url type="bugtracker">https://github.com/WinsDominoes/dateapp/issues</url> <url type="bugtracker">https://git.winscloud.net/WinsDominoes/dateapp/issues</url>
<metadata_license>MIT</metadata_license> <metadata_license>MIT</metadata_license>
<project_license>LGPL-2.1</project_license> <project_license>LGPL-2.1</project_license>
@ -42,6 +42,10 @@
</screenshots> </screenshots>
<content_rating type="oars-1.0"/> <content_rating type="oars-1.0"/>
<releases> <releases>
<release version="0.0.7" date="2024-03-03">
</release>
<release version="0.0.6" date="2024-02-03">
</release>
<release version="0.0.5" date="2024-02-02"> <release version="0.0.5" date="2024-02-02">
</release> </release>
<release version="0.0.4" date="2024-02-02"> <release version="0.0.4" date="2024-02-02">

View File

@ -6,7 +6,9 @@ import FlutterMacOS
import Foundation import Foundation
import dynamic_color import dynamic_color
import url_launcher_macos
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
DynamicColorPlugin.register(with: registry.registrar(forPlugin: "DynamicColorPlugin")) DynamicColorPlugin.register(with: registry.registrar(forPlugin: "DynamicColorPlugin"))
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
} }

View File

@ -2,7 +2,7 @@ name: dateapp
description: "An app to calculate differences between two dates" description: "An app to calculate differences between two dates"
# The following line prevents the package from being accidentally published to # The following line prevents the package from being accidentally published to
# pub.dev using `flutter pub publish`. This is preferred for private packages. # 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. # The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43 # A version number is three numbers separated by dots, like 1.2.43
@ -16,10 +16,11 @@ 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 # 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 # 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. # of the product and file versions while build-number is used as the build suffix.
version: 0.0.6 version: 0.0.7
environment: environment:
sdk: '>=3.2.5 <4.0.0' flutter: ">=3.13.0"
sdk: ">=3.1.0 <4.0.0"
# Dependencies specify other packages that your package needs in order to work. # Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions # To automatically upgrade your package dependencies to the latest versions
@ -40,9 +41,8 @@ dependencies:
cupertino_icons: ^1.0.2 cupertino_icons: ^1.0.2
intl: ^0.18.1 intl: ^0.18.1
flutter_native_splash: ^2.2.17 flutter_native_splash: ^2.2.17
sidebar_drawer: ^0.0.1+2 flutter_svg: ^2.0.10+1
flutter_adaptive_scaffold: ^0.1.7+2 url_launcher: 6.2.5
adaptive_navigation: ^0.0.4
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
@ -72,7 +72,6 @@ msix_config:
# The following section is specific to Flutter packages. # The following section is specific to Flutter packages.
flutter: flutter:
# The following line ensures that the Material Icons font is # The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in # included with your application, so that you can use the icons in
# the material Icons class. # the material Icons class.
@ -81,6 +80,7 @@ flutter:
# To add assets to your application, add an assets section, like this: # To add assets to your application, add an assets section, like this:
assets: assets:
- assets/app_icons/icon.png - assets/app_icons/icon.png
- assets/app_icons/net.winscloud.Datecalculator.svg
# - images/a_dot_ham.jpeg # - images/a_dot_ham.jpeg
# An image asset can refer to one or more resolution-specific "variants", see # An image asset can refer to one or more resolution-specific "variants", see

View File

@ -7,8 +7,11 @@
#include "generated_plugin_registrant.h" #include "generated_plugin_registrant.h"
#include <dynamic_color/dynamic_color_plugin_c_api.h> #include <dynamic_color/dynamic_color_plugin_c_api.h>
#include <url_launcher_windows/url_launcher_windows.h>
void RegisterPlugins(flutter::PluginRegistry* registry) { void RegisterPlugins(flutter::PluginRegistry* registry) {
DynamicColorPluginCApiRegisterWithRegistrar( DynamicColorPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("DynamicColorPluginCApi")); registry->GetRegistrarForPlugin("DynamicColorPluginCApi"));
UrlLauncherWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("UrlLauncherWindows"));
} }

View File

@ -4,6 +4,7 @@
list(APPEND FLUTTER_PLUGIN_LIST list(APPEND FLUTTER_PLUGIN_LIST
dynamic_color dynamic_color
url_launcher_windows
) )
list(APPEND FLUTTER_FFI_PLUGIN_LIST list(APPEND FLUTTER_FFI_PLUGIN_LIST