Compare commits

..

4 Commits

22 changed files with 901 additions and 1401 deletions

View File

@@ -1,192 +0,0 @@
//
// Generated file. Do not edit.
// This file is generated from template in file `flutter_tools/lib/src/flutter_plugins.dart`.
//
// @dart = 3.7
import 'dart:io'; // flutter_ignore: dart_io_import.
import 'package:file_picker/file_picker.dart';
import 'package:path_provider_android/path_provider_android.dart';
import 'package:file_picker/file_picker.dart';
import 'package:path_provider_foundation/path_provider_foundation.dart';
import 'package:file_picker/file_picker.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:path_provider_linux/path_provider_linux.dart';
import 'package:share_plus/share_plus.dart';
import 'package:url_launcher_linux/url_launcher_linux.dart';
import 'package:file_picker/file_picker.dart';
import 'package:path_provider_foundation/path_provider_foundation.dart';
import 'package:file_picker/file_picker.dart';
import 'package:flutter_secure_storage_windows/flutter_secure_storage_windows.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:path_provider_windows/path_provider_windows.dart';
import 'package:share_plus/share_plus.dart';
import 'package:url_launcher_windows/url_launcher_windows.dart';
@pragma('vm:entry-point')
class _PluginRegistrant {
@pragma('vm:entry-point')
static void register() {
if (Platform.isAndroid) {
try {
FilePickerIO.registerWith();
} catch (err) {
print(
'`file_picker` threw an error: $err. '
'The app may not function as expected until you remove this plugin from pubspec.yaml'
);
}
try {
PathProviderAndroid.registerWith();
} catch (err) {
print(
'`path_provider_android` threw an error: $err. '
'The app may not function as expected until you remove this plugin from pubspec.yaml'
);
}
} else if (Platform.isIOS) {
try {
FilePickerIO.registerWith();
} catch (err) {
print(
'`file_picker` threw an error: $err. '
'The app may not function as expected until you remove this plugin from pubspec.yaml'
);
}
try {
PathProviderFoundation.registerWith();
} catch (err) {
print(
'`path_provider_foundation` threw an error: $err. '
'The app may not function as expected until you remove this plugin from pubspec.yaml'
);
}
} else if (Platform.isLinux) {
try {
FilePickerLinux.registerWith();
} catch (err) {
print(
'`file_picker` threw an error: $err. '
'The app may not function as expected until you remove this plugin from pubspec.yaml'
);
}
try {
PackageInfoPlusLinuxPlugin.registerWith();
} catch (err) {
print(
'`package_info_plus` threw an error: $err. '
'The app may not function as expected until you remove this plugin from pubspec.yaml'
);
}
try {
PathProviderLinux.registerWith();
} catch (err) {
print(
'`path_provider_linux` threw an error: $err. '
'The app may not function as expected until you remove this plugin from pubspec.yaml'
);
}
try {
SharePlusLinuxPlugin.registerWith();
} catch (err) {
print(
'`share_plus` threw an error: $err. '
'The app may not function as expected until you remove this plugin from pubspec.yaml'
);
}
try {
UrlLauncherLinux.registerWith();
} catch (err) {
print(
'`url_launcher_linux` threw an error: $err. '
'The app may not function as expected until you remove this plugin from pubspec.yaml'
);
}
} else if (Platform.isMacOS) {
try {
FilePickerMacOS.registerWith();
} catch (err) {
print(
'`file_picker` threw an error: $err. '
'The app may not function as expected until you remove this plugin from pubspec.yaml'
);
}
try {
PathProviderFoundation.registerWith();
} catch (err) {
print(
'`path_provider_foundation` threw an error: $err. '
'The app may not function as expected until you remove this plugin from pubspec.yaml'
);
}
} else if (Platform.isWindows) {
try {
FilePickerWindows.registerWith();
} catch (err) {
print(
'`file_picker` threw an error: $err. '
'The app may not function as expected until you remove this plugin from pubspec.yaml'
);
}
try {
FlutterSecureStorageWindows.registerWith();
} catch (err) {
print(
'`flutter_secure_storage_windows` threw an error: $err. '
'The app may not function as expected until you remove this plugin from pubspec.yaml'
);
}
try {
PackageInfoPlusWindowsPlugin.registerWith();
} catch (err) {
print(
'`package_info_plus` threw an error: $err. '
'The app may not function as expected until you remove this plugin from pubspec.yaml'
);
}
try {
PathProviderWindows.registerWith();
} catch (err) {
print(
'`path_provider_windows` threw an error: $err. '
'The app may not function as expected until you remove this plugin from pubspec.yaml'
);
}
try {
SharePlusWindowsPlugin.registerWith();
} catch (err) {
print(
'`share_plus` threw an error: $err. '
'The app may not function as expected until you remove this plugin from pubspec.yaml'
);
}
try {
UrlLauncherWindows.registerWith();
} catch (err) {
print(
'`url_launcher_windows` threw an error: $err. '
'The app may not function as expected until you remove this plugin from pubspec.yaml'
);
}
}
}
}

File diff suppressed because one or more lines are too long

View File

@@ -514,10 +514,6 @@ pubspec_parse
3.6
file:///Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/pubspec_parse-1.5.0/
file:///Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/pubspec_parse-1.5.0/lib/
readmore
3.0
file:///Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/readmore-3.0.0/
file:///Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/readmore-3.0.0/lib/
recase
2.12
file:///Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/recase-4.1.0/

File diff suppressed because one or more lines are too long

138
ios/Podfile.lock Normal file
View File

@@ -0,0 +1,138 @@
PODS:
- DKImagePickerController/Core (4.3.9):
- DKImagePickerController/ImageDataManager
- DKImagePickerController/Resource
- DKImagePickerController/ImageDataManager (4.3.9)
- DKImagePickerController/PhotoGallery (4.3.9):
- DKImagePickerController/Core
- DKPhotoGallery
- DKImagePickerController/Resource (4.3.9)
- DKPhotoGallery (0.0.19):
- DKPhotoGallery/Core (= 0.0.19)
- DKPhotoGallery/Model (= 0.0.19)
- DKPhotoGallery/Preview (= 0.0.19)
- DKPhotoGallery/Resource (= 0.0.19)
- SDWebImage
- SwiftyGif
- DKPhotoGallery/Core (0.0.19):
- DKPhotoGallery/Model
- DKPhotoGallery/Preview
- SDWebImage
- SwiftyGif
- DKPhotoGallery/Model (0.0.19):
- SDWebImage
- SwiftyGif
- DKPhotoGallery/Preview (0.0.19):
- DKPhotoGallery/Model
- DKPhotoGallery/Resource
- SDWebImage
- SwiftyGif
- DKPhotoGallery/Resource (0.0.19):
- SDWebImage
- SwiftyGif
- file_picker (0.0.1):
- DKImagePickerController/PhotoGallery
- Flutter
- Flutter (1.0.0)
- flutter_secure_storage (6.0.0):
- Flutter
- fluttertoast (0.0.2):
- Flutter
- image_cropper (0.0.4):
- Flutter
- TOCropViewController (~> 2.7.4)
- package_info_plus (0.4.5):
- Flutter
- path_provider_foundation (0.0.1):
- Flutter
- FlutterMacOS
- SDWebImage (5.21.3):
- SDWebImage/Core (= 5.21.3)
- SDWebImage/Core (5.21.3)
- share_plus (0.0.1):
- Flutter
- sqlite3 (3.49.2):
- sqlite3/common (= 3.49.2)
- sqlite3/common (3.49.2)
- sqlite3/dbstatvtab (3.49.2):
- sqlite3/common
- sqlite3/fts5 (3.49.2):
- sqlite3/common
- sqlite3/math (3.49.2):
- sqlite3/common
- sqlite3/perf-threadsafe (3.49.2):
- sqlite3/common
- sqlite3/rtree (3.49.2):
- sqlite3/common
- sqlite3_flutter_libs (0.0.1):
- Flutter
- FlutterMacOS
- sqlite3 (~> 3.49.1)
- sqlite3/dbstatvtab
- sqlite3/fts5
- sqlite3/math
- sqlite3/perf-threadsafe
- sqlite3/rtree
- SwiftyGif (5.4.5)
- TOCropViewController (2.7.4)
DEPENDENCIES:
- file_picker (from `.symlinks/plugins/file_picker/ios`)
- Flutter (from `Flutter`)
- flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`)
- fluttertoast (from `.symlinks/plugins/fluttertoast/ios`)
- image_cropper (from `.symlinks/plugins/image_cropper/ios`)
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- share_plus (from `.symlinks/plugins/share_plus/ios`)
- sqlite3_flutter_libs (from `.symlinks/plugins/sqlite3_flutter_libs/darwin`)
SPEC REPOS:
trunk:
- DKImagePickerController
- DKPhotoGallery
- SDWebImage
- sqlite3
- SwiftyGif
- TOCropViewController
EXTERNAL SOURCES:
file_picker:
:path: ".symlinks/plugins/file_picker/ios"
Flutter:
:path: Flutter
flutter_secure_storage:
:path: ".symlinks/plugins/flutter_secure_storage/ios"
fluttertoast:
:path: ".symlinks/plugins/fluttertoast/ios"
image_cropper:
:path: ".symlinks/plugins/image_cropper/ios"
package_info_plus:
:path: ".symlinks/plugins/package_info_plus/ios"
path_provider_foundation:
:path: ".symlinks/plugins/path_provider_foundation/darwin"
share_plus:
:path: ".symlinks/plugins/share_plus/ios"
sqlite3_flutter_libs:
:path: ".symlinks/plugins/sqlite3_flutter_libs/darwin"
SPEC CHECKSUMS:
DKImagePickerController: 946cec48c7873164274ecc4624d19e3da4c1ef3c
DKPhotoGallery: b3834fecb755ee09a593d7c9e389d8b5d6deed60
file_picker: a0560bc09d61de87f12d246fc47d2119e6ef37be
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
flutter_secure_storage: 1ed9476fba7e7a782b22888f956cce43e2c62f13
fluttertoast: 2c67e14dce98bbdb200df9e1acf610d7a6264ea1
image_cropper: c4326ea50132b1e1564499e5d32a84f01fb03537
package_info_plus: af8e2ca6888548050f16fa2f1938db7b5a5df499
path_provider_foundation: 080d55be775b7414fd5a5ef3ac137b97b097e564
SDWebImage: 16309af6d214ba3f77a7c6f6fdda888cb313a50a
share_plus: 50da8cb520a8f0f65671c6c6a99b3617ed10a58a
sqlite3: 3c950dc86011117c307eb0b28c4a7bb449dce9f1
sqlite3_flutter_libs: f6acaa2172e6bb3e2e70c771661905080e8ebcf2
SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4
TOCropViewController: 80b8985ad794298fb69d3341de183f33d1853654
PODFILE CHECKSUM: 4305caec6b40dde0ae97be1573c53de1882a07e5
COCOAPODS: 1.16.2

View File

@@ -10,7 +10,9 @@
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
56D0DA369935817C9FD61D64 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 20EA46D90FEDEE106AB74AE3 /* Pods_RunnerTests.framework */; };
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
869B506EF2E45BAB39615F26 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B39F7BDABEAD0ED3D2BCBF8A /* Pods_Runner.framework */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
@@ -42,12 +44,18 @@
/* Begin PBXFileReference section */
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
20EA46D90FEDEE106AB74AE3 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
274309643C09AEB895F5B282 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = "<group>"; };
331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = "<group>"; };
331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
3DD5DA132CCC13F9168EA46C /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = "<group>"; };
4D9F7D7DAC8938D01FCC4D51 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
8430F8544E2F6590CF5BD216 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
923EC9622249E9CDBDFE9D06 /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = "<group>"; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -55,19 +63,39 @@
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
B39F7BDABEAD0ED3D2BCBF8A /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
B5951109D53267981AE8A56D /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
627E60B7283AB62A12CFF618 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
56D0DA369935817C9FD61D64 /* Pods_RunnerTests.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
97C146EB1CF9000F007C117D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
869B506EF2E45BAB39615F26 /* Pods_Runner.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
27B1E70DD21F0A27FF242714 /* Frameworks */ = {
isa = PBXGroup;
children = (
B39F7BDABEAD0ED3D2BCBF8A /* Pods_Runner.framework */,
20EA46D90FEDEE106AB74AE3 /* Pods_RunnerTests.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
331C8082294A63A400263BE5 /* RunnerTests */ = {
isa = PBXGroup;
children = (
@@ -94,6 +122,8 @@
97C146F01CF9000F007C117D /* Runner */,
97C146EF1CF9000F007C117D /* Products */,
331C8082294A63A400263BE5 /* RunnerTests */,
E9812416A7ACA68201AEE0BB /* Pods */,
27B1E70DD21F0A27FF242714 /* Frameworks */,
);
sourceTree = "<group>";
};
@@ -121,6 +151,20 @@
path = Runner;
sourceTree = "<group>";
};
E9812416A7ACA68201AEE0BB /* Pods */ = {
isa = PBXGroup;
children = (
B5951109D53267981AE8A56D /* Pods-Runner.debug.xcconfig */,
4D9F7D7DAC8938D01FCC4D51 /* Pods-Runner.release.xcconfig */,
8430F8544E2F6590CF5BD216 /* Pods-Runner.profile.xcconfig */,
923EC9622249E9CDBDFE9D06 /* Pods-RunnerTests.debug.xcconfig */,
274309643C09AEB895F5B282 /* Pods-RunnerTests.release.xcconfig */,
3DD5DA132CCC13F9168EA46C /* Pods-RunnerTests.profile.xcconfig */,
);
name = Pods;
path = Pods;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@@ -128,8 +172,10 @@
isa = PBXNativeTarget;
buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */;
buildPhases = (
B6EC4F9E6BB4749CD063C598 /* [CP] Check Pods Manifest.lock */,
331C807D294A63A400263BE5 /* Sources */,
331C807F294A63A400263BE5 /* Resources */,
627E60B7283AB62A12CFF618 /* Frameworks */,
);
buildRules = (
);
@@ -145,12 +191,14 @@
isa = PBXNativeTarget;
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = (
7961A0D505DA31A674AC7FD6 /* [CP] Check Pods Manifest.lock */,
9740EEB61CF901F6004384FC /* Run Script */,
97C146EA1CF9000F007C117D /* Sources */,
97C146EB1CF9000F007C117D /* Frameworks */,
97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
FD477B45F6C2D4CD5E5F5D4C /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
@@ -238,6 +286,28 @@
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
};
7961A0D505DA31A674AC7FD6 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
@@ -253,6 +323,45 @@
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
};
B6EC4F9E6BB4749CD063C598 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
FD477B45F6C2D4CD5E5F5D4C /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
@@ -379,6 +488,7 @@
};
331C8088294A63A400263BE5 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 923EC9622249E9CDBDFE9D06 /* Pods-RunnerTests.debug.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
@@ -396,6 +506,7 @@
};
331C8089294A63A400263BE5 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 274309643C09AEB895F5B282 /* Pods-RunnerTests.release.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
@@ -411,6 +522,7 @@
};
331C808A294A63A400263BE5 /* Profile */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 3DD5DA132CCC13F9168EA46C /* Pods-RunnerTests.profile.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;

View File

@@ -4,4 +4,7 @@
<FileRef
location = "group:Runner.xcodeproj">
</FileRef>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace>

View File

@@ -5,7 +5,7 @@ part of '../env.dart';
///
class DevEnv extends Env {
@override
Uri get url => Uri.parse('https://api.remever.dizoft-studio.ru');
Uri get url => Uri.parse('https://remever.neojik.tech');
@override
String get mode => 'dev';

View File

@@ -1,6 +1,9 @@
// Package imports:
import 'dart:io';
import 'package:drift/drift.dart';
import 'package:remever/common/functions.dart';
import 'package:remever/common/typedef.dart';
import 'package:remever/database/database.dart';
import 'package:remever/database/tables.dart';
import 'package:remever/models/crud_collection_dto.dart';
@@ -56,6 +59,33 @@ class CollectionsDao extends DatabaseAccessor<AppDatabase>
}
}
/// Синхронизация коллекций
Future<void> syncCollectionFromApi(List<Json> data) async {
for (final item in data) {
try {
await db.managers.collections.create(
(o) => o(
// id: Value<String>(item['id'].toString()),
title: item['title'],
desc: item['description'],
isPublic: Value<bool>(item['is_public']),
image: Value<String?>(null),
createdAt: Value<DateTime>(DateTime.parse(item['created_at'])),
updatedAt: Value<DateTime>(DateTime.parse(item['updated_at'])),
),
);
} catch (e, st) {
logger.logError(
'Не смог добавить колекцию в методе syncCollectionFromApi',
e,
st,
);
continue;
}
}
}
/// Обновление коллекции
Future<void> updateCollection(CrudCollectionDto dto, String id) async {
try {

View File

@@ -158,7 +158,9 @@ class CollectionDetailScreen extends StatelessWidget {
fallback:
(context) => Center(
child: AppTypography(
collection.title.substring(0, 1),
collection.title.isNotEmpty
? collection.title.substring(0, 1)
: '',
type: Bold34px(),
),
),

View File

@@ -68,6 +68,9 @@ class _CollectionScreenState extends State<CollectionScreen> {
duration: const Duration(milliseconds: 200),
child: FloatingActionButton(
backgroundColor: AppColors.primary,
// onPressed: () {
// getIt<CollectionsInterface>().getCollectionsFromApi();
// },
onPressed: () => context.pushRoute(CrudCollectionRoute()),
child: const Icon(Icons.add),
),

View File

@@ -185,7 +185,7 @@ class CollectionCard extends StatelessWidget {
decoration: BoxDecoration(shape: BoxShape.circle, color: AppColors.bg),
child: Wif(
condition: collection.image != null,
condition: collection.image != null && collection.image != '',
builder:
(context) => ClipOval(
child: Image.file(File(collection.image!), fit: BoxFit.cover),
@@ -193,7 +193,9 @@ class CollectionCard extends StatelessWidget {
fallback:
(context) => Center(
child: AppTypography(
collection.title.substring(0, 1),
collection.title.isNotEmpty
? collection.title.substring(0, 1)
: '',
type: Bold34px(),
),
),

View File

@@ -17,6 +17,7 @@ import 'package:remever/inject.dart';
import 'package:remever/screens/dialogs/alert_dialog.dart';
import 'package:remever/screens/dialogs/replace_diaog.dart';
import 'package:remever/services/tickets/tickets_interface.dart';
import 'package:remever/widgets/markdown_readmore_text.dart';
class TicketCard extends StatefulWidget {
const TicketCard({
@@ -159,15 +160,15 @@ class _TicketCardState extends State<TicketCard> {
}
Widget _buildText(BuildContext context) {
return ReadMoreText(
_isRolled ? widget.ticket.answer : widget.ticket.question,
trimMode: TrimMode.Line,
final text = _isRolled ? widget.ticket.answer : widget.ticket.question;
return MarkdownReadMoreText(
text,
trimLines: 3,
trimCollapsedText: '\nРазвернуть',
trimExpandedText: '\nСвернуть',
style: Regular16px().style,
moreStyle: Regular12px().style.copyWith(color: AppColors.primary_blue),
lessStyle: Regular12px().style.copyWith(color: AppColors.primary_blue),
linkStyle: Regular12px().style.copyWith(color: AppColors.primary_blue),
expandText: 'Развернуть',
collapseText: 'Свернуть',
);
}

View File

@@ -1,4 +1,5 @@
import 'package:auto_route/auto_route.dart';
import 'package:collection/collection.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
@@ -43,14 +44,106 @@ class _CrudCollectionFullscreenFieldState
if (widget.content != null) {
_controller.text = widget.content!;
}
_controller.addListener(_handleTextChange);
}
@override
void dispose() {
_controller.removeListener(_handleTextChange);
_controller.dispose();
super.dispose();
}
String? _lastText;
void _handleTextChange() {
final currentText = _controller.text;
// Если текст не изменился — выходим
if (_lastText == currentText) return;
// Находим позицию курсора
final selection = _controller.selection;
if (!selection.isValid) return;
// Проверяем, был ли добавлен \n
if (_lastText != null && currentText.length > _lastText!.length) {
final addedChars = currentText.substring(_lastText!.length);
if (addedChars == '\n') {
_handleNewLineInserted(selection.start - 1);
}
}
_lastText = currentText;
}
void _handleNewLineInserted(int newlinePosition) {
final text = _controller.text;
// Находим начало текущей строки (до \n)
final lineStart = text.lastIndexOf('\n', newlinePosition - 1) + 1;
final currentLine = text.substring(lineStart, newlinePosition);
String? prefix;
// Проверяем, начинается ли строка с префикса списка
if (currentLine.startsWith('')) {
prefix = '';
} else {
final match = RegExp(r'^(\d+)\.\s').firstMatch(currentLine);
if (match != null) {
final number = int.parse(match.group(1)!) + 1;
prefix = '$number. ';
}
}
// Если строка пустая (только префикс) — выходим из списка
if (currentLine.trim().isEmpty && prefix != null) {
_exitListAt(newlinePosition);
return;
}
// Если есть префикс — добавляем новую строку с префиксом
if (prefix != null) {
final insertPos = newlinePosition + 1;
final newText =
text.substring(0, insertPos) + prefix + text.substring(insertPos);
_controller.text = newText;
// Перемещаем курсор после префикса
_controller.selection = TextSelection.collapsed(
offset: insertPos + prefix.length,
);
return;
}
// Иначе — просто оставляем \n
_controller.selection = TextSelection.collapsed(
offset: newlinePosition + 1,
);
}
void _exitListAt(int newlinePosition) {
final text = _controller.text;
final insertPos = newlinePosition + 1;
// Удаляем префикс из новой строки
final lineStart = text.lastIndexOf('\n', newlinePosition - 1) + 1;
final currentLine = text.substring(lineStart, newlinePosition);
final trimmed = currentLine.trim();
String replacement = '\n';
if (trimmed.startsWith('') || RegExp(r'^\d+\.').hasMatch(trimmed)) {
replacement = '\n'; // просто перенос
}
final newText =
text.substring(0, insertPos) + replacement + text.substring(insertPos);
_controller.text = newText;
_controller.selection = TextSelection.collapsed(offset: insertPos);
}
@override
Widget build(BuildContext context) {
return KeyboardSizeProvider(
@@ -109,20 +202,142 @@ class _CrudCollectionFullscreenFieldState
top: BorderSide(color: AppColors.gray, width: 1.w),
),
),
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
const WSpace(8),
_buildPasteButton(),
_buildCopyButton(),
_buildBoldButton(),
_buildH1Button(),
_buildBulletListButton(),
_buildNumberedListButton(),
_buildSubmitButton(),
const WSpace(8),
],
),
),
),
);
},
);
}
Widget _buildBoldButton() {
return _MenuButton(
icon: Icon(Icons.format_bold),
onTap: () => _wrapSelection('**', '**'),
);
}
Widget _buildH1Button() {
return _MenuButton(
icon: Icon(Icons.format_italic_outlined),
onTap: () => _insertAtLineStart('# '),
);
}
Widget _buildBulletListButton() {
return _MenuButton(
icon: Icon(Icons.list),
onTap: () => _insertBulletList(),
);
}
Widget _buildNumberedListButton() {
return _MenuButton(
icon: Icon(Icons.list_alt_outlined),
onTap: () => _insertNumberedList(),
);
}
void _wrapSelection(String before, String after) {
final text = _controller.text;
final selection = _controller.selection;
if (!selection.isValid) {
_controller.text = '$before${selection.textInside(text)}$after';
_controller.selection = TextSelection.collapsed(
offset: _controller.text.length - after.length,
);
return;
}
final newText = text.replaceRange(
selection.start,
selection.end,
'$before${selection.textInside(text)}$after',
);
_controller.text = newText;
final cursorPos =
selection.start + before.length + selection.textInside(text).length;
_controller.selection = TextSelection.collapsed(offset: cursorPos);
}
void _insertAtLineStart(String prefix) {
final text = _controller.text;
final selection = _controller.selection;
int start = selection.start;
// Находим начало строки
int lineStart = text.lastIndexOf('\n', start - 1) + 1;
if (lineStart == 0 && start == 0) lineStart = 0;
final newText = text.replaceRange(lineStart, lineStart, prefix);
_controller.text = newText;
_controller.selection = TextSelection.collapsed(
offset: lineStart + prefix.length + (selection.end - selection.start),
);
}
void _insertBulletList() {
_insertListPrefix('');
}
void _insertNumberedList() {
_insertListPrefix('1. ');
}
void _insertListPrefix(String prefix) {
final text = _controller.text;
final selection = _controller.selection;
String insertText;
int newCursorPos;
if (selection.isCollapsed) {
// Вставляем в позицию курсора
insertText = prefix;
newCursorPos = selection.start + prefix.length;
} else {
// Оборачиваем выделение
final selected = selection.textInside(text);
final lines = selected.split('\n').where((l) => l.isNotEmpty).toList();
final prefixed = lines
.mapIndexed((index, line) {
if (prefix == '') return '$prefix$line';
final num = index + 1;
return '$num. $line';
})
.join('\n');
insertText = prefixed;
newCursorPos = selection.start + prefixed.length;
}
final newText = text.replaceRange(
selection.start,
selection.end,
insertText,
);
_controller.text = newText;
_controller.selection = TextSelection.collapsed(offset: newCursorPos);
}
Widget _buildPasteButton() {
return GestureDetector(
onTap: _onPasteTap,
@@ -205,6 +420,7 @@ class _CrudCollectionFullscreenFieldState
maxLines: 99,
maxLength: 250,
cursorColor: AppColors.danger,
textInputAction: TextInputAction.newline,
decoration: const InputDecoration.collapsed(
hintText: 'Введите содержимое',
hintStyle: TextStyle(color: AppColors.gray),
@@ -289,3 +505,18 @@ class _CrudCollectionFullscreenFieldState
}
}
}
class _MenuButton extends StatelessWidget {
final Widget icon;
final VoidCallback onTap;
const _MenuButton({required this.icon, required this.onTap});
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: onTap,
child: Container(padding: const EdgeInsets.all(8).r, child: icon),
);
}
}

View File

@@ -8,6 +8,7 @@ import 'package:remever/common/widgets/w_if.dart';
import 'package:remever/common/widgets/wspace.dart';
import 'package:remever/components/extensions/context.dart';
import 'package:remever/database/database.dart';
import 'package:remever/widgets/markdown_text.dart';
import 'package:remever/widgets/primary_button.dart';
class InfoDialog extends StatelessWidget {
@@ -60,15 +61,24 @@ class InfoDialog extends StatelessWidget {
return Flexible(
child: SingleChildScrollView(
controller: ScrollController(),
child: AppTypography(
collection.desc,
type: Regular14px(),
maxLines: 9999,
),
child: MarkdownText(collection.desc),
),
);
}
// Widget _buildText() {
// return Flexible(
// child: SingleChildScrollView(
// controller: ScrollController(),
// child: AppTypography(
// collection.desc,
// type: Regular14px(),
// maxLines: 9999,
// ),
// ),
// );
// }
///
/// Название коллекции
///
@@ -100,7 +110,9 @@ class InfoDialog extends StatelessWidget {
fallback:
(context) => Center(
child: AppTypography(
collection.title.substring(0, 1),
collection.title.isNotEmpty
? collection.title.substring(0, 1)
: '',
type: Bold34px(),
),
),

View File

@@ -1,11 +1,15 @@
import 'package:auto_route/auto_route.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:remever/common/functions.dart';
import 'package:remever/common/resources.dart';
import 'package:remever/common/storage.dart';
import 'package:remever/common/widgets/typography.dart';
import 'package:remever/common/widgets/wspace.dart';
import 'package:remever/components/extensions/context.dart';
import 'package:remever/gen/assets.gen.dart';
import 'package:remever/router.gr.dart';
import 'package:remever/screens/dialogs/alert_dialog.dart';
import 'package:remever/screens/settings/cubit/settings_cubit.dart';
import 'package:remever/widgets/primary_button.dart';
@@ -67,7 +71,25 @@ class InitialSettingsState extends StatelessWidget {
title: AppTypography('Настройки', type: SemiBold20px()),
actions: [
IconButton(
onPressed: () => showInfoToast('Тут будет выход'),
onPressed: () async {
final res = await showCuperModalBottomSheet<bool>(
context: context,
height: 262.h,
builder:
(_) => const AlertInfoDialog(
title: 'Вы уверены что хотите выйти из своего профиля?',
acceptTitle: 'Выйти',
declineTitle: 'Отменить',
),
);
if (res != null && res) {
authSecStorage.delete(key: StorageKeys.accessToken);
authSecStorage.delete(key: StorageKeys.refreshToken);
context.replaceRoute(SplashRoute());
}
},
icon: Assets.icons.settingsExit.image(height: 24.h, width: 24.w),
color: Colors.black,
),

View File

@@ -7,7 +7,6 @@ import 'package:remever/models/crud_collection_dto.dart';
abstract interface class CollectionsInterface {
/// работа с api
Future<void> getCollectionsFromApi();
Future<void> createCollectionApi();
/// Получение списка коллекций
Stream<List<Collection>> watchCollectionsList({String? search});

View File

@@ -1,6 +1,8 @@
import 'package:dio/dio.dart';
import 'package:injectable/injectable.dart';
import 'package:remever/common/functions.dart';
import 'package:remever/common/services/api_client.dart';
import 'package:remever/common/typedef.dart';
import 'package:remever/database/database.dart';
import 'package:remever/inject.dart';
import 'package:remever/models/crud_collection_dto.dart';
@@ -19,6 +21,10 @@ final class CollectionsService implements CollectionsInterface {
@override
Future<void> createCollection(CrudCollectionDto dto) async {
try {
createCollectionApi(dto);
} catch (_) {}
return await getIt<AppDatabase>().collectionsDao.createCollection(dto);
}
@@ -41,33 +47,70 @@ final class CollectionsService implements CollectionsInterface {
@override
Future<void> getCollectionsFromApi() async {
try {
final List<Json> items = [];
final perPage = 20;
final Response<dynamic> response = await apiClient.get(
'/collections',
queryParameters: <String, dynamic>{'perPage': 20, 'page': 1},
queryParameters: <String, dynamic>{'perPage': perPage, 'page': 9999},
);
print('data');
} catch (e) {
if (response.data['success'] != true) {
logger.logInfo('В методе getCollectionsFromApi success false');
throw Exception('Не удалось получить коллекции');
}
int totalCount = response.data['result']['totalCount'];
if (totalCount == 0) {
return;
}
int pagesCount = (totalCount / perPage).ceil();
int currentPage = 0;
while (pagesCount != currentPage) {
final Response<dynamic> response = await apiClient.get(
'/collections',
queryParameters: <String, dynamic>{
'perPage': perPage,
'page': currentPage + 1,
},
);
if (response.data['success'] != true) {
throw Exception('Не удалось получить $currentPage страницу журнала');
}
items.addAll(
(response.data['result']['items'] as List)
.cast<Map<String, dynamic>>(),
);
currentPage = currentPage + 1;
}
await getIt<AppDatabase>().collectionsDao.syncCollectionFromApi(items);
} catch (e, st) {
print('Response error $e');
logger.logError('Ошибка в методе getCollectionsFromApi', e, st);
}
}
@override
Future<void> createCollectionApi() async {
Future<void> createCollectionApi(CrudCollectionDto dto) async {
try {
final Response<dynamic> response = await apiClient.post(
'/collections',
data: {
"title": "Основы программирования для утюгов",
"description":
"Коллекция карточек по основам программирования для начинающих",
"is_public": true,
"title": dto.title,
"description": dto.desc,
"is_public": dto.isPublic,
},
);
print('data');
} catch (e) {
} catch (e, st) {
print('Response error $e');
logger.logError('Ошибка в методе createCollectionApi', e, st);
}
}
}

View File

@@ -0,0 +1,168 @@
import 'package:flutter/material.dart';
class MarkdownReadMoreText extends StatefulWidget {
final String text;
final int trimLines;
final TextStyle style;
final TextStyle linkStyle;
final String expandText;
final String collapseText;
const MarkdownReadMoreText(
this.text, {
super.key,
this.trimLines = 3,
required this.style,
required this.linkStyle,
this.expandText = 'Развернуть',
this.collapseText = 'Свернуть',
});
@override
State<MarkdownReadMoreText> createState() => _MarkdownReadMoreTextState();
}
class _MarkdownReadMoreTextState extends State<MarkdownReadMoreText> {
bool _isExpanded = false;
@override
Widget build(BuildContext context) {
final spans = _parseMarkdown(widget.text);
final fullText = TextSpan(children: spans, style: widget.style);
return LayoutBuilder(
builder: (context, constraints) {
final textPainter = TextPainter(
text: fullText,
maxLines: widget.trimLines,
textDirection: TextDirection.ltr,
)..layout(maxWidth: constraints.maxWidth);
final isOverflowed = textPainter.didExceedMaxLines;
if (!isOverflowed) {
return SelectableText.rich(fullText);
}
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SelectableText.rich(
_isExpanded ? fullText : _getTrimmedSpan(textPainter, spans),
),
GestureDetector(
onTap: () => setState(() => _isExpanded = !_isExpanded),
child: Text(
_isExpanded ? widget.collapseText : widget.expandText,
style: widget.linkStyle,
),
),
],
);
},
);
}
TextSpan _getTrimmedSpan(TextPainter painter, List<TextSpan> spans) {
final trimmedText = StringBuffer();
final remainingSpans = <TextSpan>[];
int charCount = 0;
final maxChars =
painter
.getPositionForOffset(Offset(painter.width, painter.height))
.offset;
for (final span in spans) {
final spanText = span.text ?? '';
if (charCount + spanText.length <= maxChars) {
remainingSpans.add(span);
charCount += spanText.length;
} else {
final remaining = maxChars - charCount;
if (remaining > 0) {
remainingSpans.add(
TextSpan(text: spanText.substring(0, remaining), style: span.style),
);
}
break;
}
}
return TextSpan(children: remainingSpans, style: widget.style);
}
List<TextSpan> _parseMarkdown(String text) {
final lines = text.split('\n');
final spans = <TextSpan>[];
for (var line in lines) {
final trimmed = line.trim();
// H1
if (trimmed.startsWith('# ') && trimmed.length > 2) {
spans.add(
TextSpan(
text: '${trimmed.substring(2)}\n',
style: const TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
),
);
continue;
}
// Нумерованный список
if (RegExp(r'^\d+\.\s').hasMatch(trimmed)) {
final match = RegExp(r'^(\d+)\.\s(.+)').firstMatch(trimmed);
if (match != null) {
spans.add(
TextSpan(
text: '${match.group(0)!}\n',
style: const TextStyle(fontSize: 16),
),
);
continue;
}
}
// Маркированный список
if (trimmed.startsWith('') && trimmed.length > 2) {
spans.add(
TextSpan(
text: '${trimmed.substring(2)}\n',
style: const TextStyle(fontSize: 16),
),
);
continue;
}
// Жирный текст
final boldRegex = RegExp(r'\*\*([^*]+)\*\*');
var remaining = line;
var boldProcessed = <TextSpan>[];
int lastEnd = 0;
for (final match in boldRegex.allMatches(line)) {
if (match.start > lastEnd) {
boldProcessed.add(
TextSpan(text: line.substring(lastEnd, match.start)),
);
}
boldProcessed.add(
TextSpan(
text: match.group(1),
style: const TextStyle(fontWeight: FontWeight.bold),
),
);
lastEnd = match.end;
}
if (lastEnd < line.length) {
boldProcessed.add(TextSpan(text: line.substring(lastEnd)));
}
boldProcessed.add(const TextSpan(text: '\n'));
spans.addAll(boldProcessed);
}
return spans;
}
}

View File

@@ -0,0 +1,95 @@
import 'package:flutter/material.dart';
import 'package:remever/common/resources.dart';
class MarkdownText extends StatelessWidget {
final String text;
final TextStyle? baseStyle;
const MarkdownText(this.text, {super.key, this.baseStyle});
@override
Widget build(BuildContext context) {
return SelectableText.rich(
TextSpan(
children: _parseMarkdown(text),
style:
baseStyle ??
const TextStyle(fontSize: 14, color: AppColors.body_text),
),
);
}
List<TextSpan> _parseMarkdown(String text) {
final lines = text.split('\n');
final spans = <TextSpan>[];
for (var line in lines) {
final trimmed = line.trim();
// H1
if (trimmed.startsWith('# ') && trimmed.length > 2) {
spans.add(
TextSpan(
text: '${trimmed.substring(2)}\n',
style: const TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
),
);
continue;
}
// Нумерованный список
if (RegExp(r'^\d+\.\s').hasMatch(trimmed)) {
final match = RegExp(r'^(\d+)\.\s(.+)').firstMatch(trimmed);
if (match != null) {
spans.add(
TextSpan(
text: '${match.group(0)!}\n',
style: const TextStyle(fontSize: 14),
),
);
continue;
}
}
// Маркированный список
if (trimmed.startsWith('') && trimmed.length > 2) {
spans.add(
TextSpan(
text: '${trimmed.substring(2)}\n',
style: const TextStyle(fontSize: 14),
),
);
continue;
}
// Жирный текст
final boldRegex = RegExp(r'\*\*([^*]+)\*\*');
var remaining = line;
var boldProcessed = <TextSpan>[];
int lastEnd = 0;
for (final match in boldRegex.allMatches(line)) {
if (match.start > lastEnd) {
boldProcessed.add(
TextSpan(text: line.substring(lastEnd, match.start)),
);
}
boldProcessed.add(
TextSpan(
text: match.group(1),
style: const TextStyle(fontWeight: FontWeight.bold),
),
);
lastEnd = match.end;
}
if (lastEnd < line.length) {
boldProcessed.add(TextSpan(text: line.substring(lastEnd)));
}
boldProcessed.add(const TextSpan(text: '\n'));
spans.addAll(boldProcessed);
}
return spans;
}
}

View File

@@ -1053,14 +1053,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.5.0"
readmore:
dependency: "direct main"
description:
name: readmore
sha256: e8fca2bd397b86342483b409e2ec26f06560a5963aceaa39b27f30722b506187
url: "https://pub.dev"
source: hosted
version: "3.0.0"
recase:
dependency: transitive
description:

View File

@@ -33,7 +33,6 @@ dependencies:
fps_widget: ^1.0.1+2
provider: ^6.1.2
freezed: ^2.5.8
readmore: ^3.0.0
fluttertoast: ^8.2.12
pin_code_fields: ^8.0.1
modal_bottom_sheet: ^3.0.0