apex_flutter_plugin 3.0.0-nullsafety.50 copy "apex_flutter_plugin: ^3.0.0-nullsafety.50" to clipboard
apex_flutter_plugin: ^3.0.0-nullsafety.50 copied to clipboard

outdated

ApexTeam Flutter Plugin - A simple flutter plugin for ApexTeam fellas which supports http request management, request encryption, request cancellation, ... .

example/lib/main.dart

import 'package:apex_flutter_plugin/apex_flutter_plugin.dart';
import 'package:apex_flutter_plugin/server.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';

GlobalKey<NavigatorState> navKey = GlobalKey();

void main() {
  debugDefaultTargetPlatformOverride = TargetPlatform.fuchsia;
  runApp(ServerWidget(
    actions: {
      Res: (x) => Res.fromJson(x),
    },
    getContext: () => navKey.currentContext!,
    config: ApiConfig("https://google.com", "1", "1", debugMode: true),
    child: MaterialApp(
      theme: ThemeData(fontFamily: 'IRANSans'),
      navigatorKey: navKey,
      home: MyApp(),
    ),
  ));
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Container(
          color: Colors.blue,
          child: Center(child: ElevatedButton(
            onPressed: () {
              ServerWidget.of(context).makeRequest<Res>(Req(), showProgressDialog: true);
            },
            child: Text('Hello baby!'),
          ))),
    );
  }
}

class Req extends Request {
  Req() : super({"hello": "world!"}, isPrivate: true);
}

class Res extends BaseAction {
  Res(int success, String message) : super(success, message);

  factory Res.fromJson(Map<String, dynamic> json) {
    return Res(json['success'], json['message']);
  }
}
8
likes
0
points
289
downloads

Publisher

verified publisherpacks.apexteam.net

Weekly Downloads

ApexTeam Flutter Plugin - A simple flutter plugin for ApexTeam fellas which supports http request management, request encryption, request cancellation, ... .

Repository (GitLab)
View/report issues

License

unknown (license)

Dependencies

connectivity, crypto, encrypt, equatable, fingerprintjs, flutter, flutter_easyloading, flutter_web_plugins, http, http_parser, pedantic, pointycastle, shared_preferences, universal_html

More

Packages that depend on apex_flutter_plugin