initial commit (migrated)

This commit is contained in:
fiatcode 2025-10-20 16:43:59 +07:00
commit b594facb51
143 changed files with 11057 additions and 0 deletions

View file

@ -0,0 +1,64 @@
import 'package:auto_route/auto_route.dart';
import 'package:kuwot/core/presentation/bloc/config/theme_mode_cubit.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:kuwot/features/app_settings/presentation/widgets/about_widget.dart';
import 'package:package_info_plus/package_info_plus.dart';
@RoutePage()
class AppSettingsPage extends StatefulWidget {
const AppSettingsPage({super.key});
@override
State<AppSettingsPage> createState() => _AppSettingsPageState();
}
class _AppSettingsPageState extends State<AppSettingsPage> {
@override
Widget build(BuildContext context) {
final themeSetting = Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const Text('App Theme'),
DropdownButton<ThemeMode>(
items: const [
DropdownMenuItem(value: ThemeMode.system, child: Text('System')),
DropdownMenuItem(value: ThemeMode.light, child: Text('Light')),
DropdownMenuItem(value: ThemeMode.dark, child: Text('Dark')),
],
value: context.watch<ThemeModeCubit>().state,
onChanged: (value) {
context.read<ThemeModeCubit>().setThemeMode(value!);
},
),
],
);
final appVersion = Center(
child: FutureBuilder<PackageInfo>(
future: PackageInfo.fromPlatform(),
builder: (context, snapshot) {
if (snapshot.hasData) {
return Text(
'v${snapshot.data!.version} (${snapshot.data!.buildNumber})',
);
}
return const Text('...');
},
),
);
return Scaffold(
appBar: AppBar(title: const Text('App Settings')),
body: ListView(
padding: const EdgeInsets.symmetric(horizontal: 16),
children: [
themeSetting,
const SizedBox(height: 20),
appVersion,
const SizedBox(height: 20),
const AboutWidget(),
],
),
);
}
}

View file

@ -0,0 +1,69 @@
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher_string.dart';
class AboutWidget extends StatelessWidget {
const AboutWidget({super.key});
@override
Widget build(BuildContext context) {
return Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Text('Links & Credits', style: Theme.of(context).textTheme.titleMedium),
const Divider(),
_buildCreditItem(
context,
title: 'Kuwot App Source',
description:
'Source code for this app. Any suggestions or contributions are welcome.',
url: 'https://github.com/dhemasnurjaya/kuwot-app',
),
_buildCreditItem(
context,
title: 'Quotes-500K',
description:
'Large quotes dataset by Shivali Goel, Rishi Madhok, Shweta Garg. Initially created for "Proposing Contextually Relevant Quotes for Images" journal.',
url: 'https://github.com/ShivaliGoel/Quotes-500K',
),
_buildCreditItem(
context,
title: 'Unsplash',
description:
'Over 6 million free high-resolution photos and illustrations brought to you by the worlds most generous community of contributors.',
url: 'https://unsplash.com/',
),
],
);
}
Widget _buildCreditItem(
BuildContext context, {
required String title,
required String description,
required String url,
}) {
return Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Text(title, style: Theme.of(context).textTheme.titleMedium),
Text(description),
const SizedBox(height: 4),
GestureDetector(
child: Text(
url,
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
decoration: TextDecoration.underline,
color: Colors.indigoAccent,
decorationColor: Colors.indigoAccent,
),
),
onTap: () async {
await launchUrlString(url);
},
),
const SizedBox(height: 16),
],
);
}
}