fix : splash animation

feat : auth with password
chore : app Architecture
This commit is contained in:
2025-04-07 16:49:15 +03:30
parent 50cc84461e
commit e83388670c
32 changed files with 1192 additions and 276 deletions

View File

@@ -1,19 +1,16 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:rasadyar_app/domain/service/user/user_service.dart';
import 'package:rasadyar_app/infrastructure/di/di.dart';
import 'package:rasadyar_app/presentation/common/app_color.dart';
import 'package:rasadyar_app/presentation/common/app_fonts.dart';
import 'package:rasadyar_app/presentation/utils/color_utils.dart';
import 'package:rasadyar_app/presentation/widget/buttons/elevated.dart';
import 'package:rasadyar_app/presentation/widget/buttons/fab_outlined.dart';
import 'package:rasadyar_app/presentation/widget/buttons/outline_elevated.dart';
import 'package:rasadyar_app/presentation/widget/buttons/text_button.dart';
import 'package:rasadyar_app/presentation/widget/inputs/r_input.dart';
import 'package:rasadyar_app/presentation/widget/pagination/pagination_from_until.dart';
import 'package:rasadyar_app/presentation/widget/pagination/show_more.dart';
import 'package:rasadyar_app/presentation/widget/tabs/tab.dart';
import 'package:rasadyar_app/presentation/routes/app_pages.dart';
import 'presentation/widget/buttons/fab.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
setupInjection();
await setupAllProvider();
void main() {
runApp(MyApp());
}
@@ -22,264 +19,15 @@ class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
return GetMaterialApp(
title: 'رصدیار',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
),
home: Home(),
);
}
}
class Home extends StatefulWidget {
const Home({super.key});
@override
State<Home> createState() => _HomeState();
}
class _HomeState extends State<Home> {
List<bool> _isOpen = [false, false, false, false, false, false];
void _handleAdd() {
print("Add FAB pressed");
}
void _handleEdit() {
print("Edit FAB pressed");
}
void _handleDelete() {
print("Delete FAB pressed");
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text("System design"), centerTitle: true),
body: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: ExpansionPanelList(
expansionCallback: (panelIndex, isExpanded) {
setState(() {
_isOpen[panelIndex] = isExpanded;
});
},
children: [
buttonWidget(),
fabWidget(),
outlinedFabWidget(),
paginationWidget(),
tabWidget(),
inputsWidget(),
],
),
),
),
);
}
ExpansionPanel inputsWidget() {
return ExpansionPanel(
isExpanded: _isOpen[5],
headerBuilder: (context, isExpanded) {
return ListTile(
title: Text(
"inputs",
style: AppFonts.yekan20Regular.copyWith(color: Colors.red),
),
);
},
body: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
spacing: 14,
children: [
RTextField(
hintText: 'حجم کشتار را در روز به قطعه وارد کنید',
hintStyle: AppFonts.yekan13Regular,
),
RTextField(
label: 'تلفن مرغداری',
labelStyle: AppFonts.yekan10Regular,
),
],
),
),
);
}
ExpansionPanel tabWidget() {
return ExpansionPanel(
isExpanded: _isOpen[4],
headerBuilder: (context, isExpanded) {
return ListTile(
title: Text(
"tab",
style: AppFonts.yekan20Regular.copyWith(color: Colors.red),
),
);
},
body: Column(
spacing: 14,
children: [
CupertinoSegmentedControlDemo(),
CupertinoSegmentedControlDemo2(),
],
),
);
}
ExpansionPanel paginationWidget() {
return ExpansionPanel(
isExpanded: _isOpen[3],
headerBuilder: (context, isExpanded) {
return ListTile(
title: Text(
"پیجینیشن",
style: AppFonts.yekan20Regular.copyWith(color: Colors.red),
),
);
},
body: Column(spacing: 14, children: [RShowMore(), PaginationFromUntil()]),
);
}
ExpansionPanel outlinedFabWidget() {
return ExpansionPanel(
isExpanded: _isOpen[2],
headerBuilder: (context, isExpanded) {
return ListTile(
title: Text(
"Outlined Fab ",
style: AppFonts.yekan20Regular.copyWith(color: Colors.green),
),
);
},
body: Column(
spacing: 14,
children: [
Row(),
RFabOutlined.smallAdd(onPressed: () {}),
RFabOutlined.smallAdd(onPressed: null),
RFabOutlined.smallAddNoBorder(onPressed: () {}),
RFabOutlined.smallAddNoBorder(onPressed: null),
RFabOutlined.add(onPressed: () {}),
RFabOutlined.add(onPressed: null),
RFabOutlined.addNoBorder(onPressed: () {}),
RFabOutlined.addNoBorder(onPressed: null),
],
),
);
}
ExpansionPanel fabWidget() {
return ExpansionPanel(
isExpanded: _isOpen[1],
headerBuilder: (context, isExpanded) {
return ListTile(
title: Text(
"Fab",
style: AppFonts.yekan20Regular.copyWith(color: Colors.green),
),
);
},
body: Column(
spacing: 14,
children: [
Row(),
RFab.smallAdd(onPressed: () {}),
RFab.smallAdd(onPressed: null),
RFab.add(onPressed: () {}),
RFab.add(onPressed: null),
RFab.smallEdit(onPressed: null),
RFab.smallEdit(onPressed: () {}),
RFab.edit(onPressed: () {}),
RFab.edit(onPressed: null),
RFab.smallDelete(onPressed: () {}),
RFab.smallDelete(onPressed: null),
RFab.delete(onPressed: () {}),
RFab.delete(onPressed: null),
RFab.smallAction(onPressed: () {}),
RFab.smallAction(onPressed: null),
RFab.action(onPressed: () {}),
RFab.action(onPressed: null),
RFab.smallFilter(onPressed: () {}),
RFab.smallFilter(onPressed: null),
RFab.filter(onPressed: () {}),
RFab.filter(onPressed: null),
RFab.smallDownload(onPressed: () {}),
RFab.smallDownload(onPressed: null),
RFab.download(onPressed: () {}),
RFab.download(onPressed: null),
RFab.smallExcel(onPressed: () {}),
RFab.smallExcel(onPressed: null),
RFab.excel(onPressed: () {}),
RFab.excel(onPressed: null),
RFab.smallBack(onPressed: () {}),
RFab.smallBack(onPressed: null),
RFab.back(onPressed: () {}),
RFab.back(onPressed: null),
],
),
);
}
ExpansionPanel buttonWidget() {
return ExpansionPanel(
isExpanded: _isOpen[0],
headerBuilder: (context, isExpanded) {
return ListTile(
title: Text(
"دکمه ها",
style: AppFonts.yekan20Regular.copyWith(color: Colors.green),
),
);
},
body: Column(
spacing: 14,
children: [
Row(),
RElevated(text: 'ثبت', onPressed: () {}),
RElevated(text: 'ثبت', onPressed: null),
ROutlinedElevated(text: 'ثبت', onPressed: () {}),
ROutlinedElevated(
text: 'ثبتwwww',
onPressed: () {},
backgroundColor: AppColor.blueNormal.disabledColor,
pressedBackgroundColor: AppColor.blueNormal,
),
ROutlinedElevated(text: 'ثبت', onPressed: null),
RTextButton(text: 'ثبت', onPressed: () {}),
RTextButton(text: 'ثبت', onPressed: null),
],
colorScheme: ColorScheme.fromSeed(seedColor: AppColor.blueNormal),
),
initialRoute: AppPages.initRoutes,
initialBinding: BindingsBuilder.put(() => UserService()),
getPages: AppPages.pages,
locale: Locale('fa'),
);
}
}