A minimal, runnable Flutter quickstart that shows how to use
flutter_abp_proxy to turn an
ABP Framework backend into a fully-typed Dart client — no hand-written DTOs,
no hand-written Retrofit services.
The app points at the public ABP CMS Kit demo backend
(https://cms-kit-demo.abpdemo.com), so you can clone and run it without
setting up your own ABP server.
- Login screen — calls the generated
LoginProxyServicewith a typedUserLoginInforequest and handles theAbpLoginResultresponse. - Blog list screen — calls the generated
BlogPostPublicProxyServiceand renders a paged list ofBlogPostCommonDtoitems returned asPagedResultDto<BlogPostCommonDto>.
Every DTO, every service, every fromJson/toJson is generated. You never
write the networking layer by hand.
git clone https://github.com/abpjs/flutter_abp_proxy_example.git
cd flutter_abp_proxy_example
flutter pub get
flutter runThe generated proxy files are checked in, so the first run works immediately.
Default credentials for the demo backend: admin / 1q2w3E*.
You can also tap "Browse blog posts as guest" to skip login — the blog list
endpoint is public.
If you change the backend, point the generator at your own URL and re-run it:
dart pub global activate flutter_abp_proxy
flutter_abp_proxy \
--url https://your-abp-backend.com \
--output lib/data/proxy \
--clean
dart run build_runner build --delete-conflicting-outputsThat's it. Your new services and models show up under lib/data/proxy/ and
you can import them the same way lib/main.dart does.
lib/
├── main.dart # Login + blog list screens (the only hand-written code)
└── data/
└── proxy/ # 100% generated by flutter_abp_proxy
├── account/
│ └── login/
│ ├── login_service.dart
│ └── models/
│ ├── user_login_info.dart
│ └── abp_login_result.dart
├── cms-kit/
│ └── blog-post-public/
│ ├── blog-post-public_service.dart
│ └── models/
│ ├── blog_post_common_dto.dart
│ └── cms_user_dto.dart
└── shared/
└── models/
├── abp_types.dart # Shared ABP base types (PagedResultDto, EntityDto, ...)
└── abp_error.dart # Structured ABP error response envelope
lib/main.dart instantiates a Dio client and passes it to the generated
services. That's the whole integration.
final dio = Dio(BaseOptions(baseUrl: 'https://cms-kit-demo.abpdemo.com'));
// Login
final loginService = LoginProxyService(dio);
final result = await loginService.loginByLogin(
UserLoginInfo(
userNameOrEmailAddress: 'admin',
password: '1q2w3E*',
),
);
// List blog posts
final blogService = BlogPostPublicProxyService(dio);
final page = await blogService.getListAsyncByBlogSlugAndInput(
'cms-kit-demo', // blogSlug
null, null, null, null, // filters
0, 20, // skipCount, maxResultCount
);
for (final post in page.items) {
print(post.title);
}- Package:
flutter_abp_proxyon pub.dev - Source: github.com/abpjs/flutter_abp_proxy
- ABP Framework: abp.io
MIT