sharara_apps_building_helpers 2.1.0
sharara_apps_building_helpers: ^2.1.0 copied to clipboard
A new sharara package to make developing more easy and efficient.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:hive_flutter/adapters.dart';
import 'package:sharara_apps_building_helpers/sharara_apps_building_helpers.dart';
import 'package:sharara_apps_building_helpers/ui.dart';
main()async{
WidgetsFlutterBinding.ensureInitialized();
await Hive.initFlutter();
await ShararaAppHelperInitializer.initialize(
withOuter:true
);
runApp(
ShararaAppHelper(
builder:(BuildContext context)=>const FirstScreen())
);
}
class FirstScreen extends StatelessWidget {
const FirstScreen({super.key});
@override
Widget build(BuildContext context) {
return const Test();
}
}
class Test extends StatelessWidget {
const Test({super.key});
Future<CompletingResults?> r()async{
await Future.delayed(const Duration(seconds:3));
return const CompletingResults(
success:false,
label:"Everything is Done"
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
drawer:Drawer(
child:ListView(
children: const [
SizedBox(height: 80,),
Text("Hi")
],
),
),
floatingActionButton:FloatingActionButton(
child:const Icon(Icons.add),
onPressed:(){},
),
appBar:AppBar(
title:const Text("app bar"),
centerTitle:true,
),
body:Center(
child:Column(
mainAxisAlignment:MainAxisAlignment.center,
children: [
Card(
child:Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
children: [
Container(
padding:const EdgeInsets.all(10),
child:const Icon(Icons.ac_unit_outlined),
),
Container(
padding:const EdgeInsets.all(10),
child: Text("${Colors.green.value}"),
),
],
),
),
),
ElevatedButton(
onPressed:()async{
FunctionHelpers.
jumpTo(context, const ShararaThemePicker());
FunctionHelpers.toast("success",status:true);
},
child:const Text("settings"),
),
ElevatedButton(
onPressed:()async{
FunctionHelpers.jumpTo(context,
Scaffold(
appBar:AppBar(
title:const Text("outer screen "),
),
body: Column(
mainAxisAlignment:MainAxisAlignment.center,
crossAxisAlignment:CrossAxisAlignment.center,
children: [
RoyalRoundedButton(
title:"check",
onPressed:(){
OuterScreenMaskController.instance
.launch(TaskProgressHolder(title: "جاري رفع البيانات", future:
r()
));
},
)
],
),
)
);
},
child:const Text("check outer mask"),
),
const SizedBox(height:20,),
RoyalPhoneTextFormField(title: "hi", controller: PhoneTextEditController()),
const SizedBox(height:20,),
RoyalRoundedButton(
title:"phone",
onPressed:(){
FunctionHelpers
.jumpTo(context,
FbPhoneAuthScreen(
phoneNumber: "+9647807832184",
onVerificationSucceed:(_){})
);
},
)
],
)
),
);
}
}