synonyms;
7 |
8 | const WordView({
9 | super.key,
10 | required this.word,
11 | required this.meanings,
12 | required this.synonyms,
13 | });
14 |
15 | @override
16 | Widget build(BuildContext context) {
17 | return NestedScrollView(
18 | headerSliverBuilder: (context, innerBoxIsScrolled) {
19 | return [
20 | SliverAppBar(
21 | expandedHeight: 100,
22 | floating: false,
23 | pinned: true,
24 | leading: const SizedBox(),
25 | flexibleSpace: FlexibleSpaceBar(
26 | centerTitle: false,
27 | title: Text(
28 | word.title ?? "",
29 | style: TextStyles.headingStyle2.bold
30 | .size(25)
31 | .textColor(Colors.white),
32 | ),
33 | ),
34 | ),
35 | ];
36 | },
37 | body: Container(
38 | constraints: const BoxConstraints.expand(),
39 | decoration: const BoxDecoration(
40 | gradient: LinearGradient(
41 | begin: Alignment.topLeft,
42 | end: Alignment.bottomRight,
43 | colors: [Colors.white, ThemeColors.accent, ThemeColors.primary],
44 | ),
45 | ),
46 | child: SingleChildScrollView(
47 | padding: const EdgeInsets.all(10),
48 | child: Column(
49 | crossAxisAlignment: CrossAxisAlignment.start,
50 | children: [
51 | if (word.conjugation?.isNotEmpty ?? false)
52 | Html(
53 | data: "Mnyambuliko: ${word.conjugation}
",
54 | style: {"p": Style(fontSize: FontSize(20))},
55 | ),
56 | WordDetails(
57 | word: word,
58 | meanings: meanings,
59 | synonyms: synonyms,
60 | ),
61 | ],
62 | ),
63 | ),
64 | ),
65 | );
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/lib/presentation/theme/bloc/theme_bloc.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | import 'package:flutter_bloc/flutter_bloc.dart';
4 | import 'package:freezed_annotation/freezed_annotation.dart';
5 |
6 | part 'theme_event.dart';
7 | part 'theme_state.dart';
8 |
9 | part 'theme_bloc.freezed.dart';
10 |
11 | class ThemeBloc extends Bloc {
12 | ThemeBloc() : super(ThemeMode.system) {
13 | on(_onThemeModeChanged);
14 | }
15 |
16 | Future _onThemeModeChanged(
17 | ThemeModeChanged event,
18 | Emitter emit,
19 | ) async {
20 | emit(event.themeMode);
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/lib/presentation/theme/bloc/theme_event.dart:
--------------------------------------------------------------------------------
1 | part of 'theme_bloc.dart';
2 |
3 | @freezed
4 | sealed class ThemeEvent with _$ThemeEvent {
5 | const factory ThemeEvent.themeModeChanged(
6 | ThemeMode themeMode,
7 | ) = ThemeModeChanged;
8 | }
9 |
--------------------------------------------------------------------------------
/lib/presentation/theme/bloc/theme_state.dart:
--------------------------------------------------------------------------------
1 | part of 'theme_bloc.dart';
2 |
3 | enum ThemeState { system, light, dark }
4 |
--------------------------------------------------------------------------------
/lib/presentation/theme/theme_data.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | import '../../data/repository/pref_repository.dart';
4 | import '../../core/utils/app_util.dart';
5 | import '../../core/di/injectable.dart';
6 | import 'theme_colors.dart';
7 |
8 | class AppTheme {
9 | AppTheme._();
10 |
11 | static String currentTheme() {
12 | var prefRepo = getIt();
13 | return getThemeModeString(prefRepo.getThemeMode());
14 | }
15 |
16 | static ThemeData lightTheme() {
17 | return ThemeData(
18 | scaffoldBackgroundColor: ThemeColors.accent1,
19 | colorScheme: const ColorScheme(
20 | brightness: Brightness.light,
21 | primary: ThemeColors.primary,
22 | onPrimary: Colors.white,
23 | primaryContainer: ThemeColors.primary,
24 | secondary: ThemeColors.primary1,
25 | onSecondary: Colors.grey,
26 | secondaryContainer: ThemeColors.primary1,
27 | surface: Colors.white,
28 | onSurface: Colors.black,
29 | error: Colors.red,
30 | onError: Colors.white,
31 | ),
32 | appBarTheme: const AppBarTheme(
33 | backgroundColor: ThemeColors.primary,
34 | foregroundColor: ThemeColors.accent,
35 | elevation: 3,
36 | ),
37 | navigationBarTheme: const NavigationBarThemeData(
38 | backgroundColor: Colors.white,
39 | indicatorColor: ThemeColors.accent,
40 | elevation: 3,
41 | ),
42 | );
43 | }
44 |
45 | static ThemeData darkTheme() {
46 | return ThemeData(
47 | scaffoldBackgroundColor: ThemeColors.primaryDark2,
48 | colorScheme: const ColorScheme(
49 | brightness: Brightness.light,
50 | primary: ThemeColors.primary2,
51 | onPrimary: ThemeColors.primaryDark1,
52 | primaryContainer: ThemeColors.primaryDark,
53 | secondary: ThemeColors.primaryDark1,
54 | onSecondary: ThemeColors.primaryDark1,
55 | secondaryContainer: ThemeColors.primaryDark1,
56 | surface: ThemeColors.primaryDark,
57 | onSurface: Colors.white,
58 | error: Colors.red,
59 | onError: Colors.white,
60 | ),
61 | appBarTheme: const AppBarTheme(
62 | backgroundColor: ThemeColors.primaryDark1,
63 | foregroundColor: Colors.white,
64 | elevation: 3,
65 | ),
66 | navigationBarTheme: const NavigationBarThemeData(
67 | backgroundColor: Colors.white,
68 | indicatorColor: ThemeColors.accent,
69 | elevation: 3,
70 | ),
71 | );
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/lib/presentation/theme/theme_fonts.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:textstyle_extensions/textstyle_extensions.dart';
4 |
5 | class ThemeFonts {
6 |
7 | static const themeFonts = 'TrebuchetMS';
8 |
9 | static const title = themeFonts;
10 | static const body = themeFonts;
11 | static const button = themeFonts;
12 | }
13 |
14 | class FontSizes {
15 | /// font size 10
16 | static const double s10 = 10;
17 |
18 | /// font size 12
19 | static const double s12 = 12;
20 |
21 | /// font size 14
22 | static const double s14 = 14;
23 |
24 | /// font size 16
25 | static const double s16 = 16;
26 |
27 | /// font size 18
28 | static const double s18 = 18;
29 |
30 | /// font size 20
31 | static const double s20 = 20;
32 |
33 | /// font size 22
34 | static const double s22 = 22;
35 |
36 | /// font size 25
37 | static const double s25 = 25;
38 |
39 | /// font size 30
40 | static const double s30 = 30;
41 | }
42 |
43 | class TextStyles {
44 | static const TextStyle trebuchetMS = TextStyle(
45 | fontFamily: ThemeFonts.themeFonts,
46 | fontWeight: FontWeight.w400,
47 | letterSpacing: 0,
48 | height: 1,
49 | fontFamilyFallback: [
50 | ThemeFonts.themeFonts,
51 | ],
52 | );
53 |
54 | static TextStyle get pageTitle1 =>
55 | trebuchetMS.bold.size(FontSizes.s30).letterSpace(2);
56 |
57 | static TextStyle get headingStyle1 =>
58 | trebuchetMS.bold.size(FontSizes.s22).letterSpace(.5);
59 |
60 | static TextStyle get headingStyle2 =>
61 | trebuchetMS.bold.size(FontSizes.s20).letterSpace(.3);
62 |
63 | static TextStyle get headingStyle3 => trebuchetMS.bold.size(FontSizes.s18);
64 |
65 | static TextStyle get headingStyle4 => trebuchetMS.bold.size(FontSizes.s16);
66 |
67 | static TextStyle get headingStyle5 => trebuchetMS.bold.size(FontSizes.s14);
68 |
69 | static TextStyle get headingStyle6 => trebuchetMS.bold.size(FontSizes.s12);
70 |
71 | static TextStyle get bodyStyle1 => trebuchetMS.size(FontSizes.s16);
72 |
73 | static TextStyle get bodyStyle2 => trebuchetMS.size(FontSizes.s14);
74 |
75 | static TextStyle get bodyStyle3 => trebuchetMS.size(FontSizes.s12);
76 |
77 | static TextStyle get callOut => trebuchetMS.size(FontSizes.s20).letterSpace(1.5).bold;
78 |
79 | static TextStyle get callOutFocus => callOut.bold;
80 |
81 | static TextStyle get buttonTextStyle =>
82 | trebuchetMS.bold.size(FontSizes.s14).letterSpace(1.75);
83 |
84 | static TextStyle get buttonSelected =>
85 | trebuchetMS.size(FontSizes.s14).letterSpace(1.75);
86 |
87 | static TextStyle get footNote => trebuchetMS.bold.size(FontSizes.s10);
88 |
89 | static TextStyle get captionText =>
90 | trebuchetMS.size(FontSizes.s10).letterSpace(.3);
91 |
92 | static TextStyle get titleStyle12 =>
93 | const TextStyle(fontWeight: FontWeight.bold, fontSize: 12);
94 | static TextStyle get titleStyle14 =>
95 | const TextStyle(fontWeight: FontWeight.bold, fontSize: 14);
96 | static TextStyle get titleStyle22 =>
97 | const TextStyle(fontWeight: FontWeight.bold, fontSize: 22);
98 | static TextStyle get titleStyle20 =>
99 | const TextStyle(fontWeight: FontWeight.bold, fontSize: 20);
100 |
101 | static TextStyle get labelStyle16 =>
102 | const TextStyle(fontWeight: FontWeight.bold, fontSize: 16);
103 | }
104 |
--------------------------------------------------------------------------------
/lib/presentation/theme/theme_styles.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 | import 'package:flutter/material.dart';
3 |
4 | class AppDurations {
5 | static const Duration fastest = Duration(seconds: 1);
6 |
7 | static const Duration fast = Duration(seconds: 2);
8 |
9 | static const Duration medium = Duration(seconds: 3);
10 |
11 | static const Duration slow = Duration(seconds: 5);
12 | }
13 |
14 | class Sizes {
15 | /// extra small size = 5
16 | static const double xs = 5;
17 |
18 | /// small size = 10
19 | static const double sm = 10;
20 |
21 | /// medium size = 15
22 | static const double m = 15;
23 |
24 | /// large size = 20
25 | static const double l = 20;
26 |
27 | /// extra large size = 30
28 | static const double xl = 30;
29 |
30 | /// extra extra large size = 50
31 | static const double xxl = 50;
32 | }
33 |
34 | class ThemeFonts {
35 | static const String poppins = "Poppins";
36 | }
37 |
38 | class Insets {
39 | static double gutterScale = 1;
40 |
41 | static const double scale = 1;
42 |
43 | /// Dynamic insets, may get scaled with the device size
44 | static double mGutter = m * gutterScale;
45 |
46 | static double lGutter = l * gutterScale;
47 |
48 | static const double xs = 2 * scale;
49 | static const double sm = 6 * scale;
50 | static const double m = 12 * scale;
51 | static const double l = 24 * scale;
52 | static const double xl = 36 * scale;
53 | }
54 |
55 | class Shadows {
56 | static bool enabled = true;
57 |
58 | static double get mRadius => 8;
59 |
60 | static List m(Color color, [double opacity = 0]) {
61 | return enabled
62 | ? [
63 | BoxShadow(
64 | color: color.withOpacity(opacity),
65 | blurRadius: mRadius,
66 | spreadRadius: mRadius / 2,
67 | offset: const Offset(1, 0),
68 | ),
69 | BoxShadow(
70 | color: color.withOpacity(opacity),
71 | blurRadius: mRadius / 2,
72 | spreadRadius: mRadius / 4,
73 | offset: const Offset(1, 0),
74 | )
75 | ]
76 | : const [];
77 | }
78 | }
79 |
80 | class Corners {
81 | static const double btn = s5;
82 |
83 | static const double dialog = 12;
84 |
85 | /// Xs
86 | static const double s3 = 3;
87 |
88 | static BorderRadius get s3Border => BorderRadius.all(s3Radius);
89 |
90 | static Radius get s3Radius => const Radius.circular(s3);
91 |
92 | /// Small
93 | static const double s5 = 5;
94 |
95 | static BorderRadius get s5Border => BorderRadius.all(s5Radius);
96 |
97 | static Radius get s5Radius => const Radius.circular(s5);
98 |
99 | /// Medium
100 | static const double s8 = 8;
101 |
102 | static const BorderRadius s8Border = BorderRadius.all(s8Radius);
103 |
104 | static const Radius s8Radius = Radius.circular(s8);
105 |
106 | /// Large
107 | static const double s10 = 10;
108 |
109 | static BorderRadius get s10Border => BorderRadius.all(s10Radius);
110 |
111 | static Radius get s10Radius => const Radius.circular(s10);
112 | }
113 |
--------------------------------------------------------------------------------
/lib/presentation/widgets/action/app_dialog.dart:
--------------------------------------------------------------------------------
1 | import 'dart:io';
2 |
3 | import 'package:flutter/cupertino.dart';
4 | import 'package:flutter/material.dart';
5 |
6 | Future appDialog(
7 | BuildContext context,
8 | String title,
9 | String message,
10 | List actions,
11 | ) {
12 | if (Platform.isIOS) {
13 | return showCupertinoDialog(
14 | context: context,
15 | builder: (context) => CupertinoAlertDialog(
16 | title: Text(title),
17 | content: Text(message),
18 | actions: actions,
19 | ),
20 | );
21 | } else {
22 | return showDialog(
23 | context: context,
24 | builder: (context) => AlertDialog(
25 | title: Text(title),
26 | content: Text(message),
27 | actions: actions,
28 | ),
29 | );
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/lib/presentation/widgets/action/app_nav_icon.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class AppNavIcon extends StatelessWidget {
4 | const AppNavIcon(
5 | this.icon, {
6 | super.key,
7 | this.color,
8 | this.height,
9 | this.width,
10 | });
11 | final IconData icon;
12 | final Color? color;
13 | final double? height;
14 | final double? width;
15 |
16 | @override
17 | Widget build(BuildContext context) {
18 | return Icon(icon, color: color);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/lib/presentation/widgets/features/custom_button.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class CustomButton extends StatelessWidget {
4 | final VoidCallback onTap;
5 | final Color? buttonColor;
6 | final double? borderRadius;
7 | final Color? textColor;
8 | final String buttonText;
9 | final double? verticalPadding;
10 | final double? horizontalPadding;
11 | final Color? borderColor;
12 | final double? fontSize;
13 |
14 | const CustomButton({
15 | super.key,
16 | required this.onTap,
17 | this.buttonColor,
18 | this.borderRadius,
19 | this.textColor,
20 | required this.buttonText,
21 | this.verticalPadding,
22 | this.horizontalPadding,
23 | this.borderColor,
24 | this.fontSize,
25 | });
26 |
27 | @override
28 | Widget build(BuildContext context) {
29 | return Container(
30 | decoration: BoxDecoration(
31 | color: buttonColor ?? Colors.white,
32 | borderRadius: BorderRadius.circular(borderRadius ?? 0),
33 | border: Border.all(color: borderColor ?? Colors.transparent, width: 1),
34 | ),
35 | child: Material(
36 | color: Colors.transparent,
37 | child: InkWell(
38 | onTap: onTap,
39 | child: Container(
40 | padding: EdgeInsets.symmetric(
41 | horizontal: horizontalPadding ?? 10,
42 | vertical: verticalPadding ?? 10,
43 | ),
44 | child: Center(
45 | child: Text(
46 | buttonText,
47 | style: TextStyle(
48 | color: textColor,
49 | fontSize: fontSize ?? 15,
50 | fontWeight: FontWeight.bold,
51 | ),
52 | ),
53 | ),
54 | ),
55 | ),
56 | ),
57 | );
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/lib/presentation/widgets/features/custom_drop_down.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class CustomDropdownItem extends StatelessWidget {
4 | final String value;
5 | final String selectedOption;
6 |
7 | const CustomDropdownItem({
8 | super.key,
9 | required this.value,
10 | required this.selectedOption,
11 | });
12 |
13 | @override
14 | Widget build(BuildContext context) {
15 | bool isSelected = value == selectedOption;
16 | return Container(
17 | padding: const EdgeInsets.all(10),
18 | color: isSelected ? Colors.blue : Colors.white,
19 | child: Text(
20 | value,
21 | style: TextStyle(
22 | fontSize: 16,
23 | color: isSelected ? Colors.white : Colors.black,
24 | ),
25 | ),
26 | );
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/lib/presentation/widgets/features/large_card.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | import '../../theme/theme_colors.dart';
4 |
5 | class LargeCard extends StatelessWidget {
6 | final String cardName;
7 | final String image;
8 | final void Function()? onTap;
9 | const LargeCard({
10 | super.key,
11 | required this.cardName,
12 | required this.image,
13 | this.onTap,
14 | });
15 |
16 | @override
17 | Widget build(BuildContext context) {
18 | return GestureDetector(
19 | onTap: onTap,
20 | child: Padding(
21 | padding: const EdgeInsets.only(left: 14, right: 14, top: 14),
22 | child: Row(
23 | children: [
24 | Container(
25 | decoration: BoxDecoration(
26 | border: Border.all(
27 | color: ThemeColors.blackText,
28 | ),
29 | borderRadius: const BorderRadius.all(
30 | Radius.circular(10),
31 | ),
32 | ),
33 | width: MediaQuery.of(context).size.width - 28,
34 | height: 230,
35 | child: Card(
36 | elevation: 0,
37 | shape: const RoundedRectangleBorder(
38 | borderRadius: BorderRadius.all(Radius.circular(10))),
39 | child: Column(
40 | mainAxisAlignment: MainAxisAlignment.center,
41 | crossAxisAlignment: CrossAxisAlignment.center,
42 | children: [
43 | Image.asset("assets/images/messages.png"),
44 | Text(
45 | cardName,
46 | textAlign: TextAlign.center,
47 | style: const TextStyle(
48 | fontSize: 15,
49 | color: ThemeColors.blackText,
50 | ),
51 | )
52 | ],
53 | ),
54 | ),
55 | ),
56 | ],
57 | ),
58 | ),
59 | );
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/lib/presentation/widgets/features/tag_item.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:textstyle_extensions/textstyle_extensions.dart';
3 |
4 | import '../../theme/theme_colors.dart';
5 | import '../../theme/theme_fonts.dart';
6 | import '../../theme/theme_styles.dart';
7 |
8 | class TagItem extends StatelessWidget {
9 | final String tagText;
10 |
11 | const TagItem({
12 | super.key,
13 | required this.tagText,
14 | });
15 |
16 | @override
17 | Widget build(BuildContext context) {
18 | try {
19 | if (tagText.isNotEmpty) {
20 | return Container(
21 | padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 5),
22 | margin: const EdgeInsets.only(right: Sizes.xs),
23 | decoration: BoxDecoration(
24 | color: Theme.of(context).brightness == Brightness.light
25 | ? ThemeColors.primaryDark1
26 | : ThemeColors.primary,
27 | borderRadius: const BorderRadius.all(Radius.circular(5)),
28 | ),
29 | child: Text(tagText,
30 | style: TextStyles.headingStyle5.textColor(Colors.white)),
31 | );
32 | } else {
33 | return const SizedBox.shrink();
34 | }
35 | } on Exception {
36 | return const SizedBox.shrink();
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/lib/presentation/widgets/general/labels.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | import '../../theme/theme_colors.dart';
4 |
5 | class TagView extends StatelessWidget {
6 | final String tagText;
7 | final double size;
8 |
9 | const TagView({super.key, required this.tagText, required this.size});
10 |
11 | @override
12 | Widget build(BuildContext context) {
13 | try {
14 | if (tagText.isNotEmpty) {
15 | return Container(
16 | padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 5),
17 | margin: const EdgeInsets.only(right: 5),
18 | decoration: const BoxDecoration(
19 | color: ThemeColors.primary,
20 | borderRadius: BorderRadius.only(
21 | topRight: Radius.circular(10),
22 | bottomLeft: Radius.circular(10),
23 | ),
24 | boxShadow: [BoxShadow(blurRadius: 1)],
25 | ),
26 | child: Text(
27 | tagText,
28 | style: TextStyle(
29 | fontSize: size * 0.8,
30 | color: Colors.white,
31 | ),
32 | ),
33 | );
34 | } else {
35 | return Container();
36 | }
37 | } on Exception {
38 | return Container();
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/lib/presentation/widgets/general/text_scale_factor.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | import '../../../core/utils/env/flavor_config.dart';
4 |
5 | class TextScaleFactor extends StatelessWidget {
6 | final Widget child;
7 |
8 | const TextScaleFactor({
9 | required this.child,
10 | Key? key,
11 | }) : super(key: key);
12 |
13 | @override
14 | Widget build(BuildContext context) {
15 | final mediaQuery = MediaQuery.of(context);
16 | FlavorConfig.instance.devicePixelRatio = mediaQuery.devicePixelRatio;
17 | return MediaQuery(
18 | data: mediaQuery.copyWith(textScaler: const TextScaler.linear(1)),
19 | child: child,
20 | );
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/lib/presentation/widgets/inputs/form_input.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter/services.dart';
3 |
4 | import '../../theme/theme_colors.dart';
5 |
6 | class FormInput extends StatefulWidget {
7 | final String? iLabel;
8 | final TextEditingController? iController;
9 | final TextInputType iType;
10 | final AutovalidateMode? validationMode;
11 | final bool? isReadOnly;
12 | final bool? isLight;
13 | final bool? isEnabled;
14 | final bool? executeValueChange;
15 | final FormFieldValidator? iValidator;
16 | final Function(String)? onChanged;
17 | final Function()? onValueChanged;
18 | final Function()? onTap;
19 | final Widget? prefix;
20 | final bool? isActive;
21 | final bool? isMultiline;
22 | final double bdRadius;
23 | final int maxInput;
24 |
25 | const FormInput({
26 | Key? key,
27 | this.iLabel = "",
28 | this.iType = TextInputType.text,
29 | this.iController,
30 | this.validationMode = AutovalidateMode.disabled,
31 | this.isReadOnly = false,
32 | this.isLight = false,
33 | this.isEnabled = true,
34 | this.executeValueChange = false,
35 | this.iValidator,
36 | this.onChanged,
37 | this.onValueChanged,
38 | this.onTap,
39 | this.prefix,
40 | this.isActive = true,
41 | this.isMultiline = false,
42 | this.bdRadius = 5,
43 | this.maxInput = 20000,
44 | }) : super(key: key);
45 |
46 | @override
47 | FormInputState createState() => FormInputState();
48 | }
49 |
50 | class FormInputState extends State {
51 | @override
52 | Widget build(BuildContext context) {
53 | Color foreColor = widget.isLight! ? Colors.white : ThemeColors.primary;
54 |
55 | return Container(
56 | margin: const EdgeInsets.all(10),
57 | child: TextFormField(
58 | controller: widget.iController,
59 | keyboardType: widget.iType,
60 | autovalidateMode: widget.validationMode,
61 | validator: widget.iValidator,
62 | minLines: widget.isMultiline! ? 50 : 1,
63 | maxLines: widget.isMultiline! ? null : 1,
64 | enabled: widget.isEnabled,
65 | readOnly: widget.isReadOnly!,
66 | onTap: widget.onTap,
67 | inputFormatters: [
68 | LengthLimitingTextInputFormatter(widget.maxInput),
69 | ],
70 | decoration: InputDecoration(
71 | labelText: widget.iLabel,
72 | prefixIcon: widget.prefix,
73 | suffixIcon: InkWell(
74 | onTap: () => widget.iController!.clear(),
75 | child: Icon(Icons.clear, color: foreColor),
76 | ),
77 | labelStyle: TextStyle(fontSize: 16, color: foreColor),
78 | isDense: widget.isMultiline! ? true : false,
79 | contentPadding: widget.isMultiline! ? null : const EdgeInsets.all(5),
80 | enabledBorder: OutlineInputBorder(
81 | borderRadius: BorderRadius.circular(widget.bdRadius),
82 | borderSide: BorderSide(color: foreColor),
83 | ),
84 | focusedBorder: OutlineInputBorder(
85 | borderRadius: BorderRadius.circular(widget.bdRadius),
86 | borderSide: BorderSide(color: foreColor),
87 | ),
88 | ),
89 | style: TextStyle(
90 | fontSize: 18,
91 | color: foreColor,
92 | ),
93 | //textInputAction: widget.isMultiline! ? TextInputAction.newline : TextInputAction.next,
94 | onChanged: widget.onChanged,
95 | ),
96 | );
97 | }
98 | }
99 |
--------------------------------------------------------------------------------
/lib/presentation/widgets/progress/custom_snackbar.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class CustomSnackbar {
4 | static void show(
5 | BuildContext context,
6 | String feedback, {
7 | SnackBarBehavior behavior = SnackBarBehavior.floating,
8 | bool isSuccess = false,
9 | Duration duration = const Duration(seconds: 5),
10 | }) {
11 | ScaffoldMessenger.of(context)
12 | ..hideCurrentSnackBar()
13 | ..showSnackBar(
14 | SnackBar(
15 | duration: duration,
16 | backgroundColor: isSuccess ? Colors.green : Colors.red,
17 | content: Text(
18 | feedback,
19 | style: const TextStyle(
20 | color: Colors.white,
21 | ),
22 | ),
23 | ),
24 | );
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/lib/presentation/widgets/progress/skeleton.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:skeleton_loader/skeleton_loader.dart';
3 |
4 | import '../../theme/theme_colors.dart';
5 | import '../../theme/theme_styles.dart';
6 |
7 | class SkeletonLoading extends StatelessWidget {
8 | const SkeletonLoading({super.key});
9 |
10 | @override
11 | Widget build(BuildContext context) {
12 | final size = MediaQuery.of(context).size;
13 | var rowWidget = Container(
14 | margin:
15 | const EdgeInsets.only(left: Sizes.m, right: Sizes.m, top: Sizes.m),
16 | child: Column(
17 | mainAxisAlignment: MainAxisAlignment.start,
18 | crossAxisAlignment: CrossAxisAlignment.start,
19 | children: [
20 | Container(
21 | margin: const EdgeInsets.only(bottom: Sizes.xs),
22 | height: 15,
23 | width: size.width - 120,
24 | color: Colors.black,
25 | ),
26 | Container(
27 | margin: const EdgeInsets.only(bottom: Sizes.xs),
28 | height: 30,
29 | width: size.width - 50,
30 | color: Colors.black,
31 | ),
32 | Row(
33 | children: [
34 | Container(
35 | height: 10,
36 | width: size.width / 6,
37 | color: Colors.black,
38 | ),
39 | SizedBox(width: Sizes.xs),
40 | Container(
41 | height: 10,
42 | width: size.width / 6,
43 | color: Colors.black,
44 | ),
45 | SizedBox(width: Sizes.xs),
46 | Container(
47 | height: 10,
48 | width: size.width / 5,
49 | color: Colors.black,
50 | ),
51 | ],
52 | ),
53 | ],
54 | ));
55 |
56 | return SingleChildScrollView(
57 | child: SkeletonLoader(
58 | builder: rowWidget,
59 | items: 10,
60 | period: const Duration(seconds: 5),
61 | highlightColor: ThemeColors.primary,
62 | direction: SkeletonDirection.ltr,
63 | ),
64 | );
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/lib/presentation/widgets/text_scale_factor.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class TextScaleFactor extends StatelessWidget {
4 | final Widget child;
5 |
6 | const TextScaleFactor({
7 | required this.child,
8 | Key? key,
9 | }) : super(key: key);
10 |
11 | @override
12 | Widget build(BuildContext context) {
13 | final mediaQuery = MediaQuery.of(context);
14 | return MediaQuery(
15 | data: mediaQuery.copyWith(textScaler: const TextScaler.linear(1)),
16 | child: child,
17 | );
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/linux/.gitignore:
--------------------------------------------------------------------------------
1 | flutter/ephemeral
2 |
--------------------------------------------------------------------------------
/linux/flutter/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # This file controls Flutter-level build steps. It should not be edited.
2 | cmake_minimum_required(VERSION 3.10)
3 |
4 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral")
5 |
6 | # Configuration provided via flutter tool.
7 | include(${EPHEMERAL_DIR}/generated_config.cmake)
8 |
9 | # TODO: Move the rest of this into files in ephemeral. See
10 | # https://github.com/flutter/flutter/issues/57146.
11 |
12 | # Serves the same purpose as list(TRANSFORM ... PREPEND ...),
13 | # which isn't available in 3.10.
14 | function(list_prepend LIST_NAME PREFIX)
15 | set(NEW_LIST "")
16 | foreach(element ${${LIST_NAME}})
17 | list(APPEND NEW_LIST "${PREFIX}${element}")
18 | endforeach(element)
19 | set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE)
20 | endfunction()
21 |
22 | # === Flutter Library ===
23 | # System-level dependencies.
24 | find_package(PkgConfig REQUIRED)
25 | pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0)
26 | pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0)
27 | pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0)
28 |
29 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so")
30 |
31 | # Published to parent scope for install step.
32 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE)
33 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE)
34 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE)
35 | set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE)
36 |
37 | list(APPEND FLUTTER_LIBRARY_HEADERS
38 | "fl_basic_message_channel.h"
39 | "fl_binary_codec.h"
40 | "fl_binary_messenger.h"
41 | "fl_dart_project.h"
42 | "fl_engine.h"
43 | "fl_json_message_codec.h"
44 | "fl_json_method_codec.h"
45 | "fl_message_codec.h"
46 | "fl_method_call.h"
47 | "fl_method_channel.h"
48 | "fl_method_codec.h"
49 | "fl_method_response.h"
50 | "fl_plugin_registrar.h"
51 | "fl_plugin_registry.h"
52 | "fl_standard_message_codec.h"
53 | "fl_standard_method_codec.h"
54 | "fl_string_codec.h"
55 | "fl_value.h"
56 | "fl_view.h"
57 | "flutter_linux.h"
58 | )
59 | list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/")
60 | add_library(flutter INTERFACE)
61 | target_include_directories(flutter INTERFACE
62 | "${EPHEMERAL_DIR}"
63 | )
64 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}")
65 | target_link_libraries(flutter INTERFACE
66 | PkgConfig::GTK
67 | PkgConfig::GLIB
68 | PkgConfig::GIO
69 | )
70 | add_dependencies(flutter flutter_assemble)
71 |
72 | # === Flutter tool backend ===
73 | # _phony_ is a non-existent file to force this command to run every time,
74 | # since currently there's no way to get a full input/output list from the
75 | # flutter tool.
76 | add_custom_command(
77 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS}
78 | ${CMAKE_CURRENT_BINARY_DIR}/_phony_
79 | COMMAND ${CMAKE_COMMAND} -E env
80 | ${FLUTTER_TOOL_ENVIRONMENT}
81 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh"
82 | ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE}
83 | VERBATIM
84 | )
85 | add_custom_target(flutter_assemble DEPENDS
86 | "${FLUTTER_LIBRARY}"
87 | ${FLUTTER_LIBRARY_HEADERS}
88 | )
89 |
--------------------------------------------------------------------------------
/linux/flutter/ephemeral/.plugin_symlinks/app_links_linux:
--------------------------------------------------------------------------------
1 | /Users/sirodaves/.pub-cache/hosted/pub.dev/app_links_linux-1.0.3/
--------------------------------------------------------------------------------
/linux/flutter/ephemeral/.plugin_symlinks/gtk:
--------------------------------------------------------------------------------
1 | /Users/sirodaves/.pub-cache/hosted/pub.dev/gtk-2.1.0/
--------------------------------------------------------------------------------
/linux/flutter/ephemeral/.plugin_symlinks/package_info_plus:
--------------------------------------------------------------------------------
1 | /Users/sirodaves/.pub-cache/hosted/pub.dev/package_info_plus-8.1.2/
--------------------------------------------------------------------------------
/linux/flutter/ephemeral/.plugin_symlinks/path_provider_linux:
--------------------------------------------------------------------------------
1 | /Users/sirodaves/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/
--------------------------------------------------------------------------------
/linux/flutter/ephemeral/.plugin_symlinks/sentry_flutter:
--------------------------------------------------------------------------------
1 | /Users/sirodaves/.pub-cache/hosted/pub.dev/sentry_flutter-8.11.1/
--------------------------------------------------------------------------------
/linux/flutter/ephemeral/.plugin_symlinks/share_plus:
--------------------------------------------------------------------------------
1 | /Users/sirodaves/.pub-cache/hosted/pub.dev/share_plus-10.1.3/
--------------------------------------------------------------------------------
/linux/flutter/ephemeral/.plugin_symlinks/shared_preferences_linux:
--------------------------------------------------------------------------------
1 | /Users/sirodaves/.pub-cache/hosted/pub.dev/shared_preferences_linux-2.4.1/
--------------------------------------------------------------------------------
/linux/flutter/ephemeral/.plugin_symlinks/url_launcher_linux:
--------------------------------------------------------------------------------
1 | /Users/sirodaves/.pub-cache/hosted/pub.dev/url_launcher_linux-3.2.1/
--------------------------------------------------------------------------------
/linux/flutter/generated_plugin_registrant.cc:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #include "generated_plugin_registrant.h"
8 |
9 | #include
10 | #include
11 | #include
12 |
13 | void fl_register_plugins(FlPluginRegistry* registry) {
14 | g_autoptr(FlPluginRegistrar) gtk_registrar =
15 | fl_plugin_registry_get_registrar_for_plugin(registry, "GtkPlugin");
16 | gtk_plugin_register_with_registrar(gtk_registrar);
17 | g_autoptr(FlPluginRegistrar) sentry_flutter_registrar =
18 | fl_plugin_registry_get_registrar_for_plugin(registry, "SentryFlutterPlugin");
19 | sentry_flutter_plugin_register_with_registrar(sentry_flutter_registrar);
20 | g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =
21 | fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");
22 | url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);
23 | }
24 |
--------------------------------------------------------------------------------
/linux/flutter/generated_plugin_registrant.h:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #ifndef GENERATED_PLUGIN_REGISTRANT_
8 | #define GENERATED_PLUGIN_REGISTRANT_
9 |
10 | #include
11 |
12 | // Registers Flutter plugins.
13 | void fl_register_plugins(FlPluginRegistry* registry);
14 |
15 | #endif // GENERATED_PLUGIN_REGISTRANT_
16 |
--------------------------------------------------------------------------------
/linux/flutter/generated_plugins.cmake:
--------------------------------------------------------------------------------
1 | #
2 | # Generated file, do not edit.
3 | #
4 |
5 | list(APPEND FLUTTER_PLUGIN_LIST
6 | gtk
7 | sentry_flutter
8 | url_launcher_linux
9 | )
10 |
11 | list(APPEND FLUTTER_FFI_PLUGIN_LIST
12 | )
13 |
14 | set(PLUGIN_BUNDLED_LIBRARIES)
15 |
16 | foreach(plugin ${FLUTTER_PLUGIN_LIST})
17 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin})
18 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
19 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $)
20 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
21 | endforeach(plugin)
22 |
23 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
24 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin})
25 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
26 | endforeach(ffi_plugin)
27 |
--------------------------------------------------------------------------------
/linux/main.cc:
--------------------------------------------------------------------------------
1 | #include "my_application.h"
2 |
3 | int main(int argc, char** argv) {
4 | g_autoptr(MyApplication) app = my_application_new();
5 | return g_application_run(G_APPLICATION(app), argc, argv);
6 | }
7 |
--------------------------------------------------------------------------------
/linux/my_application.h:
--------------------------------------------------------------------------------
1 | #ifndef FLUTTER_MY_APPLICATION_H_
2 | #define FLUTTER_MY_APPLICATION_H_
3 |
4 | #include
5 |
6 | G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION,
7 | GtkApplication)
8 |
9 | /**
10 | * my_application_new:
11 | *
12 | * Creates a new Flutter-based application.
13 | *
14 | * Returns: a new #MyApplication.
15 | */
16 | MyApplication* my_application_new();
17 |
18 | #endif // FLUTTER_MY_APPLICATION_H_
19 |
--------------------------------------------------------------------------------
/macos/.gitignore:
--------------------------------------------------------------------------------
1 | # Flutter-related
2 | **/Flutter/ephemeral/
3 | **/Pods/
4 |
5 | # Xcode-related
6 | **/dgph
7 | **/xcuserdata/
8 |
--------------------------------------------------------------------------------
/macos/Flutter/Flutter-Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2 | #include "ephemeral/Flutter-Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/macos/Flutter/Flutter-Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2 | #include "ephemeral/Flutter-Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/macos/Flutter/GeneratedPluginRegistrant.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | import FlutterMacOS
6 | import Foundation
7 |
8 | import app_links
9 | import connectivity_plus
10 | import package_info_plus
11 | import path_provider_foundation
12 | import sentry_flutter
13 | import share_plus
14 | import shared_preferences_foundation
15 | import sqflite_darwin
16 | import url_launcher_macos
17 |
18 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
19 | AppLinksMacosPlugin.register(with: registry.registrar(forPlugin: "AppLinksMacosPlugin"))
20 | ConnectivityPlusPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlusPlugin"))
21 | FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))
22 | PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
23 | SentryFlutterPlugin.register(with: registry.registrar(forPlugin: "SentryFlutterPlugin"))
24 | SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin"))
25 | SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
26 | SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
27 | UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
28 | }
29 |
--------------------------------------------------------------------------------
/macos/Flutter/ephemeral/Flutter-Generated.xcconfig:
--------------------------------------------------------------------------------
1 | // This is a generated file; do not edit or check into version control.
2 | FLUTTER_ROOT=/Users/sirodaves/Developer/Flutter/Sdk/default
3 | FLUTTER_APPLICATION_PATH=/Users/sirodaves/Developer/Flutter/Projects/SwahiLib
4 | COCOAPODS_PARALLEL_CODE_SIGN=true
5 | FLUTTER_TARGET=/Users/sirodaves/Developer/Flutter/Projects/SwahiLib/lib/main.dart
6 | FLUTTER_BUILD_DIR=build
7 | FLUTTER_BUILD_NAME=1.0.12
8 | FLUTTER_BUILD_NUMBER=1
9 | DART_DEFINES=c3VwYWJhc2VVcmw9aHR0cHM6Ly9sd2toenp2ZWV4Y2lob2JxZ2hrcS5zdXBhYmFzZS5jbw==,c3VwYWJhc2VBbm9uS2V5PWV5SmhiR2NpT2lKSVV6STFOaUlzSW5SNWNDSTZJa3BYVkNKOS5leUpwYzNNaU9pSnpkWEJoWW1GelpTSXNJbkpsWmlJNklteDNhMmg2ZW5abFpYaGphV2h2WW5GbmFHdHhJaXdpY205c1pTSTZJbUZ1YjI0aUxDSnBZWFFpT2pFM016YzBOamM1TVRVc0ltVjRjQ0k2TWpBMU16QTBNemt4TlgwLmtEVzRBWWtFMWlIOUljMXVPYUQ2Q0M0eFpaVjR3dFRrUmhlaVh1aF9tUXM=,c2VudHJ5VXJsPTQ1MDQ2NTE1MjczNTY0MTY=
10 | DART_OBFUSCATION=false
11 | TRACK_WIDGET_CREATION=true
12 | TREE_SHAKE_ICONS=false
13 | PACKAGE_CONFIG=/Users/sirodaves/Developer/Flutter/Projects/SwahiLib/.dart_tool/package_config.json
14 |
--------------------------------------------------------------------------------
/macos/Flutter/ephemeral/flutter_export_environment.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # This is a generated file; do not edit or check into version control.
3 | export "FLUTTER_ROOT=/Users/sirodaves/Developer/Flutter/Sdk/default"
4 | export "FLUTTER_APPLICATION_PATH=/Users/sirodaves/Developer/Flutter/Projects/SwahiLib"
5 | export "COCOAPODS_PARALLEL_CODE_SIGN=true"
6 | export "FLUTTER_TARGET=/Users/sirodaves/Developer/Flutter/Projects/SwahiLib/lib/main.dart"
7 | export "FLUTTER_BUILD_DIR=build"
8 | export "FLUTTER_BUILD_NAME=1.0.12"
9 | export "FLUTTER_BUILD_NUMBER=1"
10 | export "DART_DEFINES=c3VwYWJhc2VVcmw9aHR0cHM6Ly9sd2toenp2ZWV4Y2lob2JxZ2hrcS5zdXBhYmFzZS5jbw==,c3VwYWJhc2VBbm9uS2V5PWV5SmhiR2NpT2lKSVV6STFOaUlzSW5SNWNDSTZJa3BYVkNKOS5leUpwYzNNaU9pSnpkWEJoWW1GelpTSXNJbkpsWmlJNklteDNhMmg2ZW5abFpYaGphV2h2WW5GbmFHdHhJaXdpY205c1pTSTZJbUZ1YjI0aUxDSnBZWFFpT2pFM016YzBOamM1TVRVc0ltVjRjQ0k2TWpBMU16QTBNemt4TlgwLmtEVzRBWWtFMWlIOUljMXVPYUQ2Q0M0eFpaVjR3dFRrUmhlaVh1aF9tUXM=,c2VudHJ5VXJsPTQ1MDQ2NTE1MjczNTY0MTY="
11 | export "DART_OBFUSCATION=false"
12 | export "TRACK_WIDGET_CREATION=true"
13 | export "TREE_SHAKE_ICONS=false"
14 | export "PACKAGE_CONFIG=/Users/sirodaves/Developer/Flutter/Projects/SwahiLib/.dart_tool/package_config.json"
15 |
--------------------------------------------------------------------------------
/macos/Podfile:
--------------------------------------------------------------------------------
1 | platform :osx, '10.14'
2 |
3 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
4 | ENV['COCOAPODS_DISABLE_STATS'] = 'true'
5 |
6 | project 'Runner', {
7 | 'Debug' => :debug,
8 | 'Profile' => :release,
9 | 'Release' => :release,
10 | }
11 |
12 | def flutter_root
13 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__)
14 | unless File.exist?(generated_xcode_build_settings_path)
15 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first"
16 | end
17 |
18 | File.foreach(generated_xcode_build_settings_path) do |line|
19 | matches = line.match(/FLUTTER_ROOT\=(.*)/)
20 | return matches[1].strip if matches
21 | end
22 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\""
23 | end
24 |
25 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
26 |
27 | flutter_macos_podfile_setup
28 |
29 | target 'Runner' do
30 | use_frameworks!
31 | use_modular_headers!
32 |
33 | flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))
34 | target 'RunnerTests' do
35 | inherit! :search_paths
36 | end
37 | end
38 |
39 | post_install do |installer|
40 | installer.pods_project.targets.each do |target|
41 | flutter_additional_macos_build_settings(target)
42 | end
43 | end
44 |
--------------------------------------------------------------------------------
/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/macos/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/macos/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import Cocoa
2 | import FlutterMacOS
3 |
4 | @main
5 | class AppDelegate: FlutterAppDelegate {
6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
7 | return true
8 | }
9 |
10 | override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool {
11 | return true
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "16x16",
5 | "idiom" : "mac",
6 | "filename" : "app_icon_16.png",
7 | "scale" : "1x"
8 | },
9 | {
10 | "size" : "16x16",
11 | "idiom" : "mac",
12 | "filename" : "app_icon_32.png",
13 | "scale" : "2x"
14 | },
15 | {
16 | "size" : "32x32",
17 | "idiom" : "mac",
18 | "filename" : "app_icon_32.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "32x32",
23 | "idiom" : "mac",
24 | "filename" : "app_icon_64.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "128x128",
29 | "idiom" : "mac",
30 | "filename" : "app_icon_128.png",
31 | "scale" : "1x"
32 | },
33 | {
34 | "size" : "128x128",
35 | "idiom" : "mac",
36 | "filename" : "app_icon_256.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "256x256",
41 | "idiom" : "mac",
42 | "filename" : "app_icon_256.png",
43 | "scale" : "1x"
44 | },
45 | {
46 | "size" : "256x256",
47 | "idiom" : "mac",
48 | "filename" : "app_icon_512.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "512x512",
53 | "idiom" : "mac",
54 | "filename" : "app_icon_512.png",
55 | "scale" : "1x"
56 | },
57 | {
58 | "size" : "512x512",
59 | "idiom" : "mac",
60 | "filename" : "app_icon_1024.png",
61 | "scale" : "2x"
62 | }
63 | ],
64 | "info" : {
65 | "version" : 1,
66 | "author" : "xcode"
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SiroDaves/SwahiLib-Flutter/b269068f0196abf145ee565ea6ba0f4eb1fff126/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SiroDaves/SwahiLib-Flutter/b269068f0196abf145ee565ea6ba0f4eb1fff126/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SiroDaves/SwahiLib-Flutter/b269068f0196abf145ee565ea6ba0f4eb1fff126/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SiroDaves/SwahiLib-Flutter/b269068f0196abf145ee565ea6ba0f4eb1fff126/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SiroDaves/SwahiLib-Flutter/b269068f0196abf145ee565ea6ba0f4eb1fff126/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SiroDaves/SwahiLib-Flutter/b269068f0196abf145ee565ea6ba0f4eb1fff126/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SiroDaves/SwahiLib-Flutter/b269068f0196abf145ee565ea6ba0f4eb1fff126/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png
--------------------------------------------------------------------------------
/macos/Runner/Configs/AppInfo.xcconfig:
--------------------------------------------------------------------------------
1 | // Application-level settings for the Runner target.
2 | //
3 | // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the
4 | // future. If not, the values below would default to using the project name when this becomes a
5 | // 'flutter create' template.
6 |
7 | // The application's name. By default this is also the title of the Flutter window.
8 | PRODUCT_NAME = SwahiLib
9 |
10 | // The application's bundle identifier
11 | PRODUCT_BUNDLE_IDENTIFIER = com.swahilib
12 |
13 | // The copyright displayed in application information
14 | PRODUCT_COPYRIGHT = Copyright © 2024 Futuristic Ke. All rights reserved.
15 |
--------------------------------------------------------------------------------
/macos/Runner/Configs/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "../../Flutter/Flutter-Debug.xcconfig"
2 | #include "Warnings.xcconfig"
3 |
--------------------------------------------------------------------------------
/macos/Runner/Configs/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "../../Flutter/Flutter-Release.xcconfig"
2 | #include "Warnings.xcconfig"
3 |
--------------------------------------------------------------------------------
/macos/Runner/Configs/Warnings.xcconfig:
--------------------------------------------------------------------------------
1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings
2 | GCC_WARN_UNDECLARED_SELECTOR = YES
3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES
4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE
5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES
6 | CLANG_WARN_PRAGMA_PACK = YES
7 | CLANG_WARN_STRICT_PROTOTYPES = YES
8 | CLANG_WARN_COMMA = YES
9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES
10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES
11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES
12 | GCC_WARN_SHADOW = YES
13 | CLANG_WARN_UNREACHABLE_CODE = YES
14 |
--------------------------------------------------------------------------------
/macos/Runner/DebugProfile.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.app-sandbox
6 |
7 | com.apple.security.cs.allow-jit
8 |
9 | com.apple.security.network.client
10 |
11 | com.apple.security.network.server
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/macos/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIconFile
10 |
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | $(FLUTTER_BUILD_NAME)
21 | CFBundleVersion
22 | $(FLUTTER_BUILD_NUMBER)
23 | LSMinimumSystemVersion
24 | $(MACOSX_DEPLOYMENT_TARGET)
25 | NSHumanReadableCopyright
26 | $(PRODUCT_COPYRIGHT)
27 | NSMainNibFile
28 | MainMenu
29 | NSPrincipalClass
30 | NSApplication
31 |
32 |
33 |
--------------------------------------------------------------------------------
/macos/Runner/MainFlutterWindow.swift:
--------------------------------------------------------------------------------
1 | import Cocoa
2 | import FlutterMacOS
3 |
4 | class MainFlutterWindow: NSWindow {
5 | override func awakeFromNib() {
6 | let flutterViewController = FlutterViewController()
7 | let windowFrame = self.frame
8 | self.contentViewController = flutterViewController
9 | self.setFrame(windowFrame, display: true)
10 |
11 | RegisterGeneratedPlugins(registry: flutterViewController)
12 |
13 | super.awakeFromNib()
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/macos/Runner/Release.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.app-sandbox
6 |
7 | com.apple.security.network.client
8 |
9 | com.apple.security.network.server
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/macos/RunnerTests/RunnerTests.swift:
--------------------------------------------------------------------------------
1 | import Cocoa
2 | import FlutterMacOS
3 | import XCTest
4 |
5 | class RunnerTests: XCTestCase {
6 |
7 | func testExample() {
8 | // If you add code to the Runner application, consider adding tests here.
9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest.
10 | }
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: swahilib
2 | description: Kiswahili Kitukuzwe - Kamusi ya Kiswahili ya maneno, nahau, methali na misemo
3 | publish_to: 'none'
4 |
5 | version: 1.0.125
6 |
7 | environment:
8 | sdk: ^3.5.4
9 |
10 | dependencies:
11 | connectivity_plus: ^6.1.3 # Check network connectivity status (WiFi/Mobile/Offline)
12 | cupertino_icons: ^1.0.8 # iOS-style icons for use with the Cupertino widgets
13 | dartx: ^1.2.0 # Kotlin-like extension methods for Dart collections and primitives
14 | floor: ^1.5.0 # SQLite abstraction for Flutter with DAO pattern
15 | flutter:
16 | sdk: flutter # Core Flutter SDK
17 | flutter_bloc: ^8.1.6 # State management library based on BLoC (Business Logic Component) pattern
18 | flutter_html: ^3.0.0-beta.2 # Render HTML content as Flutter widgets
19 | freezed_annotation: ^2.4.4 # Annotations for generating immutable classes with union/pattern matching
20 | get_it: ^8.0.2 # Simple service locator for dependency injection
21 | http: ^1.3.0 # HTTP client for making web requests
22 | injectable: ^2.5.0 # Dependency injection framework for Flutter using annotations
23 | intl: ^0.19.0 # Internationalization and localization support
24 | json_annotation: ^4.9.0 # Annotations for code generation to serialize/deserialize JSON
25 | loading_indicator: ^3.1.1 # Various loading animations for async operations
26 | package_info_plus: ^8.1.1 # Access app version, package name, and build number
27 | path: ^1.9.0 # Path manipulation utilities (for files, directories, etc.)
28 | path_provider: ^2.1.5 # Access commonly used locations on the filesystem
29 | percent_indicator: ^4.2.4 # Circular and linear percent indicators
30 | rxdart: ^0.28.0 # Reactive functional programming with observables and streams
31 | sentry_flutter: ^8.5.0 # Error tracking and performance monitoring using Sentry
32 | share_plus: ^10.1.2 # Share content from your Flutter app with other apps
33 | shared_preferences: ^2.3.3 # Persistent storage for simple key-value pairs
34 | sizer: ^3.0.4 # Helps with responsive UI using screen dimensions
35 | skeleton_loader: ^2.0.0+4 # Display shimmer loading placeholders for content
36 | sqflite: ^2.4.1 # SQLite plugin for Flutter
37 | styled_widget: ^0.4.1 # Simplifies Flutter widget styling through extension methods
38 | supabase_flutter: ^2.8.3 # Supabase client for Flutter, provides auth, storage, database access
39 | textstyle_extensions: ^2.0.0-nullsafety # Utility extensions for `TextStyle` manipulation
40 | url_launcher: ^6.3.1 # Launch URLs (email, phone, web) in a mobile browser or other apps
41 |
42 | dev_dependencies:
43 | build_runner: ^2.4.13 # Code generation tool (used with freezed, json_serializable, etc.)
44 | floor_generator: ^1.5.0 # Generates the database access code for Floor
45 | flutter_lints: ^4.0.0 # Recommended lint rules for Flutter apps
46 | flutter_test:
47 | sdk: flutter # Flutter's built-in testing framework
48 | freezed: ^2.5.7 # Code generator for creating immutable classes with union types
49 | injectable_generator: ^2.6.2 # Code generator for injectable DI setup
50 | json_serializable: ^6.8.0 # Code generator for serializing classes to/from JSON
51 |
52 |
53 | flutter:
54 | generate: true
55 | uses-material-design: true
56 | assets:
57 | - assets/fonts/
58 | - assets/icons/
59 | - assets/images/
60 | - assets/sound/
61 | fonts:
62 | - family: TrebuchetMS
63 | fonts:
64 | - asset: assets/fonts/Trebuchet-MS.ttf
65 |
--------------------------------------------------------------------------------
/test/widget_test.dart:
--------------------------------------------------------------------------------
1 | // This is a basic Flutter widget test.
2 | //
3 | // To perform an interaction with a widget in your test, use the WidgetTester
4 | // utility in the flutter_test package. For example, you can send tap and scroll
5 | // gestures. You can also use WidgetTester to find child widgets in the widget
6 | // tree, read text, and verify that the values of widget properties are correct.
7 |
8 | import 'package:flutter/material.dart';
9 | import 'package:flutter_test/flutter_test.dart';
10 |
11 | //import 'package:swahilib/main.dart';
12 |
13 | void main() {
14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async {
15 | // Build our app and trigger a frame.
16 | //await tester.pumpWidget(const MyApp());
17 |
18 | // Verify that our counter starts at 0.
19 | expect(find.text('0'), findsOneWidget);
20 | expect(find.text('1'), findsNothing);
21 |
22 | // Tap the '+' icon and trigger a frame.
23 | await tester.tap(find.byIcon(Icons.add));
24 | await tester.pump();
25 |
26 | // Verify that our counter has incremented.
27 | expect(find.text('0'), findsNothing);
28 | expect(find.text('1'), findsOneWidget);
29 | });
30 | }
31 |
--------------------------------------------------------------------------------
/updates.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "1.0.124",
3 | "title": "Letter filtering fixed",
4 | "description": "Now words, sayings, proverbs or sayings can be filtered when you tap on the letters on the far left",
5 | "appLinks": {
6 | "android": "https://play.google.com/store/apps/details?id=com.swahilib",
7 | "ios": "https://apps.apple.com/us/app/id6446771678",
8 | "windows": "https://github.com/SiroDaves/SwahiLib",
9 | "macos": "https://github.com/SiroDaves/SwahiLib",
10 | "linux": "https://github.com/SiroDaves/SwahiLib"
11 | }
12 | }
--------------------------------------------------------------------------------
/web/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SiroDaves/SwahiLib-Flutter/b269068f0196abf145ee565ea6ba0f4eb1fff126/web/favicon.png
--------------------------------------------------------------------------------
/web/icons/Icon-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SiroDaves/SwahiLib-Flutter/b269068f0196abf145ee565ea6ba0f4eb1fff126/web/icons/Icon-192.png
--------------------------------------------------------------------------------
/web/icons/Icon-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SiroDaves/SwahiLib-Flutter/b269068f0196abf145ee565ea6ba0f4eb1fff126/web/icons/Icon-512.png
--------------------------------------------------------------------------------
/web/icons/Icon-maskable-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SiroDaves/SwahiLib-Flutter/b269068f0196abf145ee565ea6ba0f4eb1fff126/web/icons/Icon-maskable-192.png
--------------------------------------------------------------------------------
/web/icons/Icon-maskable-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SiroDaves/SwahiLib-Flutter/b269068f0196abf145ee565ea6ba0f4eb1fff126/web/icons/Icon-maskable-512.png
--------------------------------------------------------------------------------
/web/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 | SwahiLib
33 |
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/web/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "SwahiLib",
3 | "short_name": "SwahiLib",
4 | "start_url": ".",
5 | "display": "standalone",
6 | "background_color": "#0175C2",
7 | "theme_color": "#0175C2",
8 | "description": "A new Flutter project.",
9 | "orientation": "portrait-primary",
10 | "prefer_related_applications": false,
11 | "icons": [
12 | {
13 | "src": "icons/Icon-192.png",
14 | "sizes": "192x192",
15 | "type": "image/png"
16 | },
17 | {
18 | "src": "icons/Icon-512.png",
19 | "sizes": "512x512",
20 | "type": "image/png"
21 | },
22 | {
23 | "src": "icons/Icon-maskable-192.png",
24 | "sizes": "192x192",
25 | "type": "image/png",
26 | "purpose": "maskable"
27 | },
28 | {
29 | "src": "icons/Icon-maskable-512.png",
30 | "sizes": "512x512",
31 | "type": "image/png",
32 | "purpose": "maskable"
33 | }
34 | ]
35 | }
36 |
--------------------------------------------------------------------------------
/windows/.gitignore:
--------------------------------------------------------------------------------
1 | flutter/ephemeral/
2 |
3 | # Visual Studio user-specific files.
4 | *.suo
5 | *.user
6 | *.userosscache
7 | *.sln.docstates
8 |
9 | # Visual Studio build-related files.
10 | x64/
11 | x86/
12 |
13 | # Visual Studio cache files
14 | # files ending in .cache can be ignored
15 | *.[Cc]ache
16 | # but keep track of directories ending in .cache
17 | !*.[Cc]ache/
18 |
--------------------------------------------------------------------------------
/windows/flutter/ephemeral/.plugin_symlinks/app_links:
--------------------------------------------------------------------------------
1 | /Users/sirodaves/.pub-cache/hosted/pub.dev/app_links-6.3.3/
--------------------------------------------------------------------------------
/windows/flutter/ephemeral/.plugin_symlinks/connectivity_plus:
--------------------------------------------------------------------------------
1 | /Users/sirodaves/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.3/
--------------------------------------------------------------------------------
/windows/flutter/ephemeral/.plugin_symlinks/package_info_plus:
--------------------------------------------------------------------------------
1 | /Users/sirodaves/.pub-cache/hosted/pub.dev/package_info_plus-8.1.2/
--------------------------------------------------------------------------------
/windows/flutter/ephemeral/.plugin_symlinks/path_provider_windows:
--------------------------------------------------------------------------------
1 | /Users/sirodaves/.pub-cache/hosted/pub.dev/path_provider_windows-2.3.0/
--------------------------------------------------------------------------------
/windows/flutter/ephemeral/.plugin_symlinks/sentry_flutter:
--------------------------------------------------------------------------------
1 | /Users/sirodaves/.pub-cache/hosted/pub.dev/sentry_flutter-8.11.1/
--------------------------------------------------------------------------------
/windows/flutter/ephemeral/.plugin_symlinks/share_plus:
--------------------------------------------------------------------------------
1 | /Users/sirodaves/.pub-cache/hosted/pub.dev/share_plus-10.1.3/
--------------------------------------------------------------------------------
/windows/flutter/ephemeral/.plugin_symlinks/shared_preferences_windows:
--------------------------------------------------------------------------------
1 | /Users/sirodaves/.pub-cache/hosted/pub.dev/shared_preferences_windows-2.4.1/
--------------------------------------------------------------------------------
/windows/flutter/ephemeral/.plugin_symlinks/url_launcher_windows:
--------------------------------------------------------------------------------
1 | /Users/sirodaves/.pub-cache/hosted/pub.dev/url_launcher_windows-3.1.3/
--------------------------------------------------------------------------------
/windows/flutter/generated_plugin_registrant.cc:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #include "generated_plugin_registrant.h"
8 |
9 | #include
10 | #include
11 | #include
12 | #include
13 | #include
14 |
15 | void RegisterPlugins(flutter::PluginRegistry* registry) {
16 | AppLinksPluginCApiRegisterWithRegistrar(
17 | registry->GetRegistrarForPlugin("AppLinksPluginCApi"));
18 | ConnectivityPlusWindowsPluginRegisterWithRegistrar(
19 | registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin"));
20 | SentryFlutterPluginRegisterWithRegistrar(
21 | registry->GetRegistrarForPlugin("SentryFlutterPlugin"));
22 | SharePlusWindowsPluginCApiRegisterWithRegistrar(
23 | registry->GetRegistrarForPlugin("SharePlusWindowsPluginCApi"));
24 | UrlLauncherWindowsRegisterWithRegistrar(
25 | registry->GetRegistrarForPlugin("UrlLauncherWindows"));
26 | }
27 |
--------------------------------------------------------------------------------
/windows/flutter/generated_plugin_registrant.h:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #ifndef GENERATED_PLUGIN_REGISTRANT_
8 | #define GENERATED_PLUGIN_REGISTRANT_
9 |
10 | #include
11 |
12 | // Registers Flutter plugins.
13 | void RegisterPlugins(flutter::PluginRegistry* registry);
14 |
15 | #endif // GENERATED_PLUGIN_REGISTRANT_
16 |
--------------------------------------------------------------------------------
/windows/flutter/generated_plugins.cmake:
--------------------------------------------------------------------------------
1 | #
2 | # Generated file, do not edit.
3 | #
4 |
5 | list(APPEND FLUTTER_PLUGIN_LIST
6 | app_links
7 | connectivity_plus
8 | sentry_flutter
9 | share_plus
10 | url_launcher_windows
11 | )
12 |
13 | list(APPEND FLUTTER_FFI_PLUGIN_LIST
14 | )
15 |
16 | set(PLUGIN_BUNDLED_LIBRARIES)
17 |
18 | foreach(plugin ${FLUTTER_PLUGIN_LIST})
19 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin})
20 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
21 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $)
22 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
23 | endforeach(plugin)
24 |
25 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
26 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin})
27 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
28 | endforeach(ffi_plugin)
29 |
--------------------------------------------------------------------------------
/windows/runner/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.14)
2 | project(runner LANGUAGES CXX)
3 |
4 | # Define the application target. To change its name, change BINARY_NAME in the
5 | # top-level CMakeLists.txt, not the value here, or `flutter run` will no longer
6 | # work.
7 | #
8 | # Any new source files that you add to the application should be added here.
9 | add_executable(${BINARY_NAME} WIN32
10 | "flutter_window.cpp"
11 | "main.cpp"
12 | "utils.cpp"
13 | "win32_window.cpp"
14 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc"
15 | "Runner.rc"
16 | "runner.exe.manifest"
17 | )
18 |
19 | # Apply the standard set of build settings. This can be removed for applications
20 | # that need different build settings.
21 | apply_standard_settings(${BINARY_NAME})
22 |
23 | # Add preprocessor definitions for the build version.
24 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"")
25 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}")
26 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}")
27 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}")
28 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}")
29 |
30 | # Disable Windows macros that collide with C++ standard library functions.
31 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX")
32 |
33 | # Add dependency libraries and include directories. Add any application-specific
34 | # dependencies here.
35 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app)
36 | target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib")
37 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}")
38 |
39 | # Run the Flutter tool portions of the build. This must not be removed.
40 | add_dependencies(${BINARY_NAME} flutter_assemble)
41 |
--------------------------------------------------------------------------------
/windows/runner/Runner.rc:
--------------------------------------------------------------------------------
1 | // Microsoft Visual C++ generated resource script.
2 | //
3 | #pragma code_page(65001)
4 | #include "resource.h"
5 |
6 | #define APSTUDIO_READONLY_SYMBOLS
7 | /////////////////////////////////////////////////////////////////////////////
8 | //
9 | // Generated from the TEXTINCLUDE 2 resource.
10 | //
11 | #include "winres.h"
12 |
13 | /////////////////////////////////////////////////////////////////////////////
14 | #undef APSTUDIO_READONLY_SYMBOLS
15 |
16 | /////////////////////////////////////////////////////////////////////////////
17 | // English (United States) resources
18 |
19 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
21 |
22 | #ifdef APSTUDIO_INVOKED
23 | /////////////////////////////////////////////////////////////////////////////
24 | //
25 | // TEXTINCLUDE
26 | //
27 |
28 | 1 TEXTINCLUDE
29 | BEGIN
30 | "resource.h\0"
31 | END
32 |
33 | 2 TEXTINCLUDE
34 | BEGIN
35 | "#include ""winres.h""\r\n"
36 | "\0"
37 | END
38 |
39 | 3 TEXTINCLUDE
40 | BEGIN
41 | "\r\n"
42 | "\0"
43 | END
44 |
45 | #endif // APSTUDIO_INVOKED
46 |
47 |
48 | /////////////////////////////////////////////////////////////////////////////
49 | //
50 | // Icon
51 | //
52 |
53 | // Icon with lowest ID value placed first to ensure application icon
54 | // remains consistent on all systems.
55 | IDI_APP_ICON ICON "resources\\app_icon.ico"
56 |
57 |
58 | /////////////////////////////////////////////////////////////////////////////
59 | //
60 | // Version
61 | //
62 |
63 | #if defined(FLUTTER_VERSION_MAJOR) && defined(FLUTTER_VERSION_MINOR) && defined(FLUTTER_VERSION_PATCH) && defined(FLUTTER_VERSION_BUILD)
64 | #define VERSION_AS_NUMBER FLUTTER_VERSION_MAJOR,FLUTTER_VERSION_MINOR,FLUTTER_VERSION_PATCH,FLUTTER_VERSION_BUILD
65 | #else
66 | #define VERSION_AS_NUMBER 1,0,0,0
67 | #endif
68 |
69 | #if defined(FLUTTER_VERSION)
70 | #define VERSION_AS_STRING FLUTTER_VERSION
71 | #else
72 | #define VERSION_AS_STRING "1.0.0"
73 | #endif
74 |
75 | VS_VERSION_INFO VERSIONINFO
76 | FILEVERSION VERSION_AS_NUMBER
77 | PRODUCTVERSION VERSION_AS_NUMBER
78 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
79 | #ifdef _DEBUG
80 | FILEFLAGS VS_FF_DEBUG
81 | #else
82 | FILEFLAGS 0x0L
83 | #endif
84 | FILEOS VOS__WINDOWS32
85 | FILETYPE VFT_APP
86 | FILESUBTYPE 0x0L
87 | BEGIN
88 | BLOCK "StringFileInfo"
89 | BEGIN
90 | BLOCK "040904e4"
91 | BEGIN
92 | VALUE "CompanyName", "Futuristic Ke" "\0"
93 | VALUE "FileDescription", "SwahiLib" "\0"
94 | VALUE "FileVersion", VERSION_AS_STRING "\0"
95 | VALUE "InternalName", "SwahiLib" "\0"
96 | VALUE "LegalCopyright", "Copyright (C) 2024 Futuristic Ke. All rights reserved." "\0"
97 | VALUE "OriginalFilename", "SwahiLib.exe" "\0"
98 | VALUE "ProductName", "SwahiLib" "\0"
99 | VALUE "ProductVersion", VERSION_AS_STRING "\0"
100 | END
101 | END
102 | BLOCK "VarFileInfo"
103 | BEGIN
104 | VALUE "Translation", 0x409, 1252
105 | END
106 | END
107 |
108 | #endif // English (United States) resources
109 | /////////////////////////////////////////////////////////////////////////////
110 |
111 |
112 |
113 | #ifndef APSTUDIO_INVOKED
114 | /////////////////////////////////////////////////////////////////////////////
115 | //
116 | // Generated from the TEXTINCLUDE 3 resource.
117 | //
118 |
119 |
120 | /////////////////////////////////////////////////////////////////////////////
121 | #endif // not APSTUDIO_INVOKED
122 |
--------------------------------------------------------------------------------
/windows/runner/flutter_window.cpp:
--------------------------------------------------------------------------------
1 | #include "flutter_window.h"
2 |
3 | #include
4 |
5 | #include "flutter/generated_plugin_registrant.h"
6 |
7 | FlutterWindow::FlutterWindow(const flutter::DartProject& project)
8 | : project_(project) {}
9 |
10 | FlutterWindow::~FlutterWindow() {}
11 |
12 | bool FlutterWindow::OnCreate() {
13 | if (!Win32Window::OnCreate()) {
14 | return false;
15 | }
16 |
17 | RECT frame = GetClientArea();
18 |
19 | // The size here must match the window dimensions to avoid unnecessary surface
20 | // creation / destruction in the startup path.
21 | flutter_controller_ = std::make_unique(
22 | frame.right - frame.left, frame.bottom - frame.top, project_);
23 | // Ensure that basic setup of the controller was successful.
24 | if (!flutter_controller_->engine() || !flutter_controller_->view()) {
25 | return false;
26 | }
27 | RegisterPlugins(flutter_controller_->engine());
28 | SetChildContent(flutter_controller_->view()->GetNativeWindow());
29 |
30 | flutter_controller_->engine()->SetNextFrameCallback([&]() {
31 | this->Show();
32 | });
33 |
34 | // Flutter can complete the first frame before the "show window" callback is
35 | // registered. The following call ensures a frame is pending to ensure the
36 | // window is shown. It is a no-op if the first frame hasn't completed yet.
37 | flutter_controller_->ForceRedraw();
38 |
39 | return true;
40 | }
41 |
42 | void FlutterWindow::OnDestroy() {
43 | if (flutter_controller_) {
44 | flutter_controller_ = nullptr;
45 | }
46 |
47 | Win32Window::OnDestroy();
48 | }
49 |
50 | LRESULT
51 | FlutterWindow::MessageHandler(HWND hwnd, UINT const message,
52 | WPARAM const wparam,
53 | LPARAM const lparam) noexcept {
54 | // Give Flutter, including plugins, an opportunity to handle window messages.
55 | if (flutter_controller_) {
56 | std::optional result =
57 | flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam,
58 | lparam);
59 | if (result) {
60 | return *result;
61 | }
62 | }
63 |
64 | switch (message) {
65 | case WM_FONTCHANGE:
66 | flutter_controller_->engine()->ReloadSystemFonts();
67 | break;
68 | }
69 |
70 | return Win32Window::MessageHandler(hwnd, message, wparam, lparam);
71 | }
72 |
--------------------------------------------------------------------------------
/windows/runner/flutter_window.h:
--------------------------------------------------------------------------------
1 | #ifndef RUNNER_FLUTTER_WINDOW_H_
2 | #define RUNNER_FLUTTER_WINDOW_H_
3 |
4 | #include
5 | #include
6 |
7 | #include
8 |
9 | #include "win32_window.h"
10 |
11 | // A window that does nothing but host a Flutter view.
12 | class FlutterWindow : public Win32Window {
13 | public:
14 | // Creates a new FlutterWindow hosting a Flutter view running |project|.
15 | explicit FlutterWindow(const flutter::DartProject& project);
16 | virtual ~FlutterWindow();
17 |
18 | protected:
19 | // Win32Window:
20 | bool OnCreate() override;
21 | void OnDestroy() override;
22 | LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam,
23 | LPARAM const lparam) noexcept override;
24 |
25 | private:
26 | // The project to run.
27 | flutter::DartProject project_;
28 |
29 | // The Flutter instance hosted by this window.
30 | std::unique_ptr flutter_controller_;
31 | };
32 |
33 | #endif // RUNNER_FLUTTER_WINDOW_H_
34 |
--------------------------------------------------------------------------------
/windows/runner/main.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 |
5 | #include "flutter_window.h"
6 | #include "utils.h"
7 |
8 | int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
9 | _In_ wchar_t *command_line, _In_ int show_command) {
10 | // Attach to console when present (e.g., 'flutter run') or create a
11 | // new console when running with a debugger.
12 | if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) {
13 | CreateAndAttachConsole();
14 | }
15 |
16 | // Initialize COM, so that it is available for use in the library and/or
17 | // plugins.
18 | ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED);
19 |
20 | flutter::DartProject project(L"data");
21 |
22 | std::vector command_line_arguments =
23 | GetCommandLineArguments();
24 |
25 | project.set_dart_entrypoint_arguments(std::move(command_line_arguments));
26 |
27 | FlutterWindow window(project);
28 | Win32Window::Point origin(10, 10);
29 | Win32Window::Size size(720, 1280);
30 | if (!window.Create(L"SwahiLib", origin, size)) {
31 | return EXIT_FAILURE;
32 | }
33 | window.SetQuitOnClose(true);
34 |
35 | ::MSG msg;
36 | while (::GetMessage(&msg, nullptr, 0, 0)) {
37 | ::TranslateMessage(&msg);
38 | ::DispatchMessage(&msg);
39 | }
40 |
41 | ::CoUninitialize();
42 | return EXIT_SUCCESS;
43 | }
44 |
--------------------------------------------------------------------------------
/windows/runner/resource.h:
--------------------------------------------------------------------------------
1 | //{{NO_DEPENDENCIES}}
2 | // Microsoft Visual C++ generated include file.
3 | // Used by Runner.rc
4 | //
5 | #define IDI_APP_ICON 101
6 |
7 | // Next default values for new objects
8 | //
9 | #ifdef APSTUDIO_INVOKED
10 | #ifndef APSTUDIO_READONLY_SYMBOLS
11 | #define _APS_NEXT_RESOURCE_VALUE 102
12 | #define _APS_NEXT_COMMAND_VALUE 40001
13 | #define _APS_NEXT_CONTROL_VALUE 1001
14 | #define _APS_NEXT_SYMED_VALUE 101
15 | #endif
16 | #endif
17 |
--------------------------------------------------------------------------------
/windows/runner/resources/app_icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SiroDaves/SwahiLib-Flutter/b269068f0196abf145ee565ea6ba0f4eb1fff126/windows/runner/resources/app_icon.ico
--------------------------------------------------------------------------------
/windows/runner/runner.exe.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PerMonitorV2
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/windows/runner/utils.cpp:
--------------------------------------------------------------------------------
1 | #include "utils.h"
2 |
3 | #include
4 | #include
5 | #include
6 | #include
7 |
8 | #include
9 |
10 | void CreateAndAttachConsole() {
11 | if (::AllocConsole()) {
12 | FILE *unused;
13 | if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
14 | _dup2(_fileno(stdout), 1);
15 | }
16 | if (freopen_s(&unused, "CONOUT$", "w", stderr)) {
17 | _dup2(_fileno(stdout), 2);
18 | }
19 | std::ios::sync_with_stdio();
20 | FlutterDesktopResyncOutputStreams();
21 | }
22 | }
23 |
24 | std::vector GetCommandLineArguments() {
25 | // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use.
26 | int argc;
27 | wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc);
28 | if (argv == nullptr) {
29 | return std::vector();
30 | }
31 |
32 | std::vector command_line_arguments;
33 |
34 | // Skip the first argument as it's the binary name.
35 | for (int i = 1; i < argc; i++) {
36 | command_line_arguments.push_back(Utf8FromUtf16(argv[i]));
37 | }
38 |
39 | ::LocalFree(argv);
40 |
41 | return command_line_arguments;
42 | }
43 |
44 | std::string Utf8FromUtf16(const wchar_t* utf16_string) {
45 | if (utf16_string == nullptr) {
46 | return std::string();
47 | }
48 | unsigned int target_length = ::WideCharToMultiByte(
49 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string,
50 | -1, nullptr, 0, nullptr, nullptr)
51 | -1; // remove the trailing null character
52 | int input_length = (int)wcslen(utf16_string);
53 | std::string utf8_string;
54 | if (target_length == 0 || target_length > utf8_string.max_size()) {
55 | return utf8_string;
56 | }
57 | utf8_string.resize(target_length);
58 | int converted_length = ::WideCharToMultiByte(
59 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string,
60 | input_length, utf8_string.data(), target_length, nullptr, nullptr);
61 | if (converted_length == 0) {
62 | return std::string();
63 | }
64 | return utf8_string;
65 | }
66 |
--------------------------------------------------------------------------------
/windows/runner/utils.h:
--------------------------------------------------------------------------------
1 | #ifndef RUNNER_UTILS_H_
2 | #define RUNNER_UTILS_H_
3 |
4 | #include
5 | #include
6 |
7 | // Creates a console for the process, and redirects stdout and stderr to
8 | // it for both the runner and the Flutter library.
9 | void CreateAndAttachConsole();
10 |
11 | // Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string
12 | // encoded in UTF-8. Returns an empty std::string on failure.
13 | std::string Utf8FromUtf16(const wchar_t* utf16_string);
14 |
15 | // Gets the command line arguments passed in as a std::vector,
16 | // encoded in UTF-8. Returns an empty std::vector on failure.
17 | std::vector GetCommandLineArguments();
18 |
19 | #endif // RUNNER_UTILS_H_
20 |
--------------------------------------------------------------------------------