doc : widgets like

1- RSegment
2- row radio
3- Build Row
4- logo widget
This commit is contained in:
2025-10-14 12:33:20 +03:30
parent 0901b45998
commit ba907e2571
10 changed files with 42 additions and 90 deletions

BIN
doc/BuildRow.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

BIN
doc/LogoWidget.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
doc/RSegment.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:rasadyar_core/core.dart';
import 'logic.dart';
@@ -11,29 +10,18 @@ class TestPage extends StatelessWidget {
Widget build(BuildContext context) {
final TestLogic logic = Get.put(TestLogic());
return Scaffold(body: SafeArea(
child: Padding(
padding: const EdgeInsets.all(18.0),
child: Column(children: [
return Scaffold(
body: SafeArea(
child: Padding(
padding: const EdgeInsets.all(18.0),
child: Column(
spacing: 8,
children: [
Text('buildRow'),
buildRow(
title: "Test Row Item",
value: "Value",
titleLabel: "Title Label",
valueLabel: "Value Label",
titleLabelStyle: AppFonts.yekan14.copyWith(color: Colors.red),
valueLabelStyle: AppFonts.yekan14.copyWith(color: Colors.blue),
titleStyle: AppFonts.yekan16.copyWith(color: Colors.green),
valueStyle: AppFonts.yekan16.copyWith(color: Colors.purple),
],
),
Divider(),
]),
),
),
));
);
}
}

View File

@@ -1,6 +1,9 @@
import 'package:flutter/material.dart';
import 'package:rasadyar_core/core.dart';
/// see this link for UI reference:
/// [https://github.com/mirani95/rasadyarApp/blob/develop/doc/BuildRow.png]
Widget buildRow({
required String title,
required String value,

View File

@@ -1,6 +1,10 @@
import 'package:flutter/material.dart';
import 'package:rasadyar_core/core.dart';
/// see this link for UI reference:
/// [https://github.com/mirani95/rasadyarApp/blob/develop/docLogoWidget.png]
class LogoWidget extends StatelessWidget {
const LogoWidget({
super.key,

View File

@@ -0,0 +1,21 @@
import 'package:flutter/material.dart';
Widget row({
required List<Widget> children,
MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start,
CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center,
MainAxisSize mainAxisSize = MainAxisSize.max,
TextDirection? textDirection,
VerticalDirection verticalDirection = VerticalDirection.down,
TextBaseline? textBaseline,
}) {
return Row(
mainAxisAlignment: mainAxisAlignment,
crossAxisAlignment: crossAxisAlignment,
mainAxisSize: mainAxisSize,
textDirection: textDirection,
verticalDirection: verticalDirection,
textBaseline: textBaseline,
children: children,
);
}

View File

@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/// @docImport 'switch.dart';
library;
import 'dart:collection';

View File

@@ -3,6 +3,9 @@ import 'package:rasadyar_core/core.dart';
const Duration _kFadeDuration = Duration(milliseconds: 165);
/// see this link for UI reference:
/// [https://github.com/mirani95/rasadyarApp/blob/develop/doc/RSegment.png]
class RSegment extends StatefulWidget {
const RSegment({
super.key,

View File

@@ -4,15 +4,6 @@ import 'package:vector_graphics/vector_graphics.dart';
import '../common/assets.gen.dart';
SvgPicture vecWidget(String assets, {double? width, double? height, BoxFit? fit, Color? color}) {
return SvgPicture(
AssetBytesLoader(assets),
width: width,
height: height,
fit: fit ?? BoxFit.contain,
colorFilter: color != null ? ColorFilter.mode(color, BlendMode.srcIn) : null,
);
}
Widget vecWidgetWithOnTap({
required Widget child,
@@ -25,62 +16,4 @@ Widget vecWidgetWithOnTap({
return InkWell(onTap: onTap, child: child);
}
SvgPicture svgWidget(String assets, {double? width, double? height, BoxFit? fit, Color? color}) {
return SvgPicture.asset(
assets,
width: width,
height: height,
fit: fit ?? BoxFit.contain,
colorFilter: color != null ? ColorFilter.mode(color, BlendMode.srcIn) : null,
);
}
Widget vecWidget2(String assets, {double? width, double? height, BoxFit? fit, Color? color}) {
final resolvedColor = WidgetStateProperty.resolveWith<Color?>((states) {
if (states.contains(WidgetState.pressed)) {
return Colors.white;
}
return color;
}).resolve({}); // You can pass actual states if needed
return IconTheme(
data: IconThemeData(color: resolvedColor),
child: SvgPicture(
AssetBytesLoader(assets),
width: width,
height: height,
fit: fit ?? BoxFit.contain,
colorFilter: resolvedColor != null ? ColorFilter.mode(resolvedColor, BlendMode.srcIn) : null,
),
);
}
SizedBox iconBlendTester(String vecPath) {
return SizedBox(
height: 150,
child: ListView.separated(
scrollDirection: Axis.horizontal,
itemCount: BlendMode.values.length,
itemBuilder: (context, index) {
return Column(
spacing: 8,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(BlendMode.values[index].toString()),
Container(
margin: EdgeInsets.all(8),
width: 100,
height: 100,
child: SvgGenImage.vec(vecPath).svg(
width: 50,
height: 50,
colorFilter: ColorFilter.mode(Colors.red, BlendMode.values[index]),
),
),
],
);
},
separatorBuilder: (BuildContext context, int index) => SizedBox(width: 10),
),
);
}